Mercurial > pidgin.yaz
annotate finch/libgnt/gntprogressbar.c @ 30353:5139aa9b4077
Improve the handling of user's being kicked from MultiMX rooms.
* If it's us being kicked, clear the user-list and close the conversation.
* Otherwise, display a message and remove the user from the user-list.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 11 May 2010 16:28:03 +0000 |
parents | 88d889b54df4 |
children | a8cc50c2279f |
rev | line source |
---|---|
26637
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 |
29220
88d889b54df4
Fix building finch & libgnt using older gcc or non-gcc compilers that do
Stu Tomlinson <stu@nosnilmot.com>
parents:
26643
diff
changeset
|
23 #include "gntinternal.h" |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
24 #include "gntprogressbar.h" |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
25 #include "gntutils.h" |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
26 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
27 #include <string.h> |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
28 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
29 typedef struct _GntProgressBarPrivate |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
30 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
31 gdouble fraction; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
32 gboolean show_value; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
33 GntProgressBarOrientation orientation; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
34 } GntProgressBarPrivate; |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
35 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
36 struct _GntProgressBar |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
37 { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
38 GntWidget parent; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
39 #if !GLIB_CHECK_VERSION(2,4,0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
40 GntProgressBarPrivate priv; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
41 #endif |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
42 }; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
43 |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
44 #if GLIB_CHECK_VERSION(2,4,0) |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
45 #define GNT_PROGRESS_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBarPrivate)) |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
46 #else |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
47 #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:
26637
diff
changeset
|
48 #endif |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
49 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
50 static GntWidgetClass *parent_class = NULL; |
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
53 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
54 gnt_progress_bar_draw (GntWidget *widget) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
55 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
56 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
57 gchar progress[8]; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
58 gint start, end, i, pos; |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
59 int color; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
60 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
61 g_snprintf (progress, sizeof (progress), "%.1f%%", priv->fraction * 100); |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
62 color = gnt_color_pair(GNT_COLOR_NORMAL); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
63 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
64 switch (priv->orientation) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
65 case GNT_PROGRESS_LEFT_TO_RIGHT: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
66 case GNT_PROGRESS_RIGHT_TO_LEFT: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
67 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:
26637
diff
changeset
|
68 end = (priv->orientation == GNT_PROGRESS_LEFT_TO_RIGHT ? widget->priv.width * priv->fraction : widget->priv.width); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
69 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
70 /* background */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
71 for (i = 0; i < widget->priv.height; i++) |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
72 mvwhline (widget->window, i, 0, ' ' | color, widget->priv.width); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
73 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
74 /* foreground */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
75 for (i = 0; i < widget->priv.height; i++) |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
76 mvwhline (widget->window, i, start, ACS_CKBOARD | color | A_REVERSE, end); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
77 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
78 /* text */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
79 if (priv->show_value) { |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
80 pos = widget->priv.width / 2 - strlen (progress) / 2; |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
81 for (i = 0; i < progress[i]; i++, pos++) { |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
82 wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
83 mvwprintw (widget->window, widget->priv.height / 2, pos, "%c", progress[i]); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
84 } |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
85 wattrset (widget->window, color); |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
86 } |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
87 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
88 break; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
89 case GNT_PROGRESS_TOP_TO_BOTTOM: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
90 case GNT_PROGRESS_BOTTOM_TO_TOP: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
91 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:
26637
diff
changeset
|
92 end = (priv->orientation == GNT_PROGRESS_TOP_TO_BOTTOM ? widget->priv.height * priv->fraction : widget->priv.height); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
93 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
94 /* background */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
95 for (i = 0; i < widget->priv.width; i++) |
26642
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26639
diff
changeset
|
96 mvwvline (widget->window, 0, i, ' ' | color, widget->priv.height); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
97 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
98 /* foreground */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
99 for (i = 0; i < widget->priv.width; i++) |
26642
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26639
diff
changeset
|
100 mvwvline (widget->window, start, i, ACS_CKBOARD | color | A_REVERSE, end); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
101 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
102 /* text */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
103 if (priv->show_value) { |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
104 pos = widget->priv.height / 2 - strlen (progress) / 2; |
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
105 for (i = 0; i < progress[i]; i++, pos++) { |
26642
09ad3b69711f
Fix drawing for vertical progressbar.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26639
diff
changeset
|
106 wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
107 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:
26637
diff
changeset
|
108 } |
26639
a372ea58c3ae
Change how the progressbar is drawn.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26638
diff
changeset
|
109 wattrset (widget->window, color); |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
110 } |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
111 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
112 break; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
113 default: |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
114 g_assert_not_reached (); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
115 } |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
118 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
119 gnt_progress_bar_size_request (GntWidget *widget) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
120 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
121 gnt_widget_set_size (widget, widget->priv.minw, widget->priv.minh); |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
124 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
125 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
|
126 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
127 GObjectClass *g_class = G_OBJECT_CLASS (klass); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
128 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
129 parent_class = GNT_WIDGET_CLASS (klass); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
130 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
131 #if GLIB_CHECK_VERSION(2,4,0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
132 g_type_class_add_private (g_class, sizeof (GntProgressBarPrivate)); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
133 #endif |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
134 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
135 parent_class->draw = gnt_progress_bar_draw; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
136 parent_class->size_request = gnt_progress_bar_size_request; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
139 static void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
140 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
|
141 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
142 GntWidget *widget = GNT_WIDGET (instance); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
143 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
144 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
145 gnt_widget_set_take_focus (widget, FALSE); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
146 GNT_WIDGET_SET_FLAGS (widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW | GNT_WIDGET_GROW_X); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
147 |
26643
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
148 widget->priv.minw = 8; |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
149 widget->priv.minh = 1; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
150 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
151 priv->show_value = TRUE; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
154 GType |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
155 gnt_progress_bar_get_type (void) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
156 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
157 static GType type = 0; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
158 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
159 if (type == 0) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
160 static const GTypeInfo info = { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
161 sizeof (GntProgressBarClass), |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
162 NULL, /* base_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
163 NULL, /* base_finalize */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
164 gnt_progress_bar_class_init, /* class_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
165 NULL, /* class_finalize */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
166 NULL, /* class_data */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
167 sizeof (GntProgressBar), |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
168 0, /* n_preallocs */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
169 gnt_progress_bar_init, /* instance_init */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
170 NULL /* value_table */ |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
171 }; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
172 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
173 type = g_type_register_static (GNT_TYPE_WIDGET, "GntProgressBar", &info, 0); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
174 } |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
175 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
176 return type; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
179 GntWidget * |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
180 gnt_progress_bar_new (void) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
181 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
182 GntWidget *widget = g_object_new (GNT_TYPE_PROGRESS_BAR, NULL); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
183 return widget; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
186 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
187 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
|
188 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
189 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
190 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
191 if (fraction > 1.0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
192 priv->fraction = 1.0; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
193 else if (fraction < 0.0) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
194 priv->fraction = 0.0; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
195 else |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
196 priv->fraction = fraction; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
197 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
198 if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
199 gnt_widget_draw(GNT_WIDGET(pbar)); |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
202 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
203 gnt_progress_bar_set_orientation (GntProgressBar *pbar, |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
204 GntProgressBarOrientation orientation) |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
205 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
206 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
26643
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
207 GntWidget *widget = GNT_WIDGET(pbar); |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
208 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
209 priv->orientation = orientation; |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
210 if (orientation == GNT_PROGRESS_LEFT_TO_RIGHT || |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
211 orientation == GNT_PROGRESS_RIGHT_TO_LEFT) { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
212 GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_X); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
213 GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_Y); |
26643
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
214 widget->priv.minw = 8; |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
215 widget->priv.minh = 1; |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
216 } else { |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
217 GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_X); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
218 GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_Y); |
26643
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
219 widget->priv.minw = 1; |
0a5823a58279
Fix size constraints for vertical progressbars.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26642
diff
changeset
|
220 widget->priv.minh = 8; |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
221 } |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
222 |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
223 if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
224 gnt_widget_draw(GNT_WIDGET(pbar)); |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
227 void |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
228 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
|
229 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
230 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
231 priv->show_value = show; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
234 gdouble |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
235 gnt_progress_bar_get_fraction (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
236 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
237 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
238 return priv->fraction; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
241 GntProgressBarOrientation |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
242 gnt_progress_bar_get_orientation (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
243 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
244 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
245 return priv->orientation; |
26637
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 |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
248 gboolean |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
249 gnt_progress_bar_get_show_progress (GntProgressBar *pbar) |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
250 { |
26638
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
251 GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); |
cd7fa6306f85
Indentation changes, initialization changes etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26637
diff
changeset
|
252 return priv->show_value; |
26637
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
253 } |
35430bc421c2
Add a simple progress-bar in libgnt.
Saleem Abdulrasool <compnerd@compnerd.org>
parents:
diff
changeset
|
254 |