add default icon

2001-08-28  Havoc Pennington  <hp@pobox.com>

	* demos/gtk-demo/main.c (setup_default_icon): add default icon

	* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
	warning fix
	(gtk_radio_button_new_with_label): warning fix

	* gtk/gtkdnd.c: used some random GtkImage private structs,
	update to reflect GtkImage changes

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
	whether the hint is supported, just always set the icon. A task
	list might want to use it even if the WM doesn't, and the WM may
	change over time. Also, XDeleteProperty() if list == NULL.

	* gtk/gtkwindow.c (gtk_window_set_icon_list)
	(gtk_window_get_icon_list)
	(gtk_window_set_icon)
	(gtk_window_get_icon)
	(gtk_window_set_default_icon_list)
	(gtk_window_get_default_icon_list):
	new functions

	* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet

	* gtk/gtkimage.c: Implement property support, bug #59408

	* gtk/gtkcontainer.c (gtk_container_add): make the warning message
	on reparent-without-removing-first a bit more helpful.
	Let's just destroy this FAQ.
This commit is contained in:
Havoc Pennington
2001-08-29 02:20:02 +00:00
committed by Havoc Pennington
parent 3921a79118
commit 9df0074685
26 changed files with 1353 additions and 87 deletions

View File

@ -2325,7 +2325,6 @@ gdk_window_set_override_redirect (GdkWindow *window,
* gdk_window_set_icon_list:
* @window: The #GdkWindow toplevel window to set the icon of.
* @pixbufs: A list of pixbufs, of different sizes.
* @Returns: %TRUE if the icons were set, false otherwise
*
* Sets a list of icons for the window. One of these will be used
* to represent the window when it has been iconified. The icon is
@ -2335,12 +2334,8 @@ gdk_window_set_override_redirect (GdkWindow *window,
* image quality since the window manager may only need to scale the
* icon by a small amount or not at all.
*
* On the X11 backend this call might fail if the window manager
* doesn't support the Extended Window Manager Hints. Then this
* function returns FALSE, and the application should fall back
* to #gdk_window_set_icon().
**/
gboolean
void
gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs)
{
@ -2354,14 +2349,10 @@ gdk_window_set_icon_list (GdkWindow *window,
gint x, y;
gint n_channels;
g_return_val_if_fail (window != NULL, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return FALSE;
if (!gdk_net_wm_supports (gdk_atom_intern ("_NET_WM_ICON", FALSE)))
return FALSE;
return;
l = pixbufs;
size = 0;
@ -2418,14 +2409,21 @@ gdk_window_set_icon_list (GdkWindow *window,
l = g_list_next (l);
}
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE),
XA_CARDINAL, 32,
PropModeReplace,
(guchar*) data, size);
return TRUE;
if (size > 0)
{
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE),
XA_CARDINAL, 32,
PropModeReplace,
(guchar*) data, size);
}
else
{
XDeleteProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE));
}
}
void