mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
276a5a1001
First cut at tiled background images. There's no UI for setting them yet, they are only in the icon view, and they don't work properly with scrolling yet. * libnautilus/Makefile.am: * libnautilus/nautilus-gdk-extensions.c: * libnautilus/nautilus-gdk-extensions.h: * libnautilus/nautilus-gdk-pixbuf-extensions.c: * libnautilus/nautilus-gdk-pixbuf-extensions.h: Split the GdkPixbuf stuff into its own file. * libnautilus/nautilus-background.c: (nautilus_background_destroy): Fixed a bunch of leaks and added new code to stop pixbuf loading. (nautilus_background_draw): Added call to draw tiled background image. Converted gradients to use gdk_rgb instead of gdk_color. (nautilus_background_get_tile_image_uri): Implemented. (nautilus_background_set_color): Added short-circuit for background image case. (load_image_callback), (nautilus_background_set_tile_image_uri): Implemented. Include code to load in the tiled image when its URI is set. (nautilus_background_receive_dropped_color): Set the tile image to NULL when a color is dropped. * libnautilus/nautilus-gdk-extensions.c: * libnautilus/nautilus-gdk-extensions.h: (nautilus_fill_rectangle_with_color), (nautilus_fill_rectangle_with_color), (nautilus_interpolate_color): Changed from gdk_color to gdk_rgb. (nautilus_parse_rgb_with_white_default): Added function for gdk_rgb similar to what we already have for gdk_color. * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-list.c: Use gdk-pixbuf extensions in new location. * libnautilus/nautilus-metadata.h: Added metadata keys for background images. * src/ntl-view.c: Added lots of stronger checks for NAUTILUS_IS_VIEW since this is where we run into trouble with a bug I ran into. * src/file-manager/icon-view.c: Added code to handle the new background images. (create_icon_container): Keep around the handler ID when connecting to the "changed" message of the background so we can block the handler as needed. (fm_icon_view_begin_loading): Load the background image as well as the background color. We need to block the background changed signal handler so we don't get confused while the color but not the image is set up. (fm_icon_view_background_changed_callback): Save the background image URI as well as the background color in the metadata.
59 lines
2.7 KiB
C
59 lines
2.7 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
/* nautilus-gdk-pixbuf-extensions.h: Routines to augment what's in gdk-pixbuf.
|
|
|
|
Copyright (C) 2000 Eazel, Inc.
|
|
|
|
The Gnome Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
The Gnome Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
Authors: Darin Adler <darin@eazel.com>
|
|
*/
|
|
|
|
#ifndef NAUTILUS_GDK_PIXBUF_EXTENSIONS_H
|
|
#define NAUTILUS_GDK_PIXBUF_EXTENSIONS_H
|
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
#include <libgnomevfs/gnome-vfs-types.h>
|
|
|
|
typedef struct NautilusPixbufLoadHandle NautilusPixbufLoadHandle;
|
|
typedef void (* NautilusPixbufLoadCallback) (GnomeVFSResult error,
|
|
GdkPixbuf *pixbuf,
|
|
gpointer callback_data);
|
|
|
|
/* Convenience functions for lists of GdkPixbuf objects. */
|
|
void nautilus_gdk_pixbuf_list_ref (GList *pixbuf_list);
|
|
void nautilus_gdk_pixbuf_list_unref (GList *pixbuf_list);
|
|
void nautilus_gdk_pixbuf_list_free (GList *pixbuf_list);
|
|
|
|
/* Loading a GdkPixbuf with a URI. */
|
|
GdkPixbuf * nautilus_gdk_pixbuf_load (const char *uri);
|
|
|
|
/* Same thing async. */
|
|
NautilusPixbufLoadHandle *nautilus_gdk_pixbuf_load_async (const char *uri,
|
|
NautilusPixbufLoadCallback callback,
|
|
gpointer callback_data);
|
|
void nautilus_cancel_gdk_pixbuf_load (NautilusPixbufLoadHandle *handle);
|
|
|
|
/* Draw a GdkPixbuf tiled. */
|
|
void nautilus_gdk_pixbuf_render_to_drawable_tiled (GdkPixbuf *pixbuf,
|
|
GdkDrawable *drawable,
|
|
GdkGC *gc,
|
|
const GdkRectangle *destination_rectangle,
|
|
GdkRgbDither dither,
|
|
int x_dither,
|
|
int y_dither);
|
|
|
|
#endif /* NAUTILUS_GDK_PIXBUF_EXTENSIONS_H */
|