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
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
#include <stdio.h>
|
2004-02-29 18:21:57 +00:00
|
|
|
|
#include <math.h>
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkrange.h"
|
2014-04-05 06:04:12 +00:00
|
|
|
|
#include "gtkrangeprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
|
2014-07-03 00:37:55 +00:00
|
|
|
|
#include "gtkadjustmentprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkcolorscaleprivate.h"
|
|
|
|
|
#include "gtkintl.h"
|
2015-02-22 22:57:23 +00:00
|
|
|
|
#include "gtkgesturelongpressprivate.h"
|
2011-11-11 12:06:56 +00:00
|
|
|
|
#include "gtkmain.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
2011-01-30 08:12:49 +00:00
|
|
|
|
#include "gtkorientableprivate.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2010-05-18 06:46:42 +00:00
|
|
|
|
#include "gtkscale.h"
|
2004-02-29 18:21:57 +00:00
|
|
|
|
#include "gtkscrollbar.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2012-03-03 18:41:55 +00:00
|
|
|
|
#include "gtkwindow.h"
|
2014-11-08 17:55:03 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2011-06-28 02:39:43 +00:00
|
|
|
|
#include "a11y/gtkrangeaccessible.h"
|
2017-05-07 16:41:24 +00:00
|
|
|
|
#include "gtkgizmoprivate.h"
|
2017-05-07 19:39:37 +00:00
|
|
|
|
#include "gtkiconprivate.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
|
|
|
|
|
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 *mouse_location;
|
2015-12-02 19:12:01 +00:00
|
|
|
|
/* last mouse coords we got, or G_MININT if mouse is outside the range */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gint mouse_x;
|
|
|
|
|
gint mouse_y;
|
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;
|
|
|
|
|
|
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
|
|
|
|
|
2011-04-12 16:42:14 +00:00
|
|
|
|
GtkOrientation orientation;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gdouble fill_level;
|
|
|
|
|
gdouble *marks;
|
|
|
|
|
|
|
|
|
|
gint *mark_pos;
|
|
|
|
|
gint n_marks;
|
|
|
|
|
gint round_digits; /* Round off value to this many digits, -1 for no rounding */
|
|
|
|
|
gint slide_initial_slider_position;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gint 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
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
/* The range has an origin, should be drawn differently. Used by GtkScale */
|
|
|
|
|
guint has_origin : 1;
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
GtkGesture *long_press_gesture;
|
|
|
|
|
GtkGesture *multipress_gesture;
|
|
|
|
|
GtkGesture *drag_gesture;
|
|
|
|
|
|
|
|
|
|
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);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void gtk_range_destroy (GtkWidget *widget);
|
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);
|
2017-07-11 07:58:21 +00:00
|
|
|
|
static void gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void gtk_range_unmap (GtkWidget *widget);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
|
|
|
|
|
static void gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
2014-09-27 02:21:11 +00:00
|
|
|
|
static void gtk_range_drag_gesture_begin (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
static void gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range);
|
|
|
|
|
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean gtk_range_scroll_event (GtkWidget *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
|
|
|
|
GdkEventScroll *event);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static gboolean gtk_range_event (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event);
|
2001-07-14 11:35:24 +00:00
|
|
|
|
static void update_slider_position (GtkRange *range,
|
|
|
|
|
gint mouse_x,
|
|
|
|
|
gint 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,
|
|
|
|
|
gdouble adjustment_value,
|
|
|
|
|
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);
|
2014-11-29 02:27:36 +00:00
|
|
|
|
static void gtk_range_update_mouse_location (GtkRange *range);
|
2014-11-29 00:23:54 +00:00
|
|
|
|
static void gtk_range_calc_slider (GtkRange *range);
|
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,
|
|
|
|
|
gdouble value);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
static gboolean gtk_range_key_press (GtkWidget *range,
|
|
|
|
|
GdkEventKey *event);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
static void gtk_range_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state);
|
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,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gint *natural_baseline);
|
|
|
|
|
static void gtk_range_allocate_trough (GtkGizmo *gizmo,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkAllocation *out_clip);
|
|
|
|
|
static gboolean gtk_range_render_trough (GtkGizmo *gizmo,
|
|
|
|
|
GtkSnapshot *snapshot);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
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
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
|
|
|
|
|
|
|
|
|
gtk_widget_snapshot_child (widget, priv->trough_widget, snapshot);
|
|
|
|
|
}
|
|
|
|
|
|
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;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
widget_class->destroy = gtk_range_destroy;
|
2017-05-04 06:05:11 +00:00
|
|
|
|
widget_class->measure = gtk_range_measure;
|
2017-05-07 19:39:37 +00:00
|
|
|
|
widget_class->snapshot = gtk_range_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
|
|
|
|
widget_class->size_allocate = gtk_range_size_allocate;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
widget_class->unmap = gtk_range_unmap;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
widget_class->event = gtk_range_event;
|
2000-02-18 20:02:24 +00:00
|
|
|
|
widget_class->scroll_event = gtk_range_scroll_event;
|
2006-03-11 05:47:09 +00:00
|
|
|
|
widget_class->key_press_event = gtk_range_key_press;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
widget_class->state_flags_changed = gtk_range_state_flags_changed;
|
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
|
|
|
|
|
* the event to other handlers until the default GTK+ handler is
|
|
|
|
|
* 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
|
|
|
|
|
* value to the desired number of decimal digits; the default GTK+
|
|
|
|
|
* 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
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
|
|
|
|
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().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
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().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
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
|
|
|
|
|
2011-06-28 02:39:43 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_RANGE_ACCESSIBLE);
|
2017-05-25 15:34:23 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, "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);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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:
|
2014-06-09 13:21:11 +00:00
|
|
|
|
if (priv->orientation != g_value_get_enum (value))
|
|
|
|
|
{
|
|
|
|
|
priv->orientation = g_value_get_enum (value);
|
2017-05-07 14:44:13 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
|
2014-06-09 13:21:11 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
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);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
range->priv = gtk_range_get_instance_private (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2010-03-06 10:29:31 +00:00
|
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (range), FALSE);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
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;
|
2015-12-02 19:12:01 +00:00
|
|
|
|
priv->mouse_x = G_MININT;
|
|
|
|
|
priv->mouse_y = G_MININT;
|
2011-12-14 16:16:09 +00:00
|
|
|
|
priv->has_origin = FALSE;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
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
|
|
|
|
|
2016-02-24 19:43:06 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
priv->trough_widget = gtk_gizmo_new ("trough",
|
|
|
|
|
gtk_range_measure_trough,
|
|
|
|
|
gtk_range_allocate_trough,
|
|
|
|
|
gtk_range_render_trough);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_parent (priv->trough_widget, GTK_WIDGET (range));
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-06-15 10:49:18 +00:00
|
|
|
|
priv->slider_widget = gtk_gizmo_new ("slider", 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
|
|
|
|
|
* multipress ::pressed handler. Gestures are handling events
|
|
|
|
|
* in the oppposite order in which they are added to their
|
|
|
|
|
* widget.
|
|
|
|
|
*/
|
|
|
|
|
priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (range));
|
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);
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (range));
|
2014-08-12 12:02:24 +00:00
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
|
2016-02-01 10:25:51 +00:00
|
|
|
|
gtk_gesture_group (priv->drag_gesture, priv->multipress_gesture);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
g_signal_connect (priv->multipress_gesture, "pressed",
|
|
|
|
|
G_CALLBACK (gtk_range_multipress_gesture_pressed), range);
|
|
|
|
|
g_signal_connect (priv->multipress_gesture, "released",
|
|
|
|
|
G_CALLBACK (gtk_range_multipress_gesture_released), range);
|
|
|
|
|
|
|
|
|
|
priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (range));
|
2015-02-22 22:57:23 +00:00
|
|
|
|
g_object_set (priv->long_press_gesture, "delay-factor", 2.0, NULL);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_gesture_group (priv->drag_gesture, priv->long_press_gesture);
|
|
|
|
|
g_signal_connect (priv->long_press_gesture, "pressed",
|
|
|
|
|
G_CALLBACK (gtk_range_long_press_gesture_pressed), range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
|
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
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
|
|
|
|
|
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);
|
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)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_highlight_position (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2017-05-07 18:45:06 +00:00
|
|
|
|
GtkStyleContext *context;
|
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;
|
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
context = gtk_widget_get_style_context (priv->highlight_widget);
|
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_fill_position (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2017-05-07 18:45:06 +00:00
|
|
|
|
GtkStyleContext *context;
|
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;
|
|
|
|
|
|
2017-05-07 18:45:06 +00:00
|
|
|
|
context = gtk_widget_get_style_context (priv->fill_widget);
|
|
|
|
|
|
2016-03-04 19:56:08 +00:00
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
|
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
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);
|
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
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)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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().
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.18
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_flippable (GtkRange *range,
|
|
|
|
|
gboolean flippable)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2009-08-27 19:12:32 +00:00
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.18
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_flippable (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_slider_size_fixed (GtkRange *range,
|
|
|
|
|
gboolean size_fixed)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_slider_size_fixed (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_range_rect (GtkRange *range,
|
|
|
|
|
GdkRectangle *range_rect)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (range_rect != NULL);
|
|
|
|
|
|
2017-06-30 11:21:06 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (range->priv->trough_widget, range_rect);
|
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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_slider_range (GtkRange *range,
|
|
|
|
|
gint *slider_start,
|
|
|
|
|
gint *slider_end)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
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)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*slider_start = slider_alloc.y;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (slider_end)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*slider_end = slider_alloc.y + slider_alloc.height;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (slider_start)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*slider_start = slider_alloc.x;
|
2014-11-21 07:15:54 +00:00
|
|
|
|
if (slider_end)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
*slider_end = slider_alloc.x + slider_alloc.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,
|
|
|
|
|
gdouble step,
|
|
|
|
|
gdouble page)
|
|
|
|
|
{
|
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));
|
|
|
|
|
|
2011-01-05 21:06:55 +00:00
|
|
|
|
adjustment = range->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,
|
|
|
|
|
gdouble min,
|
|
|
|
|
gdouble max)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2011-01-05 21:06:55 +00:00
|
|
|
|
GtkAdjustment *adjustment;
|
2001-06-05 20:07:02 +00:00
|
|
|
|
gdouble value;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
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,
|
|
|
|
|
gdouble value)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
**/
|
|
|
|
|
gdouble
|
|
|
|
|
gtk_range_get_value (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2011-01-05 21:08:45 +00:00
|
|
|
|
return gtk_adjustment_get_value (range->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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_show_fill_level (GtkRange *range,
|
|
|
|
|
gboolean show_fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
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
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
priv->fill_widget = gtk_gizmo_new ("fill", NULL, NULL, NULL);
|
|
|
|
|
gtk_widget_set_parent (priv->fill_widget, priv->trough_widget);
|
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
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_unparent (priv->fill_widget);
|
|
|
|
|
priv->fill_widget = NULL;
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_show_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_restrict_to_fill_level (GtkRange *range,
|
|
|
|
|
gboolean restrict_to_fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2006-11-15 12:23:10 +00:00
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_range_get_restrict_to_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_fill_level (GtkRange *range,
|
|
|
|
|
gdouble fill_level)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
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
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.12
|
|
|
|
|
**/
|
|
|
|
|
gdouble
|
|
|
|
|
gtk_range_get_fill_level (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), 0.0);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->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
|
2010-09-18 23:55:42 +00:00
|
|
|
|
gtk_range_destroy (GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-09-18 23:55:42 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
}
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->destroy (widget);
|
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);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
g_clear_object (&priv->drag_gesture);
|
|
|
|
|
g_clear_object (&priv->multipress_gesture);
|
|
|
|
|
g_clear_object (&priv->long_press_gesture);
|
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_unparent (priv->slider_widget);
|
2017-05-07 18:45:06 +00:00
|
|
|
|
|
|
|
|
|
if (priv->fill_widget)
|
|
|
|
|
gtk_widget_unparent (priv->fill_widget);
|
|
|
|
|
|
|
|
|
|
if (priv->highlight_widget)
|
|
|
|
|
gtk_widget_unparent (priv->highlight_widget);
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_widget_unparent (priv->trough_widget);
|
|
|
|
|
|
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,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gint *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);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gint 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);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
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-06-08 01:28:44 +00:00
|
|
|
|
|
|
|
|
|
if (GTK_RANGE_GET_CLASS (range)->get_range_size_request)
|
|
|
|
|
{
|
|
|
|
|
gint min, nat;
|
|
|
|
|
|
|
|
|
|
GTK_RANGE_GET_CLASS (range)->get_range_size_request (range, orientation,
|
|
|
|
|
&min, &nat);
|
|
|
|
|
|
|
|
|
|
*minimum = MAX (*minimum, min);
|
|
|
|
|
*natural = MAX (*natural, nat);
|
|
|
|
|
}
|
2016-02-24 21:28:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_range_allocate_trough (GtkGizmo *gizmo,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
2017-05-07 16:41:24 +00:00
|
|
|
|
GtkAllocation *out_clip)
|
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);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
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);
|
|
|
|
|
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->slider_widget, &slider_alloc, -1, out_clip);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2017-06-29 13:28:24 +00:00
|
|
|
|
if (gtk_adjustment_get_lower (priv->adjustment) == gtk_adjustment_get_upper (priv->adjustment))
|
|
|
|
|
value = 0;
|
|
|
|
|
else
|
|
|
|
|
value = (gtk_adjustment_get_value (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment));
|
2017-05-07 18:45:06 +00:00
|
|
|
|
|
2016-01-09 22:00:09 +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)
|
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gdouble level, fill;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
GtkAllocation fill_alloc, fill_clip;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-02-23 05:19:03 +00:00
|
|
|
|
fill_alloc = *allocation;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
level = CLAMP (priv->fill_level,
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment),
|
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
|
|
|
|
|
|
|
|
|
fill = (level - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_lower (priv->adjustment) -
|
|
|
|
|
gtk_adjustment_get_page_size (priv->adjustment));
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
fill_alloc.width *= fill;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
2016-02-23 05:19:03 +00:00
|
|
|
|
fill_alloc.x += allocation->width - fill_alloc.width;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fill_alloc.height *= fill;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
2016-02-29 20:53:08 +00:00
|
|
|
|
fill_alloc.y += allocation->height - fill_alloc.height;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->fill_widget, &fill_alloc, -1, &fill_clip);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gdk_rectangle_union (out_clip, &fill_clip, out_clip);
|
|
|
|
|
}
|
2016-02-23 02:11:02 +00:00
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
|
|
|
|
{
|
|
|
|
|
GtkAllocation highlight_alloc, highlight_clip;
|
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)
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.y = allocation->y;
|
|
|
|
|
highlight_alloc.height = allocation->height;
|
2016-09-04 13:43:51 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
if (!should_invert (range))
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.x = allocation->x;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.x = allocation->x + (allocation->width * (1 - value));
|
|
|
|
|
|
|
|
|
|
highlight_alloc.width = MAX (min, allocation->width * value);
|
2016-05-22 06:24:46 +00:00
|
|
|
|
}
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.x = allocation->x;
|
|
|
|
|
highlight_alloc.width = allocation->width;
|
2016-09-04 13:43:51 +00:00
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
if (!should_invert (range))
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.y = allocation->y;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
else
|
2017-05-07 18:45:06 +00:00
|
|
|
|
highlight_alloc.y = allocation->y + (allocation->height * (1 - value));
|
|
|
|
|
|
|
|
|
|
highlight_alloc.height = MAX (min, allocation->height* value);
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->highlight_widget, &highlight_alloc, -1, &highlight_clip);
|
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
|
2016-02-24 21:28:54 +00:00
|
|
|
|
clamp_dimensions (const GtkAllocation *allocation,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height,
|
|
|
|
|
GtkBorder *border,
|
|
|
|
|
gboolean border_expands_horizontally)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
|
|
|
|
gint extra, shortage;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
/* Width */
|
|
|
|
|
extra = allocation->width - border->left - border->right - *width;
|
|
|
|
|
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 */
|
|
|
|
|
shortage = *width - allocation->width;
|
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
*width = allocation->width;
|
|
|
|
|
/* lose the border */
|
|
|
|
|
border->left = 0;
|
|
|
|
|
border->right = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
|
|
|
|
shortage = *width + border->left + border->right - allocation->width;
|
|
|
|
|
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 */
|
|
|
|
|
extra = allocation->height - border->top - border->bottom - *height;
|
|
|
|
|
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 */
|
|
|
|
|
shortage = *height - allocation->height;
|
|
|
|
|
if (shortage > 0)
|
|
|
|
|
{
|
|
|
|
|
*height = allocation->height;
|
|
|
|
|
/* lose the border */
|
|
|
|
|
border->top = 0;
|
|
|
|
|
border->bottom = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* See if we can fit rect with borders */
|
|
|
|
|
shortage = *height + border->top + border->bottom - allocation->height;
|
|
|
|
|
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
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_range_size_allocate (GtkWidget *widget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
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)
|
2016-02-24 21:28:54 +00:00
|
|
|
|
clamp_dimensions (allocation, &box_min_width, &box_min_height, &border, TRUE);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else
|
2016-02-24 21:28:54 +00:00
|
|
|
|
clamp_dimensions (allocation, &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;
|
|
|
|
|
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->trough_widget, &box_alloc, -1, out_clip);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
|
|
|
|
/* TODO: we should compute a proper clip from get_range_border(),
|
|
|
|
|
* but this will at least give us outset shadows.
|
|
|
|
|
*/
|
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
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 12:43:52 +00:00
|
|
|
|
static void
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_slider_state (GtkRange *range)
|
2008-11-11 17:47:13 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
GtkStateFlags state;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state = gtk_widget_get_state_flags (GTK_WIDGET (range));
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state &= ~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_widget &&
|
2016-03-27 03:50:59 +00:00
|
|
|
|
!(state & GTK_STATE_FLAG_INSENSITIVE))
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_widget)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_set_state_flags (priv->slider_widget, state, TRUE);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
}
|
2010-12-13 12:43:52 +00:00
|
|
|
|
|
2015-11-06 16:53:42 +00:00
|
|
|
|
static void
|
|
|
|
|
update_trough_state (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GtkStateFlags state;
|
|
|
|
|
|
|
|
|
|
state = gtk_widget_get_state_flags (GTK_WIDGET (range));
|
|
|
|
|
|
|
|
|
|
state &= ~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
if (priv->mouse_location == priv->trough_widget &&
|
2016-03-27 03:50:59 +00:00
|
|
|
|
!(state & GTK_STATE_FLAG_INSENSITIVE))
|
2015-11-06 16:53:42 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
|
2017-05-07 16:41:24 +00:00
|
|
|
|
if (priv->grab_location == priv->trough_widget)
|
2015-11-06 16:53:42 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
2017-08-28 09:17:19 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_set_state_flags (priv->trough_widget, state, TRUE);
|
2015-11-06 16:53:42 +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);
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2015-11-06 16:53:42 +00:00
|
|
|
|
update_trough_state (range);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_slider_state (range);
|
2015-12-02 03:36:31 +00:00
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->state_flags_changed (widget, previous_state);
|
2008-11-11 17:47:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static gboolean
|
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);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2017-06-18 13:45:42 +00:00
|
|
|
|
int width, height;
|
2017-05-07 16:41:24 +00:00
|
|
|
|
|
2017-06-18 13:45:42 +00:00
|
|
|
|
gtk_widget_get_content_size (GTK_WIDGET (gizmo), &width, &height);
|
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-06-18 13:45:42 +00:00
|
|
|
|
0, 0, width, height);
|
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
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
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);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
2017-05-08 11:37:12 +00:00
|
|
|
|
return gtk_widget_has_visible_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
|
|
|
|
}
|
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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-10-05 21:29:32 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2012-01-04 23:27:57 +00:00
|
|
|
|
/* Don't perform any GDK/GTK+ grab here. Since a button
|
|
|
|
|
* 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
|
|
|
|
|
2016-03-09 19:15:40 +00:00
|
|
|
|
update_trough_state (range);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_slider_state (range);
|
|
|
|
|
|
2014-10-05 21:29:32 +00:00
|
|
|
|
gtk_style_context_add_class (context, "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)
|
|
|
|
|
{
|
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
|
|
|
|
|
|
|
|
|
if (enabled)
|
|
|
|
|
gtk_style_context_add_class (context, "fine-tune");
|
|
|
|
|
else
|
|
|
|
|
gtk_style_context_remove_class (context, "fine-tune");
|
|
|
|
|
|
|
|
|
|
range->priv->zoom = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-10-05 21:29:32 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (!priv->grab_location)
|
|
|
|
|
return;
|
|
|
|
|
|
2014-10-05 21:29:32 +00:00
|
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (range));
|
2007-01-16 14:17:12 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->grab_location = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2012-04-26 21:51:13 +00:00
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_slider_state (range);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
update_zoom_state (range, FALSE);
|
2014-10-05 21:29:32 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_remove_class (context, "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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
}
|
|
|
|
|
|
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 gdouble
|
|
|
|
|
coord_to_value (GtkRange *range,
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble coord)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gdouble frac;
|
|
|
|
|
gdouble value;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
gint trough_length;
|
|
|
|
|
gint trough_start;
|
|
|
|
|
gint slider_length;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkAllocation slider_alloc, trough_alloc;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
2017-08-14 10:12:09 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
|
2006-06-09 13:48:07 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2006-06-09 13:48:07 +00:00
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
trough_length = trough_alloc.height;
|
|
|
|
|
trough_start = trough_alloc.y;
|
|
|
|
|
slider_length = slider_alloc.height;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
trough_length = trough_alloc.width;
|
|
|
|
|
trough_start = trough_alloc.x;
|
|
|
|
|
slider_length = slider_alloc.width;
|
2006-06-09 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (trough_length == slider_length)
|
|
|
|
|
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
|
2006-06-09 13:48:07 +00:00
|
|
|
|
frac = (MAX (0, coord - trough_start) /
|
|
|
|
|
(gdouble) (trough_length - slider_length));
|
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
|
|
|
|
|
2011-01-05 21:08:45 +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
|
|
|
|
|
gtk_range_key_press (GtkWidget *widget,
|
|
|
|
|
GdkEventKey *event)
|
|
|
|
|
{
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDevice *device;
|
2006-10-30 13:39:34 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
device = gdk_event_get_device ((GdkEvent *) event);
|
|
|
|
|
device = gdk_device_get_associated_device (device);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (gtk_gesture_is_active (priv->drag_gesture) &&
|
|
|
|
|
device == gtk_gesture_get_device (priv->drag_gesture) &&
|
2010-09-08 17:35:51 +00:00
|
|
|
|
event->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 &&
|
|
|
|
|
(event->keyval == GDK_KEY_Shift_L ||
|
|
|
|
|
event->keyval == GDK_KEY_Shift_R))
|
|
|
|
|
{
|
2016-03-06 03:07:55 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2015-06-21 00:26:42 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider_alloc.y;
|
2015-06-21 00:26:42 +00:00
|
|
|
|
else
|
2016-01-19 09:22:33 +00:00
|
|
|
|
priv->slide_initial_slider_position = slider_alloc.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
|
|
|
|
|
|
|
|
|
return GTK_WIDGET_CLASS (gtk_range_parent_class)->key_press_event (widget, event);
|
2006-03-11 05:47:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-05 01:59:39 +00:00
|
|
|
|
static void
|
|
|
|
|
update_initial_slider_position (GtkRange *range,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkAllocation *slider_alloc)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
2016-03-05 02:11:30 +00:00
|
|
|
|
priv->slide_initial_slider_position = MAX (0, slider_alloc->y);
|
|
|
|
|
priv->slide_initial_coordinate_delta = y - priv->slide_initial_slider_position;
|
2016-03-05 01:59:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-05 02:11:30 +00:00
|
|
|
|
priv->slide_initial_slider_position = MAX (0, slider_alloc->x);
|
|
|
|
|
priv->slide_initial_coordinate_delta = x - 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,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
2013-07-18 21:35:42 +00:00
|
|
|
|
{
|
2015-02-23 12:28:40 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_widget && !priv->zoom)
|
2015-02-23 11:42:17 +00:00
|
|
|
|
{
|
2016-03-06 03:07:55 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
2016-03-05 01:59:39 +00:00
|
|
|
|
update_initial_slider_position (range, x, y, &slider_alloc);
|
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
|
|
|
|
|
gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
GdkDevice *source_device;
|
|
|
|
|
GdkEventSequence *sequence;
|
|
|
|
|
const 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;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
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);
|
2015-07-12 05:36:17 +00:00
|
|
|
|
gdk_event_get_state (event, &state_mask);
|
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
|
|
|
|
|
2012-01-04 23:21:36 +00:00
|
|
|
|
source_device = gdk_event_get_source_device ((GdkEvent *) event);
|
|
|
|
|
source = gdk_device_get_source (source_device);
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2012-08-24 09:49:43 +00:00
|
|
|
|
g_object_get (gtk_widget_get_settings (widget),
|
|
|
|
|
"gtk-primary-button-warps-slider", &primary_warps,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2017-05-20 13:04:03 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_widget &&
|
2016-04-18 18:48:53 +00:00
|
|
|
|
gdk_event_triggers_context_menu (event))
|
2012-02-03 06:41:07 +00:00
|
|
|
|
{
|
|
|
|
|
gboolean handled;
|
|
|
|
|
|
2014-09-26 23:18:57 +00:00
|
|
|
|
gtk_gesture_set_state (priv->multipress_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
2012-02-03 06:41:07 +00:00
|
|
|
|
g_signal_emit_by_name (widget, "popup-menu", &handled);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
return;
|
2012-02-03 06:41:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
if (priv->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
|
|
|
|
|
2016-03-05 01:59:39 +00:00
|
|
|
|
update_initial_slider_position (range, x, y, &slider_alloc);
|
2017-05-07 19:39:37 +00:00
|
|
|
|
range_grab_add (range, priv->slider_widget);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2017-05-07 16:41:24 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_widget &&
|
2015-07-13 22:56:34 +00:00
|
|
|
|
(source == GDK_SOURCE_TOUCHSCREEN ||
|
|
|
|
|
(button == GDK_BUTTON_PRIMARY &&
|
|
|
|
|
((primary_warps && !shift_pressed) ||
|
|
|
|
|
(!primary_warps && shift_pressed)))))
|
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-07-13 22:56:34 +00:00
|
|
|
|
/* warp to location */
|
2014-11-25 22:13:21 +00:00
|
|
|
|
GdkRectangle slider;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
gdouble slider_low_value, slider_high_value, new_value;
|
2001-07-14 11:35:24 +00:00
|
|
|
|
|
2015-07-13 22:56:34 +00:00
|
|
|
|
slider_high_value =
|
|
|
|
|
coord_to_value (range,
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
y : x);
|
|
|
|
|
slider_low_value =
|
|
|
|
|
coord_to_value (range,
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2016-01-19 09:22:33 +00:00
|
|
|
|
y - slider_alloc.height :
|
|
|
|
|
x - slider_alloc.width);
|
2014-11-25 22:13:21 +00:00
|
|
|
|
|
2015-07-13 22:56:34 +00:00
|
|
|
|
/* compute new value for warped slider */
|
2016-03-06 03:08:14 +00:00
|
|
|
|
new_value = (slider_low_value + slider_high_value) / 2;
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_compute_slider_position (range, new_value, &slider);
|
2016-03-05 01:59:39 +00:00
|
|
|
|
update_initial_slider_position (range, x, y, &slider);
|
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
|
|
|
|
|
2010-09-02 02:09:44 +00:00
|
|
|
|
gtk_widget_queue_draw (widget);
|
2006-05-18 11:39:42 +00:00
|
|
|
|
|
2015-07-13 22:56:34 +00:00
|
|
|
|
update_slider_position (range, x, y);
|
|
|
|
|
}
|
2017-05-07 16:41:24 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_widget &&
|
2015-07-13 22:56:34 +00:00
|
|
|
|
button == GDK_BUTTON_PRIMARY &&
|
|
|
|
|
((primary_warps && shift_pressed) ||
|
|
|
|
|
(!primary_warps && !shift_pressed)))
|
|
|
|
|
{
|
|
|
|
|
/* jump by pages */
|
|
|
|
|
GtkScrollType scroll;
|
|
|
|
|
gdouble click_value;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2017-05-07 16:41:24 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_widget &&
|
2015-07-13 22:56:34 +00:00
|
|
|
|
button == GDK_BUTTON_SECONDARY)
|
|
|
|
|
{
|
|
|
|
|
/* autoscroll */
|
|
|
|
|
gdouble click_value;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
range->priv->autoscroll_mode = priv->trough_click_forward ? GTK_SCROLL_END : GTK_SCROLL_START;
|
|
|
|
|
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)
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_gesture_set_state (priv->multipress_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
guint n_press,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
2016-02-01 10:25:51 +00:00
|
|
|
|
range->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,
|
|
|
|
|
gint mouse_x,
|
|
|
|
|
gint mouse_y)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble delta;
|
|
|
|
|
gdouble c;
|
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
|
|
|
|
gdouble 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;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gdouble next_value;
|
|
|
|
|
gdouble mark_value;
|
|
|
|
|
gdouble mark_delta;
|
2012-04-26 21:51:13 +00:00
|
|
|
|
gdouble zoom;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
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
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
if (priv->zoom)
|
|
|
|
|
{
|
2016-03-06 03:07:55 +00:00
|
|
|
|
GtkAllocation trough_alloc;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2012-04-26 21:51:13 +00:00
|
|
|
|
zoom = MIN(1.0, (priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
2016-01-19 09:22:33 +00:00
|
|
|
|
trough_alloc.height : trough_alloc.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)));
|
|
|
|
|
/* 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)
|
|
|
|
|
{
|
2016-03-06 03:07:55 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
|
|
|
|
|
2017-08-14 08:18:14 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
2016-03-06 03:07:55 +00:00
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
priv->slide_initial_slider_position = (zoom * (mouse_y - priv->slide_initial_coordinate_delta) - slider_alloc.y) / (zoom - 1.0);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
else
|
2016-01-19 09:22:33 +00:00
|
|
|
|
priv->slide_initial_slider_position = (zoom * (mouse_x - priv->slide_initial_coordinate_delta) - slider_alloc.x) / (zoom - 1.0);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
delta = mouse_y - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
|
|
|
|
else
|
|
|
|
|
delta = mouse_x - (priv->slide_initial_coordinate_delta + priv->slide_initial_slider_position);
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (range->priv->autoscroll_id)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_remove_tick_callback (GTK_WIDGET (range),
|
|
|
|
|
range->priv->autoscroll_id);
|
|
|
|
|
range->priv->autoscroll_id = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* unset initial position so it can be calculated */
|
|
|
|
|
range->priv->slide_initial_slider_position = -1;
|
|
|
|
|
|
|
|
|
|
range->priv->autoscroll_mode = GTK_SCROLL_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
autoscroll_cb (GtkWidget *widget,
|
|
|
|
|
GdkFrameClock *frame_clock,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2015-02-23 01:02:02 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GtkAdjustment *adj = priv->adjustment;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gdouble increment;
|
|
|
|
|
gdouble value;
|
|
|
|
|
gboolean handled;
|
2015-07-12 05:36:17 +00:00
|
|
|
|
gdouble step, page;
|
|
|
|
|
|
|
|
|
|
step = gtk_adjustment_get_step_increment (adj);
|
|
|
|
|
page = gtk_adjustment_get_page_increment (adj);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
2015-02-23 01:02:02 +00:00
|
|
|
|
switch (priv->autoscroll_mode)
|
|
|
|
|
{
|
|
|
|
|
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:
|
|
|
|
|
{
|
|
|
|
|
gdouble x, y;
|
|
|
|
|
gdouble distance, t;
|
|
|
|
|
|
|
|
|
|
/* 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)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2017-05-10 17:38:17 +00:00
|
|
|
|
static gdouble
|
2012-01-24 11:12:34 +00:00
|
|
|
|
_gtk_range_get_wheel_delta (GtkRange *range,
|
|
|
|
|
GdkEventScroll *event)
|
2004-02-29 18:21:57 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2011-01-05 21:08:45 +00:00
|
|
|
|
GtkAdjustment *adjustment = priv->adjustment;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
gdouble dx, dy;
|
2015-03-18 02:02:35 +00:00
|
|
|
|
gdouble delta = 0;
|
2012-03-05 00:15:32 +00:00
|
|
|
|
gdouble page_increment;
|
|
|
|
|
gdouble scroll_unit;
|
2015-03-18 02:02:35 +00:00
|
|
|
|
GdkScrollDirection direction;
|
2004-02-29 18:21:57 +00:00
|
|
|
|
|
2012-03-05 00:15:32 +00:00
|
|
|
|
page_increment = gtk_adjustment_get_page_increment (adjustment);
|
|
|
|
|
|
2017-05-10 17:38:17 +00:00
|
|
|
|
scroll_unit = page_increment;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
|
|
|
|
if (gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
|
|
|
|
|
{
|
2014-09-05 11:38:30 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_QUARTZ
|
|
|
|
|
scroll_unit = 1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-03-18 02:02:35 +00:00
|
|
|
|
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
delta = - (dx ? dx : dy) * scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
else
|
2012-03-05 00:15:32 +00:00
|
|
|
|
delta = dy * scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
}
|
2015-03-18 02:02:35 +00:00
|
|
|
|
else if (gdk_event_get_scroll_direction ((GdkEvent *) event, &direction))
|
2012-01-24 11:12:34 +00:00
|
|
|
|
{
|
2015-03-18 02:02:35 +00:00
|
|
|
|
if (direction == GDK_SCROLL_UP ||
|
2015-04-15 13:27:04 +00:00
|
|
|
|
direction == GDK_SCROLL_LEFT)
|
2012-03-05 00:15:32 +00:00
|
|
|
|
delta = - scroll_unit;
|
|
|
|
|
else
|
|
|
|
|
delta = scroll_unit;
|
2012-01-24 11:12:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->inverted)
|
2004-02-29 18:21:57 +00:00
|
|
|
|
delta = - delta;
|
|
|
|
|
|
|
|
|
|
return delta;
|
|
|
|
|
}
|
2012-01-24 11:12:34 +00:00
|
|
|
|
|
2006-12-26 06:53:57 +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_event (GtkWidget *widget,
|
|
|
|
|
GdkEventScroll *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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-03-02 06:16:02 +00:00
|
|
|
|
if (gtk_widget_get_realized (widget))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2004-02-29 18:21:57 +00:00
|
|
|
|
gdouble delta;
|
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
|
|
|
|
|
2012-01-24 11:12:34 +00:00
|
|
|
|
delta = _gtk_range_get_wheel_delta (range, event);
|
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_JUMP, gtk_adjustment_get_value (priv->adjustment) + delta,
|
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);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return GDK_EVENT_STOP;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-29 16:06:20 +00:00
|
|
|
|
static void
|
|
|
|
|
update_autoscroll_mode (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkScrollType mode = GTK_SCROLL_NONE;
|
|
|
|
|
|
|
|
|
|
if (range->priv->zoom)
|
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
int width, height;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
gint size, pos;
|
|
|
|
|
|
2017-06-28 06:19:35 +00:00
|
|
|
|
gtk_widget_get_content_size (GTK_WIDGET (range), &width, &height);
|
2013-07-29 16:06:20 +00:00
|
|
|
|
|
|
|
|
|
if (range->priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
size = height;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
pos = range->priv->mouse_y;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
size = width;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
pos = range->priv->mouse_x;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-07 16:01:13 +00:00
|
|
|
|
if (pos < SCROLL_EDGE_SIZE)
|
2014-03-03 22:49:38 +00:00
|
|
|
|
mode = range->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))
|
2014-03-03 22:49:38 +00:00
|
|
|
|
mode = range->priv->inverted ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_STEP_FORWARD;
|
2013-07-29 16:06:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode != range->priv->autoscroll_mode)
|
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
|
|
|
|
range->priv->autoscroll_mode = mode;
|
|
|
|
|
add_autoscroll (range);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_drag_gesture_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gdouble 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
|
|
|
|
{
|
|
|
|
|
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
|
|
|
|
|
priv->mouse_x = start_x + offset_x;
|
|
|
|
|
priv->mouse_y = start_y + offset_y;
|
|
|
|
|
priv->in_drag = TRUE;
|
|
|
|
|
update_autoscroll_mode (range);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2015-06-20 22:37:15 +00:00
|
|
|
|
if (priv->autoscroll_mode == GTK_SCROLL_NONE)
|
|
|
|
|
update_slider_position (range, priv->mouse_x, priv->mouse_y);
|
|
|
|
|
}
|
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,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkRange *range)
|
|
|
|
|
{
|
2016-03-27 03:50:59 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gtk_range_event (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
gdouble x, y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
if (event->type == GDK_LEAVE_NOTIFY)
|
|
|
|
|
{
|
2015-12-02 19:12:01 +00:00
|
|
|
|
priv->mouse_x = G_MININT;
|
|
|
|
|
priv->mouse_y = G_MININT;
|
2014-06-05 13:29:14 +00:00
|
|
|
|
}
|
|
|
|
|
else if (gdk_event_get_coords (event, &x, &y))
|
|
|
|
|
{
|
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 02:27:36 +00:00
|
|
|
|
gtk_range_update_mouse_location (range);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
return GDK_EVENT_PROPAGATE;
|
2003-03-29 00:11: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
|
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,
|
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (data);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2014-11-29 01:39:47 +00:00
|
|
|
|
gtk_range_calc_slider (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
|
|
|
|
|
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);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2014-11-29 01:39:47 +00:00
|
|
|
|
gtk_range_calc_slider (range);
|
2005-08-20 05:55:25 +00:00
|
|
|
|
|
|
|
|
|
/* now check whether the layout changed */
|
2014-11-29 01:39:47 +00:00
|
|
|
|
if (GTK_IS_SCALE (range) && gtk_scale_get_draw_value (GTK_SCALE (range)))
|
2005-08-20 05:55:25 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
|
|
|
|
}
|
2011-01-15 05:08:39 +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
|
|
|
|
|
|
|
|
|
gtk_widget_queue_allocate (range->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,
|
|
|
|
|
gdouble oldval,
|
|
|
|
|
gdouble *newval)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
|
|
|
|
gdouble mark;
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gdouble 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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gdouble 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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gdouble 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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gdouble 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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2003-12-11 23:05:25 +00:00
|
|
|
|
gdouble 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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2011-01-05 21:08:45 +00:00
|
|
|
|
gdouble 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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
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))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
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:
|
|
|
|
|
/* Used by CList, range doesn't use it. */
|
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_NONE:
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update mouse location, return TRUE if it changes */
|
2014-11-29 02:27:36 +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_update_mouse_location (GtkRange *range)
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
gint x, y;
|
2017-05-07 19:39:37 +00:00
|
|
|
|
GtkWidget *old_location;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (range);
|
2016-03-11 06:27:21 +00:00
|
|
|
|
GdkRectangle trough_alloc, slider_alloc, slider_trace;
|
2017-05-08 11:37:31 +00:00
|
|
|
|
GtkAllocation range_alloc;
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
old_location = priv->mouse_location;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
x = priv->mouse_x;
|
|
|
|
|
y = priv->mouse_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-06-16 16:16:27 +00:00
|
|
|
|
gtk_widget_get_own_allocation (widget, &range_alloc);
|
2017-08-14 10:20:42 +00:00
|
|
|
|
gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
|
2017-06-16 16:16:27 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
|
|
|
|
gtk_widget_translate_coordinates (priv->trough_widget, widget,
|
|
|
|
|
slider_alloc.x, slider_alloc.y, &slider_alloc.x, &slider_alloc.y);
|
|
|
|
|
|
2016-03-11 06:27:21 +00:00
|
|
|
|
gdk_rectangle_union (&slider_alloc, &trough_alloc, &slider_trace);
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location != NULL)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->mouse_location = priv->grab_location;
|
2017-06-16 16:16:27 +00:00
|
|
|
|
else if (gdk_rectangle_contains_point (&slider_alloc, x, y))
|
2017-05-07 19:39:37 +00:00
|
|
|
|
priv->mouse_location = priv->slider_widget;
|
2017-06-16 16:16:27 +00:00
|
|
|
|
else if (gdk_rectangle_contains_point (&slider_trace, x, y))
|
2017-05-07 16:41:24 +00:00
|
|
|
|
priv->mouse_location = priv->trough_widget;
|
2017-06-16 16:16:27 +00:00
|
|
|
|
else if (gdk_rectangle_contains_point (&range_alloc, x, y))
|
2017-05-08 11:37:31 +00:00
|
|
|
|
priv->mouse_location = 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
|
|
|
|
else
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = 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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (old_location != priv->mouse_location)
|
2014-11-29 02:27:36 +00:00
|
|
|
|
{
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (old_location != NULL)
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (old_location));
|
2014-11-29 02:33:47 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location != NULL)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_PRELIGHT, FALSE);
|
2017-05-07 16:41:24 +00:00
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (priv->mouse_location));
|
2016-03-27 03:50:59 +00:00
|
|
|
|
}
|
2014-11-29 02:33:47 +00:00
|
|
|
|
else
|
2016-03-27 03:50:59 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_PRELIGHT);
|
|
|
|
|
}
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
2016-03-09 19:15:40 +00:00
|
|
|
|
update_trough_state (range);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_slider_state (range);
|
2014-11-29 02:27:36 +00:00
|
|
|
|
}
|
Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
Hwang to move call to sync_selection() up a few lines
to before the row list is modified, to fix crash when
removing rows in the undo_selection list.
(Test case provided by Daniel Elstner:
http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktree.c (gtk_tree_class_init): Do the setting
of tree->root_tree in parent_set rather than _map(),
fixing #50892 in a bit better manner.
Thu Feb 22 17:07:58 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
Tue Feb 2 11:22:33 2001 Jody Goldberg <jgoldberg@home.com>
* gtk/gtkstyle.c : Remove duplicate fwd decl for
gtk_default_draw_shadow.
ue Feb 20 11:40:58 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Remove excess
warning, make warnings more verbose, treat a error
in shmat as permanent, and don't try again.
(#51163, Ed Randall.)
Mon Feb 19 20:15:28 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
delay for the first click before starting to scroll.
(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)
* gtk/gtktext.c: GtkText should have I-beam cursor.
(based on gtk-enf-990513-1.patch, Eric Fisher.)
Mon Feb 19 16:42:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_allocate_child): Tiny
cleanup to remove some references to unused
->xoffset, ->yoffset.
Mon Feb 19 14:20:36 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
mask. (#51039, fix from Martin Maierhofer)
Fri Feb 16 20:09:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
for unshifted + and shifted = for non-us keyboards.
Make <Control>+ and <Control>- work as well as
<Control>KP_Plus, <Control>KP_Minus for recursive
open/close. (#2682, Ren Seindal)
Fri Feb 16 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
the active menu item before deactivating the menu,
so gtk_menu_popdown doesn't change the history. (#50964)
Fri Feb 16 15:55:22 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
draw lines with text_gc rather than black_gc.
(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-03-02 17:06:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_compute_slider_position (GtkRange *range,
|
|
|
|
|
gdouble adjustment_value,
|
|
|
|
|
GdkRectangle *slider_rect)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2017-06-18 13:45:42 +00:00
|
|
|
|
int trough_width, trough_height;
|
2016-02-27 21:31:26 +00:00
|
|
|
|
int slider_width, slider_height, min_slider_size;
|
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-06-18 13:45:42 +00:00
|
|
|
|
gtk_widget_get_content_size (priv->trough_widget, &trough_width, &trough_height);
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
gint y, bottom, top, height;
|
|
|
|
|
|
|
|
|
|
/* Slider fits into the trough, with stepper_spacing on either side,
|
|
|
|
|
* and the size/position based on the adjustment or fixed, depending.
|
|
|
|
|
*/
|
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
|
|
|
|
|
2016-10-04 14:50:28 +00:00
|
|
|
|
min_slider_size = slider_height;
|
2016-02-27 21:31:26 +00:00
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
/* Compute slider position/length */
|
2017-06-16 16:16:27 +00:00
|
|
|
|
top = 0;
|
2017-06-18 13:45:42 +00:00
|
|
|
|
bottom = top + trough_height;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
|
|
|
|
/* Scale slider half extends over the trough edge */
|
|
|
|
|
if (GTK_IS_SCALE (range))
|
|
|
|
|
{
|
2016-02-27 21:31:26 +00:00
|
|
|
|
top -= min_slider_size / 2;
|
|
|
|
|
bottom += min_slider_size / 2;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
}
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
/* slider height is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough height in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0)
|
|
|
|
|
height = ((bottom - top) * (gtk_adjustment_get_page_size (priv->adjustment) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment))));
|
|
|
|
|
else
|
2016-02-27 21:31:26 +00:00
|
|
|
|
height = min_slider_size;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
if (height < min_slider_size ||
|
2014-11-21 07:24:51 +00:00
|
|
|
|
priv->slider_size_fixed)
|
2016-02-27 21:31:26 +00:00
|
|
|
|
height = min_slider_size;
|
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
|
|
|
|
|
|
|
|
|
y = top;
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) != 0)
|
|
|
|
|
y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
|
|
|
|
|
y = CLAMP (y, top, bottom);
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
y = bottom - (y - top + height);
|
|
|
|
|
|
|
|
|
|
slider_rect->y = y;
|
|
|
|
|
slider_rect->height = height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gint x, left, right, width;
|
|
|
|
|
|
|
|
|
|
/* Slider fits into the trough, with stepper_spacing on either side,
|
|
|
|
|
* and the size/position based on the adjustment or fixed, depending.
|
|
|
|
|
*/
|
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
|
|
|
|
|
2016-10-04 14:50:28 +00:00
|
|
|
|
min_slider_size = slider_width;
|
2016-02-27 21:31:26 +00:00
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
/* Compute slider position/length */
|
2017-06-16 16:16:27 +00:00
|
|
|
|
left = 0;
|
2017-06-18 13:45:42 +00:00
|
|
|
|
right = left + trough_width;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
|
|
|
|
/* Scale slider half extends over the trough edge */
|
|
|
|
|
if (GTK_IS_SCALE (range))
|
|
|
|
|
{
|
2016-02-27 21:31:26 +00:00
|
|
|
|
left -= min_slider_size / 2;
|
|
|
|
|
right += min_slider_size / 2;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
}
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
|
|
|
|
/* slider width is the fraction (page_size /
|
|
|
|
|
* total_adjustment_range) times the trough width in pixels
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0)
|
|
|
|
|
width = ((right - left) * (gtk_adjustment_get_page_size (priv->adjustment) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment))));
|
|
|
|
|
else
|
2016-02-27 21:31:26 +00:00
|
|
|
|
width = min_slider_size;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
if (width < min_slider_size ||
|
2014-11-21 07:24:51 +00:00
|
|
|
|
priv->slider_size_fixed)
|
2016-02-27 21:31:26 +00:00
|
|
|
|
width = min_slider_size;
|
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
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
x = left;
|
|
|
|
|
|
|
|
|
|
if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) != 0)
|
|
|
|
|
x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) /
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
|
|
|
|
|
x = CLAMP (x, left, right);
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
x = right - (x - left + 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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_slider (GtkRange *range)
|
|
|
|
|
{
|
2014-11-29 00:47:31 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2015-11-05 12:23:54 +00:00
|
|
|
|
gboolean visible;
|
2014-11-29 00:47:31 +00:00
|
|
|
|
|
2015-11-05 12:23:54 +00:00
|
|
|
|
if (GTK_IS_SCALE (range) &&
|
|
|
|
|
gtk_adjustment_get_upper (priv->adjustment) == gtk_adjustment_get_lower (priv->adjustment))
|
|
|
|
|
visible = FALSE;
|
|
|
|
|
else
|
|
|
|
|
visible = TRUE;
|
|
|
|
|
|
2017-05-07 19:39:37 +00:00
|
|
|
|
gtk_widget_set_visible (priv->slider_widget, visible);
|
2014-11-29 00:47:31 +00:00
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
2017-05-07 16:41:24 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->trough_widget);
|
2014-11-29 00:47:31 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_update_mouse_location (range);
|
2014-11-29 00:23:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_marks (GtkRange *range)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2014-11-21 07:29:37 +00:00
|
|
|
|
GdkRectangle slider;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint 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),
|
2017-06-16 16:16:27 +00:00
|
|
|
|
slider.x, slider.y, &slider.x, &slider.y);
|
2014-11-21 07:29:37 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2014-11-21 07:29:37 +00:00
|
|
|
|
priv->mark_pos[i] = slider.x + slider.width / 2;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
else
|
2014-11-21 07:29:37 +00:00
|
|
|
|
priv->mark_pos[i] = slider.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,
|
|
|
|
|
gdouble value)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
{
|
2004-11-10 03:20:11 +00:00
|
|
|
|
gdouble power;
|
2004-10-06 05:11:36 +00:00
|
|
|
|
gint 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);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
1998-05-03 22:41:32 +00:00
|
|
|
|
|
2014-11-21 06:16:12 +00:00
|
|
|
|
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT,
|
2010-12-02 22:01:12 +00:00
|
|
|
|
second_timeout,
|
|
|
|
|
range);
|
2013-10-22 13:43:43 +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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
|
2010-12-02 22:01:12 +00:00
|
|
|
|
initial_timeout,
|
|
|
|
|
range);
|
2013-10-22 13:43:43 +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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
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)
|
|
|
|
|
{
|
2015-11-07 00:25:58 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2011-12-14 16:16:09 +00:00
|
|
|
|
range->priv->has_origin = has_origin;
|
2015-11-07 00:25:58 +00:00
|
|
|
|
|
|
|
|
|
if (has_origin)
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
priv->highlight_widget = gtk_gizmo_new ("highlight", NULL, NULL, NULL);
|
|
|
|
|
gtk_widget_set_parent (priv->highlight_widget, priv->trough_widget);
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
|
|
|
|
update_highlight_position (range);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-07 18:45:06 +00:00
|
|
|
|
gtk_widget_unparent (priv->highlight_widget);
|
|
|
|
|
priv->highlight_widget = NULL;
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
2011-12-14 16:16:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
_gtk_range_get_has_origin (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
return range->priv->has_origin;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_range_set_stop_values (GtkRange *range,
|
|
|
|
|
gdouble *values,
|
|
|
|
|
gint n_values)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gint i;
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->marks);
|
|
|
|
|
priv->marks = g_new (gdouble, n_values);
|
2009-01-20 05:10:27 +00:00
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
g_free (priv->mark_pos);
|
|
|
|
|
priv->mark_pos = g_new (gint, 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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gint
|
|
|
|
|
_gtk_range_get_stop_positions (GtkRange *range,
|
|
|
|
|
gint **values)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2009-01-20 05:10:27 +00:00
|
|
|
|
gtk_range_calc_marks (range);
|
|
|
|
|
|
|
|
|
|
if (values)
|
2010-08-16 06:27:49 +00:00
|
|
|
|
*values = g_memdup (priv->mark_pos, priv->n_marks * sizeof (gint));
|
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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
2010-08-12 23:50:09 +00:00
|
|
|
|
void
|
2011-01-15 05:08:39 +00:00
|
|
|
|
gtk_range_set_round_digits (GtkRange *range,
|
|
|
|
|
gint round_digits)
|
2010-08-12 23:50:09 +00:00
|
|
|
|
{
|
2011-01-15 05:08:39 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
g_return_if_fail (round_digits >= -1);
|
|
|
|
|
|
2014-06-09 13:21:11 +00:00
|
|
|
|
if (range->priv->round_digits != round_digits)
|
|
|
|
|
{
|
|
|
|
|
range->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
|
|
|
|
*
|
|
|
|
|
* Since: 2.24
|
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_range_get_round_digits (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), -1);
|
|
|
|
|
|
|
|
|
|
return range->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
|
|
|
|
{
|
2017-05-07 19:39:37 +00:00
|
|
|
|
return range->priv->slider_widget;
|
2016-02-21 23:01:04 +00:00
|
|
|
|
}
|