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
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* Copyright (C) 2001 Red Hat, Inc.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
|
/*
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2004. 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
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2014-04-05 06:04:12 +00:00
|
|
|
|
#include "gtkrangeprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
#include "gtkaccessible.h"
|
2014-07-03 00:37:55 +00:00
|
|
|
|
#include "gtkadjustmentprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkcolorscaleprivate.h"
|
2020-07-13 15:22:22 +00:00
|
|
|
|
#include "gtkenums.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkeventcontrollerkey.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include "gtkeventcontrollerscroll.h"
|
|
|
|
|
#include "gtkgesturedrag.h"
|
2015-02-22 22:57:23 +00:00
|
|
|
|
#include "gtkgesturelongpressprivate.h"
|
2019-05-29 17:10:46 +00:00
|
|
|
|
#include "gtkgestureclick.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include "gtkgizmoprivate.h"
|
|
|
|
|
#include "gtkintl.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkorientable.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2010-05-18 06:46:42 +00:00
|
|
|
|
#include "gtkscale.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <math.h>
|
2010-05-21 00:19:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkrange
|
|
|
|
|
* @Short_description: Base class for widgets which visualize an adjustment
|
|
|
|
|
* @Title: GtkRange
|
|
|
|
|
*
|
|
|
|
|
* #GtkRange is the common base class for widgets which visualize an
|
2010-06-03 05:18:42 +00:00
|
|
|
|
* adjustment, e.g #GtkScale or #GtkScrollbar.
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*
|
|
|
|
|
* Apart from signals for monitoring the parameters of the adjustment,
|
2017-05-07 14:31:23 +00:00
|
|
|
|
* #GtkRange provides properties and methods for setting a
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* “fill level” on range widgets. See gtk_range_set_fill_level().
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
#define TIMEOUT_INITIAL 500
|
2014-11-21 06:16:12 +00:00
|
|
|
|
#define TIMEOUT_REPEAT 250
|
2013-07-29 16:06:20 +00:00
|
|
|
|
#define AUTOSCROLL_FACTOR 20
|
2014-11-21 06:16:12 +00:00
|
|
|
|
#define SCROLL_EDGE_SIZE 15
|
2016-03-06 03:04:41 +00:00
|
|
|
|
#define MARK_SNAP_LENGTH 12
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
|
2019-05-27 03:18:38 +00:00
|
|
|
|
typedef struct _GtkRangePrivate GtkRangePrivate;
|
2010-08-26 17:15:37 +00:00
|
|
|
|
struct _GtkRangePrivate
|
2010-08-16 06:27:49 +00:00
|
|
|
|
{
|
2017-05-07 19:39:37 +00:00
|
|
|
|
GtkWidget *grab_location; /* "grabbed" mouse location, NULL for no grab */
|
2010-06-27 01:04:31 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRangeStepTimer *timer;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
|
|
2018-02-23 09:42:09 +00:00
|
|
|
|
int slider_x;
|
|
|
|
|
int slider_y;
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkWidget *trough_widget;
|
2017-05-07 18:45:06 +00:00
|
|
|
|
GtkWidget *fill_widget;
|
|
|
|
|
GtkWidget *highlight_widget;
|
2017-05-07 19:39:37 +00:00
|
|
|
|
GtkWidget *slider_widget;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
2020-07-25 02:57:34 +00:00
|
|
|
|
GtkGesture *drag_gesture;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double fill_level;
|
|
|
|
|
double *marks;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *mark_pos;
|
|
|
|
|
int n_marks;
|
|
|
|
|
int round_digits; /* Round off value to this many digits, -1 for no rounding */
|
|
|
|
|
int slide_initial_slider_position;
|
|
|
|
|
int slide_initial_coordinate_delta;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint flippable : 1;
|
|
|
|
|
guint inverted : 1;
|
|
|
|
|
guint slider_size_fixed : 1;
|
|
|
|
|
guint trough_click_forward : 1; /* trough click was on the forward side of slider */
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
/* Whether we're doing fine adjustment */
|
|
|
|
|
guint zoom : 1;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/* Fill level */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint show_fill_level : 1;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
guint restrict_to_fill_level : 1;
|
2014-07-08 13:35:18 +00:00
|
|
|
|
|
|
|
|
|
/* Whether dragging is ongoing */
|
|
|
|
|
guint in_drag : 1;
|
2015-07-12 05:53:36 +00:00
|
|
|
|
|
2020-07-25 02:57:34 +00:00
|
|
|
|
GtkOrientation orientation;
|
2015-07-12 05:53:36 +00:00
|
|
|
|
|
|
|
|
|
GtkScrollType autoscroll_mode;
|
|
|
|
|
guint autoscroll_id;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
};
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-06-27 01:04:31 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_ADJUSTMENT,
|
|
|
|
|
PROP_INVERTED,
|
|
|
|
|
PROP_SHOW_FILL_LEVEL,
|
|
|
|
|
PROP_RESTRICT_TO_FILL_LEVEL,
|
2011-01-15 05:08:39 +00:00
|
|
|
|
PROP_FILL_LEVEL,
|
2015-09-06 14:42:50 +00:00
|
|
|
|
PROP_ROUND_DIGITS,
|
|
|
|
|
PROP_ORIENTATION,
|
|
|
|
|
LAST_PROP = PROP_ORIENTATION
|
2010-08-16 06:27:49 +00:00
|
|
|
|
};
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
enum {
|
|
|
|
|
VALUE_CHANGED,
|
|
|
|
|
ADJUST_BOUNDS,
|
|
|
|
|
MOVE_SLIDER,
|
|
|
|
|
CHANGE_VALUE,
|
|
|
|
|
LAST_SIGNAL
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void gtk_range_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_range_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2016-06-05 23:35:36 +00:00
|
|
|
|
static void gtk_range_finalize (GObject *object);
|
2020-05-05 20:49:33 +00:00
|
|
|
|
static void gtk_range_dispose (GObject *object);
|
2017-05-04 06:05:11 +00:00
|
|
|
|
static void gtk_range_measure (GtkWidget *widget,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
static void gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void gtk_range_unmap (GtkWidget *widget);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2019-05-29 17:10:46 +00:00
|
|
|
|
static void gtk_range_click_gesture_pressed (GtkGestureClick *gesture,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
guint n_press,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range);
|
2019-05-29 17:10:46 +00:00
|
|
|
|
static void gtk_range_click_gesture_released (GtkGestureClick *gesture,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
guint n_press,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range);
|
2014-09-27 02:21:11 +00:00
|
|
|
|
static void gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
2014-09-27 02:21:11 +00:00
|
|
|
|
GtkRange *range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range);
|
|
|
|
|
|
|
|
|
|
|
2001-07-14 11:35:24 +00:00
|
|
|
|
static void update_slider_position (GtkRange *range,
|
2018-02-20 09:31:20 +00:00
|
|
|
|
int mouse_x,
|
|
|
|
|
int mouse_y);
|
2005-03-22 17:36:41 +00:00
|
|
|
|
static void stop_scrolling (GtkRange *range);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
static void add_autoscroll (GtkRange *range);
|
|
|
|
|
static void remove_autoscroll (GtkRange *range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
/* Range methods */
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static void gtk_range_move_slider (GtkRange *range,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkScrollType scroll);
|
|
|
|
|
|
|
|
|
|
/* Internals */
|
2014-11-25 22:13:21 +00:00
|
|
|
|
static void gtk_range_compute_slider_position (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double adjustment_value,
|
2014-11-25 22:13:21 +00:00
|
|
|
|
GdkRectangle *slider_rect);
|
2007-01-02 16:40:44 +00:00
|
|
|
|
static gboolean gtk_range_scroll (GtkRange *range,
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
GtkScrollType scroll);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void gtk_range_calc_marks (GtkRange *range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_range_add_step_timer (GtkRange *range,
|
|
|
|
|
GtkScrollType step);
|
|
|
|
|
static void gtk_range_remove_step_timer (GtkRange *range);
|
2004-09-13 16:09:37 +00:00
|
|
|
|
static gboolean gtk_range_real_change_value (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value);
|
2018-03-07 16:58:32 +00:00
|
|
|
|
static gboolean gtk_range_key_controller_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
static void gtk_range_direction_changed (GtkWidget *widget,
|
|
|
|
|
GtkTextDirection previous_direction);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
static void gtk_range_measure_trough (GtkGizmo *gizmo,
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
static void gtk_range_allocate_trough (GtkGizmo *gizmo,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline);
|
2019-01-18 07:01:40 +00:00
|
|
|
|
static void gtk_range_render_trough (GtkGizmo *gizmo,
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkSnapshot *snapshot);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2018-07-18 13:34:39 +00:00
|
|
|
|
static gboolean gtk_range_scroll_controller_scroll (GtkEventControllerScroll *scroll,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double dx,
|
|
|
|
|
double dy,
|
2017-09-15 11:53:59 +00:00
|
|
|
|
GtkRange *range);
|
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
static void gtk_range_set_orientation (GtkRange *range,
|
|
|
|
|
GtkOrientation orientation);
|
|
|
|
|
|
2017-05-07 14:16:05 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkRange, gtk_range, GTK_TYPE_WIDGET,
|
|
|
|
|
G_ADD_PRIVATE (GtkRange)
|
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
|
|
|
|
|
NULL))
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static guint signals[LAST_SIGNAL];
|
2015-09-06 14:42:50 +00:00
|
|
|
|
static GParamSpec *properties[LAST_PROP];
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_class_init (GtkRangeClass *class)
|
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class->set_property = gtk_range_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_range_get_property;
|
2016-06-05 23:35:36 +00:00
|
|
|
|
gobject_class->finalize = gtk_range_finalize;
|
2020-05-05 20:49:33 +00:00
|
|
|
|
gobject_class->dispose = gtk_range_dispose;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2017-05-04 06:05:11 +00:00
|
|
|
|
widget_class->measure = gtk_range_measure;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
widget_class->size_allocate = gtk_range_size_allocate;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
widget_class->unmap = gtk_range_unmap;
|
2016-03-04 19:56:08 +00:00
|
|
|
|
widget_class->direction_changed = gtk_range_direction_changed;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
|
|
|
|
|
class->move_slider = gtk_range_move_slider;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
class->change_value = gtk_range_real_change_value;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
2007-07-12 00:57:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange::value-changed:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-07-12 00:57:23 +00:00
|
|
|
|
*
|
|
|
|
|
* Emitted when the range value changes.
|
|
|
|
|
*/
|
2001-06-05 20:07:02 +00:00
|
|
|
|
signals[VALUE_CHANGED] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("value-changed"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, value_changed),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-05-21 00:19:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange::adjust-bounds:
|
|
|
|
|
* @range: the #GtkRange that received the signal
|
|
|
|
|
* @value: the value before we clamp
|
2010-05-25 13:44:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Emitted before clamping a value, to give the application a
|
|
|
|
|
* chance to adjust the bounds.
|
2010-05-21 00:19:14 +00:00
|
|
|
|
*/
|
2002-02-15 05:53:08 +00:00
|
|
|
|
signals[ADJUST_BOUNDS] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("adjust-bounds"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2002-02-15 05:53:08 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, adjust_bounds),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2002-02-15 05:53:08 +00:00
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
|
G_TYPE_DOUBLE);
|
2015-09-06 14:42:50 +00:00
|
|
|
|
|
2007-07-12 00:57:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange::move-slider:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-07-12 00:57:23 +00:00
|
|
|
|
* @step: how to move the slider
|
|
|
|
|
*
|
|
|
|
|
* Virtual function that moves the slider. Used for keybindings.
|
|
|
|
|
*/
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
signals[MOVE_SLIDER] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("move-slider"),
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, move_slider),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
|
GTK_TYPE_SCROLL_TYPE);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange::change-value:
|
2010-05-21 00:19:14 +00:00
|
|
|
|
* @range: the #GtkRange that received the signal
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* @scroll: the type of scroll action that was performed
|
|
|
|
|
* @value: the new value resulting from the scroll action
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* The #GtkRange::change-value signal is emitted when a scroll action is
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* 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
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* the event to other handlers until the default GTK handler is
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
* reached.
|
|
|
|
|
*
|
|
|
|
|
* The value parameter is unrounded. An application that overrides
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* the GtkRange::change-value signal is responsible for clamping the
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* value to the desired number of decimal digits; the default GTK
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* handler clamps the value based on #GtkRange:round-digits.
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*
|
2011-11-21 18:12:58 +00:00
|
|
|
|
* Returns: %TRUE to prevent other handlers from being invoked for
|
|
|
|
|
* the signal, %FALSE to propagate the signal further
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
*/
|
|
|
|
|
signals[CHANGE_VALUE] =
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_new (I_("change-value"),
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkRangeClass, change_value),
|
|
|
|
|
_gtk_boolean_handled_accumulator, NULL,
|
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM_DOUBLE,
|
|
|
|
|
G_TYPE_BOOLEAN, 2,
|
|
|
|
|
GTK_TYPE_SCROLL_TYPE,
|
|
|
|
|
G_TYPE_DOUBLE);
|
2008-06-20 11:08:57 +00:00
|
|
|
|
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation");
|
|
|
|
|
|
|
|
|
|
properties[PROP_ADJUSTMENT] =
|
|
|
|
|
g_param_spec_object ("adjustment",
|
|
|
|
|
P_("Adjustment"),
|
|
|
|
|
P_("The GtkAdjustment that contains the current value of this range object"),
|
|
|
|
|
GTK_TYPE_ADJUSTMENT,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT);
|
|
|
|
|
|
|
|
|
|
properties[PROP_INVERTED] =
|
|
|
|
|
g_param_spec_boolean ("inverted",
|
|
|
|
|
P_("Inverted"),
|
|
|
|
|
P_("Invert direction slider moves to increase range value"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:show-fill-level:
|
|
|
|
|
*
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* The show-fill-level property controls whether fill level indicator
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* graphics are displayed on the trough. See
|
|
|
|
|
* gtk_range_set_show_fill_level().
|
|
|
|
|
**/
|
2015-09-06 14:42:50 +00:00
|
|
|
|
properties[PROP_SHOW_FILL_LEVEL] =
|
|
|
|
|
g_param_spec_boolean ("show-fill-level",
|
|
|
|
|
P_("Show Fill Level"),
|
|
|
|
|
P_("Whether to display a fill level indicator graphics on trough."),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:restrict-to-fill-level:
|
|
|
|
|
*
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* The restrict-to-fill-level property controls whether slider
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* movement is restricted to an upper boundary set by the
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* fill level. See gtk_range_set_restrict_to_fill_level().
|
2006-11-15 12:23:10 +00:00
|
|
|
|
**/
|
2015-09-06 14:42:50 +00:00
|
|
|
|
properties[PROP_RESTRICT_TO_FILL_LEVEL] =
|
|
|
|
|
g_param_spec_boolean ("restrict-to-fill-level",
|
|
|
|
|
P_("Restrict to Fill Level"),
|
|
|
|
|
P_("Whether to restrict the upper boundary to the fill level."),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:fill-level:
|
|
|
|
|
*
|
|
|
|
|
* The fill level (e.g. prebuffering of a network stream).
|
|
|
|
|
* See gtk_range_set_fill_level().
|
|
|
|
|
**/
|
2015-09-06 14:42:50 +00:00
|
|
|
|
properties[PROP_FILL_LEVEL] =
|
|
|
|
|
g_param_spec_double ("fill-level",
|
|
|
|
|
P_("Fill Level"),
|
|
|
|
|
P_("The fill level."),
|
|
|
|
|
-G_MAXDOUBLE, G_MAXDOUBLE,
|
|
|
|
|
G_MAXDOUBLE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:round-digits:
|
|
|
|
|
*
|
|
|
|
|
* The number of digits to round the value to when
|
|
|
|
|
* it changes, or -1. See #GtkRange::change-value.
|
|
|
|
|
*/
|
2015-09-06 14:42:50 +00:00
|
|
|
|
properties[PROP_ROUND_DIGITS] =
|
|
|
|
|
g_param_spec_int ("round-digits",
|
|
|
|
|
P_("Round Digits"),
|
|
|
|
|
P_("The number of digits to round the value to."),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (gobject_class, LAST_PROP, properties);
|
2011-01-15 05:08:39 +00:00
|
|
|
|
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("range"));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_range_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2020-07-13 15:22:22 +00:00
|
|
|
|
gtk_range_set_orientation (range, g_value_get_enum (value));
|
2008-11-11 17:47:13 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ADJUSTMENT:
|
|
|
|
|
gtk_range_set_adjustment (range, g_value_get_object (value));
|
|
|
|
|
break;
|
2001-06-06 20:39:02 +00:00
|
|
|
|
case PROP_INVERTED:
|
|
|
|
|
gtk_range_set_inverted (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
case PROP_SHOW_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_show_fill_level (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_RESTRICT_TO_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_restrict_to_fill_level (range, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_FILL_LEVEL:
|
|
|
|
|
gtk_range_set_fill_level (range, g_value_get_double (value));
|
|
|
|
|
break;
|
2011-01-15 05:08:39 +00:00
|
|
|
|
case PROP_ROUND_DIGITS:
|
|
|
|
|
gtk_range_set_round_digits (range, g_value_get_int (value));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_range_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2008-11-11 17:47:13 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_enum (value, priv->orientation);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ADJUSTMENT:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_object (value, priv->adjustment);
|
2001-05-17 16:22:06 +00:00
|
|
|
|
break;
|
2001-06-06 20:39:02 +00:00
|
|
|
|
case PROP_INVERTED:
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_value_set_boolean (value, priv->inverted);
|
2001-06-06 20:39:02 +00:00
|
|
|
|
break;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
case PROP_SHOW_FILL_LEVEL:
|
|
|
|
|
g_value_set_boolean (value, gtk_range_get_show_fill_level (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_RESTRICT_TO_FILL_LEVEL:
|
|
|
|
|
g_value_set_boolean (value, gtk_range_get_restrict_to_fill_level (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_FILL_LEVEL:
|
|
|
|
|
g_value_set_double (value, gtk_range_get_fill_level (range));
|
|
|
|
|
break;
|
2011-01-15 05:08:39 +00:00
|
|
|
|
case PROP_ROUND_DIGITS:
|
|
|
|
|
g_value_set_int (value, gtk_range_get_round_digits (range));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_init (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-03-09 05:36:22 +00:00
|
|
|
|
GtkGesture *gesture;
|
2018-03-10 17:29:57 +00:00
|
|
|
|
GtkEventController *controller;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
priv->adjustment = NULL;
|
|
|
|
|
priv->inverted = FALSE;
|
|
|
|
|
priv->flippable = FALSE;
|
|
|
|
|
priv->round_digits = -1;
|
|
|
|
|
priv->show_fill_level = FALSE;
|
|
|
|
|
priv->restrict_to_fill_level = TRUE;
|
|
|
|
|
priv->fill_level = G_MAXDOUBLE;
|
|
|
|
|
priv->timer = NULL;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2020-04-23 16:48:29 +00:00
|
|
|
|
gtk_widget_update_orientation (GTK_WIDGET (range), priv->orientation);
|
2016-02-24 19:43:06 +00:00
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
priv->trough_widget = gtk_gizmo_new ("trough",
|
|
|
|
|
gtk_range_measure_trough,
|
|
|
|
|
gtk_range_allocate_trough,
|
2019-04-07 15:47:24 +00:00
|
|
|
|
gtk_range_render_trough,
|
2020-04-08 11:34:38 +00:00
|
|
|
|
NULL,
|
|
|
|
|
NULL, NULL);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_set_parent (priv->trough_widget, GTK_WIDGET (range));
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2020-04-08 11:34:38 +00:00
|
|
|
|
priv->slider_widget = gtk_gizmo_new ("slider", NULL, NULL, NULL, NULL, NULL, NULL);
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_set_parent (priv->slider_widget, priv->trough_widget);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
/* Note: Order is important here.
|
|
|
|
|
* The ::drag-begin handler relies on the state set up by the
|
2019-05-29 17:10:46 +00:00
|
|
|
|
* click ::pressed handler. Gestures are handling events
|
2020-06-18 07:47:16 +00:00
|
|
|
|
* in the opposite order in which they are added to their
|
2014-09-27 02:21:11 +00:00
|
|
|
|
* widget.
|
|
|
|
|
*/
|
2018-03-10 17:05:57 +00:00
|
|
|
|
priv->drag_gesture = gtk_gesture_drag_new ();
|
2015-07-12 05:36:17 +00:00
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->drag_gesture), 0);
|
2014-09-27 02:21:11 +00:00
|
|
|
|
g_signal_connect (priv->drag_gesture, "drag-begin",
|
|
|
|
|
G_CALLBACK (gtk_range_drag_gesture_begin), range);
|
|
|
|
|
g_signal_connect (priv->drag_gesture, "drag-update",
|
|
|
|
|
G_CALLBACK (gtk_range_drag_gesture_update), range);
|
2018-03-10 17:05:57 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (priv->drag_gesture));
|
2014-09-27 02:21:11 +00:00
|
|
|
|
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gesture = gtk_gesture_click_new ();
|
2018-10-18 08:53:32 +00:00
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
|
|
|
|
g_signal_connect (gesture, "pressed",
|
2019-05-29 17:10:46 +00:00
|
|
|
|
G_CALLBACK (gtk_range_click_gesture_pressed), range);
|
2018-10-18 08:53:32 +00:00
|
|
|
|
g_signal_connect (gesture, "released",
|
2019-05-29 17:10:46 +00:00
|
|
|
|
G_CALLBACK (gtk_range_click_gesture_released), range);
|
2018-10-18 08:53:32 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
|
2020-07-09 18:44:42 +00:00
|
|
|
|
gtk_gesture_group (gesture, priv->drag_gesture);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2018-03-09 05:36:22 +00:00
|
|
|
|
gesture = gtk_gesture_long_press_new ();
|
2019-08-10 18:08:59 +00:00
|
|
|
|
gtk_gesture_long_press_set_delay_factor (GTK_GESTURE_LONG_PRESS (gesture), 2.0);
|
2018-03-09 05:36:22 +00:00
|
|
|
|
g_signal_connect (gesture, "pressed",
|
2014-06-05 13:29:14 +00:00
|
|
|
|
G_CALLBACK (gtk_range_long_press_gesture_pressed), range);
|
2018-03-09 05:36:22 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
|
2020-07-09 18:44:42 +00:00
|
|
|
|
gtk_gesture_group (gesture, priv->drag_gesture);
|
2017-09-15 11:53:59 +00:00
|
|
|
|
|
2018-03-10 17:29:57 +00:00
|
|
|
|
controller = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
|
|
|
|
|
g_signal_connect (controller, "scroll",
|
2017-09-15 11:53:59 +00:00
|
|
|
|
G_CALLBACK (gtk_range_scroll_controller_scroll), range);
|
2018-03-10 17:29:57 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (range), controller);
|
2018-03-07 16:58:32 +00:00
|
|
|
|
|
2018-04-20 17:58:06 +00:00
|
|
|
|
controller = gtk_event_controller_key_new ();
|
|
|
|
|
g_signal_connect (controller, "key-pressed",
|
2018-03-07 16:58:32 +00:00
|
|
|
|
G_CALLBACK (gtk_range_key_controller_key_pressed), range);
|
2018-04-20 17:58:06 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (range), controller);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_set_orientation (GtkRange *range,
|
|
|
|
|
GtkOrientation orientation)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
if (priv->orientation != orientation)
|
|
|
|
|
{
|
|
|
|
|
priv->orientation = orientation;
|
|
|
|
|
|
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (range),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_ORIENTATION, priv->orientation,
|
|
|
|
|
-1);
|
|
|
|
|
|
|
|
|
|
gtk_widget_update_orientation (GTK_WIDGET (range), priv->orientation);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
|
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (range), "orientation");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_adjustment:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Get the #GtkAdjustment which is the “model” object for #GtkRange.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
* See gtk_range_set_adjustment() for details.
|
|
|
|
|
* The return value does not have a reference added, so should not
|
|
|
|
|
* be unreferenced.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (transfer none): a #GtkAdjustment
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkAdjustment*
|
|
|
|
|
gtk_range_get_adjustment (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (!priv->adjustment)
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
gtk_range_set_adjustment (range, NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return priv->adjustment;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_adjustment:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @adjustment: a #GtkAdjustment
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Sets the adjustment to be used as the “model” object for this range
|
2001-06-05 20:07:02 +00:00
|
|
|
|
* 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 #GtkScale and nonzero for #GtkScrollbar, and
|
|
|
|
|
* indicates the size of the visible area of the widget being scrolled.
|
|
|
|
|
* The page size affects the size of the scrollbar slider.
|
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_set_adjustment (GtkRange *range,
|
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
if (!adjustment)
|
2010-09-27 13:10:12 +00:00
|
|
|
|
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
else
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment != adjustment)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment)
|
1997-12-18 02:17:14 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_value_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_object_unref (priv->adjustment);
|
1997-12-18 02:17:14 +00:00
|
|
|
|
}
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->adjustment = adjustment;
|
2005-11-23 18:06:58 +00:00
|
|
|
|
g_object_ref_sink (adjustment);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_connect (adjustment, "changed",
|
|
|
|
|
G_CALLBACK (gtk_range_adjustment_changed),
|
|
|
|
|
range);
|
2008-08-08 13:25:18 +00:00
|
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2002-10-04 08:02:14 +00:00
|
|
|
|
G_CALLBACK (gtk_range_adjustment_value_changed),
|
|
|
|
|
range);
|
2017-05-13 16:56:20 +00:00
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (range),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, gtk_adjustment_get_upper (adjustment),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, gtk_adjustment_get_lower (adjustment),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, gtk_adjustment_get_value (adjustment),
|
|
|
|
|
-1);
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_adjustment_changed (adjustment, range);
|
2017-05-13 16:56:20 +00:00
|
|
|
|
gtk_range_adjustment_value_changed (adjustment, range);
|
2020-04-23 19:16:31 +00:00
|
|
|
|
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_ADJUSTMENT]);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
should_invert (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
return
|
|
|
|
|
(priv->inverted && !priv->flippable) ||
|
|
|
|
|
(priv->inverted && priv->flippable && gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_LTR) ||
|
|
|
|
|
(!priv->inverted && priv->flippable && gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_RTL);
|
|
|
|
|
else
|
|
|
|
|
return priv->inverted;
|
|
|
|
|
}
|
|
|
|
|
|
Range: Add should_invert_move() for scrolls & keys
This will be used in subsequent commits to fix the sign by which the
value is changed in response to directional scroll or keypress events.
The idea is: you have a movement to make – in the form of a delta that
follows widget directions, i.e. −1 means left or up, +1 means right or
down – and you want to know whether that delta needs to be inverted in
order to produce the intuitively expected directional change of :value.
The existing should_invert() is not sufficient: it just determines
whether to invert visually, but we need more nuance than that for input.
To answer that – while not doubling up the work for scrolls and keys – I
add a helper should_invert_move(), which considers other relevant state:
• A parallel movement on priv->orientation should just use the existing
should_invert(), which already worked OK for this case (not others).
• Movements on the other orientation now depend on priv->orientation:
◦ For a horizontal Range, always invert, so up (i.e. −ve in terms of
widget coords) always means increase value & vice-versa. This was
done in get_wheel_delta(), but move it here for use with keys too.
◦ For a vertical Range, ignore :invert as it’s only relevant to the
parallel orientation. Do not care about text direction here either
as RTL locales do not invert number lines, Cartesian plots, etc.
This returns TRUE if the delta should be inverted before applying to the
value, and we can now use this function in both scroll and key handlers.
https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-17 20:44:16 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
should_invert_move (GtkRange *range,
|
|
|
|
|
GtkOrientation move_orientation)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
/* If the move is parallel to the range, use general check for inversion */
|
|
|
|
|
if (move_orientation == priv->orientation)
|
|
|
|
|
return should_invert (range);
|
|
|
|
|
|
2018-05-21 18:42:57 +00:00
|
|
|
|
/* H scale/V move: Always invert, so down/up always dec/increase the value */
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && GTK_IS_SCALE (range))
|
Range: Add should_invert_move() for scrolls & keys
This will be used in subsequent commits to fix the sign by which the
value is changed in response to directional scroll or keypress events.
The idea is: you have a movement to make – in the form of a delta that
follows widget directions, i.e. −1 means left or up, +1 means right or
down – and you want to know whether that delta needs to be inverted in
order to produce the intuitively expected directional change of :value.
The existing should_invert() is not sufficient: it just determines
whether to invert visually, but we need more nuance than that for input.
To answer that – while not doubling up the work for scrolls and keys – I
add a helper should_invert_move(), which considers other relevant state:
• A parallel movement on priv->orientation should just use the existing
should_invert(), which already worked OK for this case (not others).
• Movements on the other orientation now depend on priv->orientation:
◦ For a horizontal Range, always invert, so up (i.e. −ve in terms of
widget coords) always means increase value & vice-versa. This was
done in get_wheel_delta(), but move it here for use with keys too.
◦ For a vertical Range, ignore :invert as it’s only relevant to the
parallel orientation. Do not care about text direction here either
as RTL locales do not invert number lines, Cartesian plots, etc.
This returns TRUE if the delta should be inverted before applying to the
value, and we can now use this function in both scroll and key handlers.
https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-17 20:44:16 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
/* V range/H move: Left/right always dec/increase the value */
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
static void
|
|
|
|
|
update_highlight_position (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
if (!priv->highlight_widget)
|
2016-03-04 19:56:08 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->highlight_widget, "bottom");
|
|
|
|
|
gtk_widget_remove_css_class (priv->highlight_widget, "top");
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->highlight_widget, "top");
|
|
|
|
|
gtk_widget_remove_css_class (priv->highlight_widget, "bottom");
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_fill_position (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
if (!priv->fill_widget)
|
2016-03-04 19:56:08 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->fill_widget, "bottom");
|
|
|
|
|
gtk_widget_remove_css_class (priv->fill_widget, "top");
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->fill_widget, "top");
|
|
|
|
|
gtk_widget_remove_css_class (priv->fill_widget, "bottom");
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_inverted:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @setting: %TRUE to invert the range
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
**/
|
2001-02-17 00:11:03 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_set_inverted (GtkRange *range,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (setting != priv->inverted)
|
2001-02-17 00:11:03 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->inverted = setting;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
update_fill_position (range);
|
|
|
|
|
update_highlight_position (range);
|
|
|
|
|
|
2019-08-09 17:36:01 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->trough_widget);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_INVERTED]);
|
2001-02-17 00:11:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_inverted:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_range_set_inverted().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the range is inverted
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
2001-02-17 00:11:03 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_inverted (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->inverted;
|
2001-02-17 00:11:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_flippable:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @flippable: %TRUE to make the range flippable
|
|
|
|
|
*
|
|
|
|
|
* If a range is flippable, it will switch its direction if it is
|
|
|
|
|
* horizontal and its direction is %GTK_TEXT_DIR_RTL.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_widget_get_direction().
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_flippable (GtkRange *range,
|
|
|
|
|
gboolean flippable)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
|
|
flippable = flippable ? TRUE : FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (flippable != priv->flippable)
|
2009-08-27 19:12:32 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->flippable = flippable;
|
2016-03-04 19:56:08 +00:00
|
|
|
|
update_fill_position (range);
|
|
|
|
|
update_highlight_position (range);
|
2009-08-27 19:12:32 +00:00
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (range));
|
2009-08-27 19:12:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_flippable:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_range_set_flippable().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the range is flippable
|
2009-08-27 19:12:32 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_flippable (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->flippable;
|
2009-08-27 19:12:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_slider_size_fixed:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @size_fixed: %TRUE to make the slider size constant
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Sets whether the range’s slider has a fixed size, or a size that
|
|
|
|
|
* depends on its adjustment’s page size.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_slider_size_fixed (GtkRange *range,
|
|
|
|
|
gboolean size_fixed)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (size_fixed != priv->slider_size_fixed)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->slider_size_fixed = size_fixed ? TRUE : FALSE;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment && gtk_widget_get_mapped (GTK_WIDGET (range)))
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->trough_widget);
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_slider_size_fixed:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_range_set_slider_size_fixed().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether the range’s slider has a fixed size.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_slider_size_fixed (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->slider_size_fixed;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_range_rect:
|
|
|
|
|
* @range: a #GtkRange
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @range_rect: (out): return location for the range rectangle
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
2017-05-07 14:31:23 +00:00
|
|
|
|
* This function returns the area that contains the range’s trough,
|
2017-06-16 16:16:27 +00:00
|
|
|
|
* in coordinates relative to @range's origin.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_range_rect (GtkRange *range,
|
|
|
|
|
GdkRectangle *range_rect)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t r;
|
2018-02-20 09:43:15 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (range_rect != NULL);
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->trough_widget, GTK_WIDGET (range), &r))
|
|
|
|
|
{
|
|
|
|
|
*range_rect = (GdkRectangle) { 0, 0, 0, 0 };
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*range_rect = (GdkRectangle) {
|
|
|
|
|
floorf (r.origin.x),
|
|
|
|
|
floorf (r.origin.y),
|
|
|
|
|
ceilf (r.size.width),
|
|
|
|
|
ceilf (r.size.height),
|
|
|
|
|
};
|
|
|
|
|
}
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_slider_range:
|
|
|
|
|
* @range: a #GtkRange
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @slider_start: (out) (allow-none): return location for the slider's
|
|
|
|
|
* start, or %NULL
|
|
|
|
|
* @slider_end: (out) (allow-none): return location for the slider's
|
|
|
|
|
* end, or %NULL
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function returns sliders range along the long dimension,
|
|
|
|
|
* in widget->window coordinates.
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_slider_range (GtkRange *range,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *slider_start,
|
|
|
|
|
int *slider_end)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t slider_bounds;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-01-22 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->slider_widget, GTK_WIDGET (range), &slider_bounds))
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
|
|
|
|
*slider_start = 0;
|
|
|
|
|
if (slider_end)
|
|
|
|
|
*slider_end = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
*slider_start = slider_bounds.origin.y;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (slider_end)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
*slider_end = slider_bounds.origin.y + slider_bounds.size.height;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
*slider_start = slider_bounds.origin.y;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (slider_end)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
*slider_end = slider_bounds.origin.x + slider_bounds.size.width;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
}
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_increments:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @step: step size
|
|
|
|
|
* @page: page size
|
|
|
|
|
*
|
|
|
|
|
* Sets the step and page sizes for the range.
|
|
|
|
|
* The step size is used when the user clicks the #GtkScrollbar
|
|
|
|
|
* arrows or moves #GtkScale via arrow keys. The page size
|
|
|
|
|
* is used for example when moving via Page Up or Page Down keys.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_increments (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double step,
|
|
|
|
|
double page)
|
2001-06-05 20:07:02 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2011-01-05 21:06:55 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
adjustment = priv->adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
gtk_adjustment_configure (adjustment,
|
|
|
|
|
gtk_adjustment_get_value (adjustment),
|
|
|
|
|
gtk_adjustment_get_lower (adjustment),
|
|
|
|
|
gtk_adjustment_get_upper (adjustment),
|
|
|
|
|
step,
|
|
|
|
|
page,
|
|
|
|
|
gtk_adjustment_get_page_size (adjustment));
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_range:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @min: minimum range value
|
|
|
|
|
* @max: maximum range value
|
|
|
|
|
*
|
|
|
|
|
* Sets the allowable values in the #GtkRange, and clamps the range
|
2002-02-27 15:43:43 +00:00
|
|
|
|
* value to be between @min and @max. (If the range has a non-zero
|
|
|
|
|
* page size, it is clamped between @min and @max - page-size.)
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_range (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double min,
|
|
|
|
|
double max)
|
2001-06-05 20:07:02 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2011-01-05 21:06:55 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value;
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2010-11-22 17:46:25 +00:00
|
|
|
|
g_return_if_fail (min <= max);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
adjustment = priv->adjustment;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
value = gtk_adjustment_get_value (adjustment);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:06:55 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
gtk_adjustment_configure (adjustment,
|
|
|
|
|
value,
|
|
|
|
|
min,
|
|
|
|
|
max,
|
|
|
|
|
gtk_adjustment_get_step_increment (adjustment),
|
|
|
|
|
gtk_adjustment_get_page_increment (adjustment),
|
|
|
|
|
gtk_adjustment_get_page_size (adjustment));
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_value:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @value: new value of the range
|
|
|
|
|
*
|
|
|
|
|
* 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
|
2007-06-10 02:53:17 +00:00
|
|
|
|
* them. The range emits the #GtkRange::value-changed signal if the
|
|
|
|
|
* value changes.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_value (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value)
|
2001-06-05 20:07:02 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (priv->adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gtk_adjustment_set_value (priv->adjustment, value);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_value:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the current value of the range.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: current value of the range.
|
2001-06-05 20:07:02 +00:00
|
|
|
|
**/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2001-06-05 20:07:02 +00:00
|
|
|
|
gtk_range_get_value (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2001-06-05 20:07:02 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return gtk_adjustment_get_value (priv->adjustment);
|
2001-06-05 20:07:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_show_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
* @show_fill_level: Whether a fill level indicator graphics is shown.
|
|
|
|
|
*
|
|
|
|
|
* Sets whether a graphical fill level is show on the trough. See
|
|
|
|
|
* gtk_range_set_fill_level() for a general description of the fill
|
|
|
|
|
* level concept.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_show_fill_level (GtkRange *range,
|
|
|
|
|
gboolean show_fill_level)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
|
|
show_fill_level = show_fill_level ? TRUE : FALSE;
|
|
|
|
|
|
2015-11-07 00:25:58 +00:00
|
|
|
|
if (show_fill_level == priv->show_fill_level)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->show_fill_level = show_fill_level;
|
|
|
|
|
|
|
|
|
|
if (show_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2020-04-08 11:34:38 +00:00
|
|
|
|
priv->fill_widget = gtk_gizmo_new ("fill", NULL, NULL, NULL, NULL, NULL, NULL);
|
2017-11-05 03:00:33 +00:00
|
|
|
|
gtk_widget_insert_after (priv->fill_widget, priv->trough_widget, NULL);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
update_fill_position (range);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
2015-11-07 00:25:58 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-11-13 19:53:14 +00:00
|
|
|
|
g_clear_pointer (&priv->fill_widget, gtk_widget_unparent);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_SHOW_FILL_LEVEL]);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (range));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_show_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets whether the range displays the fill level graphically.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @range shows the fill level.
|
2006-11-15 12:23:10 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_show_fill_level (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->show_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_restrict_to_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
* @restrict_to_fill_level: Whether the fill level restricts slider movement.
|
|
|
|
|
*
|
|
|
|
|
* Sets whether the slider is restricted to the fill level. See
|
|
|
|
|
* gtk_range_set_fill_level() for a general description of the fill
|
|
|
|
|
* level concept.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_restrict_to_fill_level (GtkRange *range,
|
|
|
|
|
gboolean restrict_to_fill_level)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
|
|
restrict_to_fill_level = restrict_to_fill_level ? TRUE : FALSE;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (restrict_to_fill_level != priv->restrict_to_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->restrict_to_fill_level = restrict_to_fill_level;
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_RESTRICT_TO_FILL_LEVEL]);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_set_value (range, gtk_range_get_value (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_restrict_to_fill_level:
|
|
|
|
|
* @range: A #GtkRange
|
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets whether the range is restricted to the fill level.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @range is restricted to the fill level.
|
2006-11-15 12:23:10 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_restrict_to_fill_level (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->restrict_to_fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_fill_level:
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @fill_level: the new position of the fill level indicator
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Set the new position of the fill level indicator.
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* The “fill level” is probably best described by its most prominent
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* use case, which is an indicator for the amount of pre-buffering in
|
|
|
|
|
* a streaming media player. In that use case, the value of the range
|
|
|
|
|
* would indicate the current play position, and the fill level would
|
|
|
|
|
* be the position up to which the file/stream has been downloaded.
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* This amount of prebuffering can be displayed on the range’s trough
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* and is themeable separately from the trough. To enable fill level
|
|
|
|
|
* display, use gtk_range_set_show_fill_level(). The range defaults
|
|
|
|
|
* to not showing the fill level.
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Additionally, it’s possible to restrict the range’s slider position
|
2006-11-15 12:23:10 +00:00
|
|
|
|
* to values which are smaller than the fill level. This is controller
|
|
|
|
|
* by gtk_range_set_restrict_to_fill_level() and is by default
|
|
|
|
|
* enabled.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_fill_level (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (fill_level != priv->fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level = fill_level;
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_FILL_LEVEL]);
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->show_fill_level)
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (range));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2006-11-15 12:23:10 +00:00
|
|
|
|
gtk_range_set_value (range, gtk_range_get_value (range));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_fill_level:
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* @range: A #GtkRange
|
2006-11-15 12:23:10 +00:00
|
|
|
|
*
|
2007-05-26 19:03:18 +00:00
|
|
|
|
* Gets the current position of the fill level indicator.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current fill level
|
2006-11-15 12:23:10 +00:00
|
|
|
|
**/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
2006-11-15 12:23:10 +00:00
|
|
|
|
gtk_range_get_fill_level (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->fill_level;
|
2006-11-15 12:23:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
2020-05-05 20:49:33 +00:00
|
|
|
|
gtk_range_dispose (GObject *object)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2020-05-05 20:49:33 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_remove_step_timer (range);
|
2007-09-06 11:44:22 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->adjustment)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
2002-10-04 08:02:14 +00:00
|
|
|
|
gtk_range_adjustment_value_changed,
|
|
|
|
|
range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_object_unref (priv->adjustment);
|
|
|
|
|
priv->adjustment = NULL;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->n_marks)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->marks);
|
|
|
|
|
priv->marks = NULL;
|
|
|
|
|
g_free (priv->mark_pos);
|
|
|
|
|
priv->mark_pos = NULL;
|
|
|
|
|
priv->n_marks = 0;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-05 20:49:33 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_range_parent_class)->dispose (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-05 23:35:36 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (object);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-06-05 23:35:36 +00:00
|
|
|
|
|
2018-11-13 19:53:14 +00:00
|
|
|
|
g_clear_pointer (&priv->slider_widget, gtk_widget_unparent);
|
|
|
|
|
g_clear_pointer (&priv->fill_widget, gtk_widget_unparent);
|
|
|
|
|
g_clear_pointer (&priv->highlight_widget, gtk_widget_unparent);
|
|
|
|
|
g_clear_pointer (&priv->trough_widget, gtk_widget_unparent);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
|
2016-06-05 23:35:36 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_range_parent_class)->finalize (object);
|
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_range_measure_trough (GtkGizmo *gizmo,
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (GTK_WIDGET (gizmo));
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min, nat;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_measure (priv->slider_widget,
|
|
|
|
|
orientation, -1,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
if (priv->fill_widget)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_measure (priv->fill_widget,
|
|
|
|
|
orientation, for_size,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*minimum = MAX (*minimum, min);
|
|
|
|
|
*natural = MAX (*natural, nat);
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
if (priv->highlight_widget)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_measure (priv->highlight_widget,
|
|
|
|
|
orientation, for_size,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*minimum = MAX (*minimum, min);
|
|
|
|
|
*natural = MAX (*natural, nat);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkBorder border = { 0 };
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
/* Measure the main box */
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_widget_measure (priv->trough_widget,
|
|
|
|
|
orientation,
|
|
|
|
|
-1,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (GTK_RANGE_GET_CLASS (range)->get_range_border)
|
|
|
|
|
GTK_RANGE_GET_CLASS (range)->get_range_border (range, &border);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
/* Add the border */
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
|
|
|
|
*minimum += border.left + border.right;
|
|
|
|
|
*natural += border.left + border.right;
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
else
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
|
|
|
|
*minimum += border.top + border.bottom;
|
|
|
|
|
*natural += border.top + border.bottom;
|
|
|
|
|
}
|
2016-02-24 21:28:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_range_allocate_trough (GtkGizmo *gizmo,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (GTK_WIDGET (gizmo));
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2017-06-28 06:19:35 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
2018-02-22 17:24:06 +00:00
|
|
|
|
const double lower = gtk_adjustment_get_lower (priv->adjustment);
|
|
|
|
|
const double upper = gtk_adjustment_get_upper (priv->adjustment);
|
|
|
|
|
const double page_size = gtk_adjustment_get_page_size (priv->adjustment);
|
2017-05-07 18:45:06 +00:00
|
|
|
|
double value;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
|
|
|
|
|
/* Slider */
|
|
|
|
|
gtk_range_calc_marks (range);
|
|
|
|
|
|
|
|
|
|
gtk_range_compute_slider_position (range,
|
|
|
|
|
gtk_adjustment_get_value (priv->adjustment),
|
|
|
|
|
&slider_alloc);
|
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->slider_widget, &slider_alloc, -1);
|
2018-02-23 09:42:09 +00:00
|
|
|
|
priv->slider_x = slider_alloc.x;
|
|
|
|
|
priv->slider_y = slider_alloc.y;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2018-02-22 17:24:06 +00:00
|
|
|
|
if (lower == upper)
|
2017-06-29 13:28:24 +00:00
|
|
|
|
value = 0;
|
|
|
|
|
else
|
2018-02-22 17:24:06 +00:00
|
|
|
|
value = (gtk_adjustment_get_value (priv->adjustment) - lower) / (upper - lower);
|
2017-05-07 18:45:06 +00:00
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->show_fill_level &&
|
2018-02-22 17:24:06 +00:00
|
|
|
|
upper - page_size - lower != 0)
|
2016-01-09 22:00:09 +00:00
|
|
|
|
{
|
2018-02-22 17:24:06 +00:00
|
|
|
|
double level, fill;
|
2018-03-31 19:02:28 +00:00
|
|
|
|
GtkAllocation fill_alloc;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
fill_alloc = (GtkAllocation) {0, 0, width, height};
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2018-02-22 17:24:06 +00:00
|
|
|
|
level = CLAMP (priv->fill_level, lower, upper - page_size);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2018-02-23 09:59:21 +00:00
|
|
|
|
fill = (level - lower) / (upper - lower - page_size);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
fill_alloc.width *= fill;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
2018-08-16 04:53:03 +00:00
|
|
|
|
fill_alloc.x += width - fill_alloc.width;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fill_alloc.height *= fill;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
2018-08-16 04:53:03 +00:00
|
|
|
|
fill_alloc.y += height - fill_alloc.height;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->fill_widget, &fill_alloc, -1);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
2016-02-23 02:11:02 +00:00
|
|
|
|
|
2018-07-07 17:18:26 +00:00
|
|
|
|
if (priv->highlight_widget)
|
2016-02-23 02:11:02 +00:00
|
|
|
|
{
|
2018-03-31 19:02:28 +00:00
|
|
|
|
GtkAllocation highlight_alloc;
|
2016-09-04 13:43:51 +00:00
|
|
|
|
int min, nat;
|
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_measure (priv->highlight_widget,
|
|
|
|
|
priv->orientation, -1,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
2016-02-23 02:11:02 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
highlight_alloc.y = 0;
|
2020-02-15 09:14:13 +00:00
|
|
|
|
highlight_alloc.width = MAX (min, value * width);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
highlight_alloc.height = height;
|
2016-09-04 13:43:51 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
if (!should_invert (range))
|
2018-08-16 04:53:03 +00:00
|
|
|
|
highlight_alloc.x = 0;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
2020-02-15 09:14:13 +00:00
|
|
|
|
highlight_alloc.x = width - highlight_alloc.width;
|
2016-05-22 06:24:46 +00:00
|
|
|
|
}
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
highlight_alloc.x = 0;
|
|
|
|
|
highlight_alloc.width = width;
|
2020-02-15 09:14:13 +00:00
|
|
|
|
highlight_alloc.height = MAX (min, height * value);
|
2016-09-04 13:43:51 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
if (!should_invert (range))
|
2018-08-16 04:53:03 +00:00
|
|
|
|
highlight_alloc.y = 0;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
2020-02-15 09:14:13 +00:00
|
|
|
|
highlight_alloc.y = height - highlight_alloc.height;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->highlight_widget, &highlight_alloc, -1);
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
2016-01-19 09:22:33 +00:00
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* Clamp dimensions and border inside allocation, such that we prefer
|
|
|
|
|
* to take space from border not dimensions in all directions, and prefer to
|
|
|
|
|
* give space to border over dimensions in one direction.
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
clamp_dimensions (int range_width,
|
|
|
|
|
int range_height,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height,
|
|
|
|
|
GtkBorder *border,
|
|
|
|
|
gboolean border_expands_horizontally)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int extra, shortage;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* Width */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
extra = range_width - border->left - border->right - *width;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (extra > 0)
|
|
|
|
|
{
|
|
|
|
|
if (border_expands_horizontally)
|
2016-01-09 22:00:09 +00:00
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
border->left += extra / 2;
|
|
|
|
|
border->right += extra / 2 + extra % 2;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*width += extra;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if we can fit rect, if not kill the border */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
shortage = *width - range_width;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
*width = range_width;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* lose the border */
|
|
|
|
|
border->left = 0;
|
|
|
|
|
border->right = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
shortage = *width + border->left + border->right - range_width;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
/* Shrink borders */
|
|
|
|
|
border->left -= shortage / 2;
|
|
|
|
|
border->right -= shortage / 2 + shortage % 2;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
2016-01-19 09:22:33 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* Height */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
extra = range_height - border->top - border->bottom - *height;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (extra > 0)
|
|
|
|
|
{
|
|
|
|
|
if (border_expands_horizontally)
|
|
|
|
|
{
|
|
|
|
|
/* don't expand border vertically */
|
|
|
|
|
*height += extra;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
border->top += extra / 2;
|
|
|
|
|
border->bottom += extra / 2 + extra % 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if we can fit rect, if not kill the border */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
shortage = *height - range_height;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
*height = range_height;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* lose the border */
|
|
|
|
|
border->top = 0;
|
|
|
|
|
border->bottom = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
2018-08-16 04:53:03 +00:00
|
|
|
|
shortage = *height + border->top + border->bottom - range_height;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
/* Shrink borders */
|
|
|
|
|
border->top -= shortage / 2;
|
|
|
|
|
border->bottom -= shortage / 2 + shortage % 2;
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkBorder border = { 0 };
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkAllocation box_alloc;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
int box_min_width, box_min_height;
|
|
|
|
|
|
|
|
|
|
if (GTK_RANGE_GET_CLASS (range)->get_range_border)
|
|
|
|
|
GTK_RANGE_GET_CLASS (range)->get_range_border (range, &border);
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_widget_measure (priv->trough_widget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL, -1,
|
|
|
|
|
&box_min_width, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_widget_measure (priv->trough_widget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL, -1,
|
|
|
|
|
&box_min_height, NULL,
|
|
|
|
|
NULL, NULL);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2018-08-16 04:53:03 +00:00
|
|
|
|
clamp_dimensions (width, height, &box_min_width, &box_min_height, &border, TRUE);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else
|
2018-08-16 04:53:03 +00:00
|
|
|
|
clamp_dimensions (width, height, &box_min_width, &box_min_height, &border, FALSE);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2017-06-16 16:16:27 +00:00
|
|
|
|
box_alloc.x = border.left;
|
|
|
|
|
box_alloc.y = border.top;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
box_alloc.width = box_min_width;
|
|
|
|
|
box_alloc.height = box_min_height;
|
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->trough_widget, &box_alloc, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_unmap (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-03-22 17:36:41 +00:00
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->unmap (widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_direction_changed (GtkWidget *widget,
|
|
|
|
|
GtkTextDirection previous_direction)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
|
|
update_fill_position (range);
|
|
|
|
|
update_highlight_position (range);
|
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->direction_changed (widget, previous_direction);
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-18 07:01:40 +00:00
|
|
|
|
static void
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_range_render_trough (GtkGizmo *gizmo,
|
|
|
|
|
GtkSnapshot *snapshot)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (GTK_WIDGET (gizmo));
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2016-03-09 16:27:01 +00:00
|
|
|
|
/* HACK: GtkColorScale wants to draw its own trough
|
|
|
|
|
* so we let it...
|
|
|
|
|
*/
|
|
|
|
|
if (GTK_IS_COLOR_SCALE (widget))
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_color_scale_snapshot_trough (GTK_COLOR_SCALE (widget), snapshot,
|
2017-12-04 11:42:52 +00:00
|
|
|
|
gtk_widget_get_width (GTK_WIDGET (gizmo)),
|
|
|
|
|
gtk_widget_get_height (GTK_WIDGET (gizmo)));
|
2016-03-09 16:27:01 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (priv->show_fill_level &&
|
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) != 0)
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->fill_widget, snapshot);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2018-07-07 17:18:26 +00:00
|
|
|
|
if (priv->highlight_widget)
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->highlight_widget, snapshot);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2017-05-08 11:37:12 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->slider_widget, snapshot);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
2017-05-07 19:39:37 +00:00
|
|
|
|
range_grab_add (GtkRange *range,
|
|
|
|
|
GtkWidget *location)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2020-09-12 16:01:04 +00:00
|
|
|
|
/* Don't perform any GDK/GTK grab here. Since a button
|
2012-01-04 23:27:57 +00:00
|
|
|
|
* is down, there's an ongoing implicit grab on
|
2017-04-02 13:19:39 +00:00
|
|
|
|
* the widget, which pretty much guarantees this
|
2012-01-04 23:27:57 +00:00
|
|
|
|
* is the only widget receiving the pointer events.
|
|
|
|
|
*/
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->grab_location = location;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_add_css_class (GTK_WIDGET (range), "dragging");
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
static void
|
|
|
|
|
update_zoom_state (GtkRange *range,
|
|
|
|
|
gboolean enabled)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
|
|
|
|
if (enabled)
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_add_css_class (GTK_WIDGET (range), "fine-tune");
|
2013-07-18 21:35:42 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (GTK_WIDGET (range), "fine-tune");
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->zoom = enabled;
|
2013-07-18 21:35:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
range_grab_remove (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2014-10-05 21:29:32 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (!priv->grab_location)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->grab_location = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
update_zoom_state (range, FALSE);
|
2014-10-05 21:29:32 +00:00
|
|
|
|
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (GTK_WIDGET (range), "dragging");
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static GtkScrollType
|
2015-06-20 22:37:15 +00:00
|
|
|
|
range_get_scroll_for_grab (GtkRange *range)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (!priv->grab_location)
|
|
|
|
|
return GTK_SCROLL_NONE;
|
|
|
|
|
|
|
|
|
|
/* In the trough */
|
2017-05-07 16:41:24 +00:00
|
|
|
|
if (priv->grab_location == priv->trough_widget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->trough_click_forward)
|
|
|
|
|
return GTK_SCROLL_PAGE_FORWARD;
|
|
|
|
|
else
|
|
|
|
|
return GTK_SCROLL_PAGE_BACKWARD;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return GTK_SCROLL_NONE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
static double
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
coord_to_value (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double coord)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double frac;
|
|
|
|
|
double value;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int trough_length;
|
|
|
|
|
int slider_length;
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t slider_bounds;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->slider_widget, priv->slider_widget, &slider_bounds))
|
|
|
|
|
graphene_rect_init (&slider_bounds, 0, 0, gtk_widget_get_width (priv->trough_widget), gtk_widget_get_height (priv->trough_widget));
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2018-02-22 16:13:05 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
2018-02-22 16:13:05 +00:00
|
|
|
|
trough_length = gtk_widget_get_width (priv->trough_widget);
|
2018-04-07 11:37:24 +00:00
|
|
|
|
slider_length = slider_bounds.size.width;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-02-22 16:13:05 +00:00
|
|
|
|
trough_length = gtk_widget_get_height (priv->trough_widget);
|
2018-04-07 11:37:24 +00:00
|
|
|
|
slider_length = slider_bounds.size.height;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (trough_length == slider_length)
|
2018-02-23 09:42:09 +00:00
|
|
|
|
{
|
|
|
|
|
frac = 1.0;
|
|
|
|
|
}
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
else
|
2018-02-23 09:42:09 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->slider_size_fixed)
|
2020-05-22 00:37:54 +00:00
|
|
|
|
frac = CLAMP (coord / (double) trough_length, 0, 1);
|
2018-02-23 09:42:09 +00:00
|
|
|
|
else
|
2020-05-22 00:37:54 +00:00
|
|
|
|
frac = CLAMP (coord / (double) (trough_length - slider_length), 0, 1);
|
2018-02-23 09:42:09 +00:00
|
|
|
|
}
|
2001-02-17 00:11:03 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
if (should_invert (range))
|
|
|
|
|
frac = 1.0 - frac;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2018-02-23 09:42:09 +00:00
|
|
|
|
value = gtk_adjustment_get_lower (priv->adjustment) +
|
|
|
|
|
frac * (gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
return value;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-11 05:47:09 +00:00
|
|
|
|
static gboolean
|
2018-03-07 16:58:32 +00:00
|
|
|
|
gtk_range_key_controller_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget)
|
2006-03-11 05:47:09 +00:00
|
|
|
|
{
|
2006-10-30 13:39:34 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2017-08-25 14:52:41 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (gtk_gesture_is_active (priv->drag_gesture) &&
|
2017-08-25 14:52:41 +00:00
|
|
|
|
keyval == GDK_KEY_Escape &&
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->grab_location != NULL)
|
2006-03-11 05:47:09 +00:00
|
|
|
|
{
|
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return GDK_EVENT_STOP;
|
2006-03-11 05:47:09 +00:00
|
|
|
|
}
|
2015-02-23 01:02:02 +00:00
|
|
|
|
else if (priv->in_drag &&
|
2017-08-25 14:52:41 +00:00
|
|
|
|
(keyval == GDK_KEY_Shift_L ||
|
|
|
|
|
keyval == GDK_KEY_Shift_R))
|
2015-02-23 01:02:02 +00:00
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t slider_bounds;
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->slider_widget, priv->trough_widget, &slider_bounds))
|
|
|
|
|
return GDK_EVENT_STOP;
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2015-06-21 00:26:42 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider_bounds.origin.y;
|
2015-06-21 00:26:42 +00:00
|
|
|
|
else
|
2018-04-07 11:37:24 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider_bounds.origin.x;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
update_zoom_state (range, !priv->zoom);
|
2015-06-21 00:26:42 +00:00
|
|
|
|
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return GDK_EVENT_STOP;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
}
|
2006-10-30 13:39:34 +00:00
|
|
|
|
|
2018-04-24 22:35:00 +00:00
|
|
|
|
return GDK_EVENT_PROPAGATE;
|
2006-03-11 05:47:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-05 01:59:39 +00:00
|
|
|
|
static void
|
2018-02-23 07:40:27 +00:00
|
|
|
|
update_initial_slider_position (GtkRange *range,
|
|
|
|
|
double x,
|
|
|
|
|
double y)
|
2016-03-05 01:59:39 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-03-05 01:59:39 +00:00
|
|
|
|
|
2018-02-23 09:42:09 +00:00
|
|
|
|
gtk_widget_translate_coordinates (GTK_WIDGET (range), priv->trough_widget,
|
2020-05-17 21:08:01 +00:00
|
|
|
|
x, y, &x, &y);
|
2018-02-23 07:40:27 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2016-03-05 01:59:39 +00:00
|
|
|
|
{
|
2018-02-23 09:42:09 +00:00
|
|
|
|
priv->slide_initial_slider_position = MAX (0, priv->slider_x);
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->slide_initial_coordinate_delta = x - priv->slide_initial_slider_position;
|
2016-03-05 01:59:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-02-23 09:42:09 +00:00
|
|
|
|
priv->slide_initial_slider_position = MAX (0, priv->slider_y);
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->slide_initial_coordinate_delta = y - priv->slide_initial_slider_position;
|
2016-03-05 01:59:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-18 21:35:42 +00:00
|
|
|
|
static void
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range)
|
2013-07-18 21:35:42 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-02-20 09:16:00 +00:00
|
|
|
|
GtkWidget *mouse_location;
|
2015-02-23 12:28:40 +00:00
|
|
|
|
|
2019-04-07 21:36:40 +00:00
|
|
|
|
mouse_location = gtk_widget_pick (GTK_WIDGET (range), x, y, GTK_PICK_DEFAULT);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
|
2018-02-20 09:16:00 +00:00
|
|
|
|
if (mouse_location == priv->slider_widget && !priv->zoom)
|
2015-02-23 11:42:17 +00:00
|
|
|
|
{
|
2018-02-23 07:40:27 +00:00
|
|
|
|
update_initial_slider_position (range, x, y);
|
2015-02-23 11:42:17 +00:00
|
|
|
|
update_zoom_state (range, TRUE);
|
|
|
|
|
}
|
2013-07-18 21:35:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gtk_range_click_gesture_pressed (GtkGestureClick *gesture,
|
|
|
|
|
guint n_press,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2019-05-29 17:10:46 +00:00
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GdkDevice *source_device;
|
|
|
|
|
GdkEventSequence *sequence;
|
2020-02-16 16:09:02 +00:00
|
|
|
|
GdkEvent *event;
|
2012-01-04 23:21:36 +00:00
|
|
|
|
GdkInputSource source;
|
2012-08-24 09:49:43 +00:00
|
|
|
|
gboolean primary_warps;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
gboolean shift_pressed;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
guint button;
|
2015-07-12 05:36:17 +00:00
|
|
|
|
GdkModifierType state_mask;
|
2018-02-20 09:16:00 +00:00
|
|
|
|
GtkWidget *mouse_location;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
2020-02-18 03:11:56 +00:00
|
|
|
|
state_mask = gdk_event_get_modifier_state (event);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
shift_pressed = (state_mask & GDK_SHIFT_MASK) != 0;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2020-07-28 22:03:48 +00:00
|
|
|
|
source_device = gdk_event_get_device ((GdkEvent *) event);
|
2012-01-04 23:21:36 +00:00
|
|
|
|
source = gdk_device_get_source (source_device);
|
|
|
|
|
|
2012-08-24 09:49:43 +00:00
|
|
|
|
g_object_get (gtk_widget_get_settings (widget),
|
|
|
|
|
"gtk-primary-button-warps-slider", &primary_warps,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2019-04-07 17:19:09 +00:00
|
|
|
|
mouse_location = gtk_widget_pick (widget, x, y, 0);
|
2017-05-20 13:04:03 +00:00
|
|
|
|
|
2020-05-13 19:23:23 +00:00
|
|
|
|
/* For the purposes of this function, we treat anything outside
|
|
|
|
|
* the slider like a click on the trough
|
|
|
|
|
*/
|
|
|
|
|
if (mouse_location != priv->slider_widget)
|
2018-02-20 09:16:00 +00:00
|
|
|
|
mouse_location = priv->trough_widget;
|
|
|
|
|
|
|
|
|
|
if (mouse_location == priv->slider_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2015-07-13 22:56:34 +00:00
|
|
|
|
/* Shift-click in the slider = fine adjustment */
|
|
|
|
|
if (shift_pressed)
|
|
|
|
|
update_zoom_state (range, TRUE);
|
2012-01-04 23:21:36 +00:00
|
|
|
|
|
2018-02-23 07:40:27 +00:00
|
|
|
|
update_initial_slider_position (range, x, y);
|
2017-05-07 19:39:37 +00:00
|
|
|
|
range_grab_add (range, priv->slider_widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2018-02-20 09:16:00 +00:00
|
|
|
|
else if (mouse_location == priv->trough_widget &&
|
2015-07-13 22:56:34 +00:00
|
|
|
|
(source == GDK_SOURCE_TOUCHSCREEN ||
|
2017-10-11 19:07:53 +00:00
|
|
|
|
(primary_warps && !shift_pressed && button == GDK_BUTTON_PRIMARY) ||
|
|
|
|
|
(!primary_warps && shift_pressed && button == GDK_BUTTON_PRIMARY) ||
|
|
|
|
|
(!primary_warps && button == GDK_BUTTON_MIDDLE)))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2020-05-17 21:08:01 +00:00
|
|
|
|
double slider_range_x, slider_range_y;
|
2019-02-20 03:53:47 +00:00
|
|
|
|
graphene_rect_t slider_bounds;
|
2018-02-23 09:42:09 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_translate_coordinates (priv->trough_widget, widget,
|
|
|
|
|
priv->slider_x, priv->slider_y,
|
|
|
|
|
&slider_range_x, &slider_range_y);
|
|
|
|
|
|
|
|
|
|
/* If we aren't fixed, center on the slider. I.e. if this is not a scale... */
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!priv->slider_size_fixed &&
|
|
|
|
|
gtk_widget_compute_bounds (priv->slider_widget, priv->slider_widget, &slider_bounds))
|
2018-02-23 09:42:09 +00:00
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
slider_range_x += (slider_bounds.size.width / 2);
|
|
|
|
|
slider_range_y += (slider_bounds.size.height / 2);
|
2018-02-23 09:42:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update_initial_slider_position (range, slider_range_x, slider_range_y);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
range_grab_add (range, priv->slider_widget);
|
2006-05-18 11:39:42 +00:00
|
|
|
|
|
2015-07-13 22:56:34 +00:00
|
|
|
|
update_slider_position (range, x, y);
|
|
|
|
|
}
|
2018-02-20 09:16:00 +00:00
|
|
|
|
else if (mouse_location == priv->trough_widget &&
|
2017-10-11 19:07:53 +00:00
|
|
|
|
((primary_warps && shift_pressed && button == GDK_BUTTON_PRIMARY) ||
|
|
|
|
|
(!primary_warps && !shift_pressed && button == GDK_BUTTON_PRIMARY) ||
|
|
|
|
|
(primary_warps && button == GDK_BUTTON_MIDDLE)))
|
2015-07-13 22:56:34 +00:00
|
|
|
|
{
|
|
|
|
|
/* jump by pages */
|
|
|
|
|
GtkScrollType scroll;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double click_value;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
click_value = coord_to_value (range,
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
y : x);
|
|
|
|
|
|
|
|
|
|
priv->trough_click_forward = click_value > gtk_adjustment_get_value (priv->adjustment);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
range_grab_add (range, priv->trough_widget);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
scroll = range_get_scroll_for_grab (range);
|
|
|
|
|
gtk_range_add_step_timer (range, scroll);
|
|
|
|
|
}
|
2018-02-20 09:16:00 +00:00
|
|
|
|
else if (mouse_location == priv->trough_widget &&
|
2015-07-13 22:56:34 +00:00
|
|
|
|
button == GDK_BUTTON_SECONDARY)
|
|
|
|
|
{
|
|
|
|
|
/* autoscroll */
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double click_value;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
click_value = coord_to_value (range,
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
y : x);
|
|
|
|
|
|
|
|
|
|
priv->trough_click_forward = click_value > gtk_adjustment_get_value (priv->adjustment);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
range_grab_add (range, priv->trough_widget);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
remove_autoscroll (range);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->autoscroll_mode = priv->trough_click_forward ? GTK_SCROLL_END : GTK_SCROLL_START;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
add_autoscroll (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_widget);
|
2014-09-27 02:30:20 +00:00
|
|
|
|
/* leave it to ::drag-begin to claim the sequence */
|
2016-03-27 03:50:59 +00:00
|
|
|
|
else if (priv->grab_location != NULL)
|
2018-10-18 08:53:32 +00:00
|
|
|
|
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gtk_range_click_gesture_released (GtkGestureClick *gesture,
|
|
|
|
|
guint n_press,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2019-05-29 17:10:46 +00:00
|
|
|
|
GtkRange *range)
|
2014-06-05 13:29:14 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
2018-02-20 09:31:20 +00:00
|
|
|
|
priv->in_drag = FALSE;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
stop_scrolling (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
/* During a slide, move the slider as required given new mouse position */
|
|
|
|
|
static void
|
|
|
|
|
update_slider_position (GtkRange *range,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int mouse_x,
|
|
|
|
|
int mouse_y)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2019-02-20 03:53:47 +00:00
|
|
|
|
graphene_rect_t trough_bounds;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double delta;
|
|
|
|
|
double c;
|
|
|
|
|
double new_value;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double next_value;
|
|
|
|
|
double mark_value;
|
|
|
|
|
double mark_delta;
|
|
|
|
|
double zoom;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
2020-05-17 21:08:01 +00:00
|
|
|
|
double x, y;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
|
2018-02-23 09:42:09 +00:00
|
|
|
|
gtk_widget_translate_coordinates (GTK_WIDGET (range), priv->trough_widget,
|
2020-05-17 21:08:01 +00:00
|
|
|
|
mouse_x, mouse_y, &x, &y);
|
2018-02-23 09:42:09 +00:00
|
|
|
|
|
2019-08-11 08:06:52 +00:00
|
|
|
|
if (priv->zoom &&
|
2019-02-20 03:53:47 +00:00
|
|
|
|
gtk_widget_compute_bounds (priv->trough_widget, priv->trough_widget, &trough_bounds))
|
2012-04-26 21:51:13 +00:00
|
|
|
|
{
|
|
|
|
|
zoom = MIN(1.0, (priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2018-04-07 11:37:24 +00:00
|
|
|
|
trough_bounds.size.height : trough_bounds.size.width) /
|
2012-04-26 21:51:13 +00:00
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment)));
|
2019-02-20 03:53:47 +00:00
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
/* the above is ineffective for scales, so just set a zoom factor */
|
|
|
|
|
if (zoom == 1.0)
|
|
|
|
|
zoom = 0.25;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
zoom = 1.0;
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
/* recalculate the initial position from the current position */
|
|
|
|
|
if (priv->slide_initial_slider_position == -1)
|
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t slider_bounds;
|
2019-08-11 08:06:52 +00:00
|
|
|
|
double zoom_divisor;
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->slider_widget, GTK_WIDGET (range), &slider_bounds))
|
|
|
|
|
graphene_rect_init (&slider_bounds, 0, 0, 0, 0);
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2019-08-11 08:06:52 +00:00
|
|
|
|
if (zoom == 1.0)
|
|
|
|
|
zoom_divisor = 1.0;
|
|
|
|
|
else
|
|
|
|
|
zoom_divisor = zoom - 1.0;
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->slide_initial_slider_position = (zoom * (y - priv->slide_initial_coordinate_delta) - slider_bounds.origin.y) / zoom_divisor;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
else
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->slide_initial_slider_position = (zoom * (x - priv->slide_initial_coordinate_delta) - slider_bounds.origin.x) / zoom_divisor;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2020-05-17 21:08:01 +00:00
|
|
|
|
delta = y - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
else
|
2020-05-17 21:08:01 +00:00
|
|
|
|
delta = x - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
c = priv->slide_initial_slider_position + zoom * delta;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
new_value = coord_to_value (range, c);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
next_value = coord_to_value (range, c + 1);
|
2012-04-26 21:51:13 +00:00
|
|
|
|
mark_delta = fabs (next_value - new_value);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
mark_value = priv->marks[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
if (fabs (gtk_adjustment_get_value (priv->adjustment) - mark_value) < 3 * mark_delta)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2016-03-06 03:04:41 +00:00
|
|
|
|
if (fabs (new_value - mark_value) < MARK_SNAP_LENGTH * mark_delta)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
|
|
|
|
new_value = mark_value;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-26 21:51:13 +00:00
|
|
|
|
}
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2014-09-26 23:18:57 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, new_value, &handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
static void
|
|
|
|
|
remove_autoscroll (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
if (priv->autoscroll_id)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_remove_tick_callback (GTK_WIDGET (range),
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->autoscroll_id);
|
|
|
|
|
priv->autoscroll_id = 0;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* unset initial position so it can be calculated */
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->slide_initial_slider_position = -1;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->autoscroll_mode = GTK_SCROLL_NONE;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
autoscroll_cb (GtkWidget *widget,
|
|
|
|
|
GdkFrameClock *frame_clock,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2015-02-23 01:02:02 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
GtkAdjustment *adj = priv->adjustment;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double increment;
|
|
|
|
|
double value;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gboolean handled;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double step, page;
|
2015-07-12 05:36:17 +00:00
|
|
|
|
|
|
|
|
|
step = gtk_adjustment_get_step_increment (adj);
|
|
|
|
|
page = gtk_adjustment_get_page_increment (adj);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) priv->autoscroll_mode)
|
2015-02-23 01:02:02 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
2015-07-12 05:36:17 +00:00
|
|
|
|
increment = step / AUTOSCROLL_FACTOR;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
2015-07-12 05:36:17 +00:00
|
|
|
|
increment = page / AUTOSCROLL_FACTOR;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
2015-07-12 05:36:17 +00:00
|
|
|
|
increment = - step / AUTOSCROLL_FACTOR;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
2015-07-12 05:36:17 +00:00
|
|
|
|
increment = - page / AUTOSCROLL_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_SCROLL_START:
|
|
|
|
|
case GTK_SCROLL_END:
|
|
|
|
|
{
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x, y;
|
|
|
|
|
double distance, t;
|
2015-07-12 05:36:17 +00:00
|
|
|
|
|
|
|
|
|
/* Vary scrolling speed from slow (ie step) to fast (2 * page),
|
|
|
|
|
* based on the distance of the pointer from the widget. We start
|
|
|
|
|
* speeding up if the pointer moves at least 20 pixels away, and
|
|
|
|
|
* we reach maximum speed when it is 220 pixels away.
|
|
|
|
|
*/
|
|
|
|
|
if (!gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (priv->drag_gesture), &x, &y))
|
|
|
|
|
{
|
|
|
|
|
x = 0.0;
|
|
|
|
|
y = 0.0;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
distance = fabs (y);
|
|
|
|
|
else
|
|
|
|
|
distance = fabs (x);
|
|
|
|
|
distance = CLAMP (distance - 20, 0.0, 200);
|
|
|
|
|
t = distance / 100.0;
|
|
|
|
|
step = (1 - t) * step + t * page;
|
|
|
|
|
if (priv->autoscroll_mode == GTK_SCROLL_END)
|
|
|
|
|
increment = step / AUTOSCROLL_FACTOR;
|
|
|
|
|
else
|
|
|
|
|
increment = - step / AUTOSCROLL_FACTOR;
|
|
|
|
|
}
|
2015-02-23 01:02:02 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
value = gtk_adjustment_get_value (adj);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
value += increment;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
|
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, value, &handled);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
add_autoscroll (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (priv->autoscroll_id != 0 ||
|
|
|
|
|
priv->autoscroll_mode == GTK_SCROLL_NONE)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->autoscroll_id = gtk_widget_add_tick_callback (GTK_WIDGET (range),
|
2015-02-23 01:02:02 +00:00
|
|
|
|
autoscroll_cb, range, NULL);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
static void
|
2005-03-22 17:36:41 +00:00
|
|
|
|
stop_scrolling (GtkRange *range)
|
2003-03-29 00:11:32 +00:00
|
|
|
|
{
|
|
|
|
|
range_grab_remove (range);
|
|
|
|
|
gtk_range_remove_step_timer (range);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
remove_autoscroll (range);
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-18 13:34:39 +00:00
|
|
|
|
static gboolean
|
2017-09-15 11:53:59 +00:00
|
|
|
|
gtk_range_scroll_controller_scroll (GtkEventControllerScroll *scroll,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double dx,
|
|
|
|
|
double dy,
|
2017-09-15 11:53:59 +00:00
|
|
|
|
GtkRange *range)
|
2004-02-29 18:21:57 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double scroll_unit, delta;
|
2017-09-15 11:53:59 +00:00
|
|
|
|
gboolean handled;
|
2018-01-01 14:28:16 +00:00
|
|
|
|
GtkOrientation move_orientation;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
2020-10-10 03:08:23 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_MACOS
|
2017-09-15 11:53:59 +00:00
|
|
|
|
scroll_unit = 1;
|
|
|
|
|
#else
|
|
|
|
|
scroll_unit = gtk_adjustment_get_page_increment (priv->adjustment);
|
2014-09-05 11:38:30 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-01 14:28:16 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && dx != 0)
|
|
|
|
|
{
|
|
|
|
|
move_orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
delta = dx * scroll_unit;
|
|
|
|
|
}
|
2017-09-15 11:53:59 +00:00
|
|
|
|
else
|
2018-01-01 14:28:16 +00:00
|
|
|
|
{
|
|
|
|
|
move_orientation = GTK_ORIENTATION_VERTICAL;
|
|
|
|
|
delta = dy * scroll_unit;
|
|
|
|
|
}
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
2018-01-01 14:28:16 +00:00
|
|
|
|
if (delta != 0 && should_invert_move (range, move_orientation))
|
2004-02-29 18:21:57 +00:00
|
|
|
|
delta = - delta;
|
|
|
|
|
|
2017-09-15 11:53:59 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_JUMP, gtk_adjustment_get_value (priv->adjustment) + delta,
|
|
|
|
|
&handled);
|
2018-07-18 13:34:39 +00:00
|
|
|
|
|
|
|
|
|
return GDK_EVENT_STOP;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
static void
|
2018-02-20 09:31:20 +00:00
|
|
|
|
update_autoscroll_mode (GtkRange *range,
|
|
|
|
|
int mouse_x,
|
|
|
|
|
int mouse_y)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
GtkScrollType mode = GTK_SCROLL_NONE;
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
if (priv->zoom)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
int width, height;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int size, pos;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2017-12-04 11:42:52 +00:00
|
|
|
|
width = gtk_widget_get_width (GTK_WIDGET (range));
|
|
|
|
|
height = gtk_widget_get_height (GTK_WIDGET (range));
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
size = height;
|
2018-02-20 09:31:20 +00:00
|
|
|
|
pos = mouse_y;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
size = width;
|
2018-02-20 09:31:20 +00:00
|
|
|
|
pos = mouse_x;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-07 16:01:13 +00:00
|
|
|
|
if (pos < SCROLL_EDGE_SIZE)
|
2018-02-20 09:43:15 +00:00
|
|
|
|
mode = priv->inverted ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD;
|
2013-10-07 16:01:13 +00:00
|
|
|
|
else if (pos > (size - SCROLL_EDGE_SIZE))
|
2018-02-20 09:43:15 +00:00
|
|
|
|
mode = priv->inverted ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_STEP_FORWARD;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
if (mode != priv->autoscroll_mode)
|
2013-07-29 16:06:20 +00:00
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->autoscroll_mode = mode;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
add_autoscroll (range);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double start_x, start_y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_widget)
|
2015-06-20 22:37:15 +00:00
|
|
|
|
{
|
2018-02-20 09:31:20 +00:00
|
|
|
|
int mouse_x, mouse_y;
|
|
|
|
|
|
2015-06-20 22:37:15 +00:00
|
|
|
|
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
|
2018-02-20 09:31:20 +00:00
|
|
|
|
mouse_x = start_x + offset_x;
|
|
|
|
|
mouse_y = start_y + offset_y;
|
2015-06-20 22:37:15 +00:00
|
|
|
|
priv->in_drag = TRUE;
|
2018-02-20 09:31:20 +00:00
|
|
|
|
update_autoscroll_mode (range, mouse_x, mouse_y);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2015-06-20 22:37:15 +00:00
|
|
|
|
if (priv->autoscroll_mode == GTK_SCROLL_NONE)
|
2018-02-20 09:31:20 +00:00
|
|
|
|
update_slider_position (range, mouse_x, mouse_y);
|
2015-06-20 22:37:15 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-27 02:21:11 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
2014-09-27 02:21:11 +00:00
|
|
|
|
GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2016-03-27 03:50:59 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_widget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
gtk_gesture_set_state (priv->drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
2014-09-27 02:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
2020-02-22 13:11:05 +00:00
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2020-02-22 13:11:05 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-13 15:22:22 +00:00
|
|
|
|
double upper = gtk_adjustment_get_upper (priv->adjustment);
|
|
|
|
|
double lower = gtk_adjustment_get_lower (priv->adjustment);
|
2020-02-22 13:11:05 +00:00
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
if (upper == lower && GTK_IS_SCALE (range))
|
2020-02-22 13:11:05 +00:00
|
|
|
|
gtk_widget_hide (priv->slider_widget);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_show (priv->slider_widget);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2020-02-22 13:11:05 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->trough_widget);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (range),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, upper,
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, lower,
|
|
|
|
|
-1);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
/* Note that we don't round off to priv->round_digits here.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* that's because it's really broken to change a value
|
|
|
|
|
* in response to a change signal on that value; round_digits
|
|
|
|
|
* is therefore defined to be a filter on what the GtkRange
|
|
|
|
|
* can input into the adjustment, not a filter that the GtkRange
|
|
|
|
|
* will enforce on the adjustment.
|
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
/* Note that we don't round off to priv->round_digits here.
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
* that's because it's really broken to change a value
|
|
|
|
|
* in response to a change signal on that value; round_digits
|
|
|
|
|
* is therefore defined to be a filter on what the GtkRange
|
|
|
|
|
* can input into the adjustment, not a filter that the GtkRange
|
|
|
|
|
* will enforce on the adjustment.
|
|
|
|
|
*/
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_emit (range, signals[VALUE_CHANGED], 0);
|
2017-05-08 12:22:51 +00:00
|
|
|
|
|
2020-07-13 15:22:22 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (range),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, gtk_adjustment_get_value (adjustment),
|
|
|
|
|
-1);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->trough_widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void
|
|
|
|
|
apply_marks (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double oldval,
|
|
|
|
|
double *newval)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double mark;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
mark = priv->marks[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
if ((oldval < mark && mark < *newval) ||
|
|
|
|
|
(oldval > mark && mark > *newval))
|
|
|
|
|
{
|
|
|
|
|
*newval = mark;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) - gtk_adjustment_get_step_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_STEP_BACKWARD, newval, &handled);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) + gtk_adjustment_get_step_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_STEP_FORWARD, newval, &handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1998-04-14 01:39:40 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
page_back (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1998-12-15 07:32:11 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) - gtk_adjustment_get_page_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_PAGE_BACKWARD, newval, &handled);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
page_forward (GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_value (priv->adjustment) + gtk_adjustment_get_page_increment (priv->adjustment);
|
|
|
|
|
apply_marks (range, gtk_adjustment_get_value (priv->adjustment), &newval);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
|
|
|
|
GTK_SCROLL_PAGE_FORWARD, newval, &handled);
|
2003-12-11 23:05:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scroll_begin (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0,
|
2011-01-05 21:08:45 +00:00
|
|
|
|
GTK_SCROLL_START, gtk_adjustment_get_lower (priv->adjustment),
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
&handled);
|
2003-12-11 23:05:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scroll_end (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double newval;
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
newval = gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment);
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_END, newval,
|
|
|
|
|
&handled);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2001-02-19 20:06:37 +00:00
|
|
|
|
|
2007-01-02 16:40:44 +00:00
|
|
|
|
static gboolean
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
gtk_range_scroll (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double old_value = gtk_adjustment_get_value (priv->adjustment);
|
2007-01-02 16:40:44 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
switch (scroll)
|
2001-02-19 20:06:37 +00:00
|
|
|
|
{
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_STEP_LEFT:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_HORIZONTAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_UP:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_VERTICAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_STEP_RIGHT:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_HORIZONTAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_DOWN:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_VERTICAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
step_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
step_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_LEFT:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_HORIZONTAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_UP:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_VERTICAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_PAGE_RIGHT:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_HORIZONTAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
|
|
|
|
else
|
|
|
|
|
page_forward (range);
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_DOWN:
|
2018-01-01 14:31:56 +00:00
|
|
|
|
if (should_invert_move (range, GTK_ORIENTATION_VERTICAL))
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
page_back (range);
|
|
|
|
|
else
|
|
|
|
|
page_forward (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
page_back (range);
|
1998-03-10 04:37:26 +00:00
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
page_forward (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_START:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
scroll_begin (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_END:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
scroll_end (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
|
case GTK_SCROLL_NONE:
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
2001-02-19 20:06:37 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2007-01-02 16:40:44 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
return gtk_adjustment_get_value (priv->adjustment) != old_value;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_move_slider (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll)
|
|
|
|
|
{
|
2007-01-02 16:40:44 +00:00
|
|
|
|
if (! gtk_range_scroll (range, scroll))
|
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (range));
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_compute_slider_position (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double adjustment_value,
|
2014-11-21 07:24:51 +00:00
|
|
|
|
GdkRectangle *slider_rect)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-02-22 16:56:49 +00:00
|
|
|
|
const double upper = gtk_adjustment_get_upper (priv->adjustment);
|
|
|
|
|
const double lower = gtk_adjustment_get_lower (priv->adjustment);
|
|
|
|
|
const double page_size = gtk_adjustment_get_page_size (priv->adjustment);
|
2020-02-22 13:04:06 +00:00
|
|
|
|
int trough_width, trough_height;
|
|
|
|
|
int slider_width, slider_height;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_measure (priv->slider_widget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL, -1,
|
|
|
|
|
&slider_width, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_widget_measure (priv->slider_widget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL, slider_width,
|
|
|
|
|
&slider_height, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
2017-12-04 11:42:52 +00:00
|
|
|
|
trough_width = gtk_widget_get_width (priv->trough_widget);
|
|
|
|
|
trough_height = gtk_widget_get_height (priv->trough_widget);
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
2020-02-22 13:04:06 +00:00
|
|
|
|
int y, height;
|
|
|
|
|
|
2017-06-18 13:45:42 +00:00
|
|
|
|
slider_rect->x = (int) floor ((trough_width - slider_width) / 2);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
slider_rect->width = slider_width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
/* slider height is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough height in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
2018-02-22 16:56:49 +00:00
|
|
|
|
if (upper - lower != 0)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
height = trough_height * (page_size / (upper - lower));
|
2014-11-21 07:24:51 +00:00
|
|
|
|
else
|
2020-02-22 13:04:06 +00:00
|
|
|
|
height = slider_height;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2020-02-22 13:04:06 +00:00
|
|
|
|
if (height < slider_height ||
|
2014-11-21 07:24:51 +00:00
|
|
|
|
priv->slider_size_fixed)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
height = slider_height;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2017-06-18 13:45:42 +00:00
|
|
|
|
height = MIN (height, trough_height);
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2018-02-22 16:56:49 +00:00
|
|
|
|
if (upper - lower - page_size != 0)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
y = (trough_height - height) * ((adjustment_value - lower) / (upper - lower - page_size));
|
|
|
|
|
else
|
|
|
|
|
y = 0;
|
|
|
|
|
|
|
|
|
|
y = CLAMP (y, 0, trough_height);
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
2020-02-22 13:04:06 +00:00
|
|
|
|
y = trough_height - y - height;
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
slider_rect->y = y;
|
|
|
|
|
slider_rect->height = height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-02-22 13:04:06 +00:00
|
|
|
|
int x, width;
|
|
|
|
|
|
2017-06-18 13:45:42 +00:00
|
|
|
|
slider_rect->y = (int) floor ((trough_height - slider_height) / 2);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
slider_rect->height = slider_height;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
/* slider width is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough width in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
2018-02-22 16:56:49 +00:00
|
|
|
|
if (upper - lower != 0)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
width = trough_width * (page_size / (upper - lower));
|
2014-11-21 07:24:51 +00:00
|
|
|
|
else
|
2020-02-22 13:04:06 +00:00
|
|
|
|
width = slider_width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2020-02-22 13:04:06 +00:00
|
|
|
|
if (width < slider_width ||
|
2014-11-21 07:24:51 +00:00
|
|
|
|
priv->slider_size_fixed)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
width = slider_width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2017-06-18 13:45:42 +00:00
|
|
|
|
width = MIN (width, trough_width);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2018-02-22 16:56:49 +00:00
|
|
|
|
if (upper - lower - page_size != 0)
|
2020-02-22 13:04:06 +00:00
|
|
|
|
x = (trough_width - width) * ((adjustment_value - lower) / (upper - lower - page_size));
|
|
|
|
|
else
|
|
|
|
|
x = 0;
|
|
|
|
|
|
|
|
|
|
x = CLAMP (x, 0, trough_width);
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
if (should_invert (range))
|
2020-02-22 13:04:06 +00:00
|
|
|
|
x = trough_width - x - width;
|
|
|
|
|
|
2014-11-25 22:12:08 +00:00
|
|
|
|
slider_rect->x = x;
|
|
|
|
|
slider_rect->width = width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_marks (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2014-11-21 07:29:37 +00:00
|
|
|
|
GdkRectangle slider;
|
2020-05-17 21:08:01 +00:00
|
|
|
|
double x, y;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < priv->n_marks; i++)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2014-11-21 07:29:37 +00:00
|
|
|
|
gtk_range_compute_slider_position (range, priv->marks[i], &slider);
|
2017-06-30 11:10:32 +00:00
|
|
|
|
gtk_widget_translate_coordinates (priv->trough_widget, GTK_WIDGET (range),
|
2020-05-17 21:08:01 +00:00
|
|
|
|
slider.x, slider.y, &x, &y);
|
2014-11-21 07:29:37 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->mark_pos[i] = x + slider.width / 2;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
else
|
2020-05-17 21:08:01 +00:00
|
|
|
|
priv->mark_pos[i] = y + slider.height / 2;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
static gboolean
|
2014-07-03 00:37:55 +00:00
|
|
|
|
gtk_range_real_change_value (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double value)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2010-05-25 13:44:29 +00:00
|
|
|
|
/* potentially adjust the bounds _before_ we clamp */
|
2002-10-04 08:02:14 +00:00
|
|
|
|
g_signal_emit (range, signals[ADJUST_BOUNDS], 0, value);
|
2002-02-15 05:53:08 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->restrict_to_fill_level)
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = MIN (value, MAX (gtk_adjustment_get_lower (priv->adjustment),
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->fill_level));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
value = CLAMP (value, gtk_adjustment_get_lower (priv->adjustment),
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->round_digits >= 0)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double power;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
i = priv->round_digits;
|
2004-10-06 05:11:36 +00:00
|
|
|
|
power = 1;
|
|
|
|
|
while (i--)
|
|
|
|
|
power *= 10;
|
2015-02-23 01:02:02 +00:00
|
|
|
|
|
2004-10-06 05:11:36 +00:00
|
|
|
|
value = floor ((value * power) + 0.5) / power;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (priv->in_drag || priv->autoscroll_id)
|
2014-11-21 07:50:38 +00:00
|
|
|
|
gtk_adjustment_set_value (priv->adjustment, value);
|
|
|
|
|
else
|
|
|
|
|
gtk_adjustment_animate_to_value (priv->adjustment, value);
|
2014-07-03 00:37:55 +00:00
|
|
|
|
|
Provide information about how an adjustment change in a range widget
Thu Aug 26 22:44:12 2004 Matthias Clasen <maclas@gmx.de>
Provide information about how an adjustment change in a range
widget happened. Add a "slider-moved" signal which reports how
a user is interacting with the range, whether they are clicking
on a stepper or the trough, or dragging the slider. (#133263,
Thomas Fitzsimmons)
* gtk/gtkmarshalers.list: Add signal type BOOLEAN:ENUM,DOUBLE.
* gtk/gtkrange.c (gtk_range_class_init): Add "change-value"
signal.
(gtk_range_internal_set_value): Rename to
gtk_range_real_change_value. Add GtkScrollType parameter. Emit
the change-value signal when the range's value changes.
(update_slider_position, gtk_range_scroll_event, step_back,
step_forward, page_back, page_forward, scroll_begin,
scroll_end): Change gtk_range_internal_set_value to
gtk_range_real_change_value.
* gtk/gtkrange.h (struct _GtkRangeClass): Declare change_value
function.
2004-08-27 02:54:12 +00:00
|
|
|
|
return FALSE;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
struct _GtkRangeStepTimer
|
|
|
|
|
{
|
|
|
|
|
guint timeout_id;
|
|
|
|
|
GtkScrollType step;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
second_timeout (gpointer data)
|
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_scroll (range, priv->timer->step);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return G_SOURCE_CONTINUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
1998-04-09 02:55:46 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
initial_timeout (gpointer data)
|
1998-05-03 22:41:32 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer->timeout_id = g_timeout_add (TIMEOUT_REPEAT, second_timeout, range);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk] second_timeout");
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return G_SOURCE_REMOVE;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_add_step_timer (GtkRange *range,
|
|
|
|
|
GtkScrollType step)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2005-11-22 12:40:15 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_return_if_fail (priv->timer == NULL);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
g_return_if_fail (step != GTK_SCROLL_NONE);
|
2005-11-22 12:40:15 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer = g_new (GtkRangeStepTimer, 1);
|
1999-02-16 04:29:00 +00:00
|
|
|
|
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer->timeout_id = g_timeout_add (TIMEOUT_INITIAL, initial_timeout, range);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk] initial_timeout");
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer->step = step;
|
2002-02-23 14:46:21 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gtk_range_scroll (range, priv->timer->step);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
}
|
1999-02-04 16:12:35 +00:00
|
|
|
|
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_remove_step_timer (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
if (priv->timer)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->timer->timeout_id != 0)
|
|
|
|
|
g_source_remove (priv->timer->timeout_id);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->timer);
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->timer = NULL;
|
1998-05-03 22:41:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_has_origin (GtkRange *range,
|
|
|
|
|
gboolean has_origin)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
|
|
|
|
|
if (has_origin)
|
|
|
|
|
{
|
2020-04-08 11:34:38 +00:00
|
|
|
|
priv->highlight_widget = gtk_gizmo_new ("highlight", NULL, NULL, NULL, NULL, NULL, NULL);
|
2017-11-05 03:00:33 +00:00
|
|
|
|
gtk_widget_insert_before (priv->highlight_widget, priv->trough_widget, priv->slider_widget);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
|
|
|
|
update_highlight_position (range);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-11-13 19:53:14 +00:00
|
|
|
|
g_clear_pointer (&priv->highlight_widget, gtk_widget_unparent);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
2011-12-14 16:16:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
_gtk_range_get_has_origin (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2018-07-07 17:18:26 +00:00
|
|
|
|
|
|
|
|
|
return priv->highlight_widget != NULL;
|
2011-12-14 16:16:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_stop_values (GtkRange *range,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double *values,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int n_values)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int i;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->marks);
|
2020-07-24 20:32:16 +00:00
|
|
|
|
priv->marks = g_new (double, n_values);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->mark_pos);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
priv->mark_pos = g_new (int, n_values);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->n_marks = n_values;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < n_values; i++)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->marks[i] = values[i];
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2015-12-02 19:43:17 +00:00
|
|
|
|
gtk_range_calc_marks (range);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2009-01-20 05:10:27 +00:00
|
|
|
|
_gtk_range_get_stop_positions (GtkRange *range,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int **values)
|
2009-01-20 05:10:27 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gtk_range_calc_marks (range);
|
|
|
|
|
|
|
|
|
|
if (values)
|
2020-07-24 13:54:49 +00:00
|
|
|
|
*values = g_memdup (priv->mark_pos, priv->n_marks * sizeof (int));
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return priv->n_marks;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
}
|
2010-08-12 23:50:09 +00:00
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_round_digits:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
* @round_digits: the precision in digits, or -1
|
|
|
|
|
*
|
|
|
|
|
* Sets the number of digits to round the value to when
|
|
|
|
|
* it changes. See #GtkRange::change-value.
|
|
|
|
|
*/
|
2010-08-12 23:50:09 +00:00
|
|
|
|
void
|
2011-01-15 05:08:39 +00:00
|
|
|
|
gtk_range_set_round_digits (GtkRange *range,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int round_digits)
|
2010-08-12 23:50:09 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (round_digits >= -1);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
if (priv->round_digits != round_digits)
|
2014-06-09 13:21:11 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->round_digits = round_digits;
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_ROUND_DIGITS]);
|
2014-06-09 13:21:11 +00:00
|
|
|
|
}
|
2011-01-15 05:08:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_round_digits:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the number of digits to round the value to when
|
|
|
|
|
* it changes. See #GtkRange::change-value.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the number of digits to round to
|
2011-01-15 05:08:39 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2011-01-15 05:08:39 +00:00
|
|
|
|
gtk_range_get_round_digits (GtkRange *range)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2011-01-15 05:08:39 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), -1);
|
|
|
|
|
|
2018-02-20 09:43:15 +00:00
|
|
|
|
return priv->round_digits;
|
2010-08-12 23:50:09 +00:00
|
|
|
|
}
|
2010-08-13 01:22:59 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_range_get_slider_widget (GtkRange *range)
|
2016-02-21 23:01:04 +00:00
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
return priv->slider_widget;
|
2016-02-21 23:01:04 +00:00
|
|
|
|
}
|
2017-12-13 03:17:49 +00:00
|
|
|
|
|
2019-01-16 18:20:53 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_range_get_trough_widget (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
return priv->trough_widget;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-13 03:17:49 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_start_autoscroll (GtkRange *range,
|
|
|
|
|
GtkScrollType scroll_type)
|
|
|
|
|
{
|
2018-02-20 09:43:15 +00:00
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
2017-12-13 03:17:49 +00:00
|
|
|
|
remove_autoscroll (range);
|
2018-02-20 09:43:15 +00:00
|
|
|
|
priv->autoscroll_mode = scroll_type;
|
2017-12-13 03:17:49 +00:00
|
|
|
|
add_autoscroll (range);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gtk_range_stop_autoscroll (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
|
|
|
|
}
|