2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:37:18 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-07-05 16:03:49 +00:00
|
|
|
|
#include "config.h"
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
#include "gtkprogressbar.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
#include "gtkcssnodeprivate.h"
|
2015-11-24 12:22:52 +00:00
|
|
|
|
#include "gtkcssnumbervalueprivate.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include "gtkcssstylepropertyprivate.h"
|
2017-04-06 17:22:14 +00:00
|
|
|
|
#include "gtkgizmoprivate.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include "gtkintl.h"
|
|
|
|
|
#include "gtklabel.h"
|
|
|
|
|
#include "gtkorientableprivate.h"
|
|
|
|
|
#include "gtkprogresstrackerprivate.h"
|
|
|
|
|
#include "gtkprivate.h"
|
|
|
|
|
#include "gtkstylecontextprivate.h"
|
|
|
|
|
#include "gtkwidgetprivate.h"
|
2019-07-15 04:38:51 +00:00
|
|
|
|
#include "gtkboxlayout.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-06-27 03:00:20 +00:00
|
|
|
|
#include "a11y/gtkprogressbaraccessible.h"
|
|
|
|
|
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2010-11-08 17:36:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkprogressbar
|
|
|
|
|
* @Short_description: A widget which indicates progress visually
|
|
|
|
|
* @Title: GtkProgressBar
|
|
|
|
|
*
|
|
|
|
|
* The #GtkProgressBar is typically used to display the progress of a long
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* running operation. It provides a visual clue that processing is underway.
|
|
|
|
|
* The GtkProgressBar can be used in two different modes: percentage mode
|
|
|
|
|
* and activity mode.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*
|
|
|
|
|
* When an application can determine how much work needs to take place
|
|
|
|
|
* (e.g. read a fixed number of bytes from a file) and can monitor its
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* progress, it can use the GtkProgressBar in percentage mode and the
|
|
|
|
|
* user sees a growing bar indicating the percentage of the work that
|
|
|
|
|
* has been completed. In this mode, the application is required to call
|
2010-11-08 17:36:39 +00:00
|
|
|
|
* gtk_progress_bar_set_fraction() periodically to update the progress bar.
|
|
|
|
|
*
|
|
|
|
|
* When an application has no accurate way of knowing the amount of work
|
|
|
|
|
* to do, it can use the #GtkProgressBar in activity mode, which shows
|
|
|
|
|
* activity by a block moving back and forth within the progress area. In
|
|
|
|
|
* this mode, the application is required to call gtk_progress_bar_pulse()
|
|
|
|
|
* periodically to update the progress bar.
|
|
|
|
|
*
|
|
|
|
|
* There is quite a bit of flexibility provided to control the appearance
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* of the #GtkProgressBar. Functions are provided to control the orientation
|
|
|
|
|
* of the bar, optional text can be displayed along with the bar, and the
|
|
|
|
|
* step size used in activity mode can be set.
|
2015-11-01 00:30:03 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
2015-11-03 18:37:57 +00:00
|
|
|
|
* |[<!-- language="plain" -->
|
2016-01-09 19:05:41 +00:00
|
|
|
|
* progressbar[.osd]
|
2017-04-22 04:35:54 +00:00
|
|
|
|
* ├── [text]
|
2016-11-18 22:43:09 +00:00
|
|
|
|
* ╰── trough[.empty][.full]
|
2015-11-04 17:32:15 +00:00
|
|
|
|
* ╰── progress[.pulse]
|
2015-11-03 18:37:57 +00:00
|
|
|
|
* ]|
|
|
|
|
|
*
|
2015-11-24 12:22:52 +00:00
|
|
|
|
* GtkProgressBar has a main CSS node with name progressbar and subnodes with
|
2017-04-25 09:57:55 +00:00
|
|
|
|
* names text and trough, of which the latter has a subnode named progress. The
|
|
|
|
|
* text subnode is only present if text is shown. The progress subnode has the
|
|
|
|
|
* style class .pulse when in activity mode. It gets the style classes .left,
|
|
|
|
|
* .right, .top or .bottom added when the progress 'touches' the corresponding
|
|
|
|
|
* end of the GtkProgressBar. The .osd class on the progressbar node is for use
|
|
|
|
|
* in overlays like the one Epiphany has for page loading progress.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2019-05-26 22:49:21 +00:00
|
|
|
|
typedef struct _GtkProgressBarClass GtkProgressBarClass;
|
|
|
|
|
|
|
|
|
|
struct _GtkProgressBar
|
|
|
|
|
{
|
|
|
|
|
GtkWidget parent_instance;
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
gchar *text;
|
|
|
|
|
|
2017-04-06 17:22:14 +00:00
|
|
|
|
GtkWidget *label;
|
|
|
|
|
GtkWidget *trough_widget;
|
|
|
|
|
GtkWidget *progress_widget;
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
gdouble fraction;
|
|
|
|
|
gdouble pulse_fraction;
|
|
|
|
|
|
2012-12-23 18:13:11 +00:00
|
|
|
|
double activity_pos;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
guint activity_blocks;
|
|
|
|
|
|
2011-04-12 16:40:30 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
guint tick_id;
|
|
|
|
|
GtkProgressTracker tracker;
|
|
|
|
|
gint64 pulse1;
|
|
|
|
|
gint64 pulse2;
|
|
|
|
|
gdouble last_iteration;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
guint activity_dir : 1;
|
|
|
|
|
guint activity_mode : 1;
|
|
|
|
|
guint ellipsize : 3;
|
|
|
|
|
guint show_text : 1;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
guint inverted : 1;
|
2020-04-26 19:44:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _GtkProgressBarClass
|
|
|
|
|
{
|
|
|
|
|
GtkWidgetClass parent_class;
|
|
|
|
|
};
|
2010-07-07 02:36:38 +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
|
|
|
|
enum {
|
2001-03-30 15:46:17 +00:00
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_FRACTION,
|
|
|
|
|
PROP_PULSE_STEP,
|
2010-09-02 03:24:20 +00:00
|
|
|
|
PROP_INVERTED,
|
2001-03-30 15:46:17 +00:00
|
|
|
|
PROP_TEXT,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
PROP_SHOW_TEXT,
|
2015-09-05 07:59:28 +00:00
|
|
|
|
PROP_ELLIPSIZE,
|
|
|
|
|
PROP_ORIENTATION,
|
|
|
|
|
NUM_PROPERTIES = PROP_ORIENTATION
|
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-11-24 22:37:52 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
static GParamSpec *progress_props[NUM_PROPERTIES] = { NULL, };
|
|
|
|
|
|
2010-10-27 03:30:48 +00:00
|
|
|
|
static void gtk_progress_bar_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_progress_bar_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_progress_bar_act_mode_enter (GtkProgressBar *progress);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
static void gtk_progress_bar_act_mode_leave (GtkProgressBar *progress);
|
2010-10-27 03:30:48 +00:00
|
|
|
|
static void gtk_progress_bar_finalize (GObject *object);
|
|
|
|
|
static void gtk_progress_bar_set_orientation (GtkProgressBar *progress,
|
|
|
|
|
GtkOrientation orientation);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
static void gtk_progress_bar_direction_changed (GtkWidget *widget,
|
|
|
|
|
GtkTextDirection previous_dir);
|
2017-05-04 06:09:44 +00:00
|
|
|
|
|
2010-09-02 03:25:22 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkProgressBar, gtk_progress_bar, GTK_TYPE_WIDGET,
|
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_class_init (GtkProgressBarClass *class)
|
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
1998-07-19 10:35:39 +00:00
|
|
|
|
widget_class = (GtkWidgetClass *) class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class->set_property = gtk_progress_bar_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_progress_bar_get_property;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gobject_class->finalize = gtk_progress_bar_finalize;
|
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
widget_class->direction_changed = gtk_progress_bar_direction_changed;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-10-27 03:30:48 +00:00
|
|
|
|
g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation");
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_INVERTED] =
|
|
|
|
|
g_param_spec_boolean ("inverted",
|
|
|
|
|
P_("Inverted"),
|
|
|
|
|
P_("Invert the direction in which the progress bar grows"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_FRACTION] =
|
|
|
|
|
g_param_spec_double ("fraction",
|
|
|
|
|
P_("Fraction"),
|
|
|
|
|
P_("The fraction of total work that has been completed"),
|
|
|
|
|
0.0, 1.0,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_PULSE_STEP] =
|
|
|
|
|
g_param_spec_double ("pulse-step",
|
|
|
|
|
P_("Pulse Step"),
|
|
|
|
|
P_("The fraction of total progress to move the bouncing block when pulsed"),
|
|
|
|
|
0.0, 1.0,
|
|
|
|
|
0.1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_TEXT] =
|
|
|
|
|
g_param_spec_string ("text",
|
|
|
|
|
P_("Text"),
|
|
|
|
|
P_("Text to be displayed in the progress bar"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2011-01-08 09:46:46 +00:00
|
|
|
|
/**
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* GtkProgressBar:show-text:
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets whether the progress bar will show a text in addition
|
|
|
|
|
* to the bar itself. The shown text is either the value of
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* the #GtkProgressBar:text property or, if that is %NULL,
|
|
|
|
|
* the #GtkProgressBar:fraction value, as a percentage.
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* To make a progress bar that is styled and sized suitably for
|
|
|
|
|
* showing text (even if the actual text is blank), set
|
|
|
|
|
* #GtkProgressBar:show-text to %TRUE and #GtkProgressBar:text
|
|
|
|
|
* to the empty string (not %NULL).
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_SHOW_TEXT] =
|
|
|
|
|
g_param_spec_boolean ("show-text",
|
|
|
|
|
P_("Show text"),
|
|
|
|
|
P_("Whether the progress is shown as text."),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2001-03-30 15:46:17 +00:00
|
|
|
|
|
2004-10-31 04:36:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkProgressBar:ellipsize:
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* The preferred place to ellipsize the string, if the progress bar does
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* not have enough room to display the entire string, specified as a
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* #PangoEllipsizeMode.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* Note that setting this property to a value other than
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* %PANGO_ELLIPSIZE_NONE has the side-effect that the progress bar requests
|
|
|
|
|
* only enough space to display the ellipsis ("..."). Another means to set a
|
|
|
|
|
* progress bar's width is gtk_widget_set_size_request().
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_ELLIPSIZE] =
|
|
|
|
|
g_param_spec_enum ("ellipsize",
|
|
|
|
|
P_("Ellipsize"),
|
|
|
|
|
P_("The preferred place to ellipsize the string, if the progress bar "
|
|
|
|
|
"does not have enough room to display the entire string, if at all."),
|
|
|
|
|
PANGO_TYPE_ELLIPSIZE_MODE,
|
|
|
|
|
PANGO_ELLIPSIZE_NONE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, progress_props);
|
2014-06-09 13:20:55 +00:00
|
|
|
|
|
2011-06-27 03:00:20 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_PROGRESS_BAR_ACCESSIBLE);
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("progressbar"));
|
2019-07-15 04:38:51 +00:00
|
|
|
|
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-18 22:43:09 +00:00
|
|
|
|
static void
|
|
|
|
|
update_fraction_classes (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
gboolean empty = FALSE;
|
|
|
|
|
gboolean full = FALSE;
|
|
|
|
|
|
|
|
|
|
/* Here we set classes based on fill-level unless we're in activity-mode.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (!pbar->activity_mode)
|
2016-11-18 22:43:09 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->fraction <= 0.0)
|
2016-11-18 22:43:09 +00:00
|
|
|
|
empty = TRUE;
|
2020-04-26 19:44:44 +00:00
|
|
|
|
else if (pbar->fraction >= 1.0)
|
2016-11-18 22:43:09 +00:00
|
|
|
|
full = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (empty)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->trough_widget, "empty");
|
2016-11-18 22:43:09 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->trough_widget, "empty");
|
2016-11-18 22:43:09 +00:00
|
|
|
|
|
|
|
|
|
if (full)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->trough_widget, "full");
|
2016-11-18 22:43:09 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->trough_widget, "full");
|
2016-11-18 22:43:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
static void
|
|
|
|
|
update_node_classes (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gboolean left = FALSE;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
gboolean right = FALSE;
|
|
|
|
|
gboolean top = FALSE;
|
|
|
|
|
gboolean bottom = FALSE;
|
|
|
|
|
|
|
|
|
|
/* Here we set positional classes, depending on which end of the
|
|
|
|
|
* progressbar the progress touches.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_mode)
|
2015-11-01 00:20:13 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-11-01 00:20:13 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
left = pbar->activity_pos <= 0.0;
|
|
|
|
|
right = pbar->activity_pos >= 1.0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
top = pbar->activity_pos <= 0.0;
|
|
|
|
|
bottom = pbar->activity_pos >= 1.0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else /* continuous */
|
|
|
|
|
{
|
|
|
|
|
gboolean inverted;
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
inverted = pbar->inverted;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (pbar)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-11-01 00:20:13 +00:00
|
|
|
|
inverted = !inverted;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-11-01 00:20:13 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
left = !inverted || pbar->fraction >= 1.0;
|
|
|
|
|
right = inverted || pbar->fraction >= 1.0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
top = !inverted || pbar->fraction >= 1.0;
|
|
|
|
|
bottom = inverted || pbar->fraction >= 1.0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (left)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_LEFT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_LEFT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (right)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_RIGHT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_RIGHT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (top)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_TOP);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_TOP);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (bottom)
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_BOTTOM);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_BOTTOM);
|
2016-11-18 22:43:09 +00:00
|
|
|
|
|
|
|
|
|
update_fraction_classes (pbar);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-06 17:22:14 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
allocate_trough (GtkGizmo *gizmo,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (gtk_widget_get_parent (GTK_WIDGET (gizmo)));
|
|
|
|
|
GtkAllocation alloc;
|
2018-08-16 04:53:03 +00:00
|
|
|
|
int progress_width, progress_height;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
gboolean inverted;
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
inverted = pbar->inverted;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (pbar)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
inverted = !inverted;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_measure (pbar->progress_widget, GTK_ORIENTATION_VERTICAL, -1,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
&progress_height, NULL,
|
2017-04-06 17:22:14 +00:00
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_measure (pbar->progress_widget, GTK_ORIENTATION_HORIZONTAL, -1,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
&progress_width, NULL,
|
2017-04-06 17:22:14 +00:00
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_mode)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
alloc.width = progress_width + (width - progress_width) / pbar->activity_blocks;
|
|
|
|
|
alloc.x = pbar->activity_pos * (width - alloc.width);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.y = (height - progress_height) / 2;
|
|
|
|
|
alloc.height = progress_height;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
alloc.height = progress_height + (height - progress_height) / pbar->activity_blocks;
|
|
|
|
|
alloc.y = pbar->activity_pos * (height - alloc.height);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.x = (width - progress_width) / 2;
|
|
|
|
|
alloc.width = progress_width;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
alloc.width = progress_width + (width - progress_width) * pbar->fraction;
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.height = progress_height;
|
|
|
|
|
alloc.y = (height - progress_height) / 2;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
|
|
|
|
if (!inverted)
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.x = 0;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
else
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.x = width - alloc.width;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.width = progress_width;
|
2020-04-26 19:44:44 +00:00
|
|
|
|
alloc.height = progress_height + (height - progress_height) * pbar->fraction;
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.x = (width - progress_width) / 2;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
|
|
|
|
if (!inverted)
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.y = 0;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
else
|
2018-08-16 04:53:03 +00:00
|
|
|
|
alloc.y = height - alloc.height;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_size_allocate (pbar->progress_widget, &alloc, -1);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_init (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->inverted = FALSE;
|
|
|
|
|
pbar->pulse_fraction = 0.1;
|
|
|
|
|
pbar->activity_pos = 0;
|
|
|
|
|
pbar->activity_dir = 1;
|
|
|
|
|
pbar->activity_blocks = 5;
|
|
|
|
|
pbar->ellipsize = PANGO_ELLIPSIZE_NONE;
|
|
|
|
|
pbar->show_text = FALSE;
|
|
|
|
|
|
|
|
|
|
pbar->text = NULL;
|
|
|
|
|
pbar->fraction = 0.0;
|
|
|
|
|
|
|
|
|
|
pbar->trough_widget = gtk_gizmo_new ("trough",
|
2017-04-06 17:22:14 +00:00
|
|
|
|
NULL,
|
|
|
|
|
allocate_trough,
|
2019-12-09 10:58:52 +00:00
|
|
|
|
NULL,
|
2020-04-08 11:34:38 +00:00
|
|
|
|
NULL,
|
|
|
|
|
NULL, NULL);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_set_parent (pbar->trough_widget, GTK_WIDGET (pbar));
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->progress_widget = gtk_gizmo_new ("progress", NULL, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
gtk_widget_set_parent (pbar->progress_widget, pbar->trough_widget);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
2019-07-15 04:38:51 +00:00
|
|
|
|
/* horizontal is default */
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->orientation = GTK_ORIENTATION_VERTICAL; /* Just to force an update... */
|
2019-07-15 04:38:51 +00:00
|
|
|
|
gtk_progress_bar_set_orientation (pbar, GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_progress_bar_set_property (GObject *object,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar;
|
|
|
|
|
|
|
|
|
|
pbar = GTK_PROGRESS_BAR (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
|
|
|
|
gtk_progress_bar_set_orientation (pbar, g_value_get_enum (value));
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
case PROP_INVERTED:
|
|
|
|
|
gtk_progress_bar_set_inverted (pbar, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_FRACTION:
|
|
|
|
|
gtk_progress_bar_set_fraction (pbar, g_value_get_double (value));
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_PULSE_STEP:
|
|
|
|
|
gtk_progress_bar_set_pulse_step (pbar, g_value_get_double (value));
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_TEXT:
|
|
|
|
|
gtk_progress_bar_set_text (pbar, g_value_get_string (value));
|
2001-01-18 04:10:40 +00:00
|
|
|
|
break;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
case PROP_SHOW_TEXT:
|
|
|
|
|
gtk_progress_bar_set_show_text (pbar, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
case PROP_ELLIPSIZE:
|
|
|
|
|
gtk_progress_bar_set_ellipsize (pbar, g_value_get_enum (value));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_progress_bar_get_property (GObject *object,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (object);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_enum (value, pbar->orientation);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
case PROP_INVERTED:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_boolean (value, pbar->inverted);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_FRACTION:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_double (value, pbar->fraction);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_PULSE_STEP:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_double (value, pbar->pulse_fraction);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_TEXT:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_string (value, pbar->text);
|
2001-01-18 04:10:40 +00:00
|
|
|
|
break;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
case PROP_SHOW_TEXT:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_boolean (value, pbar->show_text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
break;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
case PROP_ELLIPSIZE:
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_value_set_enum (value, pbar->ellipsize);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-08 17:36:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkProgressBar.
|
|
|
|
|
*
|
|
|
|
|
* Returns: a #GtkProgressBar.
|
|
|
|
|
*/
|
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
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_progress_bar_new (void)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *pbar;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
Use g_object_new instead of gtk_widget_new
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* demos/testpixbuf.c (new_testrgb_window):
* gtk/gtkctree.c (gtk_ctree_new_with_titles):
* gtk/gtkitemfactory.c (gtk_item_factory_construct),
(gtk_item_factory_create_item):
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
* gtk/gtkprogressbar.c (gtk_progress_bar_new),
(gtk_progress_bar_new_with_adjustment):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_new):
* gtk/gtktext.c (gtk_text_new):
* gtk/gtkviewport.c (gtk_viewport_new):
* tests/simple.c (main):
* tests/testgtk.c (create_statusbar), (create_get_image),
(create_saved_position), (create_tooltips), (create_cursors),
(create_display_screen), (create_progress_bar), (create_idle_test):
* tests/testmultidisplay.c (make_selection_dialog), (main):
* tests/testmultiscreen.c (main):
* tests/testrgb.c (new_testrgb_window):
Use g_object_new instead of gtk_widget_new
svn path=/trunk/; revision=20462
2008-06-19 12:25:19 +00:00
|
|
|
|
pbar = g_object_new (GTK_TYPE_PROGRESS_BAR, NULL);
|
1998-07-19 10:35:39 +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
|
|
|
|
return pbar;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (object);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_mode)
|
2013-11-10 06:20:27 +00:00
|
|
|
|
gtk_progress_bar_act_mode_leave (pbar);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_free (pbar->text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_clear_pointer (&pbar->label, gtk_widget_unparent);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_unparent (pbar->progress_widget);
|
|
|
|
|
gtk_widget_unparent (pbar->trough_widget);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_progress_bar_parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
static gchar *
|
|
|
|
|
get_current_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->text)
|
|
|
|
|
return g_strdup (pbar->text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
else
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return g_strdup_printf (C_("progress bar label", "%.0f %%"), pbar->fraction * 100.0);
|
2006-06-12 01:54:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-10 06:20:27 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
tick_cb (GtkWidget *widget,
|
|
|
|
|
GdkFrameClock *frame_clock,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (widget);
|
2016-03-28 08:08:48 +00:00
|
|
|
|
gint64 frame_time;
|
|
|
|
|
gdouble iteration, pulse_iterations, current_iterations, fraction;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->pulse2 == 0 && pbar->pulse1 == 0)
|
2016-03-28 08:08:48 +00:00
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
|
|
|
|
|
frame_time = gdk_frame_clock_get_frame_time (frame_clock);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_progress_tracker_advance_frame (&pbar->tracker, frame_time);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_assert (pbar->pulse2 > pbar->pulse1);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pulse_iterations = (pbar->pulse2 - pbar->pulse1) / (double) G_USEC_PER_SEC;
|
|
|
|
|
current_iterations = (frame_time - pbar->pulse1) / (double) G_USEC_PER_SEC;
|
2013-11-11 12:24:35 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
iteration = gtk_progress_tracker_get_iteration (&pbar->tracker);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
/* Determine the fraction to move the block from one frame
|
|
|
|
|
* to the next when pulse_fraction is how far the block should
|
|
|
|
|
* move between two calls to gtk_progress_bar_pulse().
|
|
|
|
|
*/
|
2020-04-26 19:44:44 +00:00
|
|
|
|
fraction = pbar->pulse_fraction * (iteration - pbar->last_iteration) / MAX (pulse_iterations, current_iterations);
|
|
|
|
|
pbar->last_iteration = iteration;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
if (current_iterations > 3 * pulse_iterations)
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
|
|
|
|
/* advance the block */
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_dir == 0)
|
2013-11-10 06:20:27 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos += fraction;
|
|
|
|
|
if (pbar->activity_pos > 1.0)
|
2013-11-10 06:20:27 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos = 1.0;
|
|
|
|
|
pbar->activity_dir = 1;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos -= fraction;
|
|
|
|
|
if (pbar->activity_pos <= 0)
|
2013-11-10 06:20:27 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos = 0;
|
|
|
|
|
pbar->activity_dir = 0;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_queue_allocate (pbar->trough_widget);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
1998-07-19 10:35:39 +00:00
|
|
|
|
static void
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
|
1998-07-19 10:35:39 +00:00
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (pbar);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
gboolean inverted;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
|
2010-08-11 21:03:49 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
inverted = pbar->inverted;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
2002-11-02 00:18:14 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2010-09-02 03:24:20 +00:00
|
|
|
|
inverted = !inverted;
|
2002-11-02 00:18:14 +00:00
|
|
|
|
}
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
1998-07-19 10:35:39 +00:00
|
|
|
|
/* calculate start pos */
|
2017-03-20 08:22:13 +00:00
|
|
|
|
if (!inverted)
|
1998-07-19 10:35:39 +00:00
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos = 0.0;
|
|
|
|
|
pbar->activity_dir = 0;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_pos = 1.0;
|
|
|
|
|
pbar->activity_dir = 1;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
2016-03-28 08:08:48 +00:00
|
|
|
|
/* No fixed schedule for pulses, will adapt after calls to update_pulse. Just
|
|
|
|
|
* start the tracker to repeat forever with iterations every second.*/
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_progress_tracker_start (&pbar->tracker, G_USEC_PER_SEC, 0, INFINITY);
|
|
|
|
|
pbar->tick_id = gtk_widget_add_tick_callback (widget, tick_cb, NULL, NULL);
|
|
|
|
|
pbar->pulse2 = 0;
|
|
|
|
|
pbar->pulse1 = 0;
|
|
|
|
|
pbar->last_iteration = 0;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_act_mode_leave (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->tick_id)
|
|
|
|
|
gtk_widget_remove_tick_callback (GTK_WIDGET (pbar), pbar->tick_id);
|
|
|
|
|
pbar->tick_id = 0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_set_activity_mode (GtkProgressBar *pbar,
|
|
|
|
|
gboolean activity_mode)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_mode == activity_mode)
|
|
|
|
|
return;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->activity_mode = activity_mode;
|
add -DGTK_DISABLE_DEPRECATED. #undef it at the top of gtktypebuiltins.c.
Tue Nov 19 17:05:51 2002 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: add -DGTK_DISABLE_DEPRECATED. #undef it at the
top of gtktypebuiltins.c.
* gtk/gtkclist.c
* gtk/gtkcombo.c
* gtk/gtkctree.c
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkoldeditable.c
* gtk/gtkpixmap.c
* gtk/gtkpreview.c
* gtk/gtksignal.c
* gtk/gtktext.c
* gtk/gtktipsquery.c
* gtk/gtktree.c
* gtk/gtktreeitem.c
* gtk/gtktypeutils.c: #undef GTK_DISABLE_DEPRECATED, deprecated widgets
and compat code.
* gtk/gtkcolorsel.c: move gtk_color_selection_set_color implementation
to set_color_internal, and use that. The deprecated function now
merely wraps it.
* gtk/gtkfontsel.c: same as above, except with
gtk_font_selection_get_font.
* gtk/gtknotebook.c: same as above, except with
gtk_notebook_set_homogeneous, and gtk_notebook_set_tab_{border,
hborder,vborder}.
* gtk/gtkprogressbar.c: same as above, except with
gtk_progress_bar_set_{bar_stype,discrete_blocks,activity_step,
activity_blocks}.
* gtk/gtkstyle.c: same as above, except with gtk_style_get_font.
* gtk/gtkwidget.c: same as above, except with gtk_widget_set_usize.
* gtk/gtkitemfactory.h: declare compatibility functions for deprecated
GtkMenuFactory stuff if GTK_COMPILATION, since they are used
internally by the compat code.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
use of deprecated gtk_check_menu_item_set_show_toggle (it is a noop
now).
* gtk/gtkmain.c: replaced deprecated GTK_TYPE_* with G_TYPE_*.
* gtk/gtkobject.c: replaced various deprecated functions. In set and
get_property, use g_object_{set,get}_data with "user_data" instead
of gtk_object_{set,get}_user_data.
* gtk/gtkprogress.h: API declared if GTK_COMPILATION
* gtk/gtkprogress.c: port get_type to GObject API.
* gtk/gtktypeutils.h: declare GtkArg stuff and gtk_type_init,
if GTK_COMPILATION.
* gtk/gtkwidget.c: define gtk_widget_queue_clear in terms of
gtk_widget_queue_draw instead of the other way around.
* tests/Makefile.am: define -DGTK_DISABLE_DEPRECATED
* tests/testgtk.c
* tests/testselection.c
* tests/testsocket.c: #undef GTK_DISABLE_DEPRECATED, makes use of
deprecated stuff.
2002-11-20 01:07:33 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->activity_mode)
|
|
|
|
|
gtk_progress_bar_act_mode_enter (pbar);
|
|
|
|
|
else
|
|
|
|
|
gtk_progress_bar_act_mode_leave (pbar);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_fraction:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @fraction: fraction of the task that’s been completed
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Causes the progress bar to “fill in” the given fraction
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* of the bar. The fraction should be between 0.0 and 1.0,
|
|
|
|
|
* inclusive.
|
2011-11-11 15:26:31 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble fraction)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->fraction = CLAMP (fraction, 0.0, 1.0);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->label)
|
2017-04-06 17:22:14 +00:00
|
|
|
|
{
|
|
|
|
|
char *text = get_current_text (pbar);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_label_set_label (GTK_LABEL (pbar->label), text);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
|
|
|
|
g_free (text);
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_activity_mode (pbar, FALSE);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_queue_allocate (pbar->trough_widget);
|
2016-11-18 22:43:09 +00:00
|
|
|
|
update_fraction_classes (pbar);
|
2001-01-18 04:10:40 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_FRACTION]);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-10 06:20:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_update_pulse (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2016-03-28 08:08:48 +00:00
|
|
|
|
gint64 pulse_time = g_get_monotonic_time ();
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->pulse2 == pulse_time)
|
2016-03-28 08:08:48 +00:00
|
|
|
|
return;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->pulse1 = pbar->pulse2;
|
|
|
|
|
pbar->pulse2 = pulse_time;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_pulse:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* Indicates that some progress has been made, but you don’t know how much.
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Causes the progress bar to enter “activity mode,” where a block
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* bounces back and forth. Each call to gtk_progress_bar_pulse()
|
|
|
|
|
* causes the block to move by a little bit (the amount of movement
|
|
|
|
|
* per pulse is determined by gtk_progress_bar_set_pulse_step()).
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_pulse (GtkProgressBar *pbar)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2000-07-25 22:58:17 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_activity_mode (pbar, TRUE);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
gtk_progress_bar_update_pulse (pbar);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* @text: (allow-none): a UTF-8 string, or %NULL
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Causes the given @text to appear next to the progress bar.
|
2011-07-15 16:24:01 +00:00
|
|
|
|
*
|
|
|
|
|
* If @text is %NULL and #GtkProgressBar:show-text is %TRUE, the current
|
|
|
|
|
* value of #GtkProgressBar:fraction will be displayed as a percentage.
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* If @text is non-%NULL and #GtkProgressBar:show-text is %TRUE, the text
|
|
|
|
|
* will be displayed. In this case, it will not display the progress
|
|
|
|
|
* percentage. If @text is the empty string, the progress bar will still
|
|
|
|
|
* be styled and sized suitably for containing text, as long as
|
|
|
|
|
* #GtkProgressBar:show-text is %TRUE.
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_text (GtkProgressBar *pbar,
|
2001-01-18 04:10:40 +00:00
|
|
|
|
const gchar *text)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2011-07-15 16:24:01 +00:00
|
|
|
|
/* Don't notify again if nothing's changed. */
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (g_strcmp0 (pbar->text, text) == 0)
|
2011-07-15 16:24:01 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_free (pbar->text);
|
|
|
|
|
pbar->text = g_strdup (text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->label)
|
|
|
|
|
gtk_label_set_label (GTK_LABEL (pbar->label), text);
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_TEXT]);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_show_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2018-03-31 11:27:21 +00:00
|
|
|
|
* @show_text: whether to show text
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets whether the progress bar will show text next to the bar.
|
|
|
|
|
* The shown text is either the value of the #GtkProgressBar:text
|
|
|
|
|
* property or, if that is %NULL, the #GtkProgressBar:fraction value,
|
|
|
|
|
* as a percentage.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2011-07-15 16:24:01 +00:00
|
|
|
|
* To make a progress bar that is styled and sized suitably for containing
|
|
|
|
|
* text (even if the actual text is blank), set #GtkProgressBar:show-text to
|
|
|
|
|
* %TRUE and #GtkProgressBar:text to the empty string (not %NULL).
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_show_text (GtkProgressBar *pbar,
|
|
|
|
|
gboolean show_text)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
|
|
|
|
show_text = !!show_text;
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->show_text == show_text)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->show_text = show_text;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (show_text)
|
|
|
|
|
{
|
2017-04-06 17:22:14 +00:00
|
|
|
|
char *text = get_current_text (pbar);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->label = g_object_new (GTK_TYPE_LABEL,
|
2017-04-06 17:22:14 +00:00
|
|
|
|
"css-name", "text",
|
|
|
|
|
"label", text,
|
2020-04-26 19:44:44 +00:00
|
|
|
|
"ellipsize", pbar->ellipsize,
|
2017-04-06 17:22:14 +00:00
|
|
|
|
NULL);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_insert_after (pbar->label, GTK_WIDGET (pbar), NULL);
|
2016-06-03 20:30:00 +00:00
|
|
|
|
|
2017-04-06 17:22:14 +00:00
|
|
|
|
g_free (text);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
g_clear_pointer (&pbar->label, gtk_widget_unparent);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_SHOW_TEXT]);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_show_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Gets the value of the #GtkProgressBar:show-text property.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* See gtk_progress_bar_set_show_text().
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if text is shown in the progress bar
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_progress_bar_get_show_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), FALSE);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->show_text;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_pulse_step:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @fraction: fraction between 0.0 and 1.0
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* Sets the fraction of total progress bar length to move the
|
|
|
|
|
* bouncing block for each call to gtk_progress_bar_pulse().
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
|
|
|
|
|
gdouble fraction)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->pulse_fraction = fraction;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_PULSE_STEP]);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_direction_changed (GtkWidget *widget,
|
|
|
|
|
GtkTextDirection previous_dir)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (widget);
|
|
|
|
|
|
|
|
|
|
update_node_classes (pbar);
|
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->direction_changed (widget, previous_dir);
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-02 03:25:22 +00:00
|
|
|
|
static void
|
2010-09-02 03:24:20 +00:00
|
|
|
|
gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
|
|
|
|
|
GtkOrientation orientation)
|
1998-07-19 10:35:39 +00:00
|
|
|
|
{
|
2019-07-15 04:38:51 +00:00
|
|
|
|
GtkBoxLayout *layout;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->orientation == orientation)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->orientation = orientation;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
2019-07-15 04:38:51 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_set_vexpand (pbar->trough_widget, FALSE);
|
|
|
|
|
gtk_widget_set_hexpand (pbar->trough_widget, TRUE);
|
|
|
|
|
gtk_widget_set_halign (pbar->trough_widget, GTK_ALIGN_FILL);
|
|
|
|
|
gtk_widget_set_valign (pbar->trough_widget, GTK_ALIGN_CENTER);
|
2019-07-15 04:38:51 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-26 19:44:44 +00:00
|
|
|
|
gtk_widget_set_vexpand (pbar->trough_widget, TRUE);
|
|
|
|
|
gtk_widget_set_hexpand (pbar->trough_widget, FALSE);
|
|
|
|
|
gtk_widget_set_halign (pbar->trough_widget, GTK_ALIGN_CENTER);
|
|
|
|
|
gtk_widget_set_valign (pbar->trough_widget, GTK_ALIGN_FILL);
|
2019-07-15 04:38:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
|
2017-05-14 06:05:55 +00:00
|
|
|
|
update_node_classes (pbar);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
2019-07-15 04:38:51 +00:00
|
|
|
|
layout = GTK_BOX_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (pbar)));
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (layout), GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_object_notify (G_OBJECT (pbar), "orientation");
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_inverted:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @inverted: %TRUE to invert the progress bar
|
|
|
|
|
*
|
|
|
|
|
* Progress bars normally grow from top to bottom or left to right.
|
|
|
|
|
* Inverted progress bars grow in the opposite direction.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_inverted (GtkProgressBar *pbar,
|
|
|
|
|
gboolean inverted)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->inverted == inverted)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->inverted = inverted;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
update_node_classes (pbar);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_INVERTED]);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Retrieves the text that is displayed with the progress bar,
|
2001-02-17 17:21:21 +00:00
|
|
|
|
* if any, otherwise %NULL. The return value is a reference
|
|
|
|
|
* to the text, not a copy of it, so will become invalid
|
|
|
|
|
* if you change the text in the progress bar.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable): text, or %NULL; this string is owned by the widget
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
|
* and should not be modified or freed.
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const gchar*
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), NULL);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->text;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_fraction:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns the current fraction of the task that’s been completed.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: a fraction from 0.0 to 1.0
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_fraction (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->fraction;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_pulse_step:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Retrieves the pulse step set with gtk_progress_bar_set_pulse_step().
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: a fraction from 0.0 to 1.0
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->pulse_fraction;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_inverted:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Gets the value set by gtk_progress_bar_set_inverted().
|
2010-09-02 03:24:20 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the progress bar is inverted
|
2010-09-02 03:24:20 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_progress_bar_get_inverted (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), FALSE);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->inverted;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-31 04:36:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_ellipsize:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @mode: a #PangoEllipsizeMode
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets the mode used to ellipsize (add an ellipsis: "...") the
|
|
|
|
|
* text if there is not enough space to render the entire string.
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2004-10-31 04:36:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
PangoEllipsizeMode mode)
|
2004-10-31 04:36:50 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
g_return_if_fail (mode >= PANGO_ELLIPSIZE_NONE &&
|
|
|
|
|
mode <= PANGO_ELLIPSIZE_END);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if ((PangoEllipsizeMode)pbar->ellipsize == mode)
|
|
|
|
|
return;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
pbar->ellipsize = mode;
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
if (pbar->label)
|
|
|
|
|
gtk_label_set_ellipsize (GTK_LABEL (pbar->label), mode);
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_ELLIPSIZE]);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2005-03-17 03:23:23 +00:00
|
|
|
|
* gtk_progress_bar_get_ellipsize:
|
2004-10-31 04:36:50 +00:00
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Returns the ellipsizing position of the progress bar.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
* See gtk_progress_bar_set_ellipsize().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: #PangoEllipsizeMode
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2010-06-09 04:29:55 +00:00
|
|
|
|
PangoEllipsizeMode
|
2004-10-31 04:36:50 +00:00
|
|
|
|
gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), PANGO_ELLIPSIZE_NONE);
|
|
|
|
|
|
2020-04-26 19:44:44 +00:00
|
|
|
|
return pbar->ellipsize;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
}
|