2 * This file is part of hildon-libs
4 * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
6 * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@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; version 2.1 of
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)
230 s = g_strdup_printf("<b>%s</b>", text);
232 hildon_banner_show_information_with_markup((GtkWidget *) parent, icon_name, s);
238 * gtk_banner_show_animation:
239 * @parent: #GtkWindow
240 * @text: #const gchar *
242 * The @text is the text shown in banner.
243 * Creates a new banner with the animation.
245 * Deprecated: Use #hildon_banner_show_animation instead.
247 void gtk_banner_show_animation(GtkWindow * parent, const gchar * text)
249 (void) hildon_banner_show_animation((GtkWidget *) parent, NULL, text);
253 * gtk_banner_show_bar
254 * @parent: #GtkWindow
255 * @text: #const gchar *
257 * The @text is the text shown in banner.
258 * Creates a new banner with the progressbar.
260 * Deprecated: Use #hildon_banner_show_progress instead.
262 void gtk_banner_show_bar(GtkWindow * parent, const gchar * text)
264 (void) hildon_banner_show_progress((GtkWidget *) parent, NULL, text);
268 * gtk_banner_set_text
269 * @parent: #GtkWindow
270 * @text: #const gchar *
272 * The @text is the text shown in banner.
273 * Sets the banner text.
275 * Deprecated: Use #hildon_banner_set_text instead.
277 void gtk_banner_set_text(GtkWindow * parent, const gchar * text)
281 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
283 banner = find_banner_for_parent(parent);
285 hildon_banner_set_text(HILDON_BANNER(banner), text);
289 * gtk_banner_set_fraction:
290 * @parent: #GtkWindow
291 * @fraction: #gdouble
293 * The fraction is the completion of progressbar,
294 * the scale is from 0.0 to 1.0.
295 * Sets the amount of fraction the progressbar has.
297 * Deprecated: Use #hildon_banner_set_fraction instead.
299 void gtk_banner_set_fraction(GtkWindow * parent, gdouble fraction)
303 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
305 banner = find_banner_for_parent(parent);
307 hildon_banner_set_fraction(HILDON_BANNER(banner), fraction);
312 * @parent: #GtkWindow
314 * Destroys the banner
318 void gtk_banner_close(GtkWindow * parent)
322 g_return_if_fail(GTK_IS_WINDOW(parent) || parent == NULL);
324 banner = find_banner_for_parent(parent);
326 gtk_widget_destroy(banner);
330 * gtk_banner_temporarily_disable_wrap
332 * Will disable wrapping for the next shown banner. This only
333 * affects next banner shown in this application.
335 * Currently it does nothing.
339 void gtk_banner_temporarily_disable_wrap(void)