Ardour  9.0-pre0-582-g084a23a80d
gtkprogressbar.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 /*
21  * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22  * file for a list of people on the GTK+ Team. See the ChangeLog
23  * files for a list of changes. These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26 
27 #ifndef __GTK_PROGRESS_BAR_H__
28 #define __GTK_PROGRESS_BAR_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gtk/gtkprogress.h>
36 
37 
38 G_BEGIN_DECLS
39 
40 #define GTK_TYPE_PROGRESS_BAR (gtk_progress_bar_get_type ())
41 #define GTK_PROGRESS_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PROGRESS_BAR, GtkProgressBar))
42 #define GTK_PROGRESS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PROGRESS_BAR, GtkProgressBarClass))
43 #define GTK_IS_PROGRESS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PROGRESS_BAR))
44 #define GTK_IS_PROGRESS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PROGRESS_BAR))
45 #define GTK_PROGRESS_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PROGRESS_BAR, GtkProgressBarClass))
46 
47 
48 typedef struct _GtkProgressBar GtkProgressBar;
50 
51 typedef enum
52 {
56 
57 typedef enum
58 {
64 
66 {
68 
71 
72  guint GSEAL (blocks);
73  gint GSEAL (in_block);
74 
75  gint GSEAL (activity_pos);
76  guint GSEAL (activity_step);
77  guint GSEAL (activity_blocks);
78 
79  gdouble GSEAL (pulse_fraction);
80 
81  guint GSEAL (activity_dir) : 1;
82  guint GSEAL (ellipsize) : 3;
83  guint GSEAL (dirty) : 1;
84 };
85 
87 {
89 
90  /* Padding for future expansion */
91  void (*_gtk_reserved1) (void);
92  void (*_gtk_reserved2) (void);
93  void (*_gtk_reserved3) (void);
94  void (*_gtk_reserved4) (void);
95 };
96 
97 
98 GType gtk_progress_bar_get_type (void) G_GNUC_CONST;
100 
101 /*
102  * GtkProgress/GtkProgressBar had serious problems in GTK 1.2.
103  *
104  * - Only 3 or 4 functions are really needed for 95% of progress
105  * interfaces; GtkProgress[Bar] had about 25 functions, and
106  * didn't even include these 3 or 4.
107  * - In activity mode, the API involves setting the adjustment
108  * to any random value, just to have the side effect of
109  * calling the progress bar update function - the adjustment
110  * is totally ignored in activity mode
111  * - You set the activity step as a pixel value, which means to
112  * set the activity step you basically need to connect to
113  * size_allocate
114  * - There are ctree_set_expander_style()-functions, to randomly
115  * change look-and-feel for no good reason
116  * - The split between GtkProgress and GtkProgressBar makes no sense
117  * to me whatsoever.
118  *
119  * This was a big wart on GTK and made people waste lots of time,
120  * both learning and using the interface.
121  *
122  * So, I have added what I feel is the correct API, and marked all the
123  * rest deprecated. However, the changes are 100% backward-compatible and
124  * should break no existing code.
125  *
126  * The following 9 functions are the new programming interface.
127  */
130  const gchar *text);
132  gdouble fraction);
133 
135  gdouble fraction);
137  GtkProgressBarOrientation orientation);
138 
142 
145  PangoEllipsizeMode mode);
147 
148 
149 #ifndef GTK_DISABLE_DEPRECATED
150 
151 /* Everything below here is deprecated */
154  GtkProgressBarStyle style);
156  guint blocks);
157 /* set_activity_step() is not only deprecated, it doesn't even work.
158  * (Of course, it wasn't usable anyway, you had to set it from a size_allocate
159  * handler or something)
160  */
162  guint step);
164  guint blocks);
166  gdouble percentage);
167 
168 #endif /* GTK_DISABLE_DEPRECATED */
169 
170 G_END_DECLS
171 
172 #endif /* __GTK_PROGRESS_BAR_H__ */
GtkProgressBarStyle
@ GTK_PROGRESS_DISCRETE
@ GTK_PROGRESS_CONTINUOUS
GtkProgressBarOrientation gtk_progress_bar_get_orientation(GtkProgressBar *pbar)
void gtk_progress_bar_set_activity_step(GtkProgressBar *pbar, guint step)
gdouble gtk_progress_bar_get_fraction(GtkProgressBar *pbar)
void gtk_progress_bar_update(GtkProgressBar *pbar, gdouble percentage)
void gtk_progress_bar_set_pulse_step(GtkProgressBar *pbar, gdouble fraction)
void gtk_progress_bar_set_discrete_blocks(GtkProgressBar *pbar, guint blocks)
const gchar * gtk_progress_bar_get_text(GtkProgressBar *pbar)
void gtk_progress_bar_set_fraction(GtkProgressBar *pbar, gdouble fraction)
void gtk_progress_bar_set_orientation(GtkProgressBar *pbar, GtkProgressBarOrientation orientation)
GType gtk_progress_bar_get_type(void) G_GNUC_CONST
void gtk_progress_bar_set_ellipsize(GtkProgressBar *pbar, PangoEllipsizeMode mode)
void gtk_progress_bar_set_text(GtkProgressBar *pbar, const gchar *text)
GtkWidget * gtk_progress_bar_new(void)
void gtk_progress_bar_set_activity_blocks(GtkProgressBar *pbar, guint blocks)
GtkWidget * gtk_progress_bar_new_with_adjustment(GtkAdjustment *adjustment)
PangoEllipsizeMode gtk_progress_bar_get_ellipsize(GtkProgressBar *pbar)
void gtk_progress_bar_set_bar_style(GtkProgressBar *pbar, GtkProgressBarStyle style)
void gtk_progress_bar_pulse(GtkProgressBar *pbar)
gdouble gtk_progress_bar_get_pulse_step(GtkProgressBar *pbar)
GtkProgressBarOrientation
@ GTK_PROGRESS_LEFT_TO_RIGHT
@ GTK_PROGRESS_BOTTOM_TO_TOP
@ GTK_PROGRESS_TOP_TO_BOTTOM
@ GTK_PROGRESS_RIGHT_TO_LEFT
void(* _gtk_reserved3)(void)
void(* _gtk_reserved4)(void)
GtkProgressClass parent_class
void(* _gtk_reserved1)(void)
void(* _gtk_reserved2)(void)
gdouble GSEAL(pulse_fraction)
guint GSEAL(blocks)
guint GSEAL(activity_step)
GtkProgressBarStyle GSEAL(bar_style)
gint GSEAL(in_block)
GtkProgressBarOrientation GSEAL(orientation)
gint GSEAL(activity_pos)
guint GSEAL(activity_blocks)
GtkProgress progress