Commit 16d1c8c7 authored by John Sullivan's avatar John Sullivan
Browse files

Checked in this patch from Ken Kocienda, which fixes

	bug 390 (wrong magic number used when computing alpha
	threshhold). Thanks Ken!

	* libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h:
	New #define for NAUTILUS_STANDARD_ALPHA_THRESHHOLD

	* components/music/nautilus-music-view.c:
	(nautilus_music_view_update_from_uri):
	* libnautilus-extensions/nautilus-bookmark.c:
	(nautilus_bookmark_get_pixmap_and_mask):
	* libnautilus-extensions/nautilus-icon-dnd.c:
	(nautilus_icon_dnd_begin_drag):
	* libnautilus-extensions/nautilus-icon-factory.c:
	(nautilus_icon_factory_get_pixmap_and_mask_for_file):
	* libnautilus-extensions/nautilus-list-column-title.c:
	(load_up_indicator):
	* libnautilus-extensions/nautilus-list.c: (draw_cell):
	* src/file-manager/fm-properties-window.c:
	(get_pixmap_and_mask_for_properties_window),
	(create_image_widget_for_emblem):
	* src/nautilus-bookmarks-window.c:
	* src/nautilus-complex-search-bar.c:
	(load_find_them_pixmap_widget):
	* src/nautilus-property-browser.c: (set_emblem_image_from_file),
	(element_clicked_callback), (make_properties_from_directory_path):
	* src/nautilus-sidebar-title.c: (add_emblem):
	* src/nautilus-theme-selector.c: (add_theme):
	* src/nautilus-window.c: (nautilus_window_realize):
	Replaced all uses of correct or incorrect magic numbers
	with NAUTILUS_STANDARD_ALPHA_THRESHHOLD in calls to
	gdk_pixbuf_render_pixmap_and_mask.
parent d3a89035
2000-08-23 John Sullivan <sullivan@eazel.com>
Checked in this patch from Ken Kocienda, which fixes
bug 390 (wrong magic number used when computing alpha
threshhold). Thanks Ken!
* libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h:
New #define for NAUTILUS_STANDARD_ALPHA_THRESHHOLD
* components/music/nautilus-music-view.c:
(nautilus_music_view_update_from_uri):
* libnautilus-extensions/nautilus-bookmark.c:
(nautilus_bookmark_get_pixmap_and_mask):
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_dnd_begin_drag):
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* libnautilus-extensions/nautilus-list-column-title.c:
(load_up_indicator):
* libnautilus-extensions/nautilus-list.c: (draw_cell):
* src/file-manager/fm-properties-window.c:
(get_pixmap_and_mask_for_properties_window),
(create_image_widget_for_emblem):
* src/nautilus-bookmarks-window.c:
* src/nautilus-complex-search-bar.c:
(load_find_them_pixmap_widget):
* src/nautilus-property-browser.c: (set_emblem_image_from_file),
(element_clicked_callback), (make_properties_from_directory_path):
* src/nautilus-sidebar-title.c: (add_emblem):
* src/nautilus-theme-selector.c: (add_theme):
* src/nautilus-window.c: (nautilus_window_realize):
Replaced all uses of correct or incorrect magic numbers
with NAUTILUS_STANDARD_ALPHA_THRESHHOLD in calls to
gdk_pixbuf_render_pixmap_and_mask.
2000-08-23 Yuri Syrota <rasta@renome.rovno.ua>
 
* configure.in: Added "uk" to ALL_LINGUAS
......
......@@ -1310,7 +1310,7 @@ nautilus_music_view_update_from_uri (NautilusMusicView *music_view, const char *
scaled_pixbuf = nautilus_gdk_pixbuf_scale_down_to_fit(pixbuf, 128, 128);
gdk_pixbuf_unref (pixbuf);
gdk_pixbuf_render_pixmap_and_mask (scaled_pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (scaled_pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (scaled_pixbuf);
if (music_view->details->album_image == NULL) {
......
......@@ -40,6 +40,8 @@
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
enum {
CHANGED,
LAST_SIGNAL
......@@ -188,7 +190,7 @@ nautilus_bookmark_get_pixmap_and_mask (NautilusBookmark *bookmark,
return FALSE;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, 100);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
return TRUE;
......
......@@ -29,6 +29,8 @@
#include <libgnomevfs/gnome-vfs-types.h>
#include <libart_lgpl/art_rect.h>
#define NAUTILUS_STANDARD_ALPHA_THRESHHOLD 128
typedef struct NautilusPixbufLoadHandle NautilusPixbufLoadHandle;
typedef void (* NautilusPixbufLoadCallback) (GnomeVFSResult error,
GdkPixbuf *pixbuf,
......
......@@ -43,6 +43,7 @@
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include "nautilus-background.h"
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include "nautilus-glib-extensions.h"
#include "nautilus-gtk-extensions.h"
#include "nautilus-gtk-macros.h"
......@@ -1162,7 +1163,7 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
gdk_pixbuf_render_pixmap_and_mask (transparent_pixbuf,
&pixmap_for_dragged_file,
&mask_for_dragged_file,
128);
NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (transparent_pixbuf);
......
......@@ -39,6 +39,8 @@
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <parser.h>
#include <xmlmemory.h>
......@@ -2185,7 +2187,7 @@ nautilus_icon_factory_get_pixmap_and_mask_for_file (NautilusFile *file,
if (pixbuf == NULL) {
return;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap, mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap, mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
}
......
......@@ -38,6 +38,8 @@
#include <libgnomeui/gnome-pixmap.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <string.h>
/* these are from GtkCList, for now we need to copy them here
......@@ -328,7 +330,7 @@ load_up_indicator (const char **xpm_data,
return;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, indicator_pixmap, indicator_mask, 127);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, indicator_pixmap, indicator_mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
}
......
......@@ -37,6 +37,7 @@
#include <gtk/gtkenums.h>
#include <gtk/gtkmain.h>
#include <glib.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include "nautilus-background.h"
#include "nautilus-drag.h"
......@@ -2084,7 +2085,7 @@ draw_cell (GtkCList *clist, GdkRectangle *area, int row_index, int column_index,
ellipsis_width = gdk_string_width (style->font, "...");
for (p = NAUTILUS_CELL_PIXBUF_LIST (row->cell[column_index])->pixbufs; p != NULL; p = p->next) {
gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
pixbuf_width = gdk_pixbuf_get_width (p->data);
if ((p->next != NULL && pixbuf_width + ellipsis_width >=
......
......@@ -40,6 +40,8 @@
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
enum {
CHANGED,
LAST_SIGNAL
......@@ -188,7 +190,7 @@ nautilus_bookmark_get_pixmap_and_mask (NautilusBookmark *bookmark,
return FALSE;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, 100);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
return TRUE;
......
......@@ -29,6 +29,8 @@
#include <libgnomevfs/gnome-vfs-types.h>
#include <libart_lgpl/art_rect.h>
#define NAUTILUS_STANDARD_ALPHA_THRESHHOLD 128
typedef struct NautilusPixbufLoadHandle NautilusPixbufLoadHandle;
typedef void (* NautilusPixbufLoadCallback) (GnomeVFSResult error,
GdkPixbuf *pixbuf,
......
......@@ -43,6 +43,7 @@
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include "nautilus-background.h"
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include "nautilus-glib-extensions.h"
#include "nautilus-gtk-extensions.h"
#include "nautilus-gtk-macros.h"
......@@ -1162,7 +1163,7 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
gdk_pixbuf_render_pixmap_and_mask (transparent_pixbuf,
&pixmap_for_dragged_file,
&mask_for_dragged_file,
128);
NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (transparent_pixbuf);
......
......@@ -39,6 +39,8 @@
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <parser.h>
#include <xmlmemory.h>
......@@ -2185,7 +2187,7 @@ nautilus_icon_factory_get_pixmap_and_mask_for_file (NautilusFile *file,
if (pixbuf == NULL) {
return;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap, mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap, mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
}
......
......@@ -38,6 +38,8 @@
#include <libgnomeui/gnome-pixmap.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <string.h>
/* these are from GtkCList, for now we need to copy them here
......@@ -328,7 +330,7 @@ load_up_indicator (const char **xpm_data,
return;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, indicator_pixmap, indicator_mask, 127);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, indicator_pixmap, indicator_mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
}
......
......@@ -37,6 +37,7 @@
#include <gtk/gtkenums.h>
#include <gtk/gtkmain.h>
#include <glib.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include "nautilus-background.h"
#include "nautilus-drag.h"
......@@ -2084,7 +2085,7 @@ draw_cell (GtkCList *clist, GdkRectangle *area, int row_index, int column_index,
ellipsis_width = gdk_string_width (style->font, "...");
for (p = NAUTILUS_CELL_PIXBUF_LIST (row->cell[column_index])->pixbufs; p != NULL; p = p->next) {
gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
pixbuf_width = gdk_pixbuf_get_width (p->data);
if ((p->next != NULL && pixbuf_width + ellipsis_width >=
......
......@@ -49,6 +49,7 @@
#include <libnautilus-extensions/nautilus-entry.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
......@@ -180,7 +181,7 @@ get_pixmap_and_mask_for_properties_window (NautilusFile *file,
g_assert (NAUTILUS_IS_FILE (file));
pixbuf = nautilus_icon_factory_get_pixbuf_for_file (file, NULL, NAUTILUS_ICON_SIZE_STANDARD, FALSE);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
}
......@@ -1160,7 +1161,7 @@ create_image_widget_for_emblem (const char *emblem_name)
NULL);
nautilus_scalable_icon_unref (icon);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
image_widget = gtk_pixmap_new (pixmap, mask);
......
......@@ -35,6 +35,7 @@
#include <gtk/gtkeventbox.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-search-bar-criterion.h>
#include <libnautilus-extensions/nautilus-search-bar-criterion-private.h>
......@@ -370,7 +371,7 @@ load_find_them_pixmap_widget (void)
pixbuf = gdk_pixbuf_new_from_file (NAUTILUS_PIXMAPDIR "/search.png");
if(pixmap != NULL) {
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
return gtk_pixmap_new (pixmap, mask);
} else
......
......@@ -43,6 +43,7 @@
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-generous-bin.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
......@@ -542,7 +543,7 @@ nautilus_window_realize (GtkWidget *widget)
pixbuf = gdk_pixbuf_new_from_file(filename);
if (pixbuf != NULL) {
gdk_pixbuf_render_pixmap_and_mask
(pixbuf, &pixmap, &mask, 128);
(pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
nautilus_set_mini_icon
(widget->window, pixmap, mask);
......
......@@ -43,6 +43,7 @@
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-generous-bin.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
......@@ -542,7 +543,7 @@ nautilus_window_realize (GtkWidget *widget)
pixbuf = gdk_pixbuf_new_from_file(filename);
if (pixbuf != NULL) {
gdk_pixbuf_render_pixmap_and_mask
(pixbuf, &pixmap, &mask, 128);
(pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
nautilus_set_mini_icon
(widget->window, pixmap, mask);
......
......@@ -809,7 +809,7 @@ set_emblem_image_from_file(NautilusPropertyBrowser *property_browser)
pixbuf = gdk_pixbuf_new_from_file (property_browser->details->image_path);
scaled_pixbuf = nautilus_gdk_pixbuf_scale_down_to_fit (pixbuf, MAX_ICON_WIDTH, MAX_ICON_HEIGHT);
gdk_pixbuf_unref (pixbuf);
gdk_pixbuf_render_pixmap_and_mask (scaled_pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (scaled_pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (scaled_pixbuf);
if (property_browser->details->emblem_image == NULL) {
......@@ -1273,7 +1273,7 @@ element_clicked_callback(GtkWidget *widget, GdkEventButton *event, char *element
(pixbuf,
&pixmap_for_dragged_file,
&mask_for_dragged_file,
128);
NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
gtk_drag_set_icon_pixmap
......@@ -1446,7 +1446,7 @@ make_properties_from_directory_path (NautilusPropertyBrowser *property_browser,
}
/* make a pixmap and mask to pass to the widget */
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
/* allocate a pixmap and insert it into the table */
......
......@@ -40,6 +40,7 @@
#include <libnautilus-extensions/nautilus-background.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
......@@ -432,7 +433,7 @@ add_emblem (NautilusSidebarTitle *sidebar_title, GdkPixbuf *pixbuf)
GdkBitmap *mask;
GtkWidget *pixmap_widget;
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, NAUTILUS_STANDARD_ALPHA_THRESHHOLD);
pixmap_widget = GTK_WIDGET (gtk_pixmap_new (pixmap, mask));
gtk_widget_show (pixmap_widget);
gtk_container_add (GTK_CONTAINER (sidebar_title->details->emblem_box), pixmap_widget);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment