1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "gtkmain.h"
|
|
|
|
#include "gtkrange.h"
|
|
|
|
#include "gtksignal.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define SCROLL_TIMER_LENGTH 20
|
|
|
|
#define SCROLL_INITIAL_DELAY 100
|
|
|
|
#define SCROLL_DELAY_LENGTH 300
|
|
|
|
|
|
|
|
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
|
|
|
|
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
|
|
|
enum {
|
|
|
|
ARG_0,
|
|
|
|
ARG_UPDATE_POLICY
|
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void gtk_range_class_init (GtkRangeClass *klass);
|
|
|
|
static void gtk_range_init (GtkRange *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
|
|
|
static void gtk_range_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
static void gtk_range_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
static void gtk_range_destroy (GtkObject *object);
|
1998-01-30 23:47:09 +00:00
|
|
|
static void gtk_range_finalize (GtkObject *object);
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_range_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area);
|
|
|
|
static void gtk_range_draw_focus (GtkWidget *widget);
|
|
|
|
static void gtk_range_unrealize (GtkWidget *widget);
|
|
|
|
static gint gtk_range_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_range_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_range_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_range_motion_notify (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
static gint gtk_range_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
|
|
|
static gint gtk_range_enter_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_range_leave_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_range_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_range_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
2000-02-18 20:02:24 +00:00
|
|
|
static gint gtk_range_scroll_event (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event);
|
1998-05-03 22:41:32 +00:00
|
|
|
static void gtk_range_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_real_range_draw_trough (GtkRange *range);
|
|
|
|
static void gtk_real_range_draw_slider (GtkRange *range);
|
|
|
|
static gint gtk_real_range_timer (GtkRange *range);
|
1998-03-10 04:37:26 +00:00
|
|
|
static gint gtk_range_scroll (GtkRange *range,
|
|
|
|
gfloat jump_perc);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void gtk_range_add_timer (GtkRange *range);
|
|
|
|
static void gtk_range_remove_timer (GtkRange *range);
|
|
|
|
|
|
|
|
static void gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void gtk_range_trough_hdims (GtkRange *range,
|
|
|
|
gint *left,
|
|
|
|
gint *right);
|
|
|
|
static void gtk_range_trough_vdims (GtkRange *range,
|
|
|
|
gint *top,
|
|
|
|
gint *bottom);
|
|
|
|
|
|
|
|
static GtkWidgetClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
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
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_range_get_type (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
static GtkType range_type = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!range_type)
|
|
|
|
{
|
1998-11-30 19:07:15 +00:00
|
|
|
static const GtkTypeInfo range_info =
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
"GtkRange",
|
|
|
|
sizeof (GtkRange),
|
|
|
|
sizeof (GtkRangeClass),
|
|
|
|
(GtkClassInitFunc) gtk_range_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_range_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
1998-06-28 07:46:10 +00:00
|
|
|
(GtkClassInitFunc) NULL,
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
range_type = gtk_type_unique (GTK_TYPE_WIDGET, &range_info);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return range_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_class_init (GtkRangeClass *class)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
|
|
|
object_class = (GtkObjectClass*) class;
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
|
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
|
|
|
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_object_add_arg_type ("GtkRange::update_policy",
|
|
|
|
GTK_TYPE_UPDATE_TYPE,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_UPDATE_POLICY);
|
|
|
|
|
|
|
|
object_class->set_arg = gtk_range_set_arg;
|
|
|
|
object_class->get_arg = gtk_range_get_arg;
|
|
|
|
object_class->destroy = gtk_range_destroy;
|
1998-01-30 23:47:09 +00:00
|
|
|
object_class->finalize = gtk_range_finalize;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
widget_class->draw = gtk_range_draw;
|
|
|
|
widget_class->draw_focus = gtk_range_draw_focus;
|
|
|
|
widget_class->unrealize = gtk_range_unrealize;
|
|
|
|
widget_class->expose_event = gtk_range_expose;
|
|
|
|
widget_class->button_press_event = gtk_range_button_press;
|
|
|
|
widget_class->button_release_event = gtk_range_button_release;
|
|
|
|
widget_class->motion_notify_event = gtk_range_motion_notify;
|
2000-02-18 20:02:24 +00:00
|
|
|
widget_class->scroll_event = gtk_range_scroll_event;
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class->key_press_event = gtk_range_key_press;
|
|
|
|
widget_class->enter_notify_event = gtk_range_enter_notify;
|
|
|
|
widget_class->leave_notify_event = gtk_range_leave_notify;
|
|
|
|
widget_class->focus_in_event = gtk_range_focus_in;
|
|
|
|
widget_class->focus_out_event = gtk_range_focus_out;
|
1998-05-03 22:41:32 +00:00
|
|
|
widget_class->style_set = gtk_range_style_set;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
class->slider_width = 11;
|
|
|
|
class->stepper_size = 11;
|
|
|
|
class->stepper_slider_spacing = 1;
|
|
|
|
class->min_slider_size = 7;
|
|
|
|
class->trough = 1;
|
|
|
|
class->slider = 2;
|
|
|
|
class->step_forw = 3;
|
|
|
|
class->step_back = 4;
|
|
|
|
class->draw_background = NULL;
|
1998-11-06 22:05:02 +00:00
|
|
|
class->clear_background = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
class->draw_trough = gtk_real_range_draw_trough;
|
|
|
|
class->draw_slider = gtk_real_range_draw_slider;
|
|
|
|
class->draw_step_forw = NULL;
|
|
|
|
class->draw_step_back = NULL;
|
|
|
|
class->trough_click = NULL;
|
|
|
|
class->trough_keys = NULL;
|
|
|
|
class->motion = NULL;
|
|
|
|
class->timer = gtk_real_range_timer;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
gtk_range_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
range = GTK_RANGE (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
|
|
|
case ARG_UPDATE_POLICY:
|
|
|
|
gtk_range_set_update_policy (range, GTK_VALUE_ENUM (*arg));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
range = GTK_RANGE (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
|
|
|
case ARG_UPDATE_POLICY:
|
|
|
|
GTK_VALUE_ENUM (*arg) = range->policy;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
arg->type = GTK_TYPE_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_range_init (GtkRange *range)
|
|
|
|
{
|
|
|
|
range->trough = NULL;
|
|
|
|
range->slider = NULL;
|
|
|
|
range->step_forw = NULL;
|
|
|
|
range->step_back = NULL;
|
|
|
|
|
|
|
|
range->x_click_point = 0;
|
|
|
|
range->y_click_point = 0;
|
|
|
|
range->button = 0;
|
|
|
|
range->digits = -1;
|
|
|
|
range->policy = GTK_UPDATE_CONTINUOUS;
|
|
|
|
range->scroll_type = GTK_SCROLL_NONE;
|
|
|
|
range->in_child = 0;
|
|
|
|
range->click_child = 0;
|
|
|
|
range->need_timer = FALSE;
|
|
|
|
range->timer = 0;
|
|
|
|
range->old_value = 0.0;
|
|
|
|
range->old_lower = 0.0;
|
|
|
|
range->old_upper = 0.0;
|
|
|
|
range->old_page_size = 0.0;
|
|
|
|
range->adjustment = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkAdjustment*
|
|
|
|
gtk_range_get_adjustment (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (range != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), NULL);
|
|
|
|
|
|
|
|
return range->adjustment;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_set_update_policy (GtkRange *range,
|
|
|
|
GtkUpdateType policy)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
range->policy = policy;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_set_adjustment (GtkRange *range,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (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
|
|
|
|
|
|
|
if (!adjustment)
|
|
|
|
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
|
|
|
else
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1997-12-18 02:17:14 +00:00
|
|
|
if (range->adjustment != adjustment)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1997-12-18 02:17:14 +00:00
|
|
|
if (range->adjustment)
|
|
|
|
{
|
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (range->adjustment),
|
|
|
|
(gpointer) range);
|
|
|
|
gtk_object_unref (GTK_OBJECT (range->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
|
|
|
|
1997-12-18 02:17:14 +00:00
|
|
|
range->adjustment = 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
|
|
|
gtk_object_ref (GTK_OBJECT (adjustment));
|
|
|
|
gtk_object_sink (GTK_OBJECT (adjustment));
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
|
|
|
|
(GtkSignalFunc) gtk_range_adjustment_changed,
|
|
|
|
(gpointer) range);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) gtk_range_adjustment_value_changed,
|
|
|
|
(gpointer) range);
|
|
|
|
|
|
|
|
range->old_value = adjustment->value;
|
|
|
|
range->old_lower = adjustment->lower;
|
|
|
|
range->old_upper = adjustment->upper;
|
|
|
|
range->old_page_size = adjustment->page_size;
|
|
|
|
|
|
|
|
gtk_range_adjustment_changed (adjustment, (gpointer) range);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_draw_background (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->trough && RANGE_CLASS (range)->draw_background)
|
|
|
|
(* RANGE_CLASS (range)->draw_background) (range);
|
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
void
|
|
|
|
gtk_range_clear_background (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->trough && RANGE_CLASS (range)->clear_background)
|
|
|
|
(* RANGE_CLASS (range)->clear_background) (range);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_range_draw_trough (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->trough && RANGE_CLASS (range)->draw_trough)
|
|
|
|
(* RANGE_CLASS (range)->draw_trough) (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_draw_slider (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->slider && RANGE_CLASS (range)->draw_slider)
|
|
|
|
(* RANGE_CLASS (range)->draw_slider) (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_draw_step_forw (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->step_forw && RANGE_CLASS (range)->draw_step_forw)
|
|
|
|
(* RANGE_CLASS (range)->draw_step_forw) (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_draw_step_back (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->step_back && RANGE_CLASS (range)->draw_step_back)
|
|
|
|
(* RANGE_CLASS (range)->draw_step_back) (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_slider_update (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (RANGE_CLASS (range)->slider_update)
|
|
|
|
(* RANGE_CLASS (range)->slider_update) (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gtk_range_trough_click (GtkRange *range,
|
|
|
|
gint x,
|
1998-03-10 04:37:26 +00:00
|
|
|
gint y,
|
|
|
|
gfloat *jump_perc)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
|
|
|
|
|
|
|
|
if (RANGE_CLASS (range)->trough_click)
|
1998-03-10 04:37:26 +00:00
|
|
|
return (* RANGE_CLASS (range)->trough_click) (range, x, y, jump_perc);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
return GTK_TROUGH_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_default_hslider_update (GtkRange *range)
|
|
|
|
{
|
|
|
|
gint left;
|
|
|
|
gint right;
|
|
|
|
gint x;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (range))
|
|
|
|
{
|
|
|
|
gtk_range_trough_hdims (range, &left, &right);
|
|
|
|
x = left;
|
|
|
|
|
|
|
|
if (range->adjustment->value < range->adjustment->lower)
|
|
|
|
{
|
|
|
|
range->adjustment->value = range->adjustment->lower;
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else if (range->adjustment->value > range->adjustment->upper)
|
|
|
|
{
|
|
|
|
range->adjustment->value = range->adjustment->upper;
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (range->adjustment->lower != (range->adjustment->upper - range->adjustment->page_size))
|
|
|
|
x += ((right - left) * (range->adjustment->value - range->adjustment->lower) /
|
|
|
|
(range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
|
|
|
|
|
|
|
|
if (x < left)
|
|
|
|
x = left;
|
|
|
|
else if (x > right)
|
|
|
|
x = right;
|
|
|
|
|
|
|
|
gdk_window_move (range->slider, x, GTK_WIDGET (range)->style->klass->ythickness);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_default_vslider_update (GtkRange *range)
|
|
|
|
{
|
|
|
|
gint top;
|
|
|
|
gint bottom;
|
|
|
|
gint y;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (range))
|
|
|
|
{
|
|
|
|
gtk_range_trough_vdims (range, &top, &bottom);
|
|
|
|
y = top;
|
|
|
|
|
|
|
|
if (range->adjustment->value < range->adjustment->lower)
|
|
|
|
{
|
|
|
|
range->adjustment->value = range->adjustment->lower;
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else if (range->adjustment->value > range->adjustment->upper)
|
|
|
|
{
|
|
|
|
range->adjustment->value = range->adjustment->upper;
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (range->adjustment->lower != (range->adjustment->upper - range->adjustment->page_size))
|
|
|
|
y += ((bottom - top) * (range->adjustment->value - range->adjustment->lower) /
|
|
|
|
(range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
|
|
|
|
|
|
|
|
if (y < top)
|
|
|
|
y = top;
|
|
|
|
else if (y > bottom)
|
|
|
|
y = bottom;
|
|
|
|
|
1998-02-28 20:19:20 +00:00
|
|
|
gdk_window_move (range->slider, GTK_WIDGET (range)->style->klass->xthickness, y);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gtk_range_default_htrough_click (GtkRange *range,
|
|
|
|
gint x,
|
1998-03-10 04:37:26 +00:00
|
|
|
gint y,
|
|
|
|
gfloat *jump_perc)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gint ythickness;
|
|
|
|
gint trough_width;
|
|
|
|
gint trough_height;
|
|
|
|
gint slider_x;
|
1998-03-10 22:57:26 +00:00
|
|
|
gint slider_length;
|
|
|
|
gint left, right;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
|
|
|
|
|
|
|
|
ythickness = GTK_WIDGET (range)->style->klass->ythickness;
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
gtk_range_trough_hdims (range, &left, &right);
|
|
|
|
gdk_window_get_size (range->slider, &slider_length, NULL);
|
|
|
|
right += slider_length;
|
|
|
|
|
|
|
|
if ((x > left) && (y > ythickness))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gdk_window_get_size (range->trough, &trough_width, &trough_height);
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
if ((x < right) && (y < (trough_height - ythickness)))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-10 04:37:26 +00:00
|
|
|
if (jump_perc)
|
|
|
|
{
|
1998-03-10 22:57:26 +00:00
|
|
|
*jump_perc = ((gdouble) (x - left)) / ((gdouble) (right - left));
|
1998-03-10 04:37:26 +00:00
|
|
|
return GTK_TROUGH_JUMP;
|
|
|
|
}
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
gdk_window_get_position (range->slider, &slider_x, NULL);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (x < slider_x)
|
|
|
|
return GTK_TROUGH_START;
|
|
|
|
else
|
|
|
|
return GTK_TROUGH_END;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return GTK_TROUGH_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gtk_range_default_vtrough_click (GtkRange *range,
|
|
|
|
gint x,
|
1998-03-10 04:37:26 +00:00
|
|
|
gint y,
|
|
|
|
gfloat *jump_perc)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gint xthickness;
|
|
|
|
gint trough_width;
|
|
|
|
gint trough_height;
|
|
|
|
gint slider_y;
|
1998-03-10 22:57:26 +00:00
|
|
|
gint top, bottom;
|
|
|
|
gint slider_length;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
|
|
|
|
|
|
|
|
xthickness = GTK_WIDGET (range)->style->klass->xthickness;
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
gtk_range_trough_vdims (range, &top, &bottom);
|
|
|
|
gdk_window_get_size (range->slider, NULL, &slider_length);
|
|
|
|
bottom += slider_length;
|
|
|
|
|
|
|
|
if ((x > xthickness) && (y > top))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gdk_window_get_size (range->trough, &trough_width, &trough_height);
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
if ((x < (trough_width - xthickness) && (y < bottom)))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-10 04:37:26 +00:00
|
|
|
if (jump_perc)
|
|
|
|
{
|
1998-03-10 22:57:26 +00:00
|
|
|
*jump_perc = ((gdouble) (y - top)) / ((gdouble) (bottom - top));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-03-10 04:37:26 +00:00
|
|
|
return GTK_TROUGH_JUMP;
|
|
|
|
}
|
|
|
|
|
1998-03-10 22:57:26 +00:00
|
|
|
gdk_window_get_position (range->slider, NULL, &slider_y);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (y < slider_y)
|
|
|
|
return GTK_TROUGH_START;
|
|
|
|
else
|
|
|
|
return GTK_TROUGH_END;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return GTK_TROUGH_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_default_hmotion (GtkRange *range,
|
|
|
|
gint xdelta,
|
|
|
|
gint ydelta)
|
|
|
|
{
|
|
|
|
gdouble old_value;
|
|
|
|
gint left, right;
|
|
|
|
gint slider_x, slider_y;
|
|
|
|
gint new_pos;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
range = GTK_RANGE (range);
|
|
|
|
|
|
|
|
gdk_window_get_position (range->slider, &slider_x, &slider_y);
|
|
|
|
gtk_range_trough_hdims (range, &left, &right);
|
|
|
|
|
|
|
|
if (left == right)
|
|
|
|
return;
|
|
|
|
|
|
|
|
new_pos = slider_x + xdelta;
|
|
|
|
|
|
|
|
if (new_pos < left)
|
|
|
|
new_pos = left;
|
|
|
|
else if (new_pos > right)
|
|
|
|
new_pos = right;
|
|
|
|
|
|
|
|
old_value = range->adjustment->value;
|
|
|
|
range->adjustment->value = ((range->adjustment->upper -
|
|
|
|
range->adjustment->lower -
|
|
|
|
range->adjustment->page_size) *
|
|
|
|
(new_pos - left) / (right - left) +
|
|
|
|
range->adjustment->lower);
|
|
|
|
|
|
|
|
if (range->digits >= 0)
|
|
|
|
{
|
|
|
|
char buffer[64];
|
|
|
|
|
|
|
|
sprintf (buffer, "%0.*f", range->digits, range->adjustment->value);
|
|
|
|
sscanf (buffer, "%f", &range->adjustment->value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (old_value != range->adjustment->value)
|
|
|
|
{
|
|
|
|
if (range->policy == GTK_UPDATE_CONTINUOUS)
|
|
|
|
{
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (range->policy == GTK_UPDATE_DELAYED)
|
|
|
|
{
|
|
|
|
gtk_range_remove_timer (range);
|
|
|
|
range->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
|
|
|
|
(GtkFunction) RANGE_CLASS (range)->timer,
|
|
|
|
(gpointer) range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_range_default_vmotion (GtkRange *range,
|
|
|
|
gint xdelta,
|
|
|
|
gint ydelta)
|
|
|
|
{
|
|
|
|
gdouble old_value;
|
|
|
|
gint top, bottom;
|
|
|
|
gint slider_x, slider_y;
|
|
|
|
gint new_pos;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
range = GTK_RANGE (range);
|
|
|
|
|
|
|
|
gdk_window_get_position (range->slider, &slider_x, &slider_y);
|
|
|
|
gtk_range_trough_vdims (range, &top, &bottom);
|
|
|
|
|
|
|
|
if (bottom == top)
|
|
|
|
return;
|
|
|
|
|
|
|
|
new_pos = slider_y + ydelta;
|
|
|
|
|
|
|
|
if (new_pos < top)
|
|
|
|
new_pos = top;
|
|
|
|
else if (new_pos > bottom)
|
|
|
|
new_pos = bottom;
|
|
|
|
|
|
|
|
old_value = range->adjustment->value;
|
|
|
|
range->adjustment->value = ((range->adjustment->upper -
|
|
|
|
range->adjustment->lower -
|
|
|
|
range->adjustment->page_size) *
|
|
|
|
(new_pos - top) / (bottom - top) +
|
|
|
|
range->adjustment->lower);
|
|
|
|
|
|
|
|
if (range->digits >= 0)
|
|
|
|
{
|
|
|
|
char buffer[64];
|
|
|
|
|
|
|
|
sprintf (buffer, "%0.*f", range->digits, range->adjustment->value);
|
|
|
|
sscanf (buffer, "%f", &range->adjustment->value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (old_value != range->adjustment->value)
|
|
|
|
{
|
|
|
|
if (range->policy == GTK_UPDATE_CONTINUOUS)
|
|
|
|
{
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (range->policy == GTK_UPDATE_DELAYED)
|
|
|
|
{
|
|
|
|
gtk_range_remove_timer (range);
|
|
|
|
range->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
|
|
|
|
(GtkFunction) RANGE_CLASS (range)->timer,
|
|
|
|
(gpointer) 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
|
|
|
static void
|
|
|
|
gtk_range_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (object));
|
|
|
|
|
|
|
|
range = GTK_RANGE (object);
|
|
|
|
|
|
|
|
if (range->adjustment)
|
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (range->adjustment),
|
|
|
|
(gpointer) range);
|
|
|
|
|
|
|
|
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_range_finalize (GtkObject *object)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (object));
|
|
|
|
|
|
|
|
range = GTK_RANGE (object);
|
|
|
|
|
|
|
|
if (range->adjustment)
|
|
|
|
gtk_object_unref (GTK_OBJECT (range->adjustment));
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (widget));
|
|
|
|
g_return_if_fail (area != NULL);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
|
|
|
|
{
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
gtk_range_draw_background (range);
|
|
|
|
gtk_range_draw_trough (range);
|
|
|
|
gtk_range_draw_slider (range);
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_draw_focus (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (widget));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
gtk_range_draw_trough (GTK_RANGE (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_unrealize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (widget));
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
if (range->slider)
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
|
|
|
gdk_window_set_user_data (range->slider, NULL);
|
|
|
|
gdk_window_destroy (range->slider);
|
1998-02-02 20:40:03 +00:00
|
|
|
range->slider = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->trough)
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
|
|
|
gdk_window_set_user_data (range->trough, NULL);
|
|
|
|
gdk_window_destroy (range->trough);
|
1998-02-02 20:40:03 +00:00
|
|
|
range->trough = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->step_forw)
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
|
|
|
gdk_window_set_user_data (range->step_forw, NULL);
|
|
|
|
gdk_window_destroy (range->step_forw);
|
1998-02-02 20:40:03 +00:00
|
|
|
range->step_forw = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->step_back)
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
|
|
|
gdk_window_set_user_data (range->step_back, NULL);
|
|
|
|
gdk_window_destroy (range->step_back);
|
1998-02-02 20:40:03 +00:00
|
|
|
range->step_back = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1998-02-12 03:02:14 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
|
|
|
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
2000-03-28 01:24:44 +00:00
|
|
|
/* We should really pass another argument -
|
|
|
|
*the redrawn area - to all the drawing functions)
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
if (event->window == range->trough)
|
|
|
|
{
|
2000-03-28 01:24:44 +00:00
|
|
|
gtk_range_draw_trough (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else if (event->window == widget->window)
|
|
|
|
{
|
1998-12-16 20:09:30 +00:00
|
|
|
gtk_range_draw_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else if (event->window == range->slider)
|
|
|
|
{
|
|
|
|
gtk_range_draw_slider (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_forw)
|
|
|
|
{
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_back)
|
|
|
|
{
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
gint trough_part;
|
1998-03-10 04:37:26 +00:00
|
|
|
gfloat jump_perc;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
|
1998-03-10 04:37:26 +00:00
|
|
|
jump_perc = -1;
|
1997-11-24 22:37:52 +00:00
|
|
|
range = GTK_RANGE (widget);
|
1998-03-10 04:37:26 +00:00
|
|
|
if (range->button == 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gtk_grab_add (widget);
|
|
|
|
|
|
|
|
range->button = event->button;
|
|
|
|
range->x_click_point = event->x;
|
|
|
|
range->y_click_point = event->y;
|
|
|
|
|
|
|
|
if (event->window == range->trough)
|
|
|
|
{
|
|
|
|
range->click_child = RANGE_CLASS (range)->trough;
|
1998-03-10 04:37:26 +00:00
|
|
|
|
|
|
|
if (range->button == 2)
|
|
|
|
trough_part = gtk_range_trough_click (range, event->x, event->y, &jump_perc);
|
|
|
|
else
|
|
|
|
trough_part = gtk_range_trough_click (range, event->x, event->y, NULL);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
range->scroll_type = GTK_SCROLL_NONE;
|
|
|
|
if (trough_part == GTK_TROUGH_START)
|
|
|
|
range->scroll_type = GTK_SCROLL_PAGE_BACKWARD;
|
|
|
|
else if (trough_part == GTK_TROUGH_END)
|
|
|
|
range->scroll_type = GTK_SCROLL_PAGE_FORWARD;
|
1998-03-10 04:37:26 +00:00
|
|
|
else if (trough_part == GTK_TROUGH_JUMP &&
|
|
|
|
jump_perc >= 0 && jump_perc <= 1)
|
|
|
|
range->scroll_type = GTK_SCROLL_JUMP;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->scroll_type != GTK_SCROLL_NONE)
|
|
|
|
{
|
1998-03-10 04:37:26 +00:00
|
|
|
gtk_range_scroll (range, jump_perc);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_range_add_timer (range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (event->window == range->slider)
|
|
|
|
{
|
|
|
|
range->click_child = RANGE_CLASS (range)->slider;
|
|
|
|
range->scroll_type = GTK_SCROLL_NONE;
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_forw)
|
|
|
|
{
|
|
|
|
range->click_child = RANGE_CLASS (range)->step_forw;
|
|
|
|
range->scroll_type = GTK_SCROLL_STEP_FORWARD;
|
|
|
|
|
1998-03-10 04:37:26 +00:00
|
|
|
gtk_range_scroll (range, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_range_add_timer (range);
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_back)
|
|
|
|
{
|
|
|
|
range->click_child = RANGE_CLASS (range)->step_back;
|
|
|
|
range->scroll_type = GTK_SCROLL_STEP_BACKWARD;
|
|
|
|
|
1998-03-10 04:37:26 +00:00
|
|
|
gtk_range_scroll (range, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_range_add_timer (range);
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
if (range->button == event->button)
|
|
|
|
{
|
|
|
|
gtk_grab_remove (widget);
|
|
|
|
|
|
|
|
range->button = 0;
|
|
|
|
range->x_click_point = -1;
|
|
|
|
range->y_click_point = -1;
|
|
|
|
|
|
|
|
if (range->click_child == RANGE_CLASS (range)->slider)
|
|
|
|
{
|
|
|
|
if (range->policy == GTK_UPDATE_DELAYED)
|
|
|
|
gtk_range_remove_timer (range);
|
|
|
|
|
|
|
|
if ((range->policy != GTK_UPDATE_CONTINUOUS) &&
|
|
|
|
(range->old_value != range->adjustment->value))
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else if ((range->click_child == RANGE_CLASS (range)->trough) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->step_forw) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->step_back))
|
|
|
|
{
|
|
|
|
gtk_range_remove_timer (range);
|
|
|
|
|
|
|
|
if ((range->policy != GTK_UPDATE_CONTINUOUS) &&
|
|
|
|
(range->old_value != range->adjustment->value))
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
|
|
|
|
if (range->click_child == RANGE_CLASS (range)->step_forw)
|
|
|
|
{
|
|
|
|
range->click_child = 0;
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
}
|
|
|
|
else if (range->click_child == RANGE_CLASS (range)->step_back)
|
|
|
|
{
|
|
|
|
range->click_child = 0;
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
range->click_child = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-02-18 20:02:24 +00:00
|
|
|
static gint
|
|
|
|
gtk_range_scroll_event (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (range)) {
|
|
|
|
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
|
|
|
|
gfloat new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
|
|
|
|
-adj->page_increment / 2:
|
|
|
|
adj->page_increment / 2);
|
|
|
|
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
|
|
|
}
|
|
|
|
|
2000-02-19 22:19:55 +00:00
|
|
|
return TRUE;
|
2000-02-18 20:02:24 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint
|
|
|
|
gtk_range_motion_notify (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
GdkModifierType mods;
|
|
|
|
gint x, y, mask;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
if (range->click_child == RANGE_CLASS (range)->slider)
|
|
|
|
{
|
|
|
|
x = event->x;
|
|
|
|
y = event->y;
|
|
|
|
|
|
|
|
if (event->is_hint || (event->window != range->slider))
|
|
|
|
gdk_window_get_pointer (range->slider, &x, &y, &mods);
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
else
|
|
|
|
mods = event->state;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
switch (range->button)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
mask = GDK_BUTTON1_MASK;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
mask = GDK_BUTTON2_MASK;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
mask = GDK_BUTTON3_MASK;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mask = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mods & mask)
|
|
|
|
{
|
|
|
|
if (RANGE_CLASS (range)->motion)
|
|
|
|
(* RANGE_CLASS (range)->motion) (range, x - range->x_click_point, y - range->y_click_point);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
gint return_val;
|
|
|
|
GtkScrollType scroll = GTK_SCROLL_NONE;
|
|
|
|
GtkTroughType pos = GTK_TROUGH_NONE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
return_val = FALSE;
|
|
|
|
|
|
|
|
if (RANGE_CLASS (range)->trough_keys)
|
|
|
|
return_val = (* RANGE_CLASS (range)->trough_keys) (range, event, &scroll, &pos);
|
|
|
|
|
|
|
|
if (return_val)
|
|
|
|
{
|
|
|
|
if (scroll != GTK_SCROLL_NONE)
|
|
|
|
{
|
|
|
|
range->scroll_type = scroll;
|
1998-03-10 04:37:26 +00:00
|
|
|
gtk_range_scroll (range, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->old_value != range->adjustment->value)
|
|
|
|
{
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
switch (range->scroll_type)
|
|
|
|
{
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pos != GTK_TROUGH_NONE)
|
|
|
|
{
|
|
|
|
if (pos == GTK_TROUGH_START)
|
|
|
|
range->adjustment->value = range->adjustment->lower;
|
1998-03-10 04:37:26 +00:00
|
|
|
else if (pos == GTK_TROUGH_END)
|
1997-11-24 22:37:52 +00:00
|
|
|
range->adjustment->value =
|
|
|
|
range->adjustment->upper - range->adjustment->page_size;
|
|
|
|
|
|
|
|
if (range->old_value != range->adjustment->value)
|
|
|
|
{
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment),
|
|
|
|
"value_changed");
|
|
|
|
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_enter_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
if (event->window == range->trough)
|
|
|
|
{
|
|
|
|
range->in_child = RANGE_CLASS (range)->trough;
|
|
|
|
}
|
|
|
|
else if (event->window == range->slider)
|
|
|
|
{
|
|
|
|
range->in_child = RANGE_CLASS (range)->slider;
|
|
|
|
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_slider (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_forw)
|
|
|
|
{
|
|
|
|
range->in_child = RANGE_CLASS (range)->step_forw;
|
|
|
|
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_back)
|
|
|
|
{
|
|
|
|
range->in_child = RANGE_CLASS (range)->step_back;
|
|
|
|
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_leave_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
|
|
|
range->in_child = 0;
|
|
|
|
|
|
|
|
if (event->window == range->trough)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else if (event->window == range->slider)
|
|
|
|
{
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_slider (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_forw)
|
|
|
|
{
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_step_forw (range);
|
|
|
|
}
|
|
|
|
else if (event->window == range->step_back)
|
|
|
|
{
|
|
|
|
if ((range->click_child == 0) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->trough))
|
|
|
|
gtk_range_draw_step_back (range);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_range_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
|
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_range_draw_trough (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->trough)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
|
|
|
gtk_paint_box (GTK_WIDGET (range)->style, range->trough,
|
|
|
|
GTK_STATE_ACTIVE, GTK_SHADOW_IN,
|
|
|
|
NULL, GTK_WIDGET(range), "trough",
|
|
|
|
0, 0, -1, -1);
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (range))
|
|
|
|
gtk_paint_focus (GTK_WIDGET (range)->style,
|
|
|
|
range->trough,
|
|
|
|
NULL, GTK_WIDGET(range), "trough",
|
|
|
|
0, 0, -1, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_range_draw_slider (GtkRange *range)
|
|
|
|
{
|
|
|
|
GtkStateType state_type;
|
1998-11-06 22:05:02 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
1998-11-06 22:05:02 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (range->slider)
|
|
|
|
{
|
|
|
|
if ((range->in_child == RANGE_CLASS (range)->slider) ||
|
|
|
|
(range->click_child == RANGE_CLASS (range)->slider))
|
|
|
|
state_type = GTK_STATE_PRELIGHT;
|
|
|
|
else
|
|
|
|
state_type = GTK_STATE_NORMAL;
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_paint_box (GTK_WIDGET (range)->style, range->slider,
|
|
|
|
state_type, GTK_SHADOW_OUT,
|
|
|
|
NULL, GTK_WIDGET (range), "slider",
|
|
|
|
0, 0, -1, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_real_range_timer (GtkRange *range)
|
|
|
|
{
|
|
|
|
gint return_val;
|
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_ENTER ();
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
if (range->click_child == RANGE_CLASS (range)->slider)
|
|
|
|
{
|
|
|
|
if (range->policy == GTK_UPDATE_DELAYED)
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
return_val = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-04-14 01:39:40 +00:00
|
|
|
GdkModifierType mods, mask;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!range->timer)
|
|
|
|
{
|
|
|
|
return_val = FALSE;
|
|
|
|
if (range->need_timer)
|
|
|
|
range->timer = gtk_timeout_add (SCROLL_TIMER_LENGTH,
|
|
|
|
(GtkFunction) RANGE_CLASS (range)->timer,
|
|
|
|
(gpointer) range);
|
|
|
|
else
|
1998-12-15 07:32:11 +00:00
|
|
|
{
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_LEAVE ();
|
1998-12-15 07:32:11 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
range->need_timer = FALSE;
|
|
|
|
}
|
|
|
|
|
1998-04-14 01:39:40 +00:00
|
|
|
switch (range->button)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
mask = GDK_BUTTON1_MASK;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
mask = GDK_BUTTON2_MASK;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
mask = GDK_BUTTON3_MASK;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mask = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_window_get_pointer (range->slider, NULL, NULL, &mods);
|
|
|
|
|
|
|
|
if (mods & mask)
|
|
|
|
return_val = gtk_range_scroll (range, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_LEAVE ();
|
1998-12-15 07:32:11 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1998-03-10 04:37:26 +00:00
|
|
|
gtk_range_scroll (GtkRange *range,
|
|
|
|
gfloat jump_perc)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gfloat new_value;
|
|
|
|
gint return_val;
|
|
|
|
|
|
|
|
g_return_val_if_fail (range != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
|
|
|
|
|
|
|
new_value = range->adjustment->value;
|
|
|
|
return_val = TRUE;
|
|
|
|
|
|
|
|
switch (range->scroll_type)
|
|
|
|
{
|
|
|
|
case GTK_SCROLL_NONE:
|
|
|
|
break;
|
1998-03-10 04:37:26 +00:00
|
|
|
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
if (jump_perc >= 0 && jump_perc <= 1)
|
|
|
|
{
|
|
|
|
new_value = (range->adjustment->lower +
|
|
|
|
(range->adjustment->upper - range->adjustment->page_size -
|
|
|
|
range->adjustment->lower) * jump_perc);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
new_value -= range->adjustment->step_increment;
|
|
|
|
if (new_value <= range->adjustment->lower)
|
|
|
|
{
|
|
|
|
new_value = range->adjustment->lower;
|
|
|
|
return_val = FALSE;
|
|
|
|
range->timer = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
new_value += range->adjustment->step_increment;
|
|
|
|
if (new_value >= (range->adjustment->upper - range->adjustment->page_size))
|
|
|
|
{
|
|
|
|
new_value = range->adjustment->upper - range->adjustment->page_size;
|
|
|
|
return_val = FALSE;
|
|
|
|
range->timer = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
new_value -= range->adjustment->page_increment;
|
|
|
|
if (new_value <= range->adjustment->lower)
|
|
|
|
{
|
|
|
|
new_value = range->adjustment->lower;
|
|
|
|
return_val = FALSE;
|
|
|
|
range->timer = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
new_value += range->adjustment->page_increment;
|
|
|
|
if (new_value >= (range->adjustment->upper - range->adjustment->page_size))
|
|
|
|
{
|
|
|
|
new_value = range->adjustment->upper - range->adjustment->page_size;
|
|
|
|
return_val = FALSE;
|
|
|
|
range->timer = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_value != range->adjustment->value)
|
|
|
|
{
|
|
|
|
range->adjustment->value = new_value;
|
|
|
|
|
|
|
|
if ((range->policy == GTK_UPDATE_CONTINUOUS) ||
|
|
|
|
(!return_val && (range->policy == GTK_UPDATE_DELAYED)))
|
|
|
|
{
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (range->adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_add_timer (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (!range->timer)
|
|
|
|
{
|
|
|
|
range->need_timer = TRUE;
|
|
|
|
range->timer = gtk_timeout_add (SCROLL_INITIAL_DELAY,
|
|
|
|
(GtkFunction) RANGE_CLASS (range)->timer,
|
|
|
|
(gpointer) range);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_remove_timer (GtkRange *range)
|
|
|
|
{
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (range));
|
|
|
|
|
|
|
|
if (range->timer)
|
|
|
|
{
|
|
|
|
gtk_timeout_remove (range->timer);
|
|
|
|
range->timer = 0;
|
|
|
|
}
|
|
|
|
range->need_timer = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
|
|
range = GTK_RANGE (data);
|
|
|
|
|
|
|
|
if (((range->old_lower != adjustment->lower) ||
|
|
|
|
(range->old_upper != adjustment->upper) ||
|
|
|
|
(range->old_page_size != adjustment->page_size)) &&
|
|
|
|
(range->old_value == adjustment->value))
|
|
|
|
{
|
|
|
|
if ((adjustment->lower == adjustment->upper) ||
|
|
|
|
(range->old_lower == (range->old_upper - range->old_page_size)))
|
|
|
|
{
|
|
|
|
adjustment->value = adjustment->lower;
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (adjustment), "value_changed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((range->old_value != adjustment->value) ||
|
|
|
|
(range->old_lower != adjustment->lower) ||
|
|
|
|
(range->old_upper != adjustment->upper) ||
|
|
|
|
(range->old_page_size != adjustment->page_size))
|
|
|
|
{
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
range->old_value = adjustment->value;
|
|
|
|
range->old_lower = adjustment->lower;
|
|
|
|
range->old_upper = adjustment->upper;
|
|
|
|
range->old_page_size = adjustment->page_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
|
|
range = GTK_RANGE (data);
|
|
|
|
|
|
|
|
if (range->old_value != adjustment->value)
|
|
|
|
{
|
|
|
|
gtk_range_slider_update (range);
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_range_clear_background (range);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
range->old_value = adjustment->value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_trough_hdims (GtkRange *range,
|
|
|
|
gint *left,
|
|
|
|
gint *right)
|
|
|
|
{
|
|
|
|
gint trough_width;
|
|
|
|
gint slider_length;
|
|
|
|
gint tmp_width;
|
|
|
|
gint tleft;
|
|
|
|
gint tright;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
|
|
|
|
gdk_window_get_size (range->trough, &trough_width, NULL);
|
|
|
|
gdk_window_get_size (range->slider, &slider_length, NULL);
|
|
|
|
|
|
|
|
tleft = GTK_WIDGET (range)->style->klass->xthickness;
|
|
|
|
tright = trough_width - slider_length - GTK_WIDGET (range)->style->klass->xthickness;
|
|
|
|
|
|
|
|
if (range->step_back)
|
|
|
|
{
|
|
|
|
gdk_window_get_size (range->step_back, &tmp_width, NULL);
|
|
|
|
tleft += (tmp_width + RANGE_CLASS (range)->stepper_slider_spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (range->step_forw)
|
|
|
|
{
|
|
|
|
gdk_window_get_size (range->step_forw, &tmp_width, NULL);
|
|
|
|
tright -= (tmp_width + RANGE_CLASS (range)->stepper_slider_spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (left)
|
|
|
|
*left = tleft;
|
|
|
|
if (right)
|
|
|
|
*right = tright;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_range_trough_vdims (GtkRange *range,
|
|
|
|
gint *top,
|
|
|
|
gint *bottom)
|
|
|
|
{
|
|
|
|
gint trough_height;
|
|
|
|
gint slider_length;
|
|
|
|
gint tmp_height;
|
|
|
|
gint ttop;
|
|
|
|
gint tbottom;
|
|
|
|
|
|
|
|
g_return_if_fail (range != NULL);
|
|
|
|
|
|
|
|
gdk_window_get_size (range->trough, NULL, &trough_height);
|
|
|
|
gdk_window_get_size (range->slider, NULL, &slider_length);
|
|
|
|
|
1998-02-28 20:19:20 +00:00
|
|
|
ttop = GTK_WIDGET (range)->style->klass->ythickness;
|
1997-11-24 22:37:52 +00:00
|
|
|
tbottom = trough_height - slider_length - GTK_WIDGET (range)->style->klass->ythickness;
|
|
|
|
|
|
|
|
if (range->step_back)
|
|
|
|
{
|
|
|
|
gdk_window_get_size (range->step_back, NULL, &tmp_height);
|
|
|
|
ttop += (tmp_height + RANGE_CLASS (range)->stepper_slider_spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (range->step_forw)
|
|
|
|
{
|
|
|
|
gdk_window_get_size (range->step_forw, NULL, &tmp_height);
|
|
|
|
tbottom -= (tmp_height + RANGE_CLASS (range)->stepper_slider_spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (top)
|
|
|
|
*top = ttop;
|
|
|
|
if (bottom)
|
|
|
|
*bottom = tbottom;
|
|
|
|
}
|
1998-04-09 02:55:46 +00:00
|
|
|
|
1998-05-03 22:41:32 +00:00
|
|
|
static void
|
|
|
|
gtk_range_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style)
|
|
|
|
{
|
|
|
|
GtkRange *range;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_RANGE (widget));
|
|
|
|
|
|
|
|
range = GTK_RANGE (widget);
|
|
|
|
|
1999-02-04 16:12:35 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
1998-05-03 22:41:32 +00:00
|
|
|
{
|
1999-02-04 16:12:35 +00:00
|
|
|
if (range->trough)
|
|
|
|
gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
|
1998-05-03 22:41:32 +00:00
|
|
|
|
1999-02-04 16:12:35 +00:00
|
|
|
if (range->slider)
|
|
|
|
gtk_style_set_background (widget->style, range->slider, GTK_STATE_NORMAL);
|
|
|
|
|
1999-02-16 04:29:00 +00:00
|
|
|
/* The backgrounds of the step_forw and step_back never actually
|
|
|
|
* get drawn in draw calls, so we call gdk_window_clear() here
|
|
|
|
* so they get the correct colors. This is a hack. OWT.
|
|
|
|
*/
|
|
|
|
|
1998-05-03 22:41:32 +00:00
|
|
|
if (range->step_forw)
|
1999-02-16 04:29:00 +00:00
|
|
|
{
|
|
|
|
gtk_style_set_background (widget->style, range->step_forw, GTK_STATE_ACTIVE);
|
|
|
|
gdk_window_clear (range->step_forw);
|
|
|
|
}
|
1999-02-04 16:12:35 +00:00
|
|
|
|
1998-05-03 22:41:32 +00:00
|
|
|
if (range->step_back)
|
1999-02-16 04:29:00 +00:00
|
|
|
{
|
|
|
|
gtk_style_set_background (widget->style, range->step_back, GTK_STATE_ACTIVE);
|
|
|
|
gdk_window_clear (range->step_back);
|
|
|
|
}
|
1998-05-03 22:41:32 +00:00
|
|
|
}
|
|
|
|
}
|