Mercurial > pidgin
annotate finch/libgnt/gntprogressbar.c @ 27755:6c9c6123b942
Using g_convert instead of g_utf16_to_utf8 means we don't need to go
through the whole buffer converting it first.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 31 Jul 2009 03:53:00 +0000 |
parents | 0a5823a58279 |
children | 88d889b54df4 |
rev | line source |
---|---|
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
1 /** |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
2 * GNT - The GLib Ncurses Toolkit |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
3 * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
4 * GNT is the legal property of its developers, whose names are too numerous |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
6 * source distribution. |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
7 * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
8 * This library is free software; you can redistribute it and/or modify |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
11 * (at your option) any later version. |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
12 * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
17 * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
21 **/ |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
22 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
23 #include "gntprogressbar.h" |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
24 #include "gntutils.h" |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
25 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
26 #include <string.h> |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
27 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
28 typedef struct _GntProgressBarPrivate |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
29 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
30 gdouble fraction; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
31 gboolean show_value; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
32 GntProgressBarOrientation orientation; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
33 } GntProgressBarPrivate; |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
34 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
35 struct _GntProgressBar |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
36 { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
37 GntWidget parent; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
38 #if !GLIB_CHECK_VERSION(2,4,0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
39 GntProgressBarPrivate priv; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
40 #endif |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
41 }; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
42 |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
43 #if GLIB_CHECK_VERSION(2,4,0) |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
44 #define GNT_PROGRESS_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBarPrivate)) |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
45 #else |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
46 #define GNT_PROGRESS_BAR_GET_PRIVATE(o) &(GNT_PROGRESS_BAR(o)->priv) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
47 #endif |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
48 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
49 static GntWidgetClass *parent_class = NULL; |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
50 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
51 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
52 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
53 gnt_progress_bar_draw (GntWidget *widget) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
54 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
55 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
56 gchar progress[8]; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
57 gint start, end, i, pos; |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
58 int color; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
59 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
60 g_snprintf (progress, sizeof (progress), "%.1f%%", priv->fraction * 100); |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
61 color = gnt_color_pair(GNT_COLOR_NORMAL); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
62 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
63 switch (priv->orientation) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
64 case GNT_PROGRESS_LEFT_TO_RIGHT: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
65 case GNT_PROGRESS_RIGHT_TO_LEFT: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
66 start = (priv->orientation == GNT_PROGRESS_LEFT_TO_RIGHT ? 0 : (1.0 - priv->fraction) * widget->priv.width); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
67 end = (priv->orientation == GNT_PROGRESS_LEFT_TO_RIGHT ? widget->priv.width * priv->fraction : widget->priv.width); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
68 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
69 /* background */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
70 for (i = 0; i < widget->priv.height; i++) |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
71 mvwhline (widget->window, i, 0, ' ' | color, widget->priv.width); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
72 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
73 /* foreground */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
74 for (i = 0; i < widget->priv.height; i++) |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
75 mvwhline (widget->window, i, start, ACS_CKBOARD | color | A_REVERSE, end); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
76 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
77 /* text */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
78 if (priv->show_value) { |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
79 pos = widget->priv.width / 2 - strlen (progress) / 2; |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
80 for (i = 0; i < progress[i]; i++, pos++) { |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
81 wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
82 mvwprintw (widget->window, widget->priv.height / 2, pos, "%c", progress[i]); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
83 } |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
84 wattrset (widget->window, color); |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
85 } |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
86 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
87 break; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
88 case GNT_PROGRESS_TOP_TO_BOTTOM: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
89 case GNT_PROGRESS_BOTTOM_TO_TOP: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
90 start = (priv->orientation == GNT_PROGRESS_TOP_TO_BOTTOM ? 0 : (1.0 - priv->fraction) * widget->priv.height); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
91 end = (priv->orientation == GNT_PROGRESS_TOP_TO_BOTTOM ? widget->priv.height * priv->fraction : widget->priv.height); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
92 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
93 /* background */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
94 for (i = 0; i < widget->priv.width; i++) |
26560
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26557
diff
changeset
|
95 mvwvline (widget->window, 0, i, ' ' | color, widget->priv.height); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
96 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
97 /* foreground */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
98 for (i = 0; i < widget->priv.width; i++) |
26560
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26557
diff
changeset
|
99 mvwvline (widget->window, start, i, ACS_CKBOARD | color | A_REVERSE, end); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
100 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
101 /* text */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
102 if (priv->show_value) { |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
103 pos = widget->priv.height / 2 - strlen (progress) / 2; |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
104 for (i = 0; i < progress[i]; i++, pos++) { |
26560
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26557
diff
changeset
|
105 wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
106 mvwprintw (widget->window, pos, widget->priv.width / 2, "%c\n", progress[i]); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
107 } |
26557
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26556
diff
changeset
|
108 wattrset (widget->window, color); |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
109 } |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
110 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
111 break; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
112 default: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
113 g_assert_not_reached (); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
114 } |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
115 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
116 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
117 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
118 gnt_progress_bar_size_request (GntWidget *widget) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
119 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
120 gnt_widget_set_size (widget, widget->priv.minw, widget->priv.minh); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
121 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
122 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
123 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
124 gnt_progress_bar_class_init (gpointer klass, gpointer class_data) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
125 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
126 GObjectClass *g_class = G_OBJECT_CLASS (klass); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
127 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
128 parent_class = GNT_WIDGET_CLASS (klass); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
129 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
130 #if GLIB_CHECK_VERSION(2,4,0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
131 g_type_class_add_private (g_class, sizeof (GntProgressBarPrivate)); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
132 #endif |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
133 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
134 parent_class->draw = gnt_progress_bar_draw; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
135 parent_class->size_request = gnt_progress_bar_size_request; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
136 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
137 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
138 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
139 gnt_progress_bar_init (GTypeInstance *instance, gpointer g_class) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
140 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
141 GntWidget *widget = GNT_WIDGET (instance); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
142 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
143 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
144 gnt_widget_set_take_focus (widget, FALSE); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
145 GNT_WIDGET_SET_FLAGS (widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW | GNT_WIDGET_GROW_X); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
146 |
26561
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
147 widget->priv.minw = 8; |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
148 widget->priv.minh = 1; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
149 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
150 priv->show_value = TRUE; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
151 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
152 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
153 GType |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
154 gnt_progress_bar_get_type (void) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
155 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
156 static GType type = 0; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
157 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
158 if (type == 0) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
159 static const GTypeInfo info = { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
160 sizeof (GntProgressBarClass), |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
161 NULL, /* base_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
162 NULL, /* base_finalize */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
163 gnt_progress_bar_class_init, /* class_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
164 NULL, /* class_finalize */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
165 NULL, /* class_data */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
166 sizeof (GntProgressBar), |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
167 0, /* n_preallocs */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
168 gnt_progress_bar_init, /* instance_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
169 NULL /* value_table */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
170 }; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
171 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
172 type = g_type_register_static (GNT_TYPE_WIDGET, "GntProgressBar", &info, 0); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
173 } |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
174 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
175 return type; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
176 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
177 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
178 GntWidget * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
179 gnt_progress_bar_new (void) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
180 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
181 GntWidget *widget = g_object_new (GNT_TYPE_PROGRESS_BAR, NULL); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
182 return widget; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
183 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
184 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
185 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
186 gnt_progress_bar_set_fraction (GntProgressBar *pbar, gdouble fraction) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
187 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
188 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
189 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
190 if (fraction > 1.0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
191 priv->fraction = 1.0; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
192 else if (fraction < 0.0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
193 priv->fraction = 0.0; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
194 else |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
195 priv->fraction = fraction; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
196 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
197 if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
198 gnt_widget_draw(GNT_WIDGET(pbar)); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
199 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
200 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
201 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
202 gnt_progress_bar_set_orientation (GntProgressBar *pbar, |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
203 GntProgressBarOrientation orientation) |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
204 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
205 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
26561
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
206 GntWidget *widget = GNT_WIDGET(pbar); |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
207 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
208 priv->orientation = orientation; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
209 if (orientation == GNT_PROGRESS_LEFT_TO_RIGHT || |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
210 orientation == GNT_PROGRESS_RIGHT_TO_LEFT) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
211 GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_X); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
212 GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_Y); |
26561
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
213 widget->priv.minw = 8; |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
214 widget->priv.minh = 1; |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
215 } else { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
216 GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_X); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
217 GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_Y); |
26561
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
218 widget->priv.minw = 1; |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26560
diff
changeset
|
219 widget->priv.minh = 8; |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
220 } |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
221 |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
222 if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
223 gnt_widget_draw(GNT_WIDGET(pbar)); |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
224 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
225 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
226 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
227 gnt_progress_bar_set_show_progress (GntProgressBar *pbar, gboolean show) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
228 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
229 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
230 priv->show_value = show; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
231 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
232 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
233 gdouble |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
234 gnt_progress_bar_get_fraction (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
235 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
236 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
237 return priv->fraction; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
238 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
239 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
240 GntProgressBarOrientation |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
241 gnt_progress_bar_get_orientation (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
242 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
243 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
244 return priv->orientation; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
245 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
246 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
247 gboolean |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
248 gnt_progress_bar_get_show_progress (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
249 { |
26556
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
250 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26555
diff
changeset
|
251 return priv->show_value; |
26555
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
252 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
253 |