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"
|
2016-01-19 09:22:33 +00:00
|
|
|
|
#include "gtkboxgadgetprivate.h"
|
2016-01-09 22:00:09 +00:00
|
|
|
|
#include "gtkbuiltiniconprivate.h"
|
|
|
|
|
#include "gtkcsscustomgadgetprivate.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"
|
2015-11-04 04:11:52 +00:00
|
|
|
|
#include "gtkcssstylepropertyprivate.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,
|
|
|
|
|
* #GtkRange provides properties and methods for influencing the sensitivity
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* of the “steppers”. It also provides properties and methods for setting a
|
|
|
|
|
* “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
|
|
|
|
{
|
2016-03-27 03:50:59 +00:00
|
|
|
|
GtkCssGadget *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;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
GtkCssGadget *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;
|
|
|
|
|
GtkSensitivityType lower_sensitivity;
|
|
|
|
|
GtkSensitivityType upper_sensitivity;
|
|
|
|
|
|
|
|
|
|
GdkWindow *event_window;
|
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-01-09 22:00:09 +00:00
|
|
|
|
/* Steppers are: < > ---- < >
|
|
|
|
|
* a b c d
|
|
|
|
|
*/
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkCssGadget *gadget;
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkCssGadget *contents_gadget;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkCssGadget *stepper_a_gadget;
|
|
|
|
|
GtkCssGadget *stepper_b_gadget;
|
|
|
|
|
GtkCssGadget *stepper_c_gadget;
|
|
|
|
|
GtkCssGadget *stepper_d_gadget;
|
|
|
|
|
GtkCssGadget *trough_gadget;
|
|
|
|
|
GtkCssGadget *fill_gadget;
|
|
|
|
|
GtkCssGadget *highlight_gadget;
|
|
|
|
|
GtkCssGadget *slider_gadget;
|
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 min_slider_size;
|
|
|
|
|
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;
|
2016-02-27 21:31:26 +00:00
|
|
|
|
guint slider_use_min_size : 1;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint trough_click_forward : 1; /* trough click was on the forward side of slider */
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
|
|
|
|
/* Stepper sensitivity */
|
2010-08-16 06:27:49 +00:00
|
|
|
|
guint lower_sensitive : 1;
|
|
|
|
|
guint upper_sensitive : 1;
|
2006-07-18 14:22:38 +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_LOWER_STEPPER_SENSITIVITY,
|
|
|
|
|
PROP_UPPER_STEPPER_SENSITIVITY,
|
|
|
|
|
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);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void gtk_range_destroy (GtkWidget *widget);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
static void gtk_range_get_preferred_width
|
|
|
|
|
(GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
|
|
|
|
static void gtk_range_get_preferred_height
|
|
|
|
|
(GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
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_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
|
static void gtk_range_realize (GtkWidget *widget);
|
|
|
|
|
static void gtk_range_unrealize (GtkWidget *widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void gtk_range_map (GtkWidget *widget);
|
|
|
|
|
static void gtk_range_unmap (GtkWidget *widget);
|
2010-09-04 19:44:54 +00:00
|
|
|
|
static gboolean gtk_range_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr);
|
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);
|
|
|
|
|
static void gtk_range_calc_stepper_sensitivity (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);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
static void gtk_range_measure_trough (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
static void gtk_range_allocate_trough (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_range_render_trough (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data);
|
2016-02-24 21:28:54 +00:00
|
|
|
|
static void gtk_range_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
static void gtk_range_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_range_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2008-11-11 17:47:13 +00:00
|
|
|
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkRange, gtk_range, GTK_TYPE_WIDGET,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkRange)
|
2008-11-11 17:47:13 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
|
|
|
|
|
NULL))
|
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
static guint signals[LAST_SIGNAL];
|
2015-09-06 14:42:50 +00:00
|
|
|
|
static GParamSpec *properties[LAST_PROP];
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_class_init (GtkRangeClass *class)
|
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class->set_property = gtk_range_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_range_get_property;
|
2008-11-11 17:47:13 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
widget_class->destroy = gtk_range_destroy;
|
2010-10-27 12:10:40 +00:00
|
|
|
|
widget_class->get_preferred_width = gtk_range_get_preferred_width;
|
|
|
|
|
widget_class->get_preferred_height = gtk_range_get_preferred_height;
|
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;
|
|
|
|
|
widget_class->realize = gtk_range_realize;
|
2010-10-08 05:37:33 +00:00
|
|
|
|
widget_class->unrealize = gtk_range_unrealize;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
widget_class->map = gtk_range_map;
|
|
|
|
|
widget_class->unmap = gtk_range_unmap;
|
2010-09-04 19:44:54 +00:00
|
|
|
|
widget_class->draw = gtk_range_draw;
|
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,
|
2008-08-13 18:44:11 +00:00
|
|
|
|
_gtk_marshal_VOID__VOID,
|
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,
|
|
|
|
|
_gtk_marshal_VOID__DOUBLE,
|
|
|
|
|
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,
|
2001-11-17 23:28:51 +00:00
|
|
|
|
_gtk_marshal_VOID__ENUM,
|
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
|
|
|
|
*
|
|
|
|
|
* It is not possible to use delayed update policies in an overridden
|
2011-01-15 05:08:39 +00:00
|
|
|
|
* #GtkRange::change-value handler.
|
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);
|
|
|
|
|
|
|
|
|
|
properties[PROP_LOWER_STEPPER_SENSITIVITY] =
|
|
|
|
|
g_param_spec_enum ("lower-stepper-sensitivity",
|
|
|
|
|
P_("Lower stepper sensitivity"),
|
|
|
|
|
P_("The sensitivity policy for the stepper that points to the adjustment's lower side"),
|
|
|
|
|
GTK_TYPE_SENSITIVITY_TYPE,
|
|
|
|
|
GTK_SENSITIVITY_AUTO,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_UPPER_STEPPER_SENSITIVITY] =
|
|
|
|
|
g_param_spec_enum ("upper-stepper-sensitivity",
|
|
|
|
|
P_("Upper stepper sensitivity"),
|
|
|
|
|
P_("The sensitivity policy for the stepper that points to the adjustment's upper side"),
|
|
|
|
|
GTK_TYPE_SENSITIVITY_TYPE,
|
|
|
|
|
GTK_SENSITIVITY_AUTO,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2005-11-11 12:48:29 +00:00
|
|
|
|
|
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
|
|
|
|
|
2016-02-21 08:33:36 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:slider-width:
|
|
|
|
|
*
|
|
|
|
|
* Width of scrollbar or scale thumb.
|
|
|
|
|
*
|
2016-03-11 18:14:19 +00:00
|
|
|
|
* Deprecated: 3.20: Use the min-height/min-width CSS properties on the
|
2016-02-21 08:33:36 +00:00
|
|
|
|
* slider element. The value of this style property is ignored.
|
|
|
|
|
*/
|
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
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("slider-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Slider Width"),
|
|
|
|
|
P_("Width of scrollbar or scale thumb"),
|
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
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
14,
|
2016-02-21 08:33:36 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:trough-border:
|
|
|
|
|
*
|
|
|
|
|
* Spacing between thumb/steppers and outer trough bevel.
|
|
|
|
|
*
|
2016-03-11 18:14:19 +00:00
|
|
|
|
* Deprecated: 3.20: Use the margin/padding CSS properties on the trough and
|
2016-02-21 08:33:36 +00:00
|
|
|
|
* stepper elements. The value of this style property is ignored.
|
|
|
|
|
*/
|
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
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("trough-border",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Trough Border"),
|
|
|
|
|
P_("Spacing between thumb/steppers and outer trough bevel"),
|
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
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
1,
|
2016-02-21 08:33:36 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:stepper-size:
|
|
|
|
|
*
|
|
|
|
|
* Length of step buttons at ends.
|
|
|
|
|
*
|
2016-03-11 18:14:19 +00:00
|
|
|
|
* Deprecated: 3.20: Use the min-height/min-width CSS properties on the
|
2016-02-21 08:33:36 +00:00
|
|
|
|
* stepper elements. The value of this style property is ignored.
|
|
|
|
|
*/
|
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
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("stepper-size",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Stepper Size"),
|
|
|
|
|
P_("Length of step buttons at ends"),
|
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
|
|
|
|
0,
|
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
14,
|
2016-02-21 08:33:36 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2006-06-09 13:48:07 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:stepper-spacing:
|
|
|
|
|
*
|
|
|
|
|
* The spacing between the stepper buttons and thumb. Note that
|
|
|
|
|
* stepper-spacing won't have any effect if there are no steppers.
|
2016-02-21 08:33:36 +00:00
|
|
|
|
*
|
2016-03-11 18:14:19 +00:00
|
|
|
|
* Deprecated: 3.20: Use the margin CSS property on the stepper elements.
|
2016-02-21 08:33:36 +00:00
|
|
|
|
* The value of this style property is ignored.
|
2006-06-09 13:48:07 +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
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("stepper-spacing",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Stepper Spacing"),
|
|
|
|
|
P_("Spacing between step buttons and thumb"),
|
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
|
|
|
|
0,
|
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
|
|
|
|
G_MAXINT,
|
2001-05-01 01:36:33 +00:00
|
|
|
|
0,
|
2016-02-21 08:33:36 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2015-11-16 11:17:36 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:arrow-displacement-x:
|
|
|
|
|
*
|
|
|
|
|
* How far in the x direction to move the arrow when the button is depressed.
|
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: The value of this style property is ignored.
|
|
|
|
|
*/
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("arrow-displacement-x",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Arrow X Displacement"),
|
|
|
|
|
P_("How far in the x direction to move the arrow when the button is depressed"),
|
2002-02-26 23:50:14 +00:00
|
|
|
|
G_MININT,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
0,
|
2015-11-16 20:13:33 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2015-11-16 11:17:36 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkRange:arrow-displacement-y:
|
|
|
|
|
*
|
|
|
|
|
* How far in the y direction to move the arrow when the button is depressed.
|
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: The value of this style property is ignored.
|
|
|
|
|
*/
|
2002-02-26 23:50:14 +00:00
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_int ("arrow-displacement-y",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Arrow Y Displacement"),
|
|
|
|
|
P_("How far in the y direction to move the arrow when the button is depressed"),
|
2002-02-26 23:50:14 +00:00
|
|
|
|
G_MININT,
|
|
|
|
|
G_MAXINT,
|
|
|
|
|
0,
|
2015-11-16 20:13:33 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2006-03-11 04:09:38 +00:00
|
|
|
|
|
2006-06-09 13:48:07 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:trough-under-steppers:
|
|
|
|
|
*
|
|
|
|
|
* Whether to draw the trough across the full length of the range or
|
range: allow stepper-spacing > 0 and trough-under-steppers = TRUE
Commit 4bb3d6441439e4d99255a3a08b39da7100ced953 introduced a limitation
to GtkRange style properties; when stepper-spacing is > 0,
trough-under-steppers is automatically set to FALSE; this means that
setting a spacing between the steppers (e.g. the scrollbar buttons) and
the trough (i.e. the area over which the slider is free to move) would
make the buttons always get the full allocation on the !orientation
direction.
The rationale is without this limitation, you would get an area which
seems clickable, but it's actually not.
While this is true, and undesirable, for big stepper spacings, themes
that use trough-under-steppers (which is TRUE by default anyway),
might want to set smaller spacings to avoid drawing a double line between
the button and the slider borders.
To add confusion, the documentation got it flipped, i.e. it stated
setting a positive stepper-spacing would set trough-under-steppers to
TRUE (which would also make the behavior expected by commit
4bb3d6441439e4d99255a3a08b39da7100ced953 impossible).
I don't think hardcoding either of the two limitations is a good thing.
We should let themes handle this instead, and remove this limitation. If
you want the old behavior, you can manually set trough-under-steppers to
FALSE if you set a positive stepper-spacing in your theme.
https://bugzilla.gnome.org/show_bug.cgi?id=644777
2011-03-14 22:21:47 +00:00
|
|
|
|
* to exclude the steppers and their spacing.
|
2006-06-09 13:48:07 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
2016-01-13 23:01:47 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: The value of this style property is ignored, and the
|
|
|
|
|
* widget will behave as if it was set to %TRUE.
|
2006-06-09 13:48:07 +00:00
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
|
g_param_spec_boolean ("trough-under-steppers",
|
|
|
|
|
P_("Trough Under Steppers"),
|
2006-12-31 05:09:01 +00:00
|
|
|
|
P_("Whether to draw trough for full length of range or exclude the steppers and spacing"),
|
2006-06-09 13:48:07 +00:00
|
|
|
|
TRUE,
|
2016-01-13 23:01:47 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2006-11-15 12:23:10 +00:00
|
|
|
|
|
2008-08-02 04:52:54 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkRange:arrow-scaling:
|
|
|
|
|
*
|
|
|
|
|
* The arrow size proportion relative to the scroll button size.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.14
|
2016-01-17 00:27:35 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: Use min-width/min-height on the "button" node instead.
|
|
|
|
|
* The value of this style property is ignored.
|
2008-08-02 04:52:54 +00:00
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
|
g_param_spec_float ("arrow-scaling",
|
|
|
|
|
P_("Arrow scaling"),
|
|
|
|
|
P_("Arrow scaling with regard to scroll button size"),
|
|
|
|
|
0.0, 1.0, 0.5,
|
2016-01-17 00:27:35 +00:00
|
|
|
|
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
|
2008-08-02 04:52:54 +00:00
|
|
|
|
|
2011-06-28 02:39:43 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_RANGE_ACCESSIBLE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_sync_orientation (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
|
|
|
|
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (range));
|
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_box_gadget_set_orientation (GTK_BOX_GADGET (priv->contents_gadget), orientation);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_VERTICAL)
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->contents_gadget),
|
2016-02-24 19:43:06 +00:00
|
|
|
|
priv->trough_gadget, FALSE, TRUE);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->contents_gadget),
|
2016-02-24 19:43:06 +00:00
|
|
|
|
priv->trough_gadget, TRUE, FALSE);
|
2016-01-19 09:22:33 +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);
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gtk_range_sync_orientation (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;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
case PROP_LOWER_STEPPER_SENSITIVITY:
|
|
|
|
|
gtk_range_set_lower_stepper_sensitivity (range, g_value_get_enum (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER_STEPPER_SENSITIVITY:
|
|
|
|
|
gtk_range_set_upper_stepper_sensitivity (range, g_value_get_enum (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;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
case PROP_LOWER_STEPPER_SENSITIVITY:
|
|
|
|
|
g_value_set_enum (value, gtk_range_get_lower_stepper_sensitivity (range));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_UPPER_STEPPER_SENSITIVITY:
|
|
|
|
|
g_value_set_enum (value, gtk_range_get_upper_stepper_sensitivity (range));
|
|
|
|
|
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;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
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->min_slider_size = 1;
|
|
|
|
|
priv->round_digits = -1;
|
2015-12-02 19:12:01 +00:00
|
|
|
|
priv->mouse_x = G_MININT;
|
|
|
|
|
priv->mouse_y = G_MININT;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->lower_sensitivity = GTK_SENSITIVITY_AUTO;
|
|
|
|
|
priv->upper_sensitivity = GTK_SENSITIVITY_AUTO;
|
|
|
|
|
priv->lower_sensitive = TRUE;
|
|
|
|
|
priv->upper_sensitive = TRUE;
|
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));
|
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (range));
|
2016-02-24 21:28:54 +00:00
|
|
|
|
priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
gtk_range_measure,
|
|
|
|
|
gtk_range_allocate,
|
|
|
|
|
gtk_range_render,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
priv->contents_gadget = gtk_box_gadget_new ("contents",
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
priv->gadget, NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
priv->trough_gadget = gtk_css_custom_gadget_new ("trough",
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
gtk_range_measure_trough,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gtk_range_allocate_trough,
|
|
|
|
|
gtk_range_render_trough,
|
2016-01-09 22:00:09 +00:00
|
|
|
|
NULL, NULL);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->trough_gadget,
|
|
|
|
|
gtk_css_node_get_state (widget_node));
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->contents_gadget), -1, priv->trough_gadget,
|
2016-02-24 19:43:06 +00:00
|
|
|
|
TRUE, FALSE, GTK_ALIGN_CENTER);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
priv->slider_gadget = gtk_builtin_icon_new ("slider",
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
priv->trough_gadget, NULL);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->slider_gadget,
|
|
|
|
|
gtk_css_node_get_state (widget_node));
|
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);
|
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
|
|
|
|
|
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);
|
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;
|
|
|
|
|
|
|
|
|
|
if (!priv->highlight_gadget)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_remove_class (priv->highlight_gadget, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
gtk_css_gadget_add_class (priv->highlight_gadget, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_remove_class (priv->highlight_gadget, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
gtk_css_gadget_add_class (priv->highlight_gadget, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_fill_position (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (!priv->fill_gadget)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (should_invert (range))
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_remove_class (priv->fill_gadget, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
gtk_css_gadget_add_class (priv->fill_gadget, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_remove_class (priv->fill_gadget, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
gtk_css_gadget_add_class (priv->fill_gadget, GTK_STYLE_CLASS_TOP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-04 04:11:52 +00:00
|
|
|
|
static void
|
2016-01-09 22:00:09 +00:00
|
|
|
|
update_stepper_state (GtkRange *range,
|
|
|
|
|
GtkCssGadget *gadget)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
GtkStateFlags state;
|
|
|
|
|
gboolean arrow_sensitive;
|
|
|
|
|
|
|
|
|
|
state = gtk_widget_get_state_flags (GTK_WIDGET (range));
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if ((!priv->inverted &&
|
|
|
|
|
(gadget == priv->stepper_a_gadget || gadget == priv->stepper_c_gadget)) ||
|
|
|
|
|
(priv->inverted &&
|
|
|
|
|
(gadget == priv->stepper_b_gadget || gadget == priv->stepper_d_gadget)))
|
2015-11-04 04:11:52 +00:00
|
|
|
|
arrow_sensitive = priv->lower_sensitive;
|
|
|
|
|
else
|
|
|
|
|
arrow_sensitive = priv->upper_sensitive;
|
|
|
|
|
|
|
|
|
|
state &= ~(GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT);
|
|
|
|
|
|
|
|
|
|
if ((state & GTK_STATE_FLAG_INSENSITIVE) || !arrow_sensitive)
|
|
|
|
|
{
|
|
|
|
|
state |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location == gadget)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == gadget)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (gadget, state);
|
2015-11-04 04:11:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_steppers_state (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->stepper_a_gadget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
update_stepper_state (range, priv->stepper_a_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->stepper_b_gadget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
update_stepper_state (range, priv->stepper_b_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->stepper_c_gadget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
update_stepper_state (range, priv->stepper_c_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->stepper_d_gadget)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
update_stepper_state (range, priv->stepper_d_gadget);
|
2015-11-04 04:11:52 +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
|
|
|
|
|
|
|
|
|
update_steppers_state (range);
|
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
|
|
|
|
}
|
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_range_set_slider_use_min_size (GtkRange *range,
|
|
|
|
|
gboolean use_min_size)
|
|
|
|
|
{
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (use_min_size != priv->slider_use_min_size)
|
|
|
|
|
{
|
|
|
|
|
priv->slider_use_min_size = use_min_size;
|
|
|
|
|
gtk_css_gadget_queue_resize (priv->slider_gadget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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)))
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gtk_css_gadget_queue_allocate (priv->slider_gadget);
|
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_set_min_slider_size:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @min_size: The slider’s minimum size
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Sets the minimum size of the range’s slider.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
2016-02-27 21:37:01 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: Use the min-height/min-width CSS properties on the slider
|
|
|
|
|
* node.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_min_slider_size (GtkRange *range,
|
2010-08-13 00:49:27 +00:00
|
|
|
|
gint min_size)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
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));
|
|
|
|
|
g_return_if_fail (min_size > 0);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (min_size != priv->min_slider_size)
|
2010-01-22 15:52:56 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->min_slider_size = min_size;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
|
2014-11-29 00:15:36 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_min_slider_size:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* See gtk_range_set_min_slider_size().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The minimum size of the range’s slider.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
2016-02-27 21:37:01 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 3.20: Use the min-height/min-width CSS properties on the slider
|
|
|
|
|
* node.
|
2010-01-22 15:52:56 +00:00
|
|
|
|
**/
|
|
|
|
|
gint
|
|
|
|
|
gtk_range_get_min_slider_size (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->min_slider_size;
|
2010-01-22 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
|
|
|
|
measure_one_gadget (GtkCssGadget *gadget,
|
|
|
|
|
int *width_out,
|
|
|
|
|
int *height_out)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (gadget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL, -1,
|
|
|
|
|
width_out, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_css_gadget_get_preferred_size (gadget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL, -1,
|
|
|
|
|
height_out, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* This function returns the area that contains the range’s trough
|
2010-01-22 15:52:56 +00:00
|
|
|
|
* and its steppers, in widget->window coordinates.
|
|
|
|
|
*
|
|
|
|
|
* This function is useful mainly for #GtkRange subclasses.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.20
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_get_range_rect (GtkRange *range,
|
|
|
|
|
GdkRectangle *range_rect)
|
|
|
|
|
{
|
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));
|
|
|
|
|
g_return_if_fail (range_rect != NULL);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
2016-02-24 22:29:52 +00:00
|
|
|
|
gtk_css_gadget_get_margin_box (priv->contents_gadget, 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;
|
|
|
|
|
|
2016-03-06 02:56:14 +00:00
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &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
|
|
|
|
}
|
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_lower_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @sensitivity: the lower stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'lower' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2006-05-08 14:50:33 +00:00
|
|
|
|
* Since: 2.10
|
2005-11-11 12:48:29 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
|
|
|
|
|
GtkSensitivityType sensitivity)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->lower_sensitivity != sensitivity)
|
2005-11-11 12:48:29 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->lower_sensitivity = sensitivity;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_LOWER_STEPPER_SENSITIVITY]);
|
2005-11-11 12:48:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_lower_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'lower' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The lower stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
|
|
|
|
**/
|
|
|
|
|
GtkSensitivityType
|
|
|
|
|
gtk_range_get_lower_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_SENSITIVITY_AUTO);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->lower_sensitivity;
|
2005-11-11 12:48:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_set_upper_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @sensitivity: the upper stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'upper' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2006-05-08 14:50:33 +00:00
|
|
|
|
* Since: 2.10
|
2005-11-11 12:48:29 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
|
|
|
|
|
GtkSensitivityType sensitivity)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-11-11 12:48:29 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv = range->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->upper_sensitivity != sensitivity)
|
2005-11-11 12:48:29 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->upper_sensitivity = sensitivity;
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2014-11-29 00:23:54 +00:00
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
2006-07-18 14:22:38 +00:00
|
|
|
|
|
2015-09-06 14:42:50 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_UPPER_STEPPER_SENSITIVITY]);
|
2005-11-11 12:48:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_range_get_upper_stepper_sensitivity:
|
|
|
|
|
* @range: a #GtkRange
|
|
|
|
|
*
|
|
|
|
|
* Gets the sensitivity policy for the stepper that points to the
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* 'upper' end of the GtkRange’s adjustment.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The upper stepper’s sensitivity policy.
|
2005-11-11 12:48:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.10
|
|
|
|
|
**/
|
|
|
|
|
GtkSensitivityType
|
|
|
|
|
gtk_range_get_upper_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_SENSITIVITY_AUTO);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
return range->priv->upper_sensitivity;
|
2005-11-11 12:48:29 +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
|
|
|
|
{
|
2016-01-09 22:00:09 +00:00
|
|
|
|
priv->fill_gadget = gtk_css_custom_gadget_new ("fill",
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
priv->trough_gadget, NULL,
|
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
|
NULL, NULL);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->fill_gadget,
|
|
|
|
|
gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
|
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
|
|
|
|
|
{
|
2016-03-01 20:48:01 +00:00
|
|
|
|
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->fill_gadget), NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
g_clear_object (&priv->fill_gadget);
|
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
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
g_clear_object (&priv->drag_gesture);
|
|
|
|
|
g_clear_object (&priv->multipress_gesture);
|
2014-05-26 12:02:30 +00:00
|
|
|
|
g_clear_object (&priv->long_press_gesture);
|
2013-07-18 21:35:42 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
g_clear_object (&priv->gadget);
|
2016-02-24 21:28:54 +00:00
|
|
|
|
g_clear_object (&priv->contents_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
g_clear_object (&priv->trough_gadget);
|
|
|
|
|
g_clear_object (&priv->fill_gadget);
|
|
|
|
|
g_clear_object (&priv->highlight_gadget);
|
|
|
|
|
g_clear_object (&priv->slider_gadget);
|
|
|
|
|
g_clear_object (&priv->stepper_a_gadget);
|
|
|
|
|
g_clear_object (&priv->stepper_b_gadget);
|
|
|
|
|
g_clear_object (&priv->stepper_c_gadget);
|
|
|
|
|
g_clear_object (&priv->stepper_d_gadget);
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
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
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_range_measure_trough (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer user_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
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
|
|
|
|
|
2016-02-23 02:11:02 +00:00
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->slider_gadget,
|
2016-03-05 01:28:04 +00:00
|
|
|
|
orientation, -1,
|
2016-02-23 02:11:02 +00:00
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (priv->fill_gadget)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->fill_gadget,
|
|
|
|
|
orientation, for_size,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
*minimum = MAX (*minimum, min);
|
|
|
|
|
*natural = MAX (*natural, nat);
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
if (priv->highlight_gadget)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->highlight_gadget,
|
|
|
|
|
orientation, for_size,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
*minimum = MAX (*minimum, min);
|
|
|
|
|
*natural = MAX (*natural, nat);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_range_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer user_data)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
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 */
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->contents_gadget,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
orientation,
|
|
|
|
|
-1,
|
2016-02-23 02:11:02 +00:00
|
|
|
|
minimum, natural,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
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-01-09 22:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_size_request (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->gadget, orientation, -1,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_get_preferred_width (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gtk_range_size_request (widget, GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
minimum, natural);
|
2010-10-27 12:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_get_preferred_height (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
2016-01-19 09:22:33 +00:00
|
|
|
|
gtk_range_size_request (widget, GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
minimum, natural);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
}
|
2010-10-27 12:10:40 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_allocate_trough (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
GtkAllocation slider_alloc, widget_alloc;
|
|
|
|
|
|
|
|
|
|
/* Slider */
|
|
|
|
|
gtk_range_calc_marks (range);
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (range);
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &widget_alloc);
|
|
|
|
|
gtk_range_compute_slider_position (range,
|
|
|
|
|
gtk_adjustment_get_value (priv->adjustment),
|
|
|
|
|
&slider_alloc);
|
|
|
|
|
slider_alloc.x += widget_alloc.x;
|
|
|
|
|
slider_alloc.y += widget_alloc.y;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->slider_gadget,
|
|
|
|
|
&slider_alloc,
|
|
|
|
|
gtk_widget_get_allocated_baseline (widget),
|
|
|
|
|
out_clip);
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->fill_gadget,
|
|
|
|
|
&fill_alloc,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
baseline,
|
2016-01-09 22:00:09 +00:00
|
|
|
|
&fill_clip);
|
|
|
|
|
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-02-23 05:19:03 +00:00
|
|
|
|
highlight_alloc = *allocation;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (!should_invert (range))
|
|
|
|
|
{
|
2016-02-23 05:19:03 +00:00
|
|
|
|
highlight_alloc.x = allocation->x;
|
|
|
|
|
highlight_alloc.width = slider_alloc.x + slider_alloc.width / 2 - allocation->x;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
highlight_alloc.x = slider_alloc.x + slider_alloc.width / 2;
|
2016-02-23 05:19:03 +00:00
|
|
|
|
highlight_alloc.width = allocation->x + allocation->width - highlight_alloc.x;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!should_invert (range))
|
|
|
|
|
{
|
2016-02-23 05:19:03 +00:00
|
|
|
|
highlight_alloc.y = allocation->y;
|
|
|
|
|
highlight_alloc.height = slider_alloc.y + slider_alloc.height / 2 - allocation->y;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
highlight_alloc.y = slider_alloc.y + slider_alloc.height / 2;
|
2016-02-23 05:19:03 +00:00
|
|
|
|
highlight_alloc.height = allocation->y + allocation->height - highlight_alloc.y;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->highlight_gadget,
|
|
|
|
|
&highlight_alloc,
|
|
|
|
|
baseline,
|
|
|
|
|
&highlight_clip);
|
|
|
|
|
gdk_rectangle_union (out_clip, &highlight_clip, out_clip);
|
|
|
|
|
}
|
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
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_range_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data)
|
2016-01-19 09:22:33 +00:00
|
|
|
|
{
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
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);
|
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
measure_one_gadget (priv->contents_gadget, &box_min_width, &box_min_height);
|
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
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
box_alloc.x = border.left + allocation->x;
|
|
|
|
|
box_alloc.y = border.top + allocation->y;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
box_alloc.width = box_min_width;
|
|
|
|
|
box_alloc.height = box_min_height;
|
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_css_gadget_allocate (priv->contents_gadget,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
&box_alloc,
|
2016-02-24 21:28:54 +00:00
|
|
|
|
baseline,
|
2016-01-19 09:22:33 +00:00
|
|
|
|
out_clip);
|
|
|
|
|
|
|
|
|
|
/* TODO: we should compute a proper clip from get_range_border(),
|
|
|
|
|
* but this will at least give us outset shadows.
|
|
|
|
|
*/
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gdk_rectangle_union (out_clip, allocation, out_clip);
|
2016-01-19 09:22:33 +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_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2016-02-23 02:11:02 +00:00
|
|
|
|
GtkAllocation clip;
|
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-11 21:03:15 +00:00
|
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
|
if (gtk_widget_get_realized (widget))
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_move_resize (priv->event_window,
|
2010-08-11 21:03:15 +00:00
|
|
|
|
allocation->x, allocation->y,
|
|
|
|
|
allocation->width, allocation->height);
|
2014-11-08 17:55:03 +00:00
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_css_gadget_allocate (priv->gadget,
|
|
|
|
|
allocation,
|
|
|
|
|
gtk_widget_get_allocated_baseline (widget),
|
|
|
|
|
&clip);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_widget_set_clip (widget, &clip);
|
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_realize (GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GtkAllocation allocation;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
GdkWindow *window;
|
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
|
|
|
|
GdkWindowAttr attributes;
|
2010-10-08 05:37:33 +00:00
|
|
|
|
gint attributes_mask;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-03-06 10:51:33 +00:00
|
|
|
|
gtk_widget_set_realized (widget, TRUE);
|
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-11 21:03:15 +00:00
|
|
|
|
window = gtk_widget_get_parent_window (widget);
|
|
|
|
|
gtk_widget_set_window (widget, window);
|
|
|
|
|
g_object_ref (window);
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
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
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
2010-08-11 21:03:15 +00:00
|
|
|
|
attributes.x = allocation.x;
|
|
|
|
|
attributes.y = allocation.y;
|
|
|
|
|
attributes.width = allocation.width;
|
|
|
|
|
attributes.height = allocation.height;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
attributes.wclass = GDK_INPUT_ONLY;
|
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
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget);
|
2015-03-22 04:49:16 +00:00
|
|
|
|
attributes.event_mask |= GDK_BUTTON_PRESS_MASK |
|
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
|
GDK_SCROLL_MASK |
|
|
|
|
|
GDK_SMOOTH_SCROLL_MASK |
|
|
|
|
|
GDK_ENTER_NOTIFY_MASK |
|
|
|
|
|
GDK_LEAVE_NOTIFY_MASK |
|
|
|
|
|
GDK_POINTER_MOTION_MASK;
|
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-11-15 21:04:51 +00:00
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_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
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
2001-11-15 21:04:51 +00:00
|
|
|
|
&attributes, attributes_mask);
|
2013-02-05 08:36:49 +00:00
|
|
|
|
gtk_widget_register_window (widget, priv->event_window);
|
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_unrealize (GtkWidget *widget)
|
2000-07-14 20:24:14 +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;
|
2000-07-14 20:24:14 +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_remove_step_timer (range);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2013-02-05 08:36:49 +00:00
|
|
|
|
gtk_widget_unregister_window (widget, priv->event_window);
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_destroy (priv->event_window);
|
|
|
|
|
priv->event_window = NULL;
|
2008-08-12 09:06:34 +00:00
|
|
|
|
|
2008-08-12 09:44:32 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->unrealize (widget);
|
2000-07-14 20:24:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_range_map (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
|
|
|
|
gdk_window_show (priv->event_window);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_range_parent_class)->map (widget);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_unmap (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2010-08-16 06:27:49 +00:00
|
|
|
|
|
2005-03-22 17:36:41 +00:00
|
|
|
|
stop_scrolling (range);
|
|
|
|
|
|
2010-08-16 06:27:49 +00:00
|
|
|
|
gdk_window_hide (priv->event_window);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_gadget &&
|
|
|
|
|
!(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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_gadget)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
2010-12-13 12:43:52 +00:00
|
|
|
|
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->slider_gadget, state);
|
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);
|
|
|
|
|
|
2016-03-09 19:15:40 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->contents_gadget, state);
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == priv->trough_gadget &&
|
|
|
|
|
!(state & GTK_STATE_FLAG_INSENSITIVE))
|
2015-11-06 16:53:42 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location == priv->trough_gadget)
|
2015-11-06 16:53:42 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
|
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->trough_gadget, state);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->highlight_gadget)
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->highlight_gadget, state);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
if (priv->fill_gadget)
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->fill_gadget, state);
|
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);
|
|
|
|
|
update_steppers_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
|
|
|
|
|
gtk_range_render_trough (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
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))
|
|
|
|
|
gtk_color_scale_draw_trough (GTK_COLOR_SCALE (widget), cr, x, y, width, height);
|
|
|
|
|
|
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)
|
|
|
|
|
gtk_css_gadget_draw (priv->fill_gadget, cr);
|
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
|
|
|
|
gtk_css_gadget_draw (priv->highlight_gadget, cr);
|
|
|
|
|
|
|
|
|
|
return gtk_widget_has_visible_focus (widget);
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-26 06:53:57 +00:00
|
|
|
|
static gboolean
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_range_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2016-02-24 21:28:54 +00:00
|
|
|
|
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
|
2007-09-06 11:44:22 +00:00
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2016-02-23 02:54:24 +00:00
|
|
|
|
|
2016-03-09 16:27:01 +00:00
|
|
|
|
gtk_css_gadget_draw (priv->contents_gadget, cr);
|
2016-02-23 02:54:16 +00:00
|
|
|
|
|
2016-02-28 18:00:15 +00:00
|
|
|
|
/* Draw the slider last, so that e.g. the focus ring stays below it */
|
|
|
|
|
gtk_css_gadget_draw (priv->slider_gadget, cr);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_range_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr)
|
|
|
|
|
{
|
|
|
|
|
GtkRange *range = GTK_RANGE (widget);
|
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_draw (priv->gadget, cr);
|
|
|
|
|
|
2015-12-02 19:58:58 +00:00
|
|
|
|
return GDK_EVENT_PROPAGATE;
|
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
|
|
|
|
|
range_grab_add (GtkRange *range,
|
2016-03-27 03:50:59 +00:00
|
|
|
|
GtkCssGadget *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
|
|
|
|
|
* priv->event_window, which pretty much guarantees this
|
|
|
|
|
* is the only widget receiving the pointer events.
|
|
|
|
|
*/
|
2010-08-16 06:27:49 +00:00
|
|
|
|
priv->grab_location = location;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
gtk_css_gadget_queue_allocate (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);
|
|
|
|
|
update_steppers_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
|
|
|
|
gtk_css_gadget_queue_allocate (priv->grab_location);
|
|
|
|
|
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);
|
|
|
|
|
update_steppers_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
|
|
|
|
guint grab_button;
|
2003-12-13 01:33:17 +00:00
|
|
|
|
gboolean invert;
|
|
|
|
|
|
|
|
|
|
invert = should_invert (range);
|
2014-06-05 13:29:14 +00:00
|
|
|
|
grab_button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (range->priv->multipress_gesture));
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (!priv->grab_location)
|
|
|
|
|
return GTK_SCROLL_NONE;
|
|
|
|
|
|
|
|
|
|
/* Backward stepper */
|
|
|
|
|
if (priv->grab_location == priv->stepper_a_gadget ||
|
|
|
|
|
priv->grab_location == priv->stepper_c_gadget)
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
switch (grab_button)
|
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-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_PRIMARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD;
|
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
|
|
|
|
break;
|
2015-07-12 04:23:32 +00:00
|
|
|
|
case GDK_BUTTON_SECONDARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_PAGE_FORWARD : GTK_SCROLL_PAGE_BACKWARD;
|
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
|
|
|
|
break;
|
2015-07-12 04:23:32 +00:00
|
|
|
|
case GDK_BUTTON_MIDDLE:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_END : GTK_SCROLL_START;
|
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
|
|
|
|
break;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
default:
|
|
|
|
|
return GTK_SCROLL_NONE;
|
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
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
/* Forward stepper */
|
|
|
|
|
if (priv->grab_location == priv->stepper_b_gadget ||
|
|
|
|
|
priv->grab_location == priv->stepper_d_gadget)
|
|
|
|
|
{
|
2014-06-05 13:29:14 +00:00
|
|
|
|
switch (grab_button)
|
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-25 17:51:12 +00:00
|
|
|
|
case GDK_BUTTON_PRIMARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_STEP_FORWARD;
|
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
|
|
|
|
break;
|
2015-07-12 04:23:32 +00:00
|
|
|
|
case GDK_BUTTON_SECONDARY:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_PAGE_BACKWARD : GTK_SCROLL_PAGE_FORWARD;
|
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
|
|
|
|
break;
|
2015-07-12 04:23:32 +00:00
|
|
|
|
case GDK_BUTTON_MIDDLE:
|
2003-12-13 01:33:17 +00:00
|
|
|
|
return invert ? GTK_SCROLL_START : GTK_SCROLL_END;
|
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
|
|
|
|
break;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
default:
|
|
|
|
|
return GTK_SCROLL_NONE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-10-22 13:00:13 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
/* In the trough */
|
|
|
|
|
if (priv->grab_location == priv->trough_gadget)
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
|
2016-03-06 02:56:14 +00:00
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
|
2016-02-24 22:29:52 +00:00
|
|
|
|
gtk_css_gadget_get_content_box (priv->trough_gadget, &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;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
|
|
|
|
|
|
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);
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_gadget && !priv->zoom)
|
2015-02-23 11:42:17 +00:00
|
|
|
|
{
|
2016-03-06 03:07:55 +00:00
|
|
|
|
GtkAllocation slider_alloc;
|
|
|
|
|
|
2016-03-06 02:56:14 +00:00
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &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);
|
2016-03-06 02:56:14 +00:00
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &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);
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_gadget &&
|
2012-02-03 06:41:07 +00:00
|
|
|
|
gdk_event_triggers_context_menu ((GdkEvent *)event))
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->mouse_location == priv->slider_gadget)
|
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);
|
2016-03-27 03:50:59 +00:00
|
|
|
|
range_grab_add (range, priv->slider_gadget);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2016-03-27 03:50:59 +00:00
|
|
|
|
else if (priv->mouse_location == priv->stepper_a_gadget ||
|
|
|
|
|
priv->mouse_location == priv->stepper_b_gadget ||
|
|
|
|
|
priv->mouse_location == priv->stepper_c_gadget ||
|
|
|
|
|
priv->mouse_location == priv->stepper_d_gadget)
|
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
|
|
|
|
GtkScrollType scroll;
|
|
|
|
|
|
2014-06-05 13:29:14 +00:00
|
|
|
|
range_grab_add (range, priv->mouse_location);
|
2010-08-16 06:27:49 +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
|
|
|
|
scroll = range_get_scroll_for_grab (range);
|
2015-02-23 01:02:02 +00:00
|
|
|
|
if (scroll == GTK_SCROLL_START || scroll == GTK_SCROLL_END)
|
|
|
|
|
gtk_range_scroll (range, scroll);
|
|
|
|
|
else if (scroll != GTK_SCROLL_NONE)
|
|
|
|
|
{
|
|
|
|
|
remove_autoscroll (range);
|
|
|
|
|
range->priv->autoscroll_mode = scroll;
|
|
|
|
|
add_autoscroll (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
|
|
|
|
}
|
2016-03-27 03:50:59 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_gadget &&
|
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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
range_grab_add (range, priv->slider_gadget);
|
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);
|
|
|
|
|
}
|
2016-03-27 03:50:59 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_gadget &&
|
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);
|
2016-03-27 03:50:59 +00:00
|
|
|
|
range_grab_add (range, priv->trough_gadget);
|
2015-07-13 22:56:34 +00:00
|
|
|
|
|
|
|
|
|
scroll = range_get_scroll_for_grab (range);
|
|
|
|
|
gtk_range_add_step_timer (range, scroll);
|
|
|
|
|
}
|
2016-03-27 03:50:59 +00:00
|
|
|
|
else if (priv->mouse_location == priv->trough_gadget &&
|
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);
|
2016-03-27 03:50:59 +00:00
|
|
|
|
range_grab_add (range, priv->trough_gadget);
|
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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_gadget);
|
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;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_margin_box (priv->trough_gadget, &trough_alloc);
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2004-02-29 18:21:57 +00:00
|
|
|
|
/**
|
|
|
|
|
* _gtk_range_get_wheel_delta:
|
|
|
|
|
* @range: a #GtkRange
|
2012-01-24 11:12:34 +00:00
|
|
|
|
* @event: A #GdkEventScroll
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2004-02-29 18:21:57 +00:00
|
|
|
|
* Returns a good step value for the mouse wheel.
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A good step value for the mouse wheel.
|
2012-03-05 00:15:32 +00:00
|
|
|
|
*
|
2004-02-29 18:21:57 +00:00
|
|
|
|
* Since: 2.4
|
|
|
|
|
**/
|
|
|
|
|
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-01-24 11:12:34 +00:00
|
|
|
|
gdouble page_size;
|
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-01-24 11:12:34 +00:00
|
|
|
|
page_size = gtk_adjustment_get_page_size (adjustment);
|
2012-03-05 00:15:32 +00:00
|
|
|
|
page_increment = gtk_adjustment_get_page_increment (adjustment);
|
|
|
|
|
|
|
|
|
|
if (GTK_IS_SCROLLBAR (range))
|
|
|
|
|
scroll_unit = pow (page_size, 2.0 / 3.0);
|
|
|
|
|
else
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
GtkAllocation allocation;
|
|
|
|
|
gint size, pos;
|
|
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (range), &allocation);
|
|
|
|
|
|
|
|
|
|
if (range->priv->orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
size = allocation.height;
|
|
|
|
|
pos = range->priv->mouse_y;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
size = allocation.width;
|
|
|
|
|
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
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->grab_location == priv->slider_gadget)
|
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;
|
|
|
|
|
|
|
|
|
|
if (priv->grab_location == priv->slider_gadget)
|
|
|
|
|
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);
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (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);
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (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);
|
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
|
|
|
|
}
|
|
|
|
|
|
2016-03-11 06:27:21 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
rectangle_contains_point (GdkRectangle *rect,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
|
|
|
|
{
|
|
|
|
|
return (x >= rect->x) && (x < rect->x + rect->width) &&
|
|
|
|
|
(y >= rect->y) && (y < rect->y + rect->height);
|
|
|
|
|
}
|
|
|
|
|
|
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;
|
2016-03-27 03:50:59 +00:00
|
|
|
|
GtkCssGadget *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;
|
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
|
|
|
|
|
2016-03-11 06:27:21 +00:00
|
|
|
|
gtk_css_gadget_get_border_box (priv->trough_gadget, &trough_alloc);
|
|
|
|
|
gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
|
|
|
|
|
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;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else if (priv->stepper_a_gadget &&
|
2016-03-03 06:23:11 +00:00
|
|
|
|
gtk_css_gadget_border_box_contains_point (priv->stepper_a_gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->stepper_a_gadget;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else if (priv->stepper_b_gadget &&
|
2016-03-03 06:23:11 +00:00
|
|
|
|
gtk_css_gadget_border_box_contains_point (priv->stepper_b_gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->stepper_b_gadget;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else if (priv->stepper_c_gadget &&
|
2016-03-03 06:23:11 +00:00
|
|
|
|
gtk_css_gadget_border_box_contains_point (priv->stepper_c_gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->stepper_c_gadget;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
else if (priv->stepper_d_gadget &&
|
2016-03-03 06:23:11 +00:00
|
|
|
|
gtk_css_gadget_border_box_contains_point (priv->stepper_d_gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->stepper_d_gadget;
|
2016-03-03 06:23:11 +00:00
|
|
|
|
else if (gtk_css_gadget_border_box_contains_point (priv->slider_gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->slider_gadget;
|
2016-03-11 06:27:21 +00:00
|
|
|
|
else if (rectangle_contains_point (&slider_trace, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->trough_gadget;
|
2016-02-24 21:53:13 +00:00
|
|
|
|
else if (gtk_css_gadget_margin_box_contains_point (priv->gadget, x, y))
|
2016-03-27 03:50:59 +00:00
|
|
|
|
priv->mouse_location = priv->gadget;
|
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)
|
|
|
|
|
gtk_css_gadget_queue_allocate (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);
|
|
|
|
|
gtk_css_gadget_queue_allocate (priv->mouse_location);
|
|
|
|
|
}
|
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);
|
|
|
|
|
update_steppers_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;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkAllocation trough_content_alloc;
|
2016-02-27 21:31:26 +00:00
|
|
|
|
int slider_width, slider_height, min_slider_size;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
measure_one_gadget (priv->slider_gadget, &slider_width, &slider_height);
|
2016-02-24 22:29:52 +00:00
|
|
|
|
gtk_css_gadget_get_content_box (priv->trough_gadget, &trough_content_alloc);
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
min_slider_size = priv->min_slider_size;
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
2016-01-19 09:22:33 +00:00
|
|
|
|
slider_rect->x = trough_content_alloc.x + (int) floor ((trough_content_alloc.width - slider_width) / 2);
|
|
|
|
|
slider_rect->width = slider_width;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
if (priv->slider_use_min_size)
|
|
|
|
|
min_slider_size = slider_height;
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
/* Compute slider position/length */
|
2016-01-19 09:22:33 +00:00
|
|
|
|
top = trough_content_alloc.y;
|
|
|
|
|
bottom = top + trough_content_alloc.height;
|
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
height = MIN (height, trough_content_alloc.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.
|
|
|
|
|
*/
|
2016-01-19 09:22:33 +00:00
|
|
|
|
slider_rect->y = trough_content_alloc.y + (int) floor ((trough_content_alloc.height - slider_height) / 2);
|
|
|
|
|
slider_rect->height = slider_height;
|
2014-11-21 07:24:51 +00:00
|
|
|
|
|
2016-02-27 21:31:26 +00:00
|
|
|
|
if (priv->slider_use_min_size)
|
|
|
|
|
min_slider_size = slider_width;
|
|
|
|
|
|
2014-11-21 07:24:51 +00:00
|
|
|
|
/* Compute slider position/length */
|
2016-01-19 09:22:33 +00:00
|
|
|
|
left = trough_content_alloc.x;
|
|
|
|
|
right = left + trough_content_alloc.width;
|
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
2016-01-19 09:22:33 +00:00
|
|
|
|
width = MIN (width, trough_content_alloc.width);
|
|
|
|
|
|
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;
|
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gtk_css_gadget_set_visible (priv->slider_gadget, visible);
|
2015-11-05 12:23:54 +00:00
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
gtk_css_gadget_queue_allocate (priv->slider_gadget);
|
2014-11-29 00:47:31 +00:00
|
|
|
|
|
|
|
|
|
if (priv->has_origin)
|
2016-03-27 03:50:59 +00:00
|
|
|
|
gtk_css_gadget_queue_allocate (priv->trough_gadget);
|
2014-11-29 00:47:31 +00:00
|
|
|
|
|
|
|
|
|
gtk_range_update_mouse_location (range);
|
2014-11-29 00:23:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_range_calc_stepper_sensitivity (GtkRange *range)
|
|
|
|
|
{
|
2014-11-29 01:17:27 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
gboolean was_upper_sensitive, was_lower_sensitive;
|
|
|
|
|
|
|
|
|
|
was_upper_sensitive = priv->upper_sensitive;
|
|
|
|
|
switch (priv->upper_sensitivity)
|
|
|
|
|
{
|
|
|
|
|
case GTK_SENSITIVITY_AUTO:
|
|
|
|
|
priv->upper_sensitive =
|
|
|
|
|
(gtk_adjustment_get_value (priv->adjustment) <
|
|
|
|
|
(gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_ON:
|
|
|
|
|
priv->upper_sensitive = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_OFF:
|
|
|
|
|
priv->upper_sensitive = FALSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
was_lower_sensitive = priv->lower_sensitive;
|
|
|
|
|
switch (priv->lower_sensitivity)
|
|
|
|
|
{
|
|
|
|
|
case GTK_SENSITIVITY_AUTO:
|
|
|
|
|
priv->lower_sensitive =
|
|
|
|
|
(gtk_adjustment_get_value (priv->adjustment) > gtk_adjustment_get_lower (priv->adjustment));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_ON:
|
|
|
|
|
priv->lower_sensitive = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SENSITIVITY_OFF:
|
|
|
|
|
priv->lower_sensitive = FALSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Too many side effects can influence which stepper reacts to wat condition.
|
|
|
|
|
* So we just invalidate them all.
|
|
|
|
|
*/
|
|
|
|
|
if (was_upper_sensitive != priv->upper_sensitive ||
|
|
|
|
|
was_lower_sensitive != priv->lower_sensitive)
|
|
|
|
|
{
|
2015-11-04 04:11:52 +00:00
|
|
|
|
update_steppers_state (range);
|
|
|
|
|
|
2016-03-27 03:50:59 +00:00
|
|
|
|
if (priv->stepper_a_gadget)
|
|
|
|
|
gtk_css_gadget_queue_allocate (priv->stepper_a_gadget);
|
|
|
|
|
if (priv->stepper_b_gadget)
|
|
|
|
|
gtk_css_gadget_queue_allocate (priv->stepper_b_gadget);
|
|
|
|
|
if (priv->stepper_c_gadget)
|
|
|
|
|
gtk_css_gadget_queue_allocate (priv->stepper_c_gadget);
|
|
|
|
|
if (priv->stepper_d_gadget)
|
|
|
|
|
gtk_css_gadget_queue_allocate (priv->stepper_d_gadget);
|
1997-11-24 22:37:52 +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);
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2016-01-09 22:00:09 +00:00
|
|
|
|
priv->highlight_gadget = gtk_css_custom_gadget_new ("highlight",
|
|
|
|
|
GTK_WIDGET (range),
|
|
|
|
|
priv->trough_gadget, NULL,
|
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
|
NULL, NULL);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->highlight_gadget,
|
|
|
|
|
gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
|
2016-03-04 19:56:08 +00:00
|
|
|
|
|
|
|
|
|
update_highlight_position (range);
|
2015-11-07 00:25:58 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-01 20:48:01 +00:00
|
|
|
|
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->highlight_gadget), NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
g_clear_object (&priv->highlight_gadget);
|
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
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
static void
|
|
|
|
|
sync_stepper_gadget (GtkRange *range,
|
|
|
|
|
gboolean should_have_stepper,
|
|
|
|
|
GtkCssGadget **gadget_ptr,
|
|
|
|
|
const gchar *class,
|
|
|
|
|
GtkCssImageBuiltinType image_type,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
GtkCssGadget *prev_sibling)
|
2015-11-04 04:11:52 +00:00
|
|
|
|
{
|
2016-01-09 22:00:09 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkCssGadget *gadget;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gboolean has_stepper;
|
2016-01-19 09:22:33 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
has_stepper = (*gadget_ptr != NULL);
|
|
|
|
|
if (has_stepper == should_have_stepper)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!should_have_stepper)
|
|
|
|
|
{
|
2016-02-24 20:01:07 +00:00
|
|
|
|
if (*gadget_ptr != NULL)
|
2016-03-01 20:48:01 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_css_node_set_parent (gtk_css_gadget_get_node (*gadget_ptr), NULL);
|
|
|
|
|
gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->contents_gadget), *gadget_ptr);
|
|
|
|
|
}
|
2016-01-09 22:00:09 +00:00
|
|
|
|
g_clear_object (gadget_ptr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (range);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
widget_node = gtk_widget_get_css_node (widget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
gadget = gtk_builtin_icon_new ("button",
|
|
|
|
|
widget,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (gadget), image_type);
|
|
|
|
|
gtk_css_gadget_add_class (gadget, class);
|
2016-01-17 00:27:24 +00:00
|
|
|
|
gtk_css_gadget_set_state (gadget, gtk_css_node_get_state (widget_node));
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
2016-02-24 21:28:54 +00:00
|
|
|
|
gtk_box_gadget_insert_gadget_after (GTK_BOX_GADGET (priv->contents_gadget), prev_sibling,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
gadget, FALSE, FALSE, GTK_ALIGN_FILL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
*gadget_ptr = gadget;
|
2015-11-04 04:11:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-13 01:22:59 +00:00
|
|
|
|
void
|
2015-11-04 04:11:52 +00:00
|
|
|
|
_gtk_range_set_steppers (GtkRange *range,
|
|
|
|
|
gboolean has_a,
|
|
|
|
|
gboolean has_b,
|
|
|
|
|
gboolean has_c,
|
|
|
|
|
gboolean has_d)
|
2010-08-13 01:22:59 +00:00
|
|
|
|
{
|
2015-11-04 04:11:52 +00:00
|
|
|
|
GtkRangePrivate *priv = range->priv;
|
|
|
|
|
|
2016-01-09 22:00:09 +00:00
|
|
|
|
sync_stepper_gadget (range,
|
|
|
|
|
has_a, &priv->stepper_a_gadget,
|
|
|
|
|
"up",
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
GTK_CSS_IMAGE_BUILTIN_ARROW_UP : GTK_CSS_IMAGE_BUILTIN_ARROW_LEFT,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
NULL);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
sync_stepper_gadget (range,
|
|
|
|
|
has_b, &priv->stepper_b_gadget,
|
|
|
|
|
"down",
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
GTK_CSS_IMAGE_BUILTIN_ARROW_DOWN : GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
priv->stepper_a_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
sync_stepper_gadget (range,
|
|
|
|
|
has_c, &priv->stepper_c_gadget,
|
|
|
|
|
"up",
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
GTK_CSS_IMAGE_BUILTIN_ARROW_UP : GTK_CSS_IMAGE_BUILTIN_ARROW_LEFT,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
priv->trough_gadget);
|
2016-01-09 22:00:09 +00:00
|
|
|
|
|
|
|
|
|
sync_stepper_gadget (range,
|
|
|
|
|
has_d, &priv->stepper_d_gadget,
|
|
|
|
|
"down",
|
|
|
|
|
priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
|
|
|
|
GTK_CSS_IMAGE_BUILTIN_ARROW_DOWN : GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT,
|
2016-02-24 20:01:07 +00:00
|
|
|
|
priv->stepper_c_gadget ? priv->stepper_c_gadget : priv->trough_gadget);
|
2014-11-25 21:00:11 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (range));
|
2010-08-13 01:22:59 +00:00
|
|
|
|
}
|
2015-11-05 11:47:10 +00:00
|
|
|
|
|
2016-02-21 23:01:04 +00:00
|
|
|
|
GtkCssGadget *
|
|
|
|
|
gtk_range_get_slider_gadget (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
return range->priv->slider_gadget;
|
|
|
|
|
}
|
2016-03-06 05:08:47 +00:00
|
|
|
|
|
|
|
|
|
GtkCssGadget *
|
|
|
|
|
gtk_range_get_gadget (GtkRange *range)
|
|
|
|
|
{
|
|
|
|
|
return range->priv->gadget;
|
|
|
|
|
}
|