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 deprecated. 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;
44 toplevels = gtk_window_list_toplevels();
45 for (iter = toplevels; iter; iter = iter->next)
46 if (HILDON_IS_BANNER(iter->data) &&
47 gtk_window_get_transient_for(GTK_WINDOW(iter->data)) == parent)
49 g_object_get(iter->data, "is-timed", &is_timed, NULL);
51 /* We do not want to touch timed infoprints */
58 g_list_free(toplevels);
62 /**************************************************/
64 /**************************************************/
68 * @parent: The transient window for the infoprint.
69 * @text: The text in infoprint
71 * Opens a new infoprint with @text content.
73 * If parent is %NULL, the infoprint is a system infoprint.
74 * Normally you should use your application window
75 * or dialog as a transient parent and avoid passing %NULL.
77 * Deprecated: Use #hildon_banner_show_information instead.
79 void gtk_infoprint(GtkWindow * parent, const gchar * text)
81 hildon_banner_show_information((GtkWidget *) parent, NULL, text);
85 * gtk_infoprint_with_icon_stock:
86 * @parent: The transient window for the infoprint.
87 * @text: The text in infoprint
88 * @stock_id: The stock id of the custom icon
90 * Opens a new infoprint with @text content.
91 * With this function you can also set a custom icon
92 * by giving a stock id as last parameter.
94 * If parent is %NULL, the infoprint is a system infoprint.
95 * Normally you should use your application window
96 * or dialog as a transient parent and avoid passing %NULL.
98 * Deprecated: Use #hildon_banner_show_information instead.
101 gtk_infoprint_with_icon_stock(GtkWindow * parent,
102 const gchar * text, const gchar * stock_id)
104 hildon_banner_show_information((GtkWidget *) parent, NULL, text);
108 * gtk_infoprint_with_icon_name:
109 * @parent: The transient window for the infoprint.
110 * @text: The text in infoprint
111 * @icon_name: The name of the icon
113 * Opens a new infoprint with @text content.
114 * With this function you can also set a custom icon
115 * by giving a icon name as last parameter.
117 * If parent is %NULL, the infoprint is a system infoprint.
118 * Normally you should use your application window
119 * or dialog as a transient parent and avoid passing %NULL.
121 * Deprecated: Use #hildon_banner_show_information instead.
124 gtk_infoprint_with_icon_name(GtkWindow * parent,
125 const gchar * text, const gchar * icon_name)
127 hildon_banner_show_information((GtkWidget *) parent, icon_name, text);
132 * @parent: The transient window for the infoprint.
133 * @format: Format of the text.
134 * @Varargs: List of parameters.
136 * Opens a new infoprint with @text printf-style formatting
137 * string and comma-separated list of parameters.
139 * If parent is %NULL, the infoprint is a system infoprint.
140 * This version of infoprint allow you to make printf-like formatting
143 * Deprecated: Use #hildon_banner_show_information instead.
145 void gtk_infoprintf(GtkWindow * parent, const gchar * format, ...)
150 va_start(args, format);
151 message = g_strdup_vprintf(format, args);
154 gtk_infoprint(parent, message);
160 * gtk_infoprint_temporarily_disable_wrap:
162 * Will disable wrapping for the next shown infoprint. This only
163 * affects next infoprint shown in this application.
165 * Currently it does nothing.
169 void gtk_infoprint_temporarily_disable_wrap(void)
174 * gtk_confirmation_banner:
175 * @parent: The transient window for the confirmation banner.
176 * @text: The text in confirmation banner
177 * @stock_id: The stock id of the custom icon
179 * Opens a new confirmation banner with @text content.
180 * With this function you can also set a custom icon
181 * by giving a stock id as last parameter.
183 * If parent is %NULL, the banner is a system banner.
184 * Normally you should use your application window
185 * or dialog as a transient parent and avoid passing %NULL.
187 * This function is otherwise similar to
188 * gtk_infoprint_with_icon_stock except in always restricts
189 * the text to one line and the font is emphasized.
191 * Deprecated: Use #hildon_banner_show_information instead.
194 gtk_confirmation_banner(GtkWindow * parent, const gchar * text,
195 const gchar * stock_id)
198 s = g_strdup_printf("<b>%s</b>", text);
200 hildon_banner_show_information_with_markup((GtkWidget *) parent, NULL, s);
206 * gtk_confirmation_banner_with_icon_name:
207 * @parent: The transient window for the confirmation banner.
208 * @text: The text in confirmation banner
209 * @icon_name: The name of the custom icon in icon theme
211 * Opens a new confirmation banner with @text content.
212 * With this function you can also set a custom icon
213 * by giving a icon theme's icon name as last parameter.
215 * If parent is %NULL, the banner is a system banner.
216 * Normally you should use your application window
217 * or dialog as a transient parent and avoid passing %NULL.
219 * This function is otherwise similar to
220 * gtk_infoprint_with_icon_name except in always restricts
221 * the text to one line and the font is emphasized.
223 * Deprecated: Use #hildon_banner_show_information instead.
226 gtk_confirmation_banner_with_icon_name(GtkWindow * parent, const gchar * text,
227 const gchar * icon_name)
229 hildon_banner_show_information((GtkWidget *) parent, icon_name, text);
233 * gtk_banner_show_animation:
234 * @parent: #GtkWindow
235 * @text: #const gchar *
237 * The @text is the text shown in banner.
238 * Creates a new banner with the animation.
240 * Deprecated: Use #hildon_banner_show_animation instead.
242 void gtk_banner_show_animation(GtkWindow * parent, const gchar * text)
244 (void) hildon_banner_show_animation((GtkWidget *) parent, NULL, text);
248 * gtk_banner_show_bar
249 * @parent: #GtkWindow
250 * @text: #const gchar *
252 * The @text is the text shown in banner.
253 * Creates a new banner with the progressbar.
255 * Deprecated: Use #hildon_banner_show_progress instead.
257 void gtk_banner_show_bar(GtkWindow * parent, const gchar * text)
259 (void) hildon_banner_show_progress((GtkWidget *) parent, NULL, text);
263 * gtk_banner_set_text
264 * @parent: #GtkWindow
265 * @text: #const gchar *
267 * The @text is the text shown in banner.
268 * Sets the banner text.
270 * Deprecated: Use #hildon_banner_set_text instead.
272 void gtk_banner_set_text(GtkWindow * parent, const gchar * text)
276 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
278 banner = find_banner_for_parent(parent);
280 hildon_banner_set_text(HILDON_BANNER(banner), text);
284 * gtk_banner_set_fraction:
285 * @parent: #GtkWindow
286 * @fraction: #gdouble
288 * The fraction is the completion of progressbar,
289 * the scale is from 0.0 to 1.0.
290 * Sets the amount of fraction the progressbar has.
292 * Deprecated: Use #hildon_banner_set_fraction instead.
294 void gtk_banner_set_fraction(GtkWindow * parent, gdouble fraction)
298 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
300 banner = find_banner_for_parent(parent);
302 hildon_banner_set_fraction(HILDON_BANNER(banner), fraction);
307 * @parent: #GtkWindow
309 * Destroys the banner
313 void gtk_banner_close(GtkWindow * parent)
317 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
319 banner = find_banner_for_parent(parent);
321 gtk_widget_destroy(banner);
325 * gtk_banner_temporarily_disable_wrap
327 * Will disable wrapping for the next shown banner. This only
328 * affects next banner shown in this application.
330 * Currently it does nothing.
334 void gtk_banner_temporarily_disable_wrap(void)