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"
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
1998-12-24 19:39:00 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
#include "gtkprogressbar.h"
|
2011-01-30 08:12:49 +00:00
|
|
|
|
#include "gtkorientableprivate.h"
|
2014-07-18 20:31:17 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2001-03-30 15:46:17 +00:00
|
|
|
|
#include "gtkintl.h"
|
2015-11-01 00:20:13 +00:00
|
|
|
|
#include "gtkcssshadowsvalueprivate.h"
|
|
|
|
|
#include "gtkstylecontextprivate.h"
|
|
|
|
|
#include "gtkcssnodeprivate.h"
|
|
|
|
|
#include "gtkcssstylepropertyprivate.h"
|
2015-11-24 12:22:52 +00:00
|
|
|
|
#include "gtkcsscustomgadgetprivate.h"
|
|
|
|
|
#include "gtkcssnumbervalueprivate.h"
|
2016-03-28 08:08:48 +00:00
|
|
|
|
#include "gtkprogresstrackerprivate.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-06-27 03:00:20 +00:00
|
|
|
|
#include "a11y/gtkprogressbaraccessible.h"
|
|
|
|
|
|
2016-05-09 08:37:39 +00:00
|
|
|
|
#include "fallback-c89.c"
|
|
|
|
|
|
2010-11-08 17:36:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkprogressbar
|
|
|
|
|
* @Short_description: A widget which indicates progress visually
|
|
|
|
|
* @Title: GtkProgressBar
|
|
|
|
|
*
|
|
|
|
|
* The #GtkProgressBar is typically used to display the progress of a long
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* running operation. It provides a visual clue that processing is underway.
|
|
|
|
|
* The GtkProgressBar can be used in two different modes: percentage mode
|
|
|
|
|
* and activity mode.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*
|
|
|
|
|
* When an application can determine how much work needs to take place
|
|
|
|
|
* (e.g. read a fixed number of bytes from a file) and can monitor its
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* progress, it can use the GtkProgressBar in percentage mode and the
|
|
|
|
|
* user sees a growing bar indicating the percentage of the work that
|
|
|
|
|
* has been completed. In this mode, the application is required to call
|
2010-11-08 17:36:39 +00:00
|
|
|
|
* gtk_progress_bar_set_fraction() periodically to update the progress bar.
|
|
|
|
|
*
|
|
|
|
|
* When an application has no accurate way of knowing the amount of work
|
|
|
|
|
* to do, it can use the #GtkProgressBar in activity mode, which shows
|
|
|
|
|
* activity by a block moving back and forth within the progress area. In
|
|
|
|
|
* this mode, the application is required to call gtk_progress_bar_pulse()
|
|
|
|
|
* periodically to update the progress bar.
|
|
|
|
|
*
|
|
|
|
|
* There is quite a bit of flexibility provided to control the appearance
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* of the #GtkProgressBar. Functions are provided to control the orientation
|
|
|
|
|
* of the bar, optional text can be displayed along with the bar, and the
|
|
|
|
|
* step size used in activity mode can be set.
|
2015-11-01 00:30:03 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
2015-11-03 18:37:57 +00:00
|
|
|
|
* |[<!-- language="plain" -->
|
2016-01-09 19:05:41 +00:00
|
|
|
|
* progressbar[.osd]
|
2015-11-04 17:32:15 +00:00
|
|
|
|
* ╰── trough
|
2015-11-24 12:22:52 +00:00
|
|
|
|
* ├── [text]
|
2015-11-04 17:32:15 +00:00
|
|
|
|
* ╰── progress[.pulse]
|
2015-11-03 18:37:57 +00:00
|
|
|
|
* ]|
|
|
|
|
|
*
|
2015-11-24 12:22:52 +00:00
|
|
|
|
* GtkProgressBar has a main CSS node with name progressbar and subnodes with
|
|
|
|
|
* names text, trough and 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.
|
2016-01-09 19:05:41 +00:00
|
|
|
|
* The .osd class on the progressbar node is for use in overlays like the one
|
|
|
|
|
* epiphany has for page loading progress.
|
2010-11-08 17:36:39 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
1998-07-19 10:35:39 +00:00
|
|
|
|
#define MIN_HORIZONTAL_BAR_WIDTH 150
|
2014-05-07 09:13:59 +00:00
|
|
|
|
#define MIN_HORIZONTAL_BAR_HEIGHT 6
|
|
|
|
|
#define MIN_VERTICAL_BAR_WIDTH 7
|
1998-07-19 10:35:39 +00:00
|
|
|
|
#define MIN_VERTICAL_BAR_HEIGHT 80
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
#define DEFAULT_PULSE_DURATION 250000000
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
|
struct _GtkProgressBarPrivate
|
2010-07-07 02:36:38 +00:00
|
|
|
|
{
|
|
|
|
|
gchar *text;
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
GtkCssGadget *gadget;
|
|
|
|
|
GtkCssGadget *text_gadget;
|
|
|
|
|
GtkCssGadget *trough_gadget;
|
|
|
|
|
GtkCssGadget *progress_gadget;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
gdouble fraction;
|
|
|
|
|
gdouble pulse_fraction;
|
|
|
|
|
|
2012-12-23 18:13:11 +00:00
|
|
|
|
double activity_pos;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
guint activity_blocks;
|
|
|
|
|
|
2011-04-12 16:40:30 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
guint tick_id;
|
|
|
|
|
GtkProgressTracker tracker;
|
|
|
|
|
gint64 pulse1;
|
|
|
|
|
gint64 pulse2;
|
|
|
|
|
gdouble last_iteration;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
guint activity_dir : 1;
|
|
|
|
|
guint activity_mode : 1;
|
|
|
|
|
guint ellipsize : 3;
|
|
|
|
|
guint show_text : 1;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
guint inverted : 1;
|
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);
|
2014-07-18 20:31:17 +00:00
|
|
|
|
static void gtk_progress_bar_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation);
|
2010-10-27 03:30:48 +00:00
|
|
|
|
static void gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
|
|
|
|
static void gtk_progress_bar_get_preferred_height (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural);
|
|
|
|
|
|
|
|
|
|
static gboolean gtk_progress_bar_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr);
|
|
|
|
|
static void gtk_progress_bar_act_mode_enter (GtkProgressBar *progress);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
static void gtk_progress_bar_act_mode_leave (GtkProgressBar *progress);
|
2010-10-27 03:30:48 +00:00
|
|
|
|
static void gtk_progress_bar_finalize (GObject *object);
|
|
|
|
|
static void gtk_progress_bar_set_orientation (GtkProgressBar *progress,
|
|
|
|
|
GtkOrientation orientation);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
static void gtk_progress_bar_direction_changed (GtkWidget *widget,
|
|
|
|
|
GtkTextDirection previous_dir);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static void gtk_progress_bar_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state);
|
|
|
|
|
|
|
|
|
|
static void gtk_progress_bar_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_progress_bar_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
gint baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_progress_bar_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_progress_bar_allocate_trough (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
gint baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_progress_bar_render_trough (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_progress_bar_measure_text (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_progress_bar_render_text (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
|
|
|
|
gpointer data);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-09-02 03:25:22 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkProgressBar, gtk_progress_bar, GTK_TYPE_WIDGET,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkProgressBar)
|
2010-09-02 03:25:22 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_class_init (GtkProgressBarClass *class)
|
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
1998-07-19 10:35:39 +00:00
|
|
|
|
widget_class = (GtkWidgetClass *) class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gobject_class->set_property = gtk_progress_bar_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_progress_bar_get_property;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gobject_class->finalize = gtk_progress_bar_finalize;
|
|
|
|
|
|
2010-09-01 19:22:11 +00:00
|
|
|
|
widget_class->draw = gtk_progress_bar_draw;
|
2014-07-18 20:31:17 +00:00
|
|
|
|
widget_class->size_allocate = gtk_progress_bar_size_allocate;
|
2010-10-27 03:30:48 +00:00
|
|
|
|
widget_class->get_preferred_width = gtk_progress_bar_get_preferred_width;
|
|
|
|
|
widget_class->get_preferred_height = gtk_progress_bar_get_preferred_height;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
widget_class->direction_changed = gtk_progress_bar_direction_changed;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
widget_class->state_flags_changed = gtk_progress_bar_state_flags_changed;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-10-27 03:30:48 +00:00
|
|
|
|
g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation");
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_INVERTED] =
|
|
|
|
|
g_param_spec_boolean ("inverted",
|
|
|
|
|
P_("Inverted"),
|
|
|
|
|
P_("Invert the direction in which the progress bar grows"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_FRACTION] =
|
|
|
|
|
g_param_spec_double ("fraction",
|
|
|
|
|
P_("Fraction"),
|
|
|
|
|
P_("The fraction of total work that has been completed"),
|
|
|
|
|
0.0, 1.0,
|
|
|
|
|
0.0,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_PULSE_STEP] =
|
|
|
|
|
g_param_spec_double ("pulse-step",
|
|
|
|
|
P_("Pulse Step"),
|
|
|
|
|
P_("The fraction of total progress to move the bouncing block when pulsed"),
|
|
|
|
|
0.0, 1.0,
|
|
|
|
|
0.1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
progress_props[PROP_TEXT] =
|
|
|
|
|
g_param_spec_string ("text",
|
|
|
|
|
P_("Text"),
|
|
|
|
|
P_("Text to be displayed in the progress bar"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2011-01-08 09:46:46 +00:00
|
|
|
|
/**
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* GtkProgressBar:show-text:
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets whether the progress bar will show a text in addition
|
|
|
|
|
* to the bar itself. The shown text is either the value of
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* the #GtkProgressBar:text property or, if that is %NULL,
|
|
|
|
|
* the #GtkProgressBar:fraction value, as a percentage.
|
2011-01-08 09:46:46 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* To make a progress bar that is styled and sized suitably for
|
|
|
|
|
* showing text (even if the actual text is blank), set
|
|
|
|
|
* #GtkProgressBar:show-text to %TRUE and #GtkProgressBar:text
|
|
|
|
|
* to the empty string (not %NULL).
|
2011-07-15 16:24:01 +00:00
|
|
|
|
*
|
2011-01-08 09:46:46 +00:00
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_SHOW_TEXT] =
|
|
|
|
|
g_param_spec_boolean ("show-text",
|
|
|
|
|
P_("Show text"),
|
|
|
|
|
P_("Whether the progress is shown as text."),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2001-03-30 15:46:17 +00:00
|
|
|
|
|
2004-10-31 04:36:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkProgressBar:ellipsize:
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* The preferred place to ellipsize the string, if the progress bar does
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* not have enough room to display the entire string, specified as a
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* #PangoEllipsizeMode.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* Note that setting this property to a value other than
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* %PANGO_ELLIPSIZE_NONE has the side-effect that the progress bar requests
|
|
|
|
|
* only enough space to display the ellipsis ("..."). Another means to set a
|
|
|
|
|
* progress bar's width is gtk_widget_set_size_request().
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
2015-09-05 07:59:28 +00:00
|
|
|
|
progress_props[PROP_ELLIPSIZE] =
|
|
|
|
|
g_param_spec_enum ("ellipsize",
|
|
|
|
|
P_("Ellipsize"),
|
|
|
|
|
P_("The preferred place to ellipsize the string, if the progress bar "
|
|
|
|
|
"does not have enough room to display the entire string, if at all."),
|
|
|
|
|
PANGO_TYPE_ELLIPSIZE_MODE,
|
|
|
|
|
PANGO_ELLIPSIZE_NONE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, progress_props);
|
2014-06-09 13:20:55 +00:00
|
|
|
|
|
2011-06-27 03:00:20 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_PROGRESS_BAR_ACCESSIBLE);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, "progressbar");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_node_classes (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
|
|
|
|
gboolean left = FALSE;
|
|
|
|
|
gboolean right = FALSE;
|
|
|
|
|
gboolean top = FALSE;
|
|
|
|
|
gboolean bottom = FALSE;
|
|
|
|
|
|
|
|
|
|
/* Here we set positional classes, depending on which end of the
|
|
|
|
|
* progressbar the progress touches.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (priv->activity_mode)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
left = priv->activity_pos <= 0.0;
|
|
|
|
|
right = priv->activity_pos >= 1.0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
top = priv->activity_pos <= 0.0;
|
|
|
|
|
bottom = priv->activity_pos >= 1.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else /* continuous */
|
|
|
|
|
{
|
|
|
|
|
gboolean inverted;
|
|
|
|
|
|
|
|
|
|
inverted = priv->inverted;
|
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (pbar)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
inverted = !inverted;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
left = !inverted || priv->fraction >= 1.0;
|
|
|
|
|
right = inverted || priv->fraction >= 1.0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
top = !inverted || priv->fraction >= 1.0;
|
|
|
|
|
bottom = inverted || priv->fraction >= 1.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (left)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_LEFT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_remove_class (priv->progress_gadget, GTK_STYLE_CLASS_LEFT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (right)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_RIGHT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_remove_class (priv->progress_gadget, GTK_STYLE_CLASS_RIGHT);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (top)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_TOP);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_remove_class (priv->progress_gadget, GTK_STYLE_CLASS_TOP);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
if (bottom)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_BOTTOM);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_remove_class (priv->progress_gadget, GTK_STYLE_CLASS_BOTTOM);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_node_state (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
|
|
|
|
GtkStateFlags state;
|
|
|
|
|
|
|
|
|
|
state = gtk_widget_get_state_flags (GTK_WIDGET (pbar));
|
|
|
|
|
|
2016-01-13 05:05:16 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->gadget, state);
|
|
|
|
|
gtk_css_gadget_set_state (priv->trough_gadget, state);
|
|
|
|
|
gtk_css_gadget_set_state (priv->progress_gadget, state);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (priv->text_gadget)
|
2016-01-13 05:05:16 +00:00
|
|
|
|
gtk_css_gadget_set_state (priv->text_gadget, state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_init (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
pbar->priv = gtk_progress_bar_get_instance_private (pbar);
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
priv->inverted = FALSE;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->pulse_fraction = 0.1;
|
|
|
|
|
priv->activity_pos = 0;
|
|
|
|
|
priv->activity_dir = 1;
|
|
|
|
|
priv->activity_blocks = 5;
|
|
|
|
|
priv->ellipsize = PANGO_ELLIPSIZE_NONE;
|
|
|
|
|
priv->show_text = FALSE;
|
|
|
|
|
|
2009-10-07 17:32:23 +00:00
|
|
|
|
priv->text = NULL;
|
|
|
|
|
priv->fraction = 0.0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-10-21 09:40:46 +00:00
|
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (pbar), FALSE);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2014-07-18 23:39:11 +00:00
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (pbar));
|
2015-11-24 12:22:52 +00:00
|
|
|
|
priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
|
|
|
|
|
GTK_WIDGET (pbar),
|
|
|
|
|
gtk_progress_bar_measure,
|
|
|
|
|
gtk_progress_bar_allocate,
|
|
|
|
|
gtk_progress_bar_render,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
priv->trough_gadget = gtk_css_custom_gadget_new ("trough",
|
|
|
|
|
GTK_WIDGET (pbar),
|
|
|
|
|
priv->gadget,
|
|
|
|
|
NULL,
|
2016-10-04 17:53:36 +00:00
|
|
|
|
NULL,
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_progress_bar_allocate_trough,
|
|
|
|
|
gtk_progress_bar_render_trough,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
priv->progress_gadget = gtk_css_custom_gadget_new ("progress",
|
|
|
|
|
GTK_WIDGET (pbar),
|
|
|
|
|
priv->trough_gadget,
|
|
|
|
|
NULL,
|
2016-10-04 17:53:36 +00:00
|
|
|
|
NULL,
|
2015-11-24 12:22:52 +00:00
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
update_node_state (pbar);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_progress_bar_set_property (GObject *object,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar;
|
|
|
|
|
|
|
|
|
|
pbar = GTK_PROGRESS_BAR (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
|
|
|
|
gtk_progress_bar_set_orientation (pbar, g_value_get_enum (value));
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
case PROP_INVERTED:
|
|
|
|
|
gtk_progress_bar_set_inverted (pbar, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_FRACTION:
|
|
|
|
|
gtk_progress_bar_set_fraction (pbar, g_value_get_double (value));
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_PULSE_STEP:
|
|
|
|
|
gtk_progress_bar_set_pulse_step (pbar, g_value_get_double (value));
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_TEXT:
|
|
|
|
|
gtk_progress_bar_set_text (pbar, g_value_get_string (value));
|
2001-01-18 04:10:40 +00:00
|
|
|
|
break;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
case PROP_SHOW_TEXT:
|
|
|
|
|
gtk_progress_bar_set_show_text (pbar, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
case PROP_ELLIPSIZE:
|
|
|
|
|
gtk_progress_bar_set_ellipsize (pbar, g_value_get_enum (value));
|
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
|
gtk_progress_bar_get_property (GObject *object,
|
2010-06-09 04:29:55 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate* priv = pbar->priv;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
switch (prop_id)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2010-07-07 02:36:38 +00:00
|
|
|
|
g_value_set_enum (value, priv->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:
|
|
|
|
|
g_value_set_boolean (value, priv->inverted);
|
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_FRACTION:
|
2009-10-07 17:32:23 +00:00
|
|
|
|
g_value_set_double (value, priv->fraction);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_PULSE_STEP:
|
2010-07-07 02:36:38 +00:00
|
|
|
|
g_value_set_double (value, priv->pulse_fraction);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
|
case PROP_TEXT:
|
2009-10-07 17:32:23 +00:00
|
|
|
|
g_value_set_string (value, priv->text);
|
2001-01-18 04:10:40 +00:00
|
|
|
|
break;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
case PROP_SHOW_TEXT:
|
2010-07-07 02:36:38 +00:00
|
|
|
|
g_value_set_boolean (value, priv->show_text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
break;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
case PROP_ELLIPSIZE:
|
2010-07-07 02:36:38 +00:00
|
|
|
|
g_value_set_enum (value, priv->ellipsize);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-08 17:36:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkProgressBar.
|
|
|
|
|
*
|
|
|
|
|
* Returns: a #GtkProgressBar.
|
|
|
|
|
*/
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_progress_bar_new (void)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *pbar;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
Use g_object_new instead of gtk_widget_new
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* demos/testpixbuf.c (new_testrgb_window):
* gtk/gtkctree.c (gtk_ctree_new_with_titles):
* gtk/gtkitemfactory.c (gtk_item_factory_construct),
(gtk_item_factory_create_item):
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
* gtk/gtkprogressbar.c (gtk_progress_bar_new),
(gtk_progress_bar_new_with_adjustment):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_new):
* gtk/gtktext.c (gtk_text_new):
* gtk/gtkviewport.c (gtk_viewport_new):
* tests/simple.c (main):
* tests/testgtk.c (create_statusbar), (create_get_image),
(create_saved_position), (create_tooltips), (create_cursors),
(create_display_screen), (create_progress_bar), (create_idle_test):
* tests/testmultidisplay.c (make_selection_dialog), (main):
* tests/testmultiscreen.c (main):
* tests/testrgb.c (new_testrgb_window):
Use g_object_new instead of gtk_widget_new
svn path=/trunk/; revision=20462
2008-06-19 12:25:19 +00:00
|
|
|
|
pbar = g_object_new (GTK_TYPE_PROGRESS_BAR, NULL);
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
return pbar;
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2013-11-10 06:20:27 +00:00
|
|
|
|
if (priv->activity_mode)
|
|
|
|
|
gtk_progress_bar_act_mode_leave (pbar);
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
g_free (priv->text);
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_clear_object (&priv->text_gadget);
|
|
|
|
|
g_clear_object (&priv->progress_gadget);
|
|
|
|
|
g_clear_object (&priv->trough_gadget);
|
|
|
|
|
g_clear_object (&priv->gadget);
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_progress_bar_parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
static gchar *
|
|
|
|
|
get_current_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2006-06-12 01:54:54 +00:00
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
if (priv->text)
|
|
|
|
|
return g_strdup (priv->text);
|
|
|
|
|
else
|
2014-08-22 15:06:08 +00:00
|
|
|
|
return g_strdup_printf (C_("progress bar label", "%.0f %%"), priv->fraction * 100.0);
|
2006-06-12 01:54:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-18 20:31:17 +00:00
|
|
|
|
static void
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_progress_bar_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline,
|
|
|
|
|
gpointer data)
|
2014-07-18 20:31:17 +00:00
|
|
|
|
{
|
2015-11-24 12:22:52 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBar *pbar;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
|
|
|
|
gint text_minimum, text_natural;
|
|
|
|
|
gint trough_minimum, trough_natural;
|
2014-07-18 20:31:17 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
pbar = GTK_PROGRESS_BAR (widget);
|
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->show_text)
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->text_gadget,
|
|
|
|
|
orientation,
|
|
|
|
|
-1,
|
|
|
|
|
&text_minimum, &text_natural,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
else
|
|
|
|
|
text_minimum = text_natural = 0;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->trough_gadget,
|
|
|
|
|
orientation,
|
|
|
|
|
-1,
|
|
|
|
|
&trough_minimum, &trough_natural,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
*minimum = MAX (text_minimum, trough_minimum);
|
|
|
|
|
*natural = MAX (text_natural, trough_natural);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*minimum = text_minimum + trough_minimum;
|
|
|
|
|
*natural = text_natural + trough_natural;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
*minimum = text_minimum + trough_minimum;
|
|
|
|
|
*natural = text_natural + trough_natural;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*minimum = MAX (text_minimum, trough_minimum);
|
|
|
|
|
*natural = MAX (text_natural, trough_natural);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-18 20:31:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-03 20:30:00 +00:00
|
|
|
|
static PangoLayout *
|
|
|
|
|
gtk_progress_bar_get_layout (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
gchar *buf;
|
|
|
|
|
GtkCssStyle *style;
|
|
|
|
|
PangoAttrList *attrs;
|
|
|
|
|
PangoFontDescription *desc;
|
|
|
|
|
|
|
|
|
|
buf = get_current_text (pbar);
|
|
|
|
|
layout = gtk_widget_create_pango_layout (GTK_WIDGET (pbar), buf);
|
|
|
|
|
|
|
|
|
|
style = gtk_css_node_get_style (gtk_css_gadget_get_node (pbar->priv->text_gadget));
|
|
|
|
|
|
|
|
|
|
attrs = gtk_css_style_get_pango_attributes (style);
|
|
|
|
|
desc = gtk_css_style_get_pango_font (style);
|
|
|
|
|
|
|
|
|
|
pango_layout_set_attributes (layout, attrs);
|
|
|
|
|
pango_layout_set_font_description (layout, desc);
|
|
|
|
|
|
|
|
|
|
if (attrs)
|
|
|
|
|
pango_attr_list_unref (attrs);
|
|
|
|
|
pango_font_description_free (desc);
|
|
|
|
|
|
|
|
|
|
g_free (buf);
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_progress_bar_measure_text (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline,
|
|
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2015-11-24 12:22:52 +00:00
|
|
|
|
GtkWidget *widget;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkProgressBar *pbar;
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
PangoLayout *layout;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
PangoRectangle logical_rect;
|
2010-12-28 16:42:27 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
pbar = GTK_PROGRESS_BAR (widget);
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2016-06-03 20:30:00 +00:00
|
|
|
|
layout = gtk_progress_bar_get_layout (pbar);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
if (priv->ellipsize)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
|
|
|
|
PangoContext *context;
|
|
|
|
|
PangoFontMetrics *metrics;
|
|
|
|
|
gint char_width;
|
|
|
|
|
|
|
|
|
|
/* The minimum size for ellipsized text is ~ 3 chars */
|
|
|
|
|
context = pango_layout_get_context (layout);
|
2012-12-06 01:47:24 +00:00
|
|
|
|
metrics = pango_context_get_metrics (context,
|
2016-06-03 20:30:00 +00:00
|
|
|
|
pango_layout_get_font_description (layout),
|
2012-12-06 01:47:24 +00:00
|
|
|
|
pango_context_get_language (context));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
|
|
|
|
char_width = pango_font_metrics_get_approximate_char_width (metrics);
|
|
|
|
|
pango_font_metrics_unref (metrics);
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
*minimum = PANGO_PIXELS (char_width) * 3;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
2004-10-31 04:36:50 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
*minimum = logical_rect.width;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2016-04-27 00:44:07 +00:00
|
|
|
|
*natural = MAX (*minimum, logical_rect.width);
|
2010-10-27 03:30:48 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
*minimum = *natural = logical_rect.height;
|
2010-10-27 03:30:48 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_object_unref (layout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
|
{
|
|
|
|
|
GtkAllocation clip;
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (GTK_PROGRESS_BAR (widget)->priv->gadget,
|
|
|
|
|
allocation,
|
|
|
|
|
gtk_widget_get_allocated_baseline (widget),
|
|
|
|
|
&clip);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_clip (widget, &clip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
|
|
|
|
gint bar_width, bar_height;
|
|
|
|
|
gint text_width, text_height, text_min, text_nat;
|
|
|
|
|
GtkAllocation alloc;
|
|
|
|
|
GtkAllocation text_clip;
|
|
|
|
|
|
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
priv = GTK_PROGRESS_BAR (widget)->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->trough_gadget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
&bar_height, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
bar_width = allocation->width;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
}
|
2015-11-24 12:22:52 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->trough_gadget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&bar_width, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
bar_height = allocation->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
alloc.x = allocation->x + allocation->width - bar_width;
|
|
|
|
|
alloc.y = allocation->y + allocation->height - bar_height;
|
|
|
|
|
alloc.width = bar_width;
|
|
|
|
|
alloc.height = bar_height;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->trough_gadget, &alloc, -1, out_clip);
|
|
|
|
|
|
|
|
|
|
if (!priv->show_text)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->text_gadget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&text_min, &text_nat,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->text_gadget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
&text_height, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
text_width = CLAMP (text_nat, text_min, allocation->width);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-11-24 12:22:52 +00:00
|
|
|
|
{
|
|
|
|
|
alloc.x = allocation->x + (allocation->width - text_width) / 2;
|
|
|
|
|
alloc.y = allocation->y;
|
|
|
|
|
alloc.width = text_width;
|
|
|
|
|
alloc.height = text_height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
alloc.x = allocation->x + allocation->width - text_width;
|
|
|
|
|
alloc.y = allocation->y + (allocation->height - text_height) / 2;
|
|
|
|
|
alloc.width = text_width;
|
|
|
|
|
alloc.height = text_height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->text_gadget, &alloc, -1, &text_clip);
|
|
|
|
|
|
|
|
|
|
gdk_rectangle_union (out_clip, &text_clip, out_clip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_allocate_trough (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
|
|
|
|
GtkAllocation alloc;
|
|
|
|
|
gint width, height;
|
|
|
|
|
gboolean inverted;
|
|
|
|
|
|
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
priv = GTK_PROGRESS_BAR (widget)->priv;
|
|
|
|
|
|
|
|
|
|
inverted = priv->inverted;
|
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
inverted = !inverted;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->progress_gadget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
&height, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_css_gadget_get_preferred_size (priv->progress_gadget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&width, NULL,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (priv->activity_mode)
|
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2015-12-16 00:44:07 +00:00
|
|
|
|
alloc.width = width + (allocation->width - width) / priv->activity_blocks;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
alloc.x = allocation->x + priv->activity_pos * (allocation->width - alloc.width);
|
|
|
|
|
alloc.y = allocation->y + (allocation->height - height) / 2;
|
|
|
|
|
alloc.height = height;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
2015-12-16 00:44:07 +00:00
|
|
|
|
alloc.height = height + (allocation->height - height) / priv->activity_blocks;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
alloc.y = allocation->y + priv->activity_pos * (allocation->height - alloc.height);
|
|
|
|
|
alloc.x = allocation->x + (allocation->width - width) / 2;
|
|
|
|
|
alloc.width = width;
|
|
|
|
|
}
|
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
else
|
2015-11-24 12:22:52 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2015-12-16 00:44:07 +00:00
|
|
|
|
alloc.width = width + (allocation->width - width) * priv->fraction;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
alloc.height = height;
|
|
|
|
|
alloc.y = allocation->y + (allocation->height - height) / 2;
|
|
|
|
|
|
|
|
|
|
if (!inverted)
|
|
|
|
|
alloc.x = allocation->x;
|
|
|
|
|
else
|
|
|
|
|
alloc.x = allocation->x + allocation->width - alloc.width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
alloc.width = width;
|
2015-12-16 00:44:07 +00:00
|
|
|
|
alloc.height = height + (allocation->height - height) * priv->fraction;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
alloc.x = allocation->x + (allocation->width - width) / 2;
|
|
|
|
|
|
|
|
|
|
if (!inverted)
|
|
|
|
|
alloc.y = allocation->y;
|
|
|
|
|
else
|
|
|
|
|
alloc.y = allocation->y + allocation->height - alloc.height;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (priv->progress_gadget, &alloc, -1, out_clip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (GTK_PROGRESS_BAR (widget)->priv->gadget,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
}
|
2008-08-02 04:48:47 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_get_preferred_height (GtkWidget *widget,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural)
|
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (GTK_PROGRESS_BAR (widget)->priv->gadget,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
NULL, NULL);
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +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);
|
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2016-03-28 08:08:48 +00:00
|
|
|
|
gint64 frame_time;
|
|
|
|
|
gdouble iteration, pulse_iterations, current_iterations, fraction;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
if (priv->pulse2 == 0 && priv->pulse1 == 0)
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
|
|
|
|
|
frame_time = gdk_frame_clock_get_frame_time (frame_clock);
|
|
|
|
|
gtk_progress_tracker_advance_frame (&priv->tracker, frame_time);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
|
|
|
|
g_assert (priv->pulse2 > priv->pulse1);
|
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
pulse_iterations = (priv->pulse2 - priv->pulse1) / (gdouble) G_USEC_PER_SEC;
|
|
|
|
|
current_iterations = (frame_time - priv->pulse1) / (gdouble) G_USEC_PER_SEC;
|
2013-11-11 12:24:35 +00:00
|
|
|
|
|
2016-03-28 08:08:48 +00:00
|
|
|
|
iteration = gtk_progress_tracker_get_iteration (&priv->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().
|
|
|
|
|
*/
|
2016-03-28 08:08:48 +00:00
|
|
|
|
fraction = priv->pulse_fraction * (iteration - priv->last_iteration) / MAX (pulse_iterations, current_iterations);
|
|
|
|
|
priv->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 */
|
|
|
|
|
if (priv->activity_dir == 0)
|
|
|
|
|
{
|
|
|
|
|
priv->activity_pos += fraction;
|
|
|
|
|
if (priv->activity_pos > 1.0)
|
|
|
|
|
{
|
|
|
|
|
priv->activity_pos = 1.0;
|
|
|
|
|
priv->activity_dir = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->activity_pos -= fraction;
|
|
|
|
|
if (priv->activity_pos <= 0)
|
|
|
|
|
{
|
|
|
|
|
priv->activity_pos = 0;
|
|
|
|
|
priv->activity_dir = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_widget_queue_allocate (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-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (pbar);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
gboolean inverted;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_PULSE);
|
2010-08-11 21:03:49 +00:00
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
orientation = priv->orientation;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
inverted = priv->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
|
|
|
|
{
|
2010-09-02 03:24:20 +00:00
|
|
|
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
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 */
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
1998-07-19 10:35:39 +00:00
|
|
|
|
{
|
2010-09-02 03:24:20 +00:00
|
|
|
|
if (!inverted)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2012-12-23 18:13:11 +00:00
|
|
|
|
priv->activity_pos = 0.0;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->activity_dir = 0;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
else
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2012-12-23 18:13:11 +00:00
|
|
|
|
priv->activity_pos = 1.0;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->activity_dir = 1;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-09-02 03:24:20 +00:00
|
|
|
|
if (!inverted)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2012-12-23 18:13:11 +00:00
|
|
|
|
priv->activity_pos = 0.0;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->activity_dir = 0;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
else
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2012-12-23 18:13:11 +00:00
|
|
|
|
priv->activity_pos = 1.0;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->activity_dir = 1;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
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.*/
|
|
|
|
|
gtk_progress_tracker_start (&priv->tracker, G_USEC_PER_SEC, 0, INFINITY);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
priv->tick_id = gtk_widget_add_tick_callback (widget, tick_cb, NULL, NULL);
|
|
|
|
|
priv->pulse2 = 0;
|
|
|
|
|
priv->pulse1 = 0;
|
2016-03-28 08:08:48 +00:00
|
|
|
|
priv->last_iteration = 0;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_act_mode_leave (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->tick_id)
|
|
|
|
|
gtk_widget_remove_tick_callback (GTK_WIDGET (pbar), priv->tick_id);
|
|
|
|
|
priv->tick_id = 0;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_remove_class (priv->progress_gadget, GTK_STYLE_CLASS_PULSE);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
update_node_classes (pbar);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_progress_bar_render_text (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer data)
|
2002-11-25 18:03:34 +00:00
|
|
|
|
{
|
2015-11-24 12:22:52 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBar *pbar;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-12-28 16:42:27 +00:00
|
|
|
|
GtkStyleContext *context;
|
2002-11-25 18:03:34 +00:00
|
|
|
|
PangoLayout *layout;
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
pbar = GTK_PROGRESS_BAR (widget);
|
|
|
|
|
priv = pbar->priv;
|
2006-08-29 10:22:27 +00:00
|
|
|
|
|
2010-12-28 16:42:27 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_style_context_save_to_node (context, gtk_css_gadget_get_node (gadget));
|
2010-08-11 21:03:49 +00:00
|
|
|
|
|
2016-06-03 20:30:00 +00:00
|
|
|
|
layout = gtk_progress_bar_get_layout (pbar);
|
2010-07-07 02:36:38 +00:00
|
|
|
|
pango_layout_set_ellipsize (layout, priv->ellipsize);
|
|
|
|
|
if (priv->ellipsize)
|
2010-09-01 19:22:11 +00:00
|
|
|
|
pango_layout_set_width (layout, width * PANGO_SCALE);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_render_layout (context, cr, x, y, layout);
|
2002-11-25 23:38:49 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_object_unref (layout);
|
2002-11-25 23:38:49 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
2002-11-25 23:38:49 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2006-06-16 09:51:39 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_progress_bar_render_trough (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-12-28 16:42:27 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
priv = GTK_PROGRESS_BAR (widget)->priv;
|
2006-12-11 15:35:25 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_draw (priv->progress_gadget, cr);
|
2010-12-28 16:42:27 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2010-09-01 19:22:11 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_progress_bar_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-12-28 16:42:27 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
priv = GTK_PROGRESS_BAR (widget)->priv;
|
2010-12-28 16:42:27 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_draw (priv->trough_gadget, cr);
|
|
|
|
|
if (priv->show_text)
|
|
|
|
|
gtk_css_gadget_draw (priv->text_gadget, cr);
|
2002-11-25 23:38:49 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
return FALSE;
|
2002-11-25 18:03:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-01 19:22:11 +00:00
|
|
|
|
static gboolean
|
2015-05-08 02:07:41 +00:00
|
|
|
|
gtk_progress_bar_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr)
|
2002-11-25 18:03:34 +00:00
|
|
|
|
{
|
2010-09-01 19:22:11 +00:00
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2014-05-07 09:13:59 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_css_gadget_draw (priv->gadget, cr);
|
2010-09-01 19:22:11 +00:00
|
|
|
|
|
|
|
|
|
return FALSE;
|
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)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
activity_mode = !!activity_mode;
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
if (priv->activity_mode != activity_mode)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->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
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
if (priv->activity_mode)
|
2010-07-31 14:09:11 +00:00
|
|
|
|
gtk_progress_bar_act_mode_enter (pbar);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
else
|
|
|
|
|
gtk_progress_bar_act_mode_leave (pbar);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2011-03-29 11:55:06 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1998-07-19 10:35:39 +00:00
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_fraction:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @fraction: fraction of the task that’s been completed
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Causes the progress bar to “fill in” the given fraction
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* of the bar. The fraction should be between 0.0 and 1.0,
|
|
|
|
|
* inclusive.
|
2011-11-11 15:26:31 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble fraction)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate* priv;
|
2009-10-07 17:32:23 +00:00
|
|
|
|
|
2000-07-25 22:58:17 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
2013-11-10 06:20:27 +00:00
|
|
|
|
priv->fraction = CLAMP (fraction, 0.0, 1.0);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_activity_mode (pbar, FALSE);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (pbar));
|
2001-01-18 04:10:40 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_FRACTION]);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-10 06:20:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_update_pulse (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2016-03-28 08:08:48 +00:00
|
|
|
|
gint64 pulse_time = g_get_monotonic_time ();
|
|
|
|
|
|
|
|
|
|
if (priv->pulse2 == pulse_time)
|
|
|
|
|
return;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
|
|
|
|
|
priv->pulse1 = priv->pulse2;
|
2016-03-28 08:08:48 +00:00
|
|
|
|
priv->pulse2 = pulse_time;
|
2013-11-10 06:20:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_pulse:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* Indicates that some progress has been made, but you don’t know how much.
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Causes the progress bar to enter “activity mode,” where a block
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* bounces back and forth. Each call to gtk_progress_bar_pulse()
|
|
|
|
|
* causes the block to move by a little bit (the amount of movement
|
|
|
|
|
* per pulse is determined by gtk_progress_bar_set_pulse_step()).
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_pulse (GtkProgressBar *pbar)
|
2010-06-09 04:29:55 +00:00
|
|
|
|
{
|
2000-07-25 22:58:17 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_activity_mode (pbar, TRUE);
|
2013-11-10 06:20:27 +00:00
|
|
|
|
gtk_progress_bar_update_pulse (pbar);
|
2000-07-25 22:58:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* @text: (allow-none): a UTF-8 string, or %NULL
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Causes the given @text to appear next to the progress bar.
|
2011-07-15 16:24:01 +00:00
|
|
|
|
*
|
|
|
|
|
* If @text is %NULL and #GtkProgressBar:show-text is %TRUE, the current
|
|
|
|
|
* value of #GtkProgressBar:fraction will be displayed as a percentage.
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* If @text is non-%NULL and #GtkProgressBar:show-text is %TRUE, the text
|
|
|
|
|
* will be displayed. In this case, it will not display the progress
|
|
|
|
|
* percentage. If @text is the empty string, the progress bar will still
|
|
|
|
|
* be styled and sized suitably for containing text, as long as
|
|
|
|
|
* #GtkProgressBar:show-text is %TRUE.
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_text (GtkProgressBar *pbar,
|
2001-01-18 04:10:40 +00:00
|
|
|
|
const gchar *text)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
2009-10-07 17:32:23 +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
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
2011-07-15 16:24:01 +00:00
|
|
|
|
/* Don't notify again if nothing's changed. */
|
|
|
|
|
if (g_strcmp0 (priv->text, text) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2009-10-07 17:32:23 +00:00
|
|
|
|
g_free (priv->text);
|
2011-07-15 16:24:01 +00:00
|
|
|
|
priv->text = g_strdup (text);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2011-03-29 11:55:06 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
2010-06-09 04:29:55 +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
|
|
|
|
}
|
|
|
|
|
|
2016-06-03 20:30:00 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_text_style_changed (GtkCssNode *node,
|
|
|
|
|
GtkCssStyleChange *change,
|
|
|
|
|
GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
if (change == NULL ||
|
|
|
|
|
gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_ATTRS) ||
|
|
|
|
|
gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_FONT))
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_show_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @show_text: whether to show superimposed text
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets whether the progress bar will show text next to the bar.
|
|
|
|
|
* The shown text is either the value of the #GtkProgressBar:text
|
|
|
|
|
* property or, if that is %NULL, the #GtkProgressBar:fraction value,
|
|
|
|
|
* as a percentage.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2011-07-15 16:24:01 +00:00
|
|
|
|
* To make a progress bar that is styled and sized suitably for containing
|
|
|
|
|
* text (even if the actual text is blank), set #GtkProgressBar:show-text to
|
|
|
|
|
* %TRUE and #GtkProgressBar:text to the empty string (not %NULL).
|
|
|
|
|
*
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_show_text (GtkProgressBar *pbar,
|
|
|
|
|
gboolean show_text)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
2010-06-09 04:29:55 +00:00
|
|
|
|
show_text = !!show_text;
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (priv->show_text == show_text)
|
|
|
|
|
return;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
priv->show_text = show_text;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (show_text)
|
|
|
|
|
{
|
|
|
|
|
priv->text_gadget = gtk_css_custom_gadget_new ("text",
|
|
|
|
|
GTK_WIDGET (pbar),
|
|
|
|
|
priv->gadget,
|
|
|
|
|
priv->trough_gadget,
|
|
|
|
|
gtk_progress_bar_measure_text,
|
|
|
|
|
NULL,
|
|
|
|
|
gtk_progress_bar_render_text,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL);
|
2016-06-03 20:30:00 +00:00
|
|
|
|
g_signal_connect (gtk_css_gadget_get_node (priv->text_gadget), "style-changed",
|
|
|
|
|
G_CALLBACK (gtk_progress_bar_text_style_changed), pbar);
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
update_node_state (pbar);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-01 21:00:30 +00:00
|
|
|
|
if (priv->text_gadget)
|
|
|
|
|
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->text_gadget), NULL);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_clear_object (&priv->text_gadget);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
2015-11-24 12:22:52 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_SHOW_TEXT]);
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_show_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Gets the value of the #GtkProgressBar:show-text property.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
* See gtk_progress_bar_set_show_text().
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if text is shown in the progress bar
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_progress_bar_get_show_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), FALSE);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
return pbar->priv->show_text;
|
2010-06-09 04:29:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_pulse_step:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @fraction: fraction between 0.0 and 1.0
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2001-01-18 04:10:40 +00:00
|
|
|
|
* Sets the fraction of total progress bar length to move the
|
|
|
|
|
* bouncing block for each call to gtk_progress_bar_pulse().
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2000-07-25 22:58:17 +00:00
|
|
|
|
void
|
2010-06-09 04:29:55 +00:00
|
|
|
|
gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
|
|
|
|
|
gdouble fraction)
|
2000-07-25 22:58:17 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-07-07 02:36:38 +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
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
|
|
|
|
priv->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);
|
2015-11-24 12:22:52 +00:00
|
|
|
|
update_node_state (pbar);
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->direction_changed (widget, previous_dir);
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_progress_bar_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBar *pbar = GTK_PROGRESS_BAR (widget);
|
|
|
|
|
|
|
|
|
|
update_node_state (pbar);
|
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->state_flags_changed (widget, previous_state);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-09-02 03:25:22 +00:00
|
|
|
|
GtkProgressBarPrivate *priv = pbar->priv;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (priv->orientation == orientation)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->orientation = orientation;
|
|
|
|
|
|
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
|
|
|
|
|
update_node_classes (pbar);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
|
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (pbar), "orientation");
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_inverted:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @inverted: %TRUE to invert the progress bar
|
|
|
|
|
*
|
|
|
|
|
* Progress bars normally grow from top to bottom or left to right.
|
|
|
|
|
* Inverted progress bars grow in the opposite direction.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_progress_bar_set_inverted (GtkProgressBar *pbar,
|
|
|
|
|
gboolean inverted)
|
|
|
|
|
{
|
|
|
|
|
GtkProgressBarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
|
|
|
|
|
|
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
if (priv->inverted == inverted)
|
|
|
|
|
return;
|
2010-09-02 03:24:20 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
priv->inverted = inverted;
|
2015-11-01 00:20:13 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
update_node_classes (pbar);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
2010-09-02 03:24:20 +00:00
|
|
|
|
|
2015-11-24 12:22:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_INVERTED]);
|
2010-09-02 03:24:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 04:10:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_text:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Retrieves the text that is displayed with the progress bar,
|
2001-02-17 17:21:21 +00:00
|
|
|
|
* if any, otherwise %NULL. The return value is a reference
|
|
|
|
|
* to the text, not a copy of it, so will become invalid
|
|
|
|
|
* if you change the text in the progress bar.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable): text, or %NULL; this string is owned by the widget
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
|
* and should not be modified or freed.
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const gchar*
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_text (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), NULL);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
return pbar->priv->text;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_fraction:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns the current fraction of the task that’s been completed.
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: a fraction from 0.0 to 1.0
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_fraction (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
return pbar->priv->fraction;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_pulse_step:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Retrieves the pulse step set with gtk_progress_bar_set_pulse_step().
|
2010-06-09 04:29:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: a fraction from 0.0 to 1.0
|
2011-07-15 16:31:59 +00:00
|
|
|
|
*/
|
2001-03-19 21:06:38 +00:00
|
|
|
|
gdouble
|
2001-01-18 04:10:40 +00:00
|
|
|
|
gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
return pbar->priv->pulse_fraction;
|
2001-01-18 04:10:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-02 03:24:20 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_get_inverted:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Gets the value set by gtk_progress_bar_set_inverted().
|
2010-09-02 03:24:20 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the progress bar is inverted
|
2010-09-02 03:24:20 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_progress_bar_get_inverted (GtkProgressBar *pbar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), FALSE);
|
|
|
|
|
|
|
|
|
|
return pbar->priv->inverted;
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-31 04:36:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_progress_bar_set_ellipsize:
|
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
* @mode: a #PangoEllipsizeMode
|
|
|
|
|
*
|
2015-05-08 02:07:41 +00:00
|
|
|
|
* Sets the mode used to ellipsize (add an ellipsis: "...") the
|
|
|
|
|
* text if there is not enough space to render the entire string.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
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
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkProgressBarPrivate *priv;
|
2010-07-07 02:36:38 +00:00
|
|
|
|
|
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);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv = pbar->priv;
|
|
|
|
|
|
|
|
|
|
if ((PangoEllipsizeMode)priv->ellipsize != mode)
|
2004-10-31 04:36:50 +00:00
|
|
|
|
{
|
2010-07-07 02:36:38 +00:00
|
|
|
|
priv->ellipsize = mode;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
|
2015-09-05 07:59:28 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (pbar), progress_props[PROP_ELLIPSIZE]);
|
2004-10-31 04:36:50 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (pbar));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2005-03-17 03:23:23 +00:00
|
|
|
|
* gtk_progress_bar_get_ellipsize:
|
2004-10-31 04:36:50 +00:00
|
|
|
|
* @pbar: a #GtkProgressBar
|
|
|
|
|
*
|
2011-07-15 16:31:59 +00:00
|
|
|
|
* Returns the ellipsizing position of the progress bar.
|
2004-10-31 04:36:50 +00:00
|
|
|
|
* See gtk_progress_bar_set_ellipsize().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: #PangoEllipsizeMode
|
2004-10-31 04:36:50 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
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);
|
|
|
|
|
|
2010-07-07 02:36:38 +00:00
|
|
|
|
return pbar->priv->ellipsize;
|
2004-10-31 04:36:50 +00:00
|
|
|
|
}
|