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
|
|
|
|
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkboxlayout.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"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkorientable.h"
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include "gtkprogresstrackerprivate.h"
|
|
|
|
|
#include "gtkprivate.h"
|
|
|
|
|
#include "gtkwidgetprivate.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2018-02-08 13:39:45 +00:00
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2010-11-08 17:36:39 +00:00
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* `GtkProgressBar` is typically used to display the progress of a long
|
|
|
|
|
* running operation.
|
|
|
|
|
*
|
|
|
|
|
* It provides a visual clue that processing is underway. `GtkProgressBar`
|
|
|
|
|
* can be used in two different modes: percentage mode and activity mode.
|
|
|
|
|
*
|
|
|
|
|
* ![An example GtkProgressBar](progressbar.png)
|
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
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* progress, it can use the `GtkProgressBar` in percentage mode and the
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* user sees a growing bar indicating the percentage of the work that
|
|
|
|
|
* has been completed. In this mode, the application is required to call
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* [method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*
|
|
|
|
|
* When an application has no accurate way of knowing the amount of work
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* to do, it can use the `GtkProgressBar` in activity mode, which shows
|
2010-11-08 17:36:39 +00:00
|
|
|
|
* activity by a block moving back and forth within the progress area. In
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* this mode, the application is required to call [method@Gtk.ProgressBar.pulse]
|
2010-11-08 17:36:39 +00:00
|
|
|
|
* periodically to update the progress bar.
|
|
|
|
|
*
|
|
|
|
|
* There is quite a bit of flexibility provided to control the appearance
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* of the `GtkProgressBar`. Functions are provided to control the orientation
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* 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
|
|
|
|
|
*
|
2021-02-28 01:04:37 +00:00
|
|
|
|
* ```
|
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]
|
2021-02-28 01:04:37 +00:00
|
|
|
|
* ```
|
2015-11-03 18:37:57 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +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.
|
2020-07-27 14:46:52 +00:00
|
|
|
|
*
|
|
|
|
|
* # Accessibility
|
|
|
|
|
*
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* `GtkProgressBar` uses the %GTK_ACCESSIBLE_ROLE_PROGRESS_BAR role.
|
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;
|
|
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *text;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2017-04-06 17:22:14 +00:00
|
|
|
|
GtkWidget *label;
|
|
|
|
|
GtkWidget *trough_widget;
|
|
|
|
|
GtkWidget *progress_widget;
|
|
|
|
|
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double fraction;
|
|
|
|
|
double pulse_fraction;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2012-12-23 18:13:11 +00:00
|
|
|
|
double activity_pos;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
guint activity_blocks;
|
|
|
|
|
|
2021-06-15 11:37:57 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
guint tick_id;
|
|
|
|
|
GtkProgressTracker tracker;
|
|
|
|
|
gint64 pulse1;
|
|
|
|
|
gint64 pulse2;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double 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);
|
2020-07-27 23:24:49 +00:00
|
|
|
|
static void gtk_progress_bar_dispose (GObject *object);
|
2010-10-27 03:30:48 +00:00
|
|
|
|
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;
|
2020-07-27 23:24:49 +00:00
|
|
|
|
gobject_class->dispose = gtk_progress_bar_dispose;
|
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
|
|
|
|
|
2021-02-19 20:43:33 +00:00
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:inverted: (attributes org.gtk.Property.get=gtk_progress_bar_get_inverted org.gtk.Property.set=gtk_progress_bar_set_inverted)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
|
|
|
|
* Invert the direction in which the progress bar grows.
|
|
|
|
|
*/
|
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);
|
|
|
|
|
|
2021-02-19 20:43:33 +00:00
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:fraction: (attributes org.gtk.Property.get=gtk_progress_bar_get_fraction org.gtk.Property.set=gtk_progress_bar_set_fraction)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
|
|
|
|
* The fraction of total work that has been completed.
|
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
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);
|
|
|
|
|
|
2021-02-19 20:43:33 +00:00
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:pulse-step: (attributes org.gtk.Property.get=gtk_progress_bar_get_pulse_step org.gtk.Property.set=gtk_progress_bar_set_pulse_step)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
|
|
|
|
* The fraction of total progress to move the bounding block when pulsed.
|
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
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);
|
|
|
|
|
|
2021-02-19 20:43:33 +00:00
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:text: (attributes org.gtk.Property.get=gtk_progress_bar_get_text org.gtk.Property.set=gtk_progress_bar_set_text)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
|
|
|
|
* Text to be displayed in the progress bar.
|
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:show-text: (attributes org.gtk.Property.get=gtk_progress_bar_get_show_text org.gtk.Property.set=gtk_progress_bar_set_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
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* to the bar itself.
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* The shown text is either the value of the [property@Gtk.ProgressBar:text]
|
|
|
|
|
* property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction]
|
|
|
|
|
* value, as a percentage.
|
|
|
|
|
*
|
|
|
|
|
* To make a progress bar that is styled and sized suitably for showing text
|
|
|
|
|
* (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text]
|
|
|
|
|
* to %TRUE and [property@Gtk.ProgressBar: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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* GtkProgressBar:ellipsize: (attributes org.gtk.Property.get=gtk_progress_bar_get_ellipsize org.gtk.Property.set=gtk_progress_bar_set_ellipsize)
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* The preferred place to ellipsize the string.
|
|
|
|
|
*
|
|
|
|
|
* The text will be ellipsized if the progress bar does not have enough room
|
|
|
|
|
* to display the entire string, specified as a `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
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* progress bar's width is [method@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
|
|
|
|
|
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);
|
2020-07-13 15:03:27 +00:00
|
|
|
|
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_PROGRESS_BAR);
|
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
|
|
|
|
{
|
2021-06-15 11:37:57 +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)
|
|
|
|
|
{
|
2021-06-15 11:37:57 +00:00
|
|
|
|
if (pbar->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-11-01 00:20:13 +00:00
|
|
|
|
inverted = !inverted;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-15 11:37:57 +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-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, "left");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, "left");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (right)
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, "right");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, "right");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (top)
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, "top");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, "top");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (bottom)
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, "bottom");
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, "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)
|
|
|
|
|
{
|
2021-06-15 11:37:57 +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
|
|
|
|
{
|
2021-06-15 11:37:57 +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
|
|
|
|
|
{
|
2021-06-15 11:37:57 +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;
|
|
|
|
|
|
2020-10-21 19:09:55 +00:00
|
|
|
|
pbar->trough_widget = gtk_gizmo_new_with_role ("trough",
|
|
|
|
|
GTK_ACCESSIBLE_ROLE_NONE,
|
|
|
|
|
NULL,
|
|
|
|
|
allocate_trough,
|
|
|
|
|
NULL,
|
|
|
|
|
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-10-21 19:09:55 +00:00
|
|
|
|
pbar->progress_widget = gtk_gizmo_new_with_role ("progress",
|
|
|
|
|
GTK_ACCESSIBLE_ROLE_NONE,
|
|
|
|
|
NULL, NULL, NULL, NULL, NULL, NULL);
|
2020-04-26 19:44:44 +00:00
|
|
|
|
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 */
|
2021-06-15 11:37:57 +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);
|
2021-06-15 11:37:57 +00:00
|
|
|
|
gtk_widget_update_orientation (GTK_WIDGET (pbar), pbar->orientation);
|
2020-07-27 23:24:49 +00:00
|
|
|
|
|
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (pbar),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, 1.0,
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, 0.0,
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, 0.0,
|
|
|
|
|
-1);
|
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:
|
2021-06-15 11:37:57 +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:
|
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* Creates a new `GtkProgressBar`.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* Returns: a `GtkProgressBar`.
|
2010-11-08 17:36: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
|
|
|
|
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
|
2020-07-27 23:24:49 +00:00
|
|
|
|
gtk_progress_bar_dispose (GObject *object)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
|
|
|
|
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_clear_pointer (&pbar->label, gtk_widget_unparent);
|
2020-07-27 23:24:49 +00:00
|
|
|
|
g_clear_pointer (&pbar->progress_widget, gtk_widget_unparent);
|
|
|
|
|
g_clear_pointer (&pbar->trough_widget, gtk_widget_unparent);
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_progress_bar_parent_class)->dispose (object);
|
|
|
|
|
}
|
2017-04-06 17:22:14 +00:00
|
|
|
|
|
2020-07-27 23:24:49 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (object);
|
|
|
|
|
|
|
|
|
|
g_free (pbar->text);
|
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
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
|
static char *
|
2010-06-09 04:29:55 +00:00
|
|
|
|
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;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double 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-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (pbar->progress_widget, "pulse");
|
2020-07-17 17:10:18 +00:00
|
|
|
|
gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
|
|
|
|
|
GTK_ACCESSIBLE_STATE_BUSY, TRUE,
|
|
|
|
|
-1);
|
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
|
|
|
|
{
|
2021-06-15 11:37:57 +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-07-17 17:10:18 +00:00
|
|
|
|
gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
|
|
|
|
|
GTK_ACCESSIBLE_STATE_BUSY, FALSE,
|
|
|
|
|
-1);
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (pbar->progress_widget, "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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_fraction: (attributes org.gtk.Method.set_property=fraction)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @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
|
2021-02-19 20:43:33 +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,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double fraction)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
2020-07-28 12:27:50 +00:00
|
|
|
|
char *text = NULL;
|
|
|
|
|
|
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
|
|
|
|
{
|
2020-07-28 12:27:50 +00:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
2020-07-17 17:10:18 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (pbar),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, 1.0,
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, 0.0,
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, fraction,
|
|
|
|
|
-1);
|
|
|
|
|
|
2020-07-28 12:27:50 +00:00
|
|
|
|
if (text != NULL)
|
|
|
|
|
{
|
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (pbar),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, text,
|
|
|
|
|
-1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_accessible_reset_property (GTK_ACCESSIBLE (pbar), GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_free (text);
|
2020-07-17 17:10:18 +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:
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @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.
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Causes the progress bar to enter “activity mode,” where a block
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* bounces back and forth. Each call to [method@Gtk.ProgressBar.pulse]
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* causes the block to move by a little bit (the amount of movement
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* per pulse is determined by [method@Gtk.ProgressBar.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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_text: (attributes org.gtk.Method.set_property=text)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2021-05-21 00:45:06 +00:00
|
|
|
|
* @text: (nullable): a UTF-8 string
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
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
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* If @text is %NULL and [property@Gtk.ProgressBar:show-text] is %TRUE,
|
|
|
|
|
* the current value of [property@Gtk.ProgressBar:fraction] will be displayed
|
|
|
|
|
* as a percentage.
|
2011-07-15 16:24:01 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* If @text is non-%NULL and [property@Gtk.ProgressBar:show-text] is %TRUE,
|
|
|
|
|
* the text will be displayed. In this case, it will not display the progress
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* percentage. If @text is the empty string, the progress bar will still
|
|
|
|
|
* be styled and sized suitably for containing text, as long as
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* [property@Gtk.ProgressBar: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,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_show_text: (attributes org.gtk.Method.set_property=show-text)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @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.
|
2021-02-19 20:43:33 +00:00
|
|
|
|
*
|
|
|
|
|
* The shown text is either the value of the [property@Gtk.ProgressBar:text]
|
|
|
|
|
* property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] value,
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* 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
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* text (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text]
|
|
|
|
|
* to %TRUE and [property@Gtk.ProgressBar: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,
|
2020-10-21 19:09:55 +00:00
|
|
|
|
"accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_show_text: (attributes org.gtk.Method.get_property=show-text)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
|
|
|
|
*
|
|
|
|
|
* Returns whether the `GtkProgressBar` shows text.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* See [method@Gtk.ProgressBar.set_show_text].
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_pulse_step: (attributes org.gtk.Method.set_property=pulse-step)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* @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
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* bouncing block.
|
|
|
|
|
*
|
|
|
|
|
* The bouncing block is moved when [method@Gtk.ProgressBar.pulse]
|
|
|
|
|
* is called.
|
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,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double 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
|
|
|
|
|
2021-06-15 11:37:57 +00:00
|
|
|
|
if (pbar->orientation == orientation)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2021-06-15 11:37:57 +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
|
|
|
|
}
|
|
|
|
|
|
2021-06-15 11:37:57 +00:00
|
|
|
|
gtk_widget_update_orientation (GTK_WIDGET (pbar), pbar->orientation);
|
2017-05-14 06:05:55 +00:00
|
|
|
|
update_node_classes (pbar);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
2021-06-15 11:37:57 +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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_inverted: (attributes org.gtk.Method.set_property=inverted)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2010-09-02 03:24:20 +00:00
|
|
|
|
* @inverted: %TRUE to invert the progress bar
|
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* Sets whether the progress bar is inverted.
|
|
|
|
|
*
|
2010-09-02 03:24:20 +00:00
|
|
|
|
* 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
|
|
|
|
|
2021-12-18 17:45:28 +00:00
|
|
|
|
gtk_widget_queue_allocate (pbar->trough_widget);
|
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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_text: (attributes org.gtk.Method.get_property=text)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
|
|
|
|
*
|
|
|
|
|
* Retrieves the text that is displayed with the progress bar.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* 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
|
|
|
|
*
|
2021-05-21 00:45:06 +00:00
|
|
|
|
* Returns: (nullable): the text
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_fraction: (attributes org.gtk.Method.get_property=fraction)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @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
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_pulse_step: (attributes org.gtk.Method.get_property=pulse-step)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* Retrieves the pulse step.
|
|
|
|
|
*
|
|
|
|
|
* See [method@Gtk.ProgressBar.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
|
|
|
|
*/
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double
|
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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_inverted: (attributes org.gtk.Method.get_property=inverted)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2010-09-02 03:24:20 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* Returns whether the progress bar is 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
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_set_ellipsize: (attributes org.gtk.Method.set_property=ellipsize)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
|
|
|
|
* @mode: a `PangoEllipsizeMode`
|
|
|
|
|
*
|
|
|
|
|
* Sets the mode used to ellipsize the text.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* The text is ellipsized 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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-24 04:10:56 +00:00
|
|
|
|
* gtk_progress_bar_get_ellipsize: (attributes org.gtk.Method.get_property=ellipsize)
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* @pbar: a `GtkProgressBar`
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Returns the ellipsizing position of the progress bar.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2021-02-19 20:43:33 +00:00
|
|
|
|
* See [method@Gtk.ProgressBar.set_ellipsize].
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
}
|