2 * This file is part of hildon-libs
4 * Copyright (C) 2005 Nokia Corporation.
6 * Contact: Luc Pionchon <luc.pionchon@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 * SECTION:gtk-infoprint
27 * @short_description: deprecated widget. Use #HildonBanner instead
29 * This widget is deprectaed. Use #HildonBanner instead
32 #include "gtk-infoprint.h"
33 #include "hildon-banner.h"
35 /* This is a helper function that searches the banner for
36 given window. This is needed to provide backwards
38 static GtkWidget *find_banner_for_parent(GtkWindow *parent)
40 GList *toplevels, *iter;
41 GtkWidget *result = NULL;
43 toplevels = gtk_window_list_toplevels();
44 for (iter = toplevels; iter; iter = iter->next)
45 if (HILDON_IS_BANNER(iter->data) &&
46 gtk_window_get_transient_for(GTK_WINDOW(iter->data)) == parent)
52 g_list_free(toplevels);
56 /**************************************************/
58 /**************************************************/
62 * @parent: The transient window for the infoprint.
63 * @text: The text in infoprint
65 * Opens a new infoprint with @text content.
67 * If parent is %NULL, the infoprint is a system infoprint.
68 * Normally you should use your application window
69 * or dialog as a transient parent and avoid passing %NULL.
71 * Deprecated: Use #hildon_banner_show_information instead.
73 void gtk_infoprint(GtkWindow * parent, const gchar * text)
75 hildon_banner_show_information((GtkWidget *) parent, NULL, text);
79 * gtk_infoprint_with_icon_stock:
80 * @parent: The transient window for the infoprint.
81 * @text: The text in infoprint
82 * @stock_id: The stock id of the custom icon
84 * Opens a new infoprint with @text content.
85 * With this function you can also set a custom icon
86 * by giving a stock id as last parameter.
88 * If parent is %NULL, the infoprint is a system infoprint.
89 * Normally you should use your application window
90 * or dialog as a transient parent and avoid passing %NULL.
92 * Deprecated: Use #hildon_banner_show_information instead.
95 gtk_infoprint_with_icon_stock(GtkWindow * parent,
96 const gchar * text, const gchar * stock_id)
98 hildon_banner_show_information((GtkWidget *) parent, NULL, text);
102 * gtk_infoprint_with_icon_name:
103 * @parent: The transient window for the infoprint.
104 * @text: The text in infoprint
105 * @icon_name: The name of the icon
107 * Opens a new infoprint with @text content.
108 * With this function you can also set a custom icon
109 * by giving a icon name as last parameter.
111 * If parent is %NULL, the infoprint is a system infoprint.
112 * Normally you should use your application window
113 * or dialog as a transient parent and avoid passing %NULL.
115 * Deprecated: Use #hildon_banner_show_information instead.
118 gtk_infoprint_with_icon_name(GtkWindow * parent,
119 const gchar * text, const gchar * icon_name)
121 hildon_banner_show_information((GtkWidget *) parent, icon_name, text);
126 * @parent: The transient window for the infoprint.
127 * @format: Format of the text.
128 * @Varargs: List of parameters.
130 * Opens a new infoprint with @text printf-style formatting
131 * string and comma-separated list of parameters.
133 * If parent is %NULL, the infoprint is a system infoprint.
134 * This version of infoprint allow you to make printf-like formatting
137 * Deprecated: Use #hildon_banner_show_information instead.
139 void gtk_infoprintf(GtkWindow * parent, const gchar * format, ...)
144 va_start(args, format);
145 message = g_strdup_vprintf(format, args);
148 gtk_infoprint(parent, message);
154 * gtk_infoprint_temporarily_disable_wrap:
156 * Will disable wrapping for the next shown infoprint. This only
157 * affects next infoprint shown in this application.
159 * Currently it does nothing.
163 void gtk_infoprint_temporarily_disable_wrap(void)
168 * gtk_confirmation_banner:
169 * @parent: The transient window for the confirmation banner.
170 * @text: The text in confirmation banner
171 * @stock_id: The stock id of the custom icon
173 * Opens a new confirmation banner with @text content.
174 * With this function you can also set a custom icon
175 * by giving a stock id as last parameter.
177 * If parent is %NULL, the banner is a system banner.
178 * Normally you should use your application window
179 * or dialog as a transient parent and avoid passing %NULL.
181 * This function is otherwise similar to
182 * gtk_infoprint_with_icon_stock except in always restricts
183 * the text to one line and the font is emphasized.
185 * Deprecated: Use #hildon_banner_show_information instead.
188 gtk_confirmation_banner(GtkWindow * parent, const gchar * text,
189 const gchar * stock_id)
191 hildon_banner_show_information((GtkWidget *) parent, NULL, text);
195 * gtk_confirmation_banner_with_icon_name:
196 * @parent: The transient window for the confirmation banner.
197 * @text: The text in confirmation banner
198 * @icon_name: The name of the custom icon in icon theme
200 * Opens a new confirmation banner with @text content.
201 * With this function you can also set a custom icon
202 * by giving a icon theme's icon name as last parameter.
204 * If parent is %NULL, the banner is a system banner.
205 * Normally you should use your application window
206 * or dialog as a transient parent and avoid passing %NULL.
208 * This function is otherwise similar to
209 * gtk_infoprint_with_icon_name except in always restricts
210 * the text to one line and the font is emphasized.
212 * Deprecated: Use #hildon_banner_show_information instead.
215 gtk_confirmation_banner_with_icon_name(GtkWindow * parent, const gchar * text,
216 const gchar * icon_name)
218 hildon_banner_show_information((GtkWidget *) parent, icon_name, text);
222 * gtk_banner_show_animation:
223 * @parent: #GtkWindow
224 * @text: #const gchar *
226 * The @text is the text shown in banner.
227 * Creates a new banner with the animation.
229 * Deprecated: Use #hildon_banner_show_animation instead.
231 void gtk_banner_show_animation(GtkWindow * parent, const gchar * text)
233 (void) hildon_banner_show_animation((GtkWidget *) parent, NULL, text);
237 * gtk_banner_show_bar
238 * @parent: #GtkWindow
239 * @text: #const gchar *
241 * The @text is the text shown in banner.
242 * Creates a new banner with the progressbar.
244 * Deprecated: Use #hildon_banner_show_progress instead.
246 void gtk_banner_show_bar(GtkWindow * parent, const gchar * text)
248 (void) hildon_banner_show_progress((GtkWidget *) parent, NULL, text);
252 * gtk_banner_set_text
253 * @parent: #GtkWindow
254 * @text: #const gchar *
256 * The @text is the text shown in banner.
257 * Sets the banner text.
259 * Deprecated: Use #hildon_banner_set_text instead.
261 void gtk_banner_set_text(GtkWindow * parent, const gchar * text)
265 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
267 banner = find_banner_for_parent(parent);
269 hildon_banner_set_text(HILDON_BANNER(banner), text);
273 * gtk_banner_set_fraction:
274 * @parent: #GtkWindow
275 * @fraction: #gdouble
277 * The fraction is the completion of progressbar,
278 * the scale is from 0.0 to 1.0.
279 * Sets the amount of fraction the progressbar has.
281 * Deprecated: Use #hildon_banner_set_fraction instead.
283 void gtk_banner_set_fraction(GtkWindow * parent, gdouble fraction)
287 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
289 banner = find_banner_for_parent(parent);
291 hildon_banner_set_fraction(HILDON_BANNER(banner), fraction);
296 * @parent: #GtkWindow
298 * Destroys the banner
302 void gtk_banner_close(GtkWindow * parent)
306 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
308 banner = find_banner_for_parent(parent);
310 gtk_widget_destroy(banner);
314 * gtk_banner_temporarily_disable_wrap
316 * Will disable wrapping for the next shown banner. This only
317 * affects next banner shown in this application.
319 * Currently it does nothing.
323 void gtk_banner_temporarily_disable_wrap(void)