Commit eecee135 authored by Andy Hertzfeld's avatar Andy Hertzfeld

moved pixbuf manipulation routines into


      moved pixbuf manipulation routines into
      libnautilus/nautilus-graphic-effects
parent d316c0cc
2000-03-24 Andy Hertzfeld <andy@eazel.com>
moved pixbuf special effect routines into libnautilus, to prepare for
adding selection hilighting and others
* libnautilus/nautilus-graphic-effects.h:
header file for pixbuf graphic effects routines
* libnautilus/nautilus-graphic-effects.c:
moved create_spotlight_pixbuf and make_semi_transparent here,
fixed bug in create_spotlight_pixbuf by using separate rowstride for
the src and dst like Darin did for make_semi_transparent
* libnautilus/Makefile.am:
added nautilus-graphic-effects.c & .h
* libnautilus/nautilus-icon-canvas-item.c:
removed create_spotlight_pixbuf routine
* libnautilus/nautilus-icon-dnd.c:
removed make_semi_transparent routine
2000-03-23 John Sullivan <sullivan@eazel.com>
Put sample merged menu item and merged toolbar item
......
......@@ -42,6 +42,7 @@ libnautilusinclude_HEADERS= \
nautilus-glib-extensions.h \
nautilus-global-preferences.h \
nautilus-gnome-extensions.h \
nautilus-graphic-effects.h \
nautilus-gtk-extensions.h \
nautilus-icon-container.h \
nautilus-icon-factory.h \
......@@ -77,6 +78,7 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
nautilus-glib-extensions.c \
nautilus-global-preferences.c \
nautilus-gnome-extensions.c \
nautilus-graphic-effects.c \
nautilus-gtk-extensions.c \
nautilus-icon-canvas-item.c \
nautilus-icon-container.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* Nautilus - pixbuf manipulation routines for graphical effects.
*
* Copyright (C) 2000 Eazel, Inc
*
* Author: Andy Hertzfeld <andy@eazel.com>
*
* This 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.
*
* This 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 this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* This file contains pixbuf manipulation routines used for graphical effects like pre-lighting
and selection hilighting */
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libart_lgpl/art_rgb_pixbuf_affine.h>
#include <libgnomeui/gnome-canvas-util.h>
#include "nautilus-graphic-effects.h"
/* graphics routine to lighten a pixbuf */
static guchar
lighten_component (guchar cur_value)
{
int new_value = cur_value;
new_value += 24 + (new_value >> 3);
if (new_value > 255)
new_value = 255;
return (guchar) new_value;
}
static void
do_lighten (GdkPixbuf *dest, GdkPixbuf *src)
{
int i, j;
int width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
has_alpha = gdk_pixbuf_get_has_alpha (src);
width = gdk_pixbuf_get_width (src);
height = gdk_pixbuf_get_height (src);
src_rowstride = gdk_pixbuf_get_rowstride (src);
dst_rowstride = gdk_pixbuf_get_rowstride (dest);
target_pixels = gdk_pixbuf_get_pixels (dest);
original_pixels = gdk_pixbuf_get_pixels (src);
for (i = 0; i < height; i++) {
pixdest = target_pixels + i*dst_rowstride;
pixsrc = original_pixels + i*src_rowstride;
for (j = 0; j < width; j++) {
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
if (has_alpha) {
*(pixdest++) = *(pixsrc++);
}
}
}
}
/* utility routine to lighten a pixbuf for pre-lighting */
GdkPixbuf *
create_spotlight_pixbuf (GdkPixbuf* source_pixbuf)
{
GdkPixbuf *new = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
gdk_pixbuf_get_has_alpha (source_pixbuf),
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
gdk_pixbuf_get_width (source_pixbuf),
gdk_pixbuf_get_height (source_pixbuf));
do_lighten (new, source_pixbuf);
return new;
}
/* this routine takes the source pixbuf and returns a new one that's semi-transparent, by
clearing every other pixel's alpha value in a checkerboard grip. We have to do the
checkerboard instead of reducing the alpha since it will be turned into an alpha-less
gdkpixmap and mask for the actual dragging */
GdkPixbuf *
make_semi_transparent(GdkPixbuf *source_pixbuf)
{
gint i, j, temp_alpha;
gint width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
guchar alpha_value;
GdkPixbuf *dest_pixbuf;
guchar start_alpha_value;
has_alpha = gdk_pixbuf_get_has_alpha (source_pixbuf);
width = gdk_pixbuf_get_width (source_pixbuf);
height = gdk_pixbuf_get_height (source_pixbuf);
src_rowstride = gdk_pixbuf_get_rowstride (source_pixbuf);
/* allocate the destination pixbuf to be a clone of the source */
dest_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
TRUE,
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
width,
height);
dst_rowstride = gdk_pixbuf_get_rowstride (dest_pixbuf);
/* set up pointers to the actual pixels */
target_pixels = gdk_pixbuf_get_pixels (dest_pixbuf);
original_pixels = gdk_pixbuf_get_pixels (source_pixbuf);
/* loop through the pixels to do the actual work, copying from the source to the destination */
start_alpha_value = ~0;
for (i = 0; i < height; i++) {
pixdest = target_pixels + i * dst_rowstride;
pixsrc = original_pixels + i * src_rowstride;
alpha_value = start_alpha_value;
for (j = 0; j < width; j++) {
*pixdest++ = *pixsrc++; /* red */
*pixdest++ = *pixsrc++; /* green */
*pixdest++ = *pixsrc++; /* blue */
if (has_alpha) {
temp_alpha = *pixsrc++;
} else {
temp_alpha = ~0;
}
*pixdest++ = temp_alpha & alpha_value;
alpha_value = ~alpha_value;
}
start_alpha_value = ~start_alpha_value;
}
return dest_pixbuf;
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-graphic-effects.h: Pixmap manipulation routines for graphical effects.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Andy Hertzfeld <andy@eazel.com>
*/
#ifndef NAUTILUS_GRAPHIC_EFFECTS_H
#define NAUTILUS_GRAPHIC_EFFECTS_H
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
/* return a lightened pixbuf for pre-lighting */
GdkPixbuf* create_spotlight_pixbuf (GdkPixbuf* source_pixbuf);
/* return a semi-transparent pixbuf from the source pixbuf using a checkboard
stipple in the alpha channel (so it can be converted to an alpha-less pixmap) */
GdkPixbuf* make_semi_transparent(GdkPixbuf *source_pixbuf);
#endif /* NAUTILUS_GRAPHIC_EFFECTS_H */
......@@ -39,6 +39,7 @@
#include "nautilus-gdk-extensions.h"
#include "nautilus-gtk-macros.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-graphic-effects.h"
#define STRETCH_HANDLE_THICKNESS 5
#define EMBLEM_SPACING 2
......@@ -913,65 +914,6 @@ draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
}
/* graphics routine to lighten a pixbuf */
/* FIXME: should be in a graphics library somewhere */
static guchar
lighten_component (guchar cur_value)
{
int new_value = cur_value;
new_value += 24 + (new_value >> 3);
if (new_value > 255)
new_value = 255;
return (guchar) new_value;
}
static void
do_lighten (GdkPixbuf *dest, GdkPixbuf *src)
{
int i, j;
int width, height, has_alpha, rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
has_alpha = gdk_pixbuf_get_has_alpha (src);
width = gdk_pixbuf_get_width (src);
height = gdk_pixbuf_get_height (src);
rowstride = gdk_pixbuf_get_rowstride (src);
target_pixels = gdk_pixbuf_get_pixels (dest);
original_pixels = gdk_pixbuf_get_pixels (src);
for (i = 0; i < height; i++) {
pixdest = target_pixels + i*rowstride;
pixsrc = original_pixels + i*rowstride;
for (j = 0; j < width; j++) {
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
if (has_alpha) {
*(pixdest++) = *(pixsrc++);
}
}
}
}
/* utility routine to lighten a pixbuf for pre-lighting */
static GdkPixbuf *
create_spotlight_pixbuf (GdkPixbuf* source_pixbuf)
{
GdkPixbuf *new = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
gdk_pixbuf_get_has_alpha (source_pixbuf),
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
gdk_pixbuf_get_width (source_pixbuf),
gdk_pixbuf_get_height (source_pixbuf));
do_lighten (new, source_pixbuf);
return new;
}
/* Draw the icon item. */
static void
nautilus_icon_canvas_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
......
......@@ -36,6 +36,8 @@
#include "nautilus-gtk-extensions.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-background.h"
#include "nautilus-graphic-effects.h"
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include "nautilus-icon-private.h"
......@@ -719,71 +721,6 @@ nautilus_icon_dnd_fini (NautilusIconContainer *container)
g_free (dnd_info);
}
/* this routine takes the source pixbuf and returns a new one that's semi-transparent, by
clearing every other pixel's alpha value in a checkerboard grip. We have to do the
checkerboard instead of reducing the alpha since it will be turned into an alpha-less
gdkpixmap and mask for the actual dragging */
/* FIXME: this should probably be in a graphics effects library instead of here */
static GdkPixbuf *
make_semi_transparent(GdkPixbuf *source_pixbuf)
{
gint i, j, temp_alpha;
gint width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
guchar alpha_value;
GdkPixbuf *dest_pixbuf;
guchar start_alpha_value;
has_alpha = gdk_pixbuf_get_has_alpha (source_pixbuf);
width = gdk_pixbuf_get_width (source_pixbuf);
height = gdk_pixbuf_get_height (source_pixbuf);
src_rowstride = gdk_pixbuf_get_rowstride (source_pixbuf);
/* allocate the destination pixbuf to be a clone of the source */
dest_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
TRUE,
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
width,
height);
dst_rowstride = gdk_pixbuf_get_rowstride (dest_pixbuf);
/* set up pointers to the actual pixels */
target_pixels = gdk_pixbuf_get_pixels (dest_pixbuf);
original_pixels = gdk_pixbuf_get_pixels (source_pixbuf);
/* loop through the pixels to do the actual work, copying from the source to the destination */
start_alpha_value = ~0;
for (i = 0; i < height; i++) {
pixdest = target_pixels + i * dst_rowstride;
pixsrc = original_pixels + i * src_rowstride;
alpha_value = start_alpha_value;
for (j = 0; j < width; j++) {
*pixdest++ = *pixsrc++; /* red */
*pixdest++ = *pixsrc++; /* green */
*pixdest++ = *pixsrc++; /* blue */
if (has_alpha) {
temp_alpha = *pixsrc++;
} else {
temp_alpha = ~0;
}
*pixdest++ = temp_alpha & alpha_value;
alpha_value = ~alpha_value;
}
start_alpha_value = ~start_alpha_value;
}
return dest_pixbuf;
}
void
nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
......
......@@ -42,6 +42,7 @@ libnautilusinclude_HEADERS= \
nautilus-glib-extensions.h \
nautilus-global-preferences.h \
nautilus-gnome-extensions.h \
nautilus-graphic-effects.h \
nautilus-gtk-extensions.h \
nautilus-icon-container.h \
nautilus-icon-factory.h \
......@@ -77,6 +78,7 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
nautilus-glib-extensions.c \
nautilus-global-preferences.c \
nautilus-gnome-extensions.c \
nautilus-graphic-effects.c \
nautilus-gtk-extensions.c \
nautilus-icon-canvas-item.c \
nautilus-icon-container.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* Nautilus - pixbuf manipulation routines for graphical effects.
*
* Copyright (C) 2000 Eazel, Inc
*
* Author: Andy Hertzfeld <andy@eazel.com>
*
* This 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.
*
* This 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 this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* This file contains pixbuf manipulation routines used for graphical effects like pre-lighting
and selection hilighting */
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libart_lgpl/art_rgb_pixbuf_affine.h>
#include <libgnomeui/gnome-canvas-util.h>
#include "nautilus-graphic-effects.h"
/* graphics routine to lighten a pixbuf */
static guchar
lighten_component (guchar cur_value)
{
int new_value = cur_value;
new_value += 24 + (new_value >> 3);
if (new_value > 255)
new_value = 255;
return (guchar) new_value;
}
static void
do_lighten (GdkPixbuf *dest, GdkPixbuf *src)
{
int i, j;
int width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
has_alpha = gdk_pixbuf_get_has_alpha (src);
width = gdk_pixbuf_get_width (src);
height = gdk_pixbuf_get_height (src);
src_rowstride = gdk_pixbuf_get_rowstride (src);
dst_rowstride = gdk_pixbuf_get_rowstride (dest);
target_pixels = gdk_pixbuf_get_pixels (dest);
original_pixels = gdk_pixbuf_get_pixels (src);
for (i = 0; i < height; i++) {
pixdest = target_pixels + i*dst_rowstride;
pixsrc = original_pixels + i*src_rowstride;
for (j = 0; j < width; j++) {
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
if (has_alpha) {
*(pixdest++) = *(pixsrc++);
}
}
}
}
/* utility routine to lighten a pixbuf for pre-lighting */
GdkPixbuf *
create_spotlight_pixbuf (GdkPixbuf* source_pixbuf)
{
GdkPixbuf *new = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
gdk_pixbuf_get_has_alpha (source_pixbuf),
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
gdk_pixbuf_get_width (source_pixbuf),
gdk_pixbuf_get_height (source_pixbuf));
do_lighten (new, source_pixbuf);
return new;
}
/* this routine takes the source pixbuf and returns a new one that's semi-transparent, by
clearing every other pixel's alpha value in a checkerboard grip. We have to do the
checkerboard instead of reducing the alpha since it will be turned into an alpha-less
gdkpixmap and mask for the actual dragging */
GdkPixbuf *
make_semi_transparent(GdkPixbuf *source_pixbuf)
{
gint i, j, temp_alpha;
gint width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
guchar alpha_value;
GdkPixbuf *dest_pixbuf;
guchar start_alpha_value;
has_alpha = gdk_pixbuf_get_has_alpha (source_pixbuf);
width = gdk_pixbuf_get_width (source_pixbuf);
height = gdk_pixbuf_get_height (source_pixbuf);
src_rowstride = gdk_pixbuf_get_rowstride (source_pixbuf);
/* allocate the destination pixbuf to be a clone of the source */
dest_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
TRUE,
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
width,
height);
dst_rowstride = gdk_pixbuf_get_rowstride (dest_pixbuf);
/* set up pointers to the actual pixels */
target_pixels = gdk_pixbuf_get_pixels (dest_pixbuf);
original_pixels = gdk_pixbuf_get_pixels (source_pixbuf);
/* loop through the pixels to do the actual work, copying from the source to the destination */
start_alpha_value = ~0;
for (i = 0; i < height; i++) {
pixdest = target_pixels + i * dst_rowstride;
pixsrc = original_pixels + i * src_rowstride;
alpha_value = start_alpha_value;
for (j = 0; j < width; j++) {
*pixdest++ = *pixsrc++; /* red */
*pixdest++ = *pixsrc++; /* green */
*pixdest++ = *pixsrc++; /* blue */
if (has_alpha) {
temp_alpha = *pixsrc++;
} else {
temp_alpha = ~0;
}
*pixdest++ = temp_alpha & alpha_value;
alpha_value = ~alpha_value;
}
start_alpha_value = ~start_alpha_value;
}
return dest_pixbuf;
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-graphic-effects.h: Pixmap manipulation routines for graphical effects.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Andy Hertzfeld <andy@eazel.com>
*/
#ifndef NAUTILUS_GRAPHIC_EFFECTS_H
#define NAUTILUS_GRAPHIC_EFFECTS_H
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
/* return a lightened pixbuf for pre-lighting */
GdkPixbuf* create_spotlight_pixbuf (GdkPixbuf* source_pixbuf);
/* return a semi-transparent pixbuf from the source pixbuf using a checkboard
stipple in the alpha channel (so it can be converted to an alpha-less pixmap) */
GdkPixbuf* make_semi_transparent(GdkPixbuf *source_pixbuf);
#endif /* NAUTILUS_GRAPHIC_EFFECTS_H */
......@@ -39,6 +39,7 @@
#include "nautilus-gdk-extensions.h"
#include "nautilus-gtk-macros.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-graphic-effects.h"
#define STRETCH_HANDLE_THICKNESS 5
#define EMBLEM_SPACING 2
......@@ -913,65 +914,6 @@ draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
}
/* graphics routine to lighten a pixbuf */
/* FIXME: should be in a graphics library somewhere */
static guchar
lighten_component (guchar cur_value)
{
int new_value = cur_value;
new_value += 24 + (new_value >> 3);
if (new_value > 255)
new_value = 255;
return (guchar) new_value;
}
static void
do_lighten (GdkPixbuf *dest, GdkPixbuf *src)
{
int i, j;
int width, height, has_alpha, rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;
has_alpha = gdk_pixbuf_get_has_alpha (src);
width = gdk_pixbuf_get_width (src);
height = gdk_pixbuf_get_height (src);
rowstride = gdk_pixbuf_get_rowstride (src);
target_pixels = gdk_pixbuf_get_pixels (dest);
original_pixels = gdk_pixbuf_get_pixels (src);
for (i = 0; i < height; i++) {
pixdest = target_pixels + i*rowstride;
pixsrc = original_pixels + i*rowstride;
for (j = 0; j < width; j++) {
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
*(pixdest++) = lighten_component(*(pixsrc++));
if (has_alpha) {
*(pixdest++) = *(pixsrc++);
}
}
}
}
/* utility routine to lighten a pixbuf for pre-lighting */
static GdkPixbuf *
create_spotlight_pixbuf (GdkPixbuf* source_pixbuf)
{
GdkPixbuf *new = gdk_pixbuf_new (gdk_pixbuf_get_format (source_pixbuf),
gdk_pixbuf_get_has_alpha (source_pixbuf),
gdk_pixbuf_get_bits_per_sample (source_pixbuf),
gdk_pixbuf_get_width (source_pixbuf),
gdk_pixbuf_get_height (source_pixbuf));
do_lighten (new, source_pixbuf);
return new;
}
/* Draw the icon item. */
static void
nautilus_icon_canvas_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
......
......@@ -36,6 +36,8 @@
#include "nautilus-gtk-extensions.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-background.h"
#include "nautilus-graphic-effects.h"
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include "nautilus-icon-private.h"
......@@ -719,71 +721,6 @@ nautilus_icon_dnd_fini (NautilusIconContainer *container)
g_free (dnd_info);
}
/* this routine takes the source pixbuf and returns a new one that's semi-transparent, by
clearing every other pixel's alpha value in a checkerboard grip. We have to do the
checkerboard instead of reducing the alpha since it will be turned into an alpha-less
gdkpixmap and mask for the actual dragging */
/* FIXME: this should probably be in a graphics effects library instead of here */
static GdkPixbuf *
make_semi_transparent(GdkPixbuf *source_pixbuf)
{
gint i, j, temp_alpha;
gint width, height, has_alpha, src_rowstride, dst_rowstride;
guchar *target_pixels;
guchar *original_pixels;
guchar *pixsrc;
guchar *pixdest;