Skip to content
  • Darin Adler's avatar
    Reworked the canvas item class used by the icon · 423b5c48
    Darin Adler authored
    	container. Straightened out the use of various coordinate systems
    	and bounds calculations and removed much unused code inherited
    	from the GdkPixbuf canvas item class that Andy cloned our code
    	from. Changed the class so it doesn't scale icons any more -- we
    	leave that to the icon factory so the scaled icons can be cached.
    
    	* libnautilus/gnome-icon-container-dnd.c:
    	* libnautilus/gnome-icon-container-private.h:
    	* libnautilus/gnome-icon-container.c:
    	* libnautilus/nautilus-icons-view-icon-item.c:
    	* libnautilus/nautilus-icons-view-icon-item.h:
    	Made extensive changes to the icon item class, including getting
    	rid of the "x", "y", "width", and "height" attributes, adding a
    	new "font" attribute, changing the "label" attribute name to "text"
    	to be more consistent with other canvas items, simplifying the
    	update logic for now (we can recomplicate it later if need be),
    	changing the pixbuf to have a fixed size in pixels instead of being
    	scaled with the pixels_per_unit and changing the pixbuf when we change
    	zoom levels, and other misc. cleanup.
    	(nautilus_icons_view_icon_item_get_arg):
    	Fixed bug for "label" which would return a non-strdup'd	piece of text.
    	(draw_or_measure_text_box):
    	Fixed bug where width of the selection box would be based on the
    	length of the last line of text, not the widest, and extra GCs would
    	be created for each line of text.
    
    	* libnautilus/nautilus-icons-controller.h:
    	* libnautilus/nautilus-icons-controller.c:
    	(nautilus_icons_controller_get_icon_image):
    	* src/file-manager/fm-icons-controller.c:
    	(fm_icons_controller_get_icon_image):
    	Changed the interface so that the icons controller specifies the icon
    	as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
    	container get the appropriate icon for size as it zooms.
    
    	* libnautilus/gdk-extensions.h:
    	* libnautilus/gdk-extensions.c:
    	(nautilus_gdk_font_equal):
    	Added a version of gdk_font_equal that works with NULL for the font.
    	Maybe we need a naming scheme for these NULL-tolerant variations on
    	basic calls.
    
    	* src/ntl-uri-map.c: (nautilus_navinfo_free):
    	* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
    	Fixed a NULL dereference that would happen when @navi was NULL.
    
    	* libnautilus/nautilus-directory.c:
    	(nautilus_directory_try_to_read_metafile):
    	Fixed error handling for case when gnome_vfs_read fails.  Fixed
    	error handling for case where metafile_info.size won't fit into a
    	size_t.  Switched back to g_malloc instead of g_alloca, since the
    	size of a file might be too big for the stack. In the long run, we
    	will feed the file data directly to the XML code, so this is a bit
    	temporary.  Removed the assert that Elliot added to help track
    	down the giant files sizes coming from gnome-vfs; the failure in
    	g_malloc will be easy to debug, unlike the failure in
    	g_alloca. (The assert was added without a ChangeLog entry.)
    423b5c48