]> Pileus Git - ~andy/gtk/blob - gtk/gtkprogressbar.h
Introduced generic GtkProgress widget. Derived GtkProgressBar from
[~andy/gtk] / gtk / gtkprogressbar.h
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 Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library 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 #ifndef __GTK_PROGRESS_BAR_H__
21 #define __GTK_PROGRESS_BAR_H__
22
23
24 #include <gdk/gdk.h>
25 #include <gtk/gtkprogress.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32
33 #define GTK_PROGRESS_BAR(obj)          GTK_CHECK_CAST (obj, gtk_progress_bar_get_type (), GtkProgressBar)
34 #define GTK_PROGRESS_BAR_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_progress_bar_get_type (), GtkProgressBarClass)
35 #define GTK_IS_PROGRESS_BAR(obj)       GTK_CHECK_TYPE (obj, gtk_progress_bar_get_type ())
36
37
38 typedef struct _GtkProgressBar       GtkProgressBar;
39 typedef struct _GtkProgressBarClass  GtkProgressBarClass;
40
41 typedef enum
42 {
43   GTK_PROGRESS_CONTINUOUS,
44   GTK_PROGRESS_DISCRETE
45 } GtkProgressBarStyle;
46
47 typedef enum
48 {
49   GTK_PROGRESS_LEFT_TO_RIGHT,
50   GTK_PROGRESS_RIGHT_TO_LEFT,
51   GTK_PROGRESS_BOTTOM_TO_TOP,
52   GTK_PROGRESS_TOP_TO_BOTTOM
53 } GtkProgressBarOrientation;
54
55 struct _GtkProgressBar
56 {
57   GtkProgress progress;
58
59   GtkProgressBarStyle bar_style;
60   GtkProgressBarOrientation orientation;
61
62   guint blocks;
63   gint  in_block;
64
65   gint  activity_pos;
66   guint activity_step;
67   guint activity_dir : 1;
68 };
69
70 struct _GtkProgressBarClass
71 {
72   GtkProgressClass parent_class;
73 };
74
75
76 guint      gtk_progress_bar_get_type             (void);
77 GtkWidget* gtk_progress_bar_new                  (void);
78 GtkWidget* gtk_progress_bar_new_with_adjustment  (GtkAdjustment  *adjustment);
79 void       gtk_progress_bar_construct            (GtkProgressBar *pbar,
80                                                   GtkAdjustment  *adjustment);
81 void       gtk_progress_bar_set_bar_style        (GtkProgressBar *pbar,
82                                                   GtkProgressBarStyle style);
83 void       gtk_progress_bar_set_number_of_blocks (GtkProgressBar *pbar,
84                                                   guint           blocks);
85 void       gtk_progress_bar_set_activity_step    (GtkProgressBar *pbar,
86                                                   guint           step);
87 void       gtk_progress_bar_set_orientation      (GtkProgressBar *pbar,
88                                                   GtkProgressBarOrientation orientation);
89 void       gtk_progress_bar_update               (GtkProgressBar *pbar,
90                                                   gfloat          percentage);
91
92
93 #ifdef __cplusplus
94 }
95 #endif /* __cplusplus */
96
97
98 #endif /* __GTK_PROGRESS_BAR_H__ */