window: Remove icon list

This commit is contained in:
Timm Bäder 2018-12-30 06:48:05 +01:00 committed by Matthias Clasen
parent 131e8d8905
commit 55b99e9916
3 changed files with 0 additions and 97 deletions

View File

@ -4702,93 +4702,6 @@ gtk_window_unrealize_icon (GtkWindow *window)
} }
/**
* gtk_window_set_icon_list:
* @window: a #GtkWindow
* @list: (element-type GdkTexture): list of image surfaces
*
* Sets up the icon representing a #GtkWindow. The icon is used when
* the window is minimized (also known as iconified). Some window
* managers or desktop environments may also place it in the window
* frame, or display it in other contexts. On others, the icon is not
* used at all, so your mileage may vary.
*
* gtk_window_set_icon_list() allows you to pass in the same icon in
* several hand-drawn sizes. The list should contain the natural sizes
* your icon is available in; that is, dont scale the image before
* passing it to GTK+. Scaling is postponed until the last minute,
* when the desired final size is known, to allow best quality.
*
* By passing several sizes, you may improve the final image quality
* of the icon, by reducing or eliminating automatic image scaling.
*
* Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and
* larger images (64x64, 128x128) if you have them.
*
* See also gtk_window_set_default_icon_list() to set the icon
* for all windows in your application in one go.
*
* Note that transient windows (those who have been set transient for another
* window using gtk_window_set_transient_for()) will inherit their
* icon from their transient parent. So theres no need to explicitly
* set the icon on transient windows.
**/
void
gtk_window_set_icon_list (GtkWindow *window,
GList *list)
{
GtkWindowIconInfo *info;
g_return_if_fail (GTK_IS_WINDOW (window));
info = ensure_icon_info (window);
if (info->icon_list == list) /* check for NULL mostly */
return;
g_list_foreach (list,
(GFunc) g_object_ref, NULL);
g_list_free_full (info->icon_list, g_object_unref);
info->icon_list = g_list_copy (list);
gtk_window_unrealize_icon (window);
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
gtk_window_realize_icon (window);
/* We could try to update our transient children, but I don't think
* it's really worth it. If we did it, the best way would probably
* be to have children connect to notify::icon-list
*/
}
/**
* gtk_window_get_icon_list:
* @window: a #GtkWindow
*
* Retrieves the list of icons set by gtk_window_set_icon_list().
* The list is copied, but the reference count on each
* member wont be incremented.
*
* Returns: (element-type GdkTexture) (transfer container): copy of windows icon list
**/
GList*
gtk_window_get_icon_list (GtkWindow *window)
{
GtkWindowIconInfo *info;
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
info = get_icon_info (window);
if (info)
return g_list_copy (info->icon_list);
else
return NULL;
}
static void static void
update_themed_icon (GtkWindow *window) update_themed_icon (GtkWindow *window)
{ {
@ -5725,9 +5638,6 @@ gtk_window_destroy (GtkWidget *widget)
remove_attach_widget (window); remove_attach_widget (window);
/* frees the icons */
gtk_window_set_icon_list (window, NULL);
if (priv->has_user_ref_count) if (priv->has_user_ref_count)
{ {
priv->has_user_ref_count = FALSE; priv->has_user_ref_count = FALSE;

View File

@ -272,11 +272,6 @@ void gtk_window_set_deletable (GtkWindow *window,
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gtk_window_get_deletable (GtkWindow *window); gboolean gtk_window_get_deletable (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_set_icon_list (GtkWindow *window,
GList *list);
GDK_AVAILABLE_IN_ALL
GList* gtk_window_get_icon_list (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_set_icon_name (GtkWindow *window, void gtk_window_set_icon_name (GtkWindow *window,
const gchar *name); const gchar *name);

View File

@ -4888,8 +4888,6 @@ create_wmhints (GtkWidget *widget)
list = g_list_prepend (NULL, texture); list = g_list_prepend (NULL, texture);
gtk_window_set_icon_list (GTK_WINDOW (window), list);
g_list_free (list); g_list_free (list);
g_object_unref (texture); g_object_unref (texture);
g_object_unref (pixbuf); g_object_unref (pixbuf);