nautilus/libnautilus-private/nautilus-icon-canvas-item.c

1370 lines
40 KiB
C
Raw Normal View History

Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
/* Nautilus - Icon canvas item class for icon container.
*
* 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.
*/
#include <config.h>
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
#include "nautilus-icon-canvas-item.h"
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <gtk/gtksignal.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
#include <libgnomeui/gnome-canvas-util.h>
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
#include <libgnomeui/gnome-icon-text.h>
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
#include "nautilus-icon-private.h"
#include "nautilus-string.h"
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
#include "nautilus-glib-extensions.h"
#include "nautilus-gdk-extensions.h"
First cut at tiled background images. 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.
2000-04-04 01:00:13 +00:00
#include "nautilus-gdk-pixbuf-extensions.h"
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
#include "nautilus-gtk-macros.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-graphic-effects.h"
#define STRETCH_HANDLE_THICKNESS 5
#define EMBLEM_SPACING 2
#define MAX_TEXT_WIDTH 80
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
/* Private part of the NautilusIconCanvasItem structure. */
struct NautilusIconCanvasItemDetails {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* The image, text, font. */
GdkPixbuf *pixbuf;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
GList *emblem_pixbufs;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
char *editable_text; /* Text that can be modified by a renaming function */
Support for icon selection by typing the item's name. Initialize and flush 2000-05-08 Pavel <pavel@eazel.com> * libnautilus-extensions/nautilus-icon-container.c: * libnautilus-extensions/nautilus-icon-private.h: (match_best_name), (select_matching_name), (destroy), (button_press_event), (nautilus_icon_container_almost_drag), (nautilus_icon_container_flush_typeselect_state), (nautilus_icon_container_handle_typeahead), (key_press_event), (nautilus_icon_container_initialize): Support for icon selection by typing the item's name. Initialize and flush the new typeselect state properly. Rework key_press_event a little bit to make it easier to call the inherited key_press call when we did not handle the keyboard event ourselves. * libnautilus-extensions/nautilus-icon-container.c: (select_previous_or_next_name), (compare_icons_by_name), (build_sorted_icon_list): Support for selecting next/previous icon alphabetically using Tab and Shift-Tab. * libnautilus-extensions/nautilus-icon-container.c: (find_best_icon), (find_best_selected_icon), (leftmost_in_top_row), (rightmost_in_bottom_row), (same_row_right_side_leftmost), (same_row_left_side_rightmost), (same_column_above_lowest), (same_column_below_highest), (keyboard_home), (keyboard_end), (keyboard_arrow_key): Add data parameter to find_best_icon and find_best_selected_icon to allow using more complicated match predicates. * libnautilus-extensions/nautilus-glib-extensions.c: * libnautilus-extensions/nautilus-glib-extensions.h: (nautilus_g_list_copy): Add a list shallow copy utility call. * libnautilus-extensions/nautilus-glib-extensions.c: * libnautilus-extensions/nautilus-glib-extensions.h: (nautilus_get_system_time), (nautilus_self_check_glib_extensions) Add a utility call to get the system time in microseconds. * libnautilus-extensions/nautilus-icon-canvas-item.c: Fix a typo. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_start_renaming_selected_item): Fix white space.
2000-05-08 08:44:22 +00:00
char *additional_text; /* Text that cannot be modifed, such as file size, etc. */
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
GdkFont *font;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Size of the text at current font. */
int text_width;
int text_height;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Highlight state. */
guint is_highlighted_for_selection : 1;
guint is_highlighted_as_keyboard_focus: 1;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
guint is_highlighted_for_drop : 1;
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
guint show_stretch_handles : 1;
guint is_prelit : 1;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
gboolean is_renaming;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
};
/* Object argument IDs. */
enum {
ARG_0,
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
ARG_EDITABLE_TEXT,
ARG_ADDITIONAL_TEXT,
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
ARG_FONT,
ARG_HIGHLIGHTED_FOR_SELECTION,
ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS,
ARG_HIGHLIGHTED_FOR_DROP,
ARG_MODIFIER
};
typedef enum {
RIGHT_SIDE,
BOTTOM_SIDE,
LEFT_SIDE,
TOP_SIDE
} RectangleSide;
typedef struct {
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItem *icon_item;
ArtIRect icon_rect;
RectangleSide side;
int position;
GList *emblem;
} EmblemLayout;
enum {
BOUNDS_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
static GdkColor highlight_background_color;
static GdkColor highlight_text_color;
/* GtkObject */
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
static void nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class);
static void nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *item);
static void nautilus_icon_canvas_item_destroy (GtkObject *object);
static int nautilus_icon_canvas_item_event (GnomeCanvasItem *item,
GdkEvent *event);
static void nautilus_icon_canvas_item_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void nautilus_icon_canvas_item_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
/* GnomeCanvasItem */
static void nautilus_icon_canvas_item_update (GnomeCanvasItem *item,
double *affine,
ArtSVP *clip_path,
int flags);
static void nautilus_icon_canvas_item_draw (GnomeCanvasItem *item,
GdkDrawable *drawable,
int x,
int y,
int width,
int height);
static double nautilus_icon_canvas_item_point (GnomeCanvasItem *item,
double x,
double y,
int cx,
int cy,
GnomeCanvasItem **actual_item);
static void nautilus_icon_canvas_item_bounds (GnomeCanvasItem *item,
double *x1,
double *y1,
double *x2,
double *y2);
/* private */
static void draw_or_measure_label_text (NautilusIconCanvasItem *item,
GdkDrawable *drawable,
int icon_left,
int icon_bottom);
static void draw_label_text (NautilusIconCanvasItem *item,
GdkDrawable *drawable,
int icon_left,
int icon_bottom);
static void measure_label_text (NautilusIconCanvasItem *item);
static void get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
ArtIRect *rect);
static void emblem_layout_reset (EmblemLayout *layout,
NautilusIconCanvasItem *icon_item,
const ArtIRect *icon_rect);
static gboolean emblem_layout_next (EmblemLayout *layout,
GdkPixbuf **emblem_pixbuf,
ArtIRect *emblem_rect);
static void draw_pixbuf (GdkPixbuf *pixbuf,
GdkDrawable *drawable,
int x,
int y);
static gboolean hit_test_stretch_handle (NautilusIconCanvasItem *item,
const ArtIRect *canvas_rect);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusIconCanvasItem, nautilus_icon_canvas_item, GNOME_TYPE_CANVAS_ITEM)
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Class initialization function for the icon canvas item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class)
{
GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
object_class = GTK_OBJECT_CLASS (class);
item_class = GNOME_CANVAS_ITEM_CLASS (class);
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
gtk_object_add_arg_type ("NautilusIconCanvasItem::editable_text",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_EDITABLE_TEXT);
gtk_object_add_arg_type ("NautilusIconCanvasItem::additional_text",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ADDITIONAL_TEXT);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
gtk_object_add_arg_type ("NautilusIconCanvasItem::font",
GTK_TYPE_BOXED, GTK_ARG_READWRITE, ARG_FONT);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_for_selection",
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HIGHLIGHTED_FOR_SELECTION);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_as_keyboard_focus",
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_for_drop",
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HIGHLIGHTED_FOR_DROP);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
object_class->destroy = nautilus_icon_canvas_item_destroy;
object_class->set_arg = nautilus_icon_canvas_item_set_arg;
object_class->get_arg = nautilus_icon_canvas_item_get_arg;
signals[BOUNDS_CHANGED]
= gtk_signal_new ("bounds_changed",
GTK_RUN_LAST,
object_class->type,
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
GTK_SIGNAL_OFFSET (NautilusIconCanvasItemClass,
bounds_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
item_class->update = nautilus_icon_canvas_item_update;
item_class->draw = nautilus_icon_canvas_item_draw;
item_class->point = nautilus_icon_canvas_item_point;
item_class->bounds = nautilus_icon_canvas_item_bounds;
item_class->event = nautilus_icon_canvas_item_event;
/* set up the highlight colors - soon, get these from preferences */
gdk_color_parse ("rgb:00/00/00", &highlight_background_color);
gdk_color_parse ("rgb:FF/FF/FF", &highlight_text_color);
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Object initialization function for the icon item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *icon_item)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
details = g_new0 (NautilusIconCanvasItemDetails, 1);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
icon_item->details = details;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
icon_item->details->is_renaming = FALSE;
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Destroy handler for the icon canvas item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_destroy (GtkObject *object)
{
GnomeCanvasItem *item;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItem *icon_item;
NautilusIconCanvasItemDetails *details;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (object));
item = GNOME_CANVAS_ITEM (object);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
icon_item = (NAUTILUS_ICON_CANVAS_ITEM (object));
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details = icon_item->details;
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (details->pixbuf != NULL) {
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
gdk_pixbuf_unref (details->pixbuf);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
nautilus_gdk_pixbuf_list_free (details->emblem_pixbufs);
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
g_free (details->editable_text);
g_free (details->additional_text);
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
if (details->font != NULL) {
gdk_font_unref (details->font);
}
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
g_free (details);
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
/* Currently we require pixbufs in this format (for hit testing).
* Perhaps gdk-pixbuf will be changed so it can do the hit testing
* and we won't have this requirement any more.
*/
static gboolean
pixbuf_is_acceptable (GdkPixbuf *pixbuf)
{
return gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
&& ((!gdk_pixbuf_get_has_alpha (pixbuf)
&& gdk_pixbuf_get_n_channels (pixbuf) == 3)
|| (gdk_pixbuf_get_has_alpha (pixbuf)
&& gdk_pixbuf_get_n_channels (pixbuf) == 4))
&& gdk_pixbuf_get_bits_per_sample (pixbuf) == 8;
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Set_arg handler for the icon item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
GdkFont *font;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
switch (arg_id) {
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
case ARG_EDITABLE_TEXT:
if (nautilus_strcmp (details->editable_text, GTK_VALUE_STRING (*arg)) == 0) {
return;
}
g_free (details->editable_text);
details->editable_text = g_strdup (GTK_VALUE_STRING (*arg));
break;
case ARG_ADDITIONAL_TEXT:
if (nautilus_strcmp (details->additional_text, GTK_VALUE_STRING (*arg)) == 0) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
g_free (details->additional_text);
details->additional_text = g_strdup (GTK_VALUE_STRING (*arg));
break;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
case ARG_FONT:
font = GTK_VALUE_BOXED (*arg);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (nautilus_gdk_font_equal (font, details->font)) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (font != NULL) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
gdk_font_ref (font);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
if (details->font != NULL) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
gdk_font_unref (details->font);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details->font = font;
break;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
case ARG_HIGHLIGHTED_FOR_SELECTION:
if (!details->is_highlighted_for_selection == !GTK_VALUE_BOOL (*arg)) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details->is_highlighted_for_selection = GTK_VALUE_BOOL (*arg);
break;
case ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS:
if (!details->is_highlighted_as_keyboard_focus == !GTK_VALUE_BOOL (*arg)) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
details->is_highlighted_as_keyboard_focus = GTK_VALUE_BOOL (*arg);
break;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
case ARG_HIGHLIGHTED_FOR_DROP:
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (!details->is_highlighted_for_drop == !GTK_VALUE_BOOL (*arg)) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details->is_highlighted_for_drop = GTK_VALUE_BOOL (*arg);
break;
default:
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
g_warning ("nautilus_icons_view_item_item_set_arg on unknown argument");
return;
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (object));
}
/* Get_arg handler for the icon item */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
switch (arg_id) {
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
case ARG_EDITABLE_TEXT:
GTK_VALUE_STRING (*arg) = g_strdup (details->editable_text);
break;
case ARG_ADDITIONAL_TEXT:
GTK_VALUE_STRING (*arg) = g_strdup (details->additional_text);
break;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
case ARG_FONT:
GTK_VALUE_BOXED (*arg) = details->font;
break;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
case ARG_HIGHLIGHTED_FOR_SELECTION:
GTK_VALUE_BOOL (*arg) = details->is_highlighted_for_selection;
break;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
case ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS:
GTK_VALUE_BOOL (*arg) = details->is_highlighted_as_keyboard_focus;
break;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
case ARG_HIGHLIGHTED_FOR_DROP:
GTK_VALUE_BOOL (*arg) = details->is_highlighted_for_drop;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
GdkPixbuf *
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
nautilus_icon_canvas_item_get_image (NautilusIconCanvasItem *item)
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), NULL);
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
details = item->details;
return details->pixbuf;
}
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_set_image (NautilusIconCanvasItem *item,
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
GdkPixbuf *image)
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
g_return_if_fail (image == NULL || pixbuf_is_acceptable (image));
details = item->details;
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
if (details->pixbuf == image) {
Added additional data to icons so they can specify where the embedded text fits in each icon. * icons/eazel/Makefile.am, icons/eazel/i-regular.xml: Added the file to specify attributes of icons. Specifically added the attribute that says there is space for embedded text in the Eazel-theme regular icon. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (get_child_node_by_property), (get_themed_icon_file_path), (get_icon_file_path), (nautilus_icon_factory_get_thumbnail_uri), (load_specific_image), (load_image_for_scaling), (get_image_from_cache), (load_image_scale_if_necessary), (nautilus_icon_factory_get_pixbuf_for_icon), (nautilus_icon_factory_get_pixbuf_for_file): Added code to read a rectangle for the embedded text along with the icon, cache it with the icon, scale it with the icon, and return it to the caller along with the icon. * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_initialize_class), (nautilus_icons_view_icon_item_set_arg), (nautilus_icons_view_icon_item_get_arg), (nautilus_icons_view_icon_item_get_image), (nautilus_icons_view_icon_item_set_image), (nautilus_art_irect_to_gdk_rectangle), (draw_mini_text), (draw_embedded_text), (nautilus_icons_view_icon_item_draw): Changed the code that draws the embedded text to respect the text rectangle passed in. Changed the pixbuf setting to use a function instead of the arg interface and take a text rectangle along with the pixbuf. * libnautilus/gnome-icon-container-dnd.c (gnome_icon_container_dnd_begin_drag): * libnautilus/gnome-icon-container.c: (icon_get_actual_size): Got rid of callers who were using the arg interface to get at the image of an icon ("NautilusIconsViewIconItem::pixbuf"). * src/file-manager/fm-directory-view-icons.c: (get_icon_property_cb): Get rid of hard-coded rule that only themes with eazel at the front of their names can display text inside the icons. * libnautilus/gnome-icon-container.c: (icon_new): Fixed a bug where icons would be super-tiny if they got too big, like if you entered a directory that was zoomed all the way in. (start_stretching), (ungrab_stretch_icon), (end_stretching), (gnome_icon_container_show_stretch_handles): Added code to grab the pointer while stretching an icon. (item_event_cb): Added a return statement that John forgot when he was editing. Without that, it was falling through to the next case, which had the same effect anyway. (update_icon): Pass the text rectangle through from the icon factory to the icon canvas item, using the new call instead of the old arg interface approach. * components/help/.cvsignore: Added entries for .la and .lo files. * components/help/Makefile.am: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * libnautilus/nautilus-directory-private.h: * libnautilus/nautilus-directory.c: * src/nautilus-bookmarklist.c: Fixed flags for gnome-xml includes. Someone pointed out that you are supposed to include these as "#include <tree.h>", not "#include <gnome-xml/tree.h>" so I fixed our uses to work that way. * libnautilus/nautilus-directory.c: (nautilus_directory_get_file_metadata_node): Fixed code that was destroying something allocated by gnome-xml with g_free instead of xmlFree. * libnautilus/nautilus-file.c: (nautilus_file_get_keywords), (nautilus_file_set_keywords): Fixed storage leak where we were getting a property and not freeing it. * libnautilus/nautilus-default-file-icon.h: * libnautilus/nautilus-default-file-icon.c: * libnautilus/nautilus-icon-factory.c: (load_image_for_scaling): Got rid of the global that tells whether the default icon has an alpha channel -- it's not hardwired TRUE.
2000-03-15 00:31:49 +00:00
return;
}
if (image != NULL) {
gdk_pixbuf_ref (image);
}
if (details->pixbuf != NULL) {
gdk_pixbuf_unref (details->pixbuf);
}
details->pixbuf = image;
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_set_emblems (NautilusIconCanvasItem *item,
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
GList *emblem_pixbufs)
{
GList *p;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
g_assert (item->details->emblem_pixbufs != emblem_pixbufs || emblem_pixbufs == NULL);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
/* The case where the emblems are identical is fairly common,
* so lets take the time to check for it.
*/
if (nautilus_g_list_equal (item->details->emblem_pixbufs, emblem_pixbufs)) {
return;
}
/* Check if they are acceptable. */
for (p = emblem_pixbufs; p != NULL; p = p->next) {
g_return_if_fail (pixbuf_is_acceptable (p->data));
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
/* Take in the new list of emblems. */
nautilus_gdk_pixbuf_list_ref (emblem_pixbufs);
nautilus_gdk_pixbuf_list_free (item->details->emblem_pixbufs);
item->details->emblem_pixbufs = g_list_copy (emblem_pixbufs);
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
}
/* Recomputes the bounding box of a icon canvas item.
* This is a generic implementation that could be used for any canvas item
* class, it has no assumptions about how the item is used.
*/
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
recompute_bounding_box (NautilusIconCanvasItem *icon_item)
{
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
/* The bounds stored in the item is the same as what get_bounds
* returns, except it's in canvas coordinates instead of the item's
* parent's coordinates.
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
*/
GnomeCanvasItem *item;
ArtPoint top_left, bottom_right;
double i2c[6];
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
item = GNOME_CANVAS_ITEM (icon_item);
gnome_canvas_item_get_bounds (item,
&top_left.x, &top_left.y,
&bottom_right.x, &bottom_right.y);
gnome_canvas_item_i2c_affine (item->parent, i2c);
art_affine_point (&top_left, &top_left, i2c);
art_affine_point (&bottom_right, &bottom_right, i2c);
item->x1 = top_left.x;
item->y1 = top_left.y;
item->x2 = bottom_right.x;
item->y2 = bottom_right.y;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_update_bounds (NautilusIconCanvasItem *item)
{
ArtIRect before, after;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
/* Compute new bounds. */
nautilus_gnome_canvas_item_get_current_canvas_bounds
(GNOME_CANVAS_ITEM (item), &before);
recompute_bounding_box (item);
nautilus_gnome_canvas_item_get_current_canvas_bounds
(GNOME_CANVAS_ITEM (item), &after);
/* If the bounds didn't change, we are done. */
if (nautilus_art_irect_equal (&before, &after)) {
return;
}
/* Send out the bounds_changed signal and queue a redraw. */
nautilus_gnome_canvas_request_redraw_rectangle
(GNOME_CANVAS_ITEM (item)->canvas, &before);
gtk_signal_emit (GTK_OBJECT (item),
signals[BOUNDS_CHANGED]);
nautilus_gnome_canvas_item_request_redraw
(GNOME_CANVAS_ITEM (item));
}
/* Update handler for the icon canvas item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_update (GnomeCanvasItem *item,
double *affine,
ArtSVP *clip_path,
int flags)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_update_bounds (NAUTILUS_ICON_CANVAS_ITEM (item));
nautilus_gnome_canvas_item_request_redraw (item);
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, update, (item, affine, clip_path, flags));
}
/* Rendering */
/* routine to underline the text in a gnome_icon_text structure */
static void
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
gnome_icon_underline_text (GnomeIconTextInfo *text_info, GdkDrawable *drawable, GdkGC *gc, int x, int y)
{
GList *item;
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
int text_width;
GnomeIconTextInfoRow *row;
int xpos;
y += text_info->font->ascent;
for (item = text_info->rows; item; item = item->next) {
if (item->data) {
row = item->data;
xpos = (text_info->width - row->width) / 2;
text_width = gdk_text_width_wc(text_info->font, row->text_wc, row->text_length);
gdk_draw_line(drawable, gc, x + xpos, y + 1, x + xpos + text_width, y + 1);
y += text_info->baseline_skip;
} else
y += text_info->baseline_skip / 2;
}
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Draw the text in a box, using gnomelib routines. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
draw_or_measure_label_text (NautilusIconCanvasItem *item,
GdkDrawable *drawable,
int icon_left,
int icon_bottom)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
int width_so_far, height_so_far;
GdkGC* gc;
GdkGCValues save_gc;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
int max_text_width;
int icon_width, text_left, box_left;
GnomeIconTextInfo *icon_text_info;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
char **pieces;
const char *text_piece;
int i;
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
char *combined_text;
gboolean have_editable, have_additional, needs_highlight;
details = item->details;
needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
have_editable = details->editable_text != NULL
&& details->editable_text[0] != '\0';
have_additional = details->additional_text != NULL
&& details->additional_text[0] != '\0';
/* No font or no text, then do no work. */
if (details->font == NULL || (!have_editable && !have_additional)) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details->text_height = 0;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
details->text_width = 0;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
return;
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
/* Combine editable and additional text for processing */
combined_text = g_strconcat
(have_editable ? details->editable_text : "",
(have_editable && have_additional) ? "\n" : "",
have_additional ? details->additional_text : "",
NULL);
width_so_far = 0;
height_so_far = 0;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
if (drawable != NULL) {
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
gc = gdk_gc_new (GNOME_CANVAS_ITEM (item)->canvas->layout.bin_window);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
max_text_width = floor (MAX_TEXT_WIDTH * GNOME_CANVAS_ITEM (item)->canvas->pixels_per_unit);
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
/* if the icon is highlighted, do some set-up */
if (needs_highlight && drawable != NULL) {
GnomeCanvasItem *canvas_item = GNOME_CANVAS_ITEM(item);
gdk_gc_get_values(gc, &save_gc);
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas_item->canvas)), &highlight_background_color, FALSE, TRUE);
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas_item->canvas)), &highlight_text_color, FALSE, TRUE);
gdk_gc_set_foreground(gc, &highlight_background_color);
gdk_draw_rectangle (drawable, gc, TRUE, icon_left + (icon_width - details->text_width) / 2, icon_bottom, details->text_width, details->text_height);
gdk_gc_set_foreground(gc, &highlight_text_color);
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
pieces = g_strsplit (combined_text, "\n", 0);
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
for (i = 0; (text_piece = pieces[i]) != NULL; i++) {
/* Replace empty string with space for measurement and drawing.
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
* This makes empty lines appear, instead of being collapsed out.
*/
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (text_piece[0] == '\0') {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
text_piece = " ";
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
icon_text_info = gnome_icon_layout_text
(details->font, text_piece, " -_,;.?/&", max_text_width, TRUE);
/* Draw text if we are not in user rename mode */
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
if (drawable != NULL && details->is_renaming == FALSE) {
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
text_left = icon_left + (icon_width - icon_text_info->width) / 2;
gnome_icon_paint_text (icon_text_info, drawable, gc,
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
text_left, icon_bottom + height_so_far, GTK_JUSTIFY_CENTER);
/* if it's highlighted, embolden by drawing twice */
if (needs_highlight)
gnome_icon_paint_text (icon_text_info, drawable, gc,
text_left + 1, icon_bottom + height_so_far, GTK_JUSTIFY_CENTER);
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
/* if it's prelit, underline the text */
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
if (details->is_prelit) {
gnome_icon_underline_text (icon_text_info, drawable, gc, text_left + 1, icon_bottom + height_so_far);
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
}
}
width_so_far = MAX (width_so_far, icon_text_info->width);
height_so_far += icon_text_info->height;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
gnome_icon_text_info_free (icon_text_info);
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
}
g_strfreev (pieces);
if (needs_highlight && drawable != NULL)
gdk_gc_set_foreground(gc, &save_gc.foreground);
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
height_so_far += 2; /* extra slop for nicer highlighting */
if (needs_highlight)
width_so_far += 2; /* account for emboldening */
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
if (drawable != NULL) {
/* Current calculations should match what we measured before drawing.
* This assumes that we will always make a separate call to measure
* before the call to draw. We might later decide to use this function
* differently and change these asserts.
*/
g_assert (height_so_far == details->text_height);
g_assert (width_so_far == details->text_width);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
box_left = icon_left + (icon_width - width_so_far) / 2;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* indicate keyboard selection by framing the text with a gray-stippled rectangle */
if (details->is_highlighted_as_keyboard_focus) {
Fixed bug Andy pointed out where list view "links" could be activated by clicking in white space past the name. Also started making changes in the direction of getting keyboard selection working properly in list view (but most of the work remains). * libnautilus/nautilus-gdk-extensions.h, * libnautilus/nautilus-gdk-extensions.c: (nautilus_stipple_bitmap): New function, returns pointer to static 50% stipple bitmap. * libnautilus/nautilus-icon-cvanvas-item.c: remove global stipple object; (nautilus_icon_canvas_item_initialize_class): Remove initialization of global stipple object. (draw_or_measure_label_text), (draw_stretch_handles): Use nautilus_stipple_bitmap () in lieu of global stipple object in this file. * libnautilus/nautilus-list.c: (get_cell_horizontal_start_position): New function, extracted from draw_row so I could use it elsewhere. (nautilus_list_key): Removed function. (nautilus_list_draw_focus): New function, draws keyboard-focussed row with the same stipple outline used in icon view. (nautilus_list_move_function_row): New function, copied & simplified from GtkCList. Will probably rewrite entirely or eliminate very soon. (nautilus_list_scroll_vertical): New function, copied & simplified from GtkCList. Handles various keyboard commands, though not yet with the behavior we actually want. (nautilus_list_initialize_class): Begin to override and eliminate GtkCList key bindings that we want to change. I've just started this work -- all I've done so far is make space do nothing but Control-space toggle the selection status of the keyboard-focussed row. I need to go through and fix up all the bad inherited bindings. Also in this function replace GtkCList's scroll_vertical and draw_focus function pointers, and removed the key_press_event and key_release_event overrides that were deliberately preventing us from inheriting any of GtkCList's keyboard behavior. (nautilus_list_button_release): Only activate link-text if the click is in the horizontal bounds of the text. (draw_row) Use get_cell_horizontal_start_position that was extracted from this function.
2000-04-08 01:05:59 +00:00
gdk_gc_set_stipple (gc, nautilus_stipple_bitmap ());
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
gdk_gc_set_fill (gc, GDK_STIPPLED);
gdk_draw_rectangle (drawable, gc, FALSE,
box_left, icon_bottom - 2,
width_so_far, 2 + height_so_far);
}
gdk_gc_unref (gc);
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
} else {
/* If measuring, remember the width & height. */
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details->text_width = width_so_far;
details->text_height = height_so_far;
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
g_free (combined_text);
}
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
measure_label_text (NautilusIconCanvasItem *item)
{
draw_or_measure_label_text (item, NULL, 0, 0);
}
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
draw_label_text (NautilusIconCanvasItem *item, GdkDrawable *drawable,
int icon_left, int icon_bottom)
{
draw_or_measure_label_text (item, drawable, icon_left, icon_bottom);
}
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
draw_stretch_handles (NautilusIconCanvasItem *item, GdkDrawable *drawable,
const ArtIRect *rect)
{
GdkGC *gc;
if (!item->details->show_stretch_handles) {
return;
}
gc = gdk_gc_new (drawable);
gdk_draw_rectangle (drawable, gc, TRUE,
rect->x0,
rect->y0,
STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS);
gdk_draw_rectangle (drawable, gc, TRUE,
rect->x1 - STRETCH_HANDLE_THICKNESS,
rect->y0,
STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS);
gdk_draw_rectangle (drawable, gc, TRUE,
rect->x0,
rect->y1 - STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS);
gdk_draw_rectangle (drawable, gc, TRUE,
rect->x1 - STRETCH_HANDLE_THICKNESS,
rect->y1 - STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS,
STRETCH_HANDLE_THICKNESS);
Fixed bug Andy pointed out where list view "links" could be activated by clicking in white space past the name. Also started making changes in the direction of getting keyboard selection working properly in list view (but most of the work remains). * libnautilus/nautilus-gdk-extensions.h, * libnautilus/nautilus-gdk-extensions.c: (nautilus_stipple_bitmap): New function, returns pointer to static 50% stipple bitmap. * libnautilus/nautilus-icon-cvanvas-item.c: remove global stipple object; (nautilus_icon_canvas_item_initialize_class): Remove initialization of global stipple object. (draw_or_measure_label_text), (draw_stretch_handles): Use nautilus_stipple_bitmap () in lieu of global stipple object in this file. * libnautilus/nautilus-list.c: (get_cell_horizontal_start_position): New function, extracted from draw_row so I could use it elsewhere. (nautilus_list_key): Removed function. (nautilus_list_draw_focus): New function, draws keyboard-focussed row with the same stipple outline used in icon view. (nautilus_list_move_function_row): New function, copied & simplified from GtkCList. Will probably rewrite entirely or eliminate very soon. (nautilus_list_scroll_vertical): New function, copied & simplified from GtkCList. Handles various keyboard commands, though not yet with the behavior we actually want. (nautilus_list_initialize_class): Begin to override and eliminate GtkCList key bindings that we want to change. I've just started this work -- all I've done so far is make space do nothing but Control-space toggle the selection status of the keyboard-focussed row. I need to go through and fix up all the bad inherited bindings. Also in this function replace GtkCList's scroll_vertical and draw_focus function pointers, and removed the key_press_event and key_release_event overrides that were deliberately preventing us from inheriting any of GtkCList's keyboard behavior. (nautilus_list_button_release): Only activate link-text if the click is in the horizontal bounds of the text. (draw_row) Use get_cell_horizontal_start_position that was extracted from this function.
2000-04-08 01:05:59 +00:00
gdk_gc_set_stipple (gc, nautilus_stipple_bitmap ());
gdk_gc_set_fill (gc, GDK_STIPPLED);
gdk_draw_rectangle (drawable, gc, FALSE,
rect->x0 + (STRETCH_HANDLE_THICKNESS - 1) / 2,
rect->y0 + (STRETCH_HANDLE_THICKNESS - 1) / 2,
rect->x1 - rect->x0 - (STRETCH_HANDLE_THICKNESS - 1) - 1,
rect->y1 - rect->y0 - (STRETCH_HANDLE_THICKNESS - 1) - 1);
gdk_gc_unref (gc);
}
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
emblem_layout_reset (EmblemLayout *layout, NautilusIconCanvasItem *icon_item, const ArtIRect *icon_rect)
{
layout->icon_item = icon_item;
layout->icon_rect = *icon_rect;
layout->side = RIGHT_SIDE;
layout->position = 0;
layout->emblem = icon_item->details->emblem_pixbufs;
}
static gboolean
emblem_layout_next (EmblemLayout *layout,
GdkPixbuf **emblem_pixbuf,
ArtIRect *emblem_rect)
{
GdkPixbuf *pixbuf;
int width, height, x, y;
/* Check if we have layed out all of the pixbufs. */
if (layout->emblem == NULL) {
return FALSE;
}
/* Get the pixbuf. */
pixbuf = layout->emblem->data;
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
/* Advance to the next emblem. */
layout->emblem = layout->emblem->next;
for (;;) {
/* Find the side to lay out along. */
switch (layout->side) {
case RIGHT_SIDE:
x = layout->icon_rect.x1;
y = layout->icon_rect.y0;
break;
case BOTTOM_SIDE:
x = layout->icon_rect.x1;
y = layout->icon_rect.y1;
break;
case LEFT_SIDE:
x = layout->icon_rect.x0;
y = layout->icon_rect.y1;
break;
case TOP_SIDE:
x = layout->icon_rect.x0;
y = layout->icon_rect.y0;
break;
}
if (layout->position != 0) {
switch (layout->side) {
case RIGHT_SIDE:
y += layout->position + height / 2;
break;
case BOTTOM_SIDE:
x -= layout->position + width / 2;
break;
case LEFT_SIDE:
y -= layout->position + height / 2;
break;
case TOP_SIDE:
x += layout->position + width / 2;
break;
}
}
/* Check to see if emblem fits in current side. */
if (x >= layout->icon_rect.x0 && x <= layout->icon_rect.x1
&& y >= layout->icon_rect.y0 && y <= layout->icon_rect.y1) {
/* It fits. */
/* Advance along the side. */
switch (layout->side) {
case RIGHT_SIDE:
case LEFT_SIDE:
layout->position += height + EMBLEM_SPACING;
break;
case BOTTOM_SIDE:
case TOP_SIDE:
layout->position += width + EMBLEM_SPACING;
break;
}
/* Return the rectangle and pixbuf. */
*emblem_pixbuf = pixbuf;
emblem_rect->x0 = x - width / 2;
emblem_rect->y0 = y - height / 2;
emblem_rect->x1 = emblem_rect->x0 + width;
emblem_rect->y1 = emblem_rect->y0 + height;
return TRUE;
}
/* It doesn't fit, so move to the next side. */
switch (layout->side) {
case RIGHT_SIDE:
layout->side = BOTTOM_SIDE;
break;
case BOTTOM_SIDE:
layout->side = LEFT_SIDE;
break;
case LEFT_SIDE:
layout->side = TOP_SIDE;
break;
case TOP_SIDE:
default:
return FALSE;
}
layout->position = 0;
}
}
static void
draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y)
{
/* FIXME bugzilla.eazel.com 703:
* Dither would be better if we passed dither values.
*/
gdk_pixbuf_render_to_drawable_alpha (pixbuf, drawable, 0, 0, x, y,
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
GDK_PIXBUF_ALPHA_BILEVEL, 128, GDK_RGB_DITHER_MAX,
0, 0);
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Draw the icon item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
int x, int y, int width, int height)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItem *icon_item;
NautilusIconCanvasItemDetails *details;
ArtIRect icon_rect, emblem_rect;
EmblemLayout emblem_layout;
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
GdkPixbuf *emblem_pixbuf, *temp_pixbuf, *old_pixbuf;
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details = icon_item->details;
/* Draw the pixbuf. */
if (details->pixbuf == NULL) {
return;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
}
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
/* Compute icon rectangle in drawable coordinates. */
get_icon_canvas_rectangle (icon_item, &icon_rect);
icon_rect.x0 -= x;
icon_rect.y0 -= y;
icon_rect.x1 -= x;
icon_rect.y1 -= y;
/* if the pre-lit or selection flag is set, make a pre-lit or darkened pixbuf and draw that instead */
temp_pixbuf = details->pixbuf;
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
if (details->is_prelit) {
temp_pixbuf = nautilus_create_spotlight_pixbuf (details->pixbuf);
}
if (details->is_highlighted_for_selection || details->is_highlighted_for_drop) {
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
old_pixbuf = temp_pixbuf;
temp_pixbuf = nautilus_create_darkened_pixbuf (temp_pixbuf,
0.8 * 255,
0.8 * 255);
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
if (old_pixbuf != details->pixbuf) {
gdk_pixbuf_unref (old_pixbuf);
}
}
draw_pixbuf (temp_pixbuf, drawable, icon_rect.x0, icon_rect.y0);
Preparing for support for background images. * libnautilus/nautilus-background.h: * libnautilus/nautilus-background.c: Preparing for support for background images. * libnautilus/nautilus-background.c: * libnautilus/nautilus-debug.c: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-dnd.c: Add those braces that Maciej, John, and the style guide all prefer. * libnautilus/nautilus-file.c: (nautilus_file_set_metadata): A change to metadata is considered a change to the file. * libnautilus/nautilus-graphic-effects.c: * libnautilus/nautilus-graphic-effects.h: Added nautilus_ prefix to all the functions in here. * libnautilus/nautilus-gtk-extensions.c: * libnautilus/nautilus-gtk-extensions.h: (nautilus_point_in_allocation), (nautilus_point_in_widget): Added hit testing help functions that check if a point is in a particular allocation/widget. * libnautilus/nautilus-icon-dnd.c: (get_gnome_icon_list_selection): Fixed a bug that happens when you get a 0-length piece of selection data. * libnautilus/nautilus-icon-dnd.h: Changed the icon list back to "x-gnome-icon-list". That's how the other GNOME folks want it, not "x-nautilus-icon-list". * src/nautilus-index-tabs.c: * src/nautilus-index-tabs.h: * src/nautilus-index-title.c: * src/nautilus-index-title.h: * src/ntl-index-panel.c: * src/ntl-index-panel.h: lite -> light, Other cleanup. * src/nautilus-index-title.c: * src/nautilus-index-title.h: (nautilus_index_title_hit_test_icon): * src/ntl-index-panel.c: (hit_test), (uri_is_local_image), (receive_dropped_uri_list), (receive_dropped_color): Added code needed to support dropping an image on the icon to set a custom icon. This doesn't yet update the icon in the panel itself, but I'll do that soon.
2000-03-29 02:02:45 +00:00
if (temp_pixbuf != details->pixbuf) {
gdk_pixbuf_unref (temp_pixbuf);
}
/* Draw the emblem pixbufs. */
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
draw_pixbuf (emblem_pixbuf, drawable, emblem_rect.x0, emblem_rect.y0);
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
}
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
/* Draw stretching handles (if necessary). */
draw_stretch_handles (icon_item, drawable, &icon_rect);
/* Draw the label text. */
draw_label_text (icon_item, drawable, icon_rect.x0, icon_rect.y1);
}
/* handle events */
static int
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_event (GnomeCanvasItem *item, GdkEvent *event)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItem *icon_item;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
switch (event->type) {
case GDK_ENTER_NOTIFY:
if (!icon_item->details->is_prelit) {
icon_item->details->is_prelit = TRUE;
gnome_canvas_item_request_update (item);
}
return TRUE;
case GDK_LEAVE_NOTIFY:
if (icon_item->details->is_prelit
|| icon_item->details->is_highlighted_for_drop) {
/* When leaving, turn of the prelight state and the
* higlighted for drop. The latter gets turned on
* by the drag&drop motion callback.
*/
icon_item->details->is_prelit = FALSE;
icon_item->details->is_highlighted_for_drop = FALSE;
gnome_canvas_item_request_update (item);
}
return TRUE;
default:
/* Don't eat up other events; icon container might use them. */
return FALSE;
}
}
static void
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
compute_text_rectangle (NautilusIconCanvasItem *item,
const ArtIRect *icon_rect,
ArtIRect *text_rect)
{
/* Compute text rectangle. */
text_rect->x0 = (icon_rect->x0 + icon_rect->x1) / 2 - item->details->text_width / 2;
text_rect->y0 = icon_rect->y1;
text_rect->x1 = text_rect->x0 + item->details->text_width;
text_rect->y1 = text_rect->y0 + item->details->text_height;
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
static void
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
compute_editable_text_rectangle (NautilusIconCanvasItem *item,
const ArtIRect *icon_rect,
ArtIRect *text_rect)
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
{
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
int text_width, text_height;
g_assert (item->details->editable_text != NULL);
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
/* Get editable text dimensions */
text_width = gdk_text_width (item->details->font, item->details->editable_text,
strlen (item->details->editable_text));
text_height = gdk_text_height (item->details->font, item->details->editable_text,
strlen (item->details->editable_text));
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
/* Compute text rectangle. */
text_rect->x0 = (icon_rect->x0 + icon_rect->x1) / 2 - text_width / 2;
text_rect->y0 = icon_rect->y1;
text_rect->x1 = text_rect->x0 + text_width;
text_rect->y1 = text_rect->y0 + text_height;
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
static gboolean
hit_test_pixbuf (GdkPixbuf *pixbuf, const ArtIRect *pixbuf_location, const ArtIRect *probe_rect)
{
ArtIRect relative_rect, pixbuf_rect;
int x, y;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
guint8 *pixel;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
/* You can get here without a pixbuf in some strange cases. */
if (pixbuf == NULL) {
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return FALSE;
}
/* Check to see if it's within the rectangle at all. */
relative_rect.x0 = probe_rect->x0 - pixbuf_location->x0;
relative_rect.y0 = probe_rect->y0 - pixbuf_location->y0;
relative_rect.x1 = probe_rect->x1 - pixbuf_location->x0;
relative_rect.y1 = probe_rect->y1 - pixbuf_location->y0;
pixbuf_rect.x0 = 0;
pixbuf_rect.y0 = 0;
pixbuf_rect.x1 = gdk_pixbuf_get_width (pixbuf);
pixbuf_rect.y1 = gdk_pixbuf_get_height (pixbuf);
art_irect_intersect (&relative_rect, &relative_rect, &pixbuf_rect);
if (art_irect_empty (&relative_rect)) {
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return FALSE;
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* If there's no alpha channel, it's opaque and we have a hit. */
if (!gdk_pixbuf_get_has_alpha (pixbuf)) {
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return TRUE;
}
g_assert (gdk_pixbuf_get_n_channels (pixbuf) == 4);
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Check the alpha channel of the pixel to see if we have a hit. */
for (x = relative_rect.x0; x < relative_rect.x1; x++) {
for (y = relative_rect.y0; y < relative_rect.y1; y++) {
pixel = gdk_pixbuf_get_pixels (pixbuf)
+ y * gdk_pixbuf_get_rowstride (pixbuf)
+ x * 4;
if (pixel[3] >= 128) {
return TRUE;
}
}
}
return FALSE;
}
static gboolean
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItemDetails *details;
ArtIRect icon_rect, text_rect, emblem_rect;
EmblemLayout emblem_layout;
GdkPixbuf *emblem_pixbuf;
details = icon_item->details;
/* Check for hits in the stretch handles. */
if (hit_test_stretch_handle (icon_item, canvas_rect)) {
return TRUE;
}
/* Check for hit in the icon. */
get_icon_canvas_rectangle (icon_item, &icon_rect);
if (hit_test_pixbuf (details->pixbuf, &icon_rect, canvas_rect)) {
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return TRUE;
}
/* Check for hit in the text. */
compute_text_rectangle (icon_item, &icon_rect, &text_rect);
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
if (nautilus_art_irect_hits_irect (&text_rect, canvas_rect)
&& !icon_item->details->is_renaming) {
return TRUE;
}
/* Check for hit in the emblem pixbufs. */
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) {
return TRUE;
}
}
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return FALSE;
}
/* Point handler for the icon canvas item. */
static double
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
GnomeCanvasItem **actual_item)
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
{
ArtIRect canvas_rect;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
*actual_item = item;
canvas_rect.x0 = cx;
canvas_rect.y0 = cy;
canvas_rect.x1 = cx + 1;
canvas_rect.y1 = cy + 1;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
if (hit_test (NAUTILUS_ICON_CANVAS_ITEM (item), &canvas_rect)) {
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return 0.0;
} else {
/* This value means not hit.
* It's kind of arbitrary. Can we do better?
*/
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
return item->canvas->pixels_per_unit * 2 + 10;
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Bounds handler for the icon canvas item. */
static void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_bounds (GnomeCanvasItem *item,
double *x1, double *y1, double *x2, double *y2)
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
NautilusIconCanvasItem *icon_item;
NautilusIconCanvasItemDetails *details;
ArtIRect icon_rect, text_rect, total_rect, emblem_rect;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
double pixels_per_unit;
EmblemLayout emblem_layout;
GdkPixbuf *emblem_pixbuf;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
g_assert (x1 != NULL);
g_assert (y1 != NULL);
g_assert (x2 != NULL);
g_assert (y2 != NULL);
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
details = icon_item->details;
measure_label_text (icon_item);
/* Compute icon rectangle. */
icon_rect.x0 = 0;
icon_rect.y0 = 0;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
if (details->pixbuf == NULL) {
icon_rect.x1 = 0;
icon_rect.y1 = 0;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
} else {
icon_rect.x1 = gdk_pixbuf_get_width (details->pixbuf);
icon_rect.y1 = gdk_pixbuf_get_height (details->pixbuf);
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
/* Compute text rectangle. */
compute_text_rectangle (icon_item, &icon_rect, &text_rect);
/* Compute total rectangle, adding in emblem rectangles. */
art_irect_union (&total_rect, &icon_rect, &text_rect);
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
art_irect_union (&total_rect, &total_rect, &emblem_rect);
}
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
/* Return the result. */
pixels_per_unit = item->canvas->pixels_per_unit;
*x1 = total_rect.x0 / pixels_per_unit;
*y1 = total_rect.y0 / pixels_per_unit;
*x2 = total_rect.x1 / pixels_per_unit;
*y2 = total_rect.y1 / pixels_per_unit;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
/* Get the rectangle of the icon only, in world coordinates. */
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_get_icon_rectangle (NautilusIconCanvasItem *item,
ArtDRect *rect)
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
{
double i2w[6];
ArtPoint art_point;
double pixels_per_unit;
GdkPixbuf *pixbuf;
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
g_return_if_fail (rect != NULL);
gnome_canvas_item_i2w_affine (GNOME_CANVAS_ITEM (item), i2w);
art_point.x = 0;
art_point.y = 0;
art_affine_point (&art_point, &art_point, i2w);
Changed it to not attempt to create a GC just to measure the text. This * nautilus-icons-view-icon-item.c: (nautilus_icons_view_draw_text_box): Changed it to not attempt to create a GC just to measure the text. This makes it work when the widget is not realized. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: (nautilus_icons_view_icon_item_center_offset): Changed the parameter type to NautilusIconsViewIconItem. * fm-directory-view.c: (stop_load): (fm_directory_view_load_uri): Fixed code so that if you stop loading more than once, or stop before you even start, it won't send extra progress requests to the Nautilus shell or call stop_monitoring extra times on the NautilusDirectory object. * nautilus-icons-view-icon-item.h: nautilus-icons-view-icon-item.c: gnome-icon-container-dnd.c: Quick cleanup of the new NautilusIconsViewIconItem class. * libnautilus/gdk-extensions.c: libnautilus/gnome-icon-container-dnd.c: libnautilus/gnome-icon-container.c: libnautilus/gtkflist.c: libnautilus/nautilus-background-canvas-group.c: libnautilus/nautilus-background.c: libnautilus/nautilus-debug.c: libnautilus/nautilus-default-file-icon.c: libnautilus/nautilus-directory.c: libnautilus/nautilus-icon-factory.c: libnautilus/nautilus-icons-controller.c: libnautilus/nautilus-icons-view-icon-item.c: libnautilus/nautilus-lib-self-check-functions.c: libnautilus/nautilus-self-checks.c: libnautilus/nautilus-string.c: src/explorer-location-bar.c: src/file-manager/dfos-corba.c: src/file-manager/dfos-xfer-progress-dialog.c: src/file-manager/dfos-xfer.c: src/file-manager/dfos.c: src/file-manager/fm-directory-view-icons.c: src/file-manager/fm-directory-view-list.c: src/file-manager/fm-directory-view.c: src/file-manager/fm-icons-controller.c: src/file-manager/fm-main.c: src/nautilus-self-check-functions.c: src/ntl-index-panel.c: Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always include <config.h>, but there's no reason to include that ifdef since we don't plan on building without a <config.h> ever.
2000-01-31 01:30:16 +00:00
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
rect->x0 = art_point.x;
rect->y0 = art_point.y;
pixbuf = item->details->pixbuf;
pixels_per_unit = GNOME_CANVAS_ITEM (item)->canvas->pixels_per_unit;
rect->x1 = rect->x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf)) / pixels_per_unit;
rect->y1 = rect->y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf)) / pixels_per_unit;
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
/* Get the rectangle of the icon only, in canvas coordinates. */
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
ArtIRect *rect)
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
{
double i2c[6];
ArtPoint art_point;
GdkPixbuf *pixbuf;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
g_return_if_fail (rect != NULL);
gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (item), i2c);
art_point.x = 0;
art_point.y = 0;
art_affine_point (&art_point, &art_point, i2c);
rect->x0 = floor (art_point.x);
rect->y0 = floor (art_point.y);
pixbuf = item->details->pixbuf;
rect->x1 = rect->x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf));
rect->y1 = rect->y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf));
Reworked the canvas item class used by the icon 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.)
2000-02-10 00:33:49 +00:00
}
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
void
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_set_show_stretch_handles (NautilusIconCanvasItem *item,
gboolean show_stretch_handles)
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
{
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
g_return_if_fail (show_stretch_handles == FALSE || show_stretch_handles == TRUE);
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (!item->details->show_stretch_handles == !show_stretch_handles) {
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
return;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
item->details->show_stretch_handles = show_stretch_handles;
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
}
/* Check if one of the stretch handles was hit. */
static gboolean
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
hit_test_stretch_handle (NautilusIconCanvasItem *item,
const ArtIRect *probe_canvas_rect)
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
{
ArtIRect icon_rect;
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
/* Make sure there are handles to hit. */
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
if (!item->details->show_stretch_handles) {
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
return FALSE;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
/* Quick check to see if the rect hits the icon at all. */
get_icon_canvas_rectangle (item, &icon_rect);
if (!nautilus_art_irect_hits_irect (probe_canvas_rect, &icon_rect)) {
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
return FALSE;
Some of the underlying work to prepare for emblems on the icons. * style-guide.html: Some minor updates to the style guide, including rules about headers. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.c: (nautilus_icon_factory_get_emblem_icons_for_file), (nautilus_scalable_icon_get), (nautilus_icon_factor_clear), (nautilus_icon_factory_load_file), (nautilus_gdk_pixbuf_composite_corner), (nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash), (nautilus_scalable_icon_equal), (nautilus_icon_factory_get_icon_for_file), (load_specific_image): Added interface for getting emblem icons for a file, and got rid of the symbolic-link overlay that was previously built into the icon. * libnautilus/gnome-icon-container.c (update_icon): Get pixbufs for all emblems and pass into the icon object. * libnautilus/nautilus-icons-controller.c (nautius_icons_controller_get_icon_image): src/file-manager/fm-icons-controller.h, src/file-manager/fm-icons-controller.c (fm_icons_controller_get_icon_image): Return a list of emblem images along with the main image. * libnautilus/nautilus-icons-view-icon-item.h, libnautilus/nautilus-icons-view-icon-item.c (nautilus_icons_view_icon_item_set_emblems), (nautilus_icons_view_icon_item_destroy): Keep a list of emblem pixbufs in each icon. We don't draw them quite yet. * libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c: (nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref), (nautilus_gdk_pixbuf_list_free): Convenience functions for manipulating lists of GdkPixbuf objects. * libnautilus/nautilus-directory.h, libnautilus/nautilus-directory.c: (nautilus_file_list_ref), (nautilus_file_list_unref), (nautilus_file_list_free): Convenience functions for manipulating lists of NautilusFile objects. Also got rid of NautilusFileList typedef. * libnautilus/nautilus-icon-factory.h, libnautilus/nautilus-icon-factory.h: (nautilus_scalable_icon_list_free): Convenience function for manipulating lists of NautilusScalableIcon objects. * libnautilus/nautilus-glib-extensions.h, libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal): Function to compare two GLists to see if they are identical. Particularly useful with lists of reference-counted objects. * src/file-manager/fm-directory-view-icons.c (fm_directory_view_icons_destroy), (add_icon_if_already_positioned), (fm_directory_view_icons_append_selection_context_menu_items), (display_icons_not_already_positioned), (fm_direectory_view_icons_get_selection): src/file-manager/fm-directory-view-list.c (fm_directory_view_list_get_selection): src/file-manager/fm-directory-view.c (display_selection_info), (display_pending_files), (add_files_cb), (open_in_new_window_cb), (fm_directory_view_real_append_selection_context_menu_items): Got rid of use of NautilusFileList typedef, corrected ref. counting of files in the lists by using new calls. * src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c, src/nautilus-index-tabs.c, src/file-manager/fm-directory-view-icons.c, src/file-manager/fm-directory-view.c, src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
}
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
/* Check for hits in the stretch handles. */
return (probe_canvas_rect->x0 < icon_rect.x0 + STRETCH_HANDLE_THICKNESS
|| probe_canvas_rect->x1 >= icon_rect.x1 - STRETCH_HANDLE_THICKNESS)
&& (probe_canvas_rect->y0 < icon_rect.y0 + STRETCH_HANDLE_THICKNESS
|| probe_canvas_rect->y1 >= icon_rect.y1 - STRETCH_HANDLE_THICKNESS);
}
gboolean
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_hit_test_stretch_handles (NautilusIconCanvasItem *item,
const ArtPoint *world_point)
{
ArtIRect canvas_rect;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
g_return_val_if_fail (world_point != NULL, FALSE);
gnome_canvas_w2c (GNOME_CANVAS_ITEM (item)->canvas,
world_point->x,
world_point->y,
&canvas_rect.x0,
&canvas_rect.y0);
canvas_rect.x1 = canvas_rect.x0 + 1;
canvas_rect.y1 = canvas_rect.y0 + 1;
return hit_test_stretch_handle (item, &canvas_rect);
}
gboolean
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
nautilus_icon_canvas_item_hit_test_rectangle (NautilusIconCanvasItem *item,
const ArtDRect *world_rect)
{
ArtIRect canvas_rect;
Did some of the items from RENAMING. * libnautilus/Makefile.am: * libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.h: * libnautilus/gnome-icon-container-grid.c: * libnautilus/gnome-icon-container-grid.h: * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.c: * libnautilus/gnome-icon-container.h: * libnautilus/gtkflist.c: * libnautilus/gtkflist.h: * libnautilus/nautilus-icon-canvas-item.c: * libnautilus/nautilus-icon-canvas-item.h: * libnautilus/nautilus-icon-container.c: * libnautilus/nautilus-icon-container.h: * libnautilus/nautilus-icon-dnd.c: * libnautilus/nautilus-icon-dnd.h: * libnautilus/nautilus-icon-grid.c: * libnautilus/nautilus-icon-grid.h: * libnautilus/nautilus-icon-private.h: * libnautilus/nautilus-icons-view-icon-item.c: * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-lib-self-check-functions.h: * libnautilus/nautilus-list-column-title.c: * libnautilus/nautilus-list.c: * libnautilus/nautilus-list.h: * src/file-manager/Makefile.am: * src/file-manager/fm-directory-view-icons.c: * src/file-manager/fm-directory-view-icons.h: * src/file-manager/fm-directory-view-list.c: * src/file-manager/fm-directory-view-list.h: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-icon-view.h: * src/file-manager/fm-list-view.c: * src/file-manager/fm-list-view.h: * src/ntl-app.c: Did these RENAMING entries: FMDirectoryViewIcons -> FMIconView FMDirectoryViewList -> FMListView GnomeIconContainer -> NautilusIconContainer GnomeIconContainerIcon -> NautilusIcon NautilusIconsViewIconItem -> NautilusIconCanvasItem * RENAMING: Marked the renaming done.
2000-03-22 00:29:07 +00:00
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
g_return_val_if_fail (world_rect != NULL, FALSE);
nautilus_gnome_canvas_world_to_canvas_rectangle
(GNOME_CANVAS_ITEM (item)->canvas, world_rect, &canvas_rect);
return hit_test (item, &canvas_rect);
Added icon stretching and did some cleanups. Stretched icons aren't yet persistent (the scale factor is not saved in metadata), but that's not much more work. * libnautilus/gnome-icon-container-private.h: * libnautilus/gnome-icon-container.h: * libnautilus/gnome-icon-container.c: (icon_new), (icon_position), (icon_set_position), (icon_get_size), (icon_set_size), (icon_toggle_selected), (icon_select), (icon_set_selected), (button_press_event), (gnome_icon_container_begin_stretch), (start_stretching), (gnome_icon_container_stretch), (continue_stretching), (gnome_icon_container_end_stretch), (end_stretching), (button_release_event), (motion_notify_event), (handle_icon_button_press), (gnome_icon_container_clear), (request_update_one), (update_icon), (get_first_selected_icon), (gnome_icon_container_show_stretch_handles), (gnome_icon_container_has_stretch_handles), (gnome_icon_container_is_stretched), (gnome_icon_container_unstretch), (compute_stretch), (nautilus_self_check_compute_stretch), (nautilus_self_check_gnome_icon_container): * libnautilus/nautilus-icons-view-icon-item.h: * libnautilus/nautilus-icons-view-icon-item.c: (nautilus_icons_view_icon_item_draw), (nautilus_icons_view_icon_item_point), (nautilus_icons_view_icon_item_set_show_stretch_handles), (nautilus_icons_view_icon_item_get_hit_stretch_handle): * libnautilus/nautilus-lib-self-check-functions.h: Added machinery for stretching icons. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (append_item_context_menu_items), (fm_directory_view_real_append_item_context_menu_items), (fm_directory_view_initialize_class), (create_item_context_menu): Added machinery for views to have view-specific menu items for icons as well as for the window as a whole. * src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize_class), (fm_directory_view_icons_append_item_context_menu_items), (show_stretch_handles_cb), (unstretch_item_cb): Added menu items for stretching icons. * libnautilus/gnome-icon-container.c: (start_rubberbanding): Fixed bug that would result in two rubberband timeouts at once if you did rubberbanding quickly. * components/notes/.cvsignore: Andy's new component needs a .cvsignore file for its generated pieces. * libnautilus/nautilus-directory.c: (nautilus_directory_try_to_read_metafile), (nautilus_directory_read_metafile): Simplified logic in metafile-reading functions and fixed a bug where the vfs handle would be left open if certain categories of errors occurred. * libnautilus/nautilus-gtk-extensions.h: Added a missing gtk_marshal function. * libnautilus/nautilus-icon-factory.h: * libnautilus/nautilus-icon-factory.c: (nautilus_icon_size_for_zoom_level), (nautilus_get_icon_size_for_zoom_level), (nautilus_icon_factory_get_pixbuf_for_file), (nautilus_icon_factory_get_pixmap_and_mask_for_file): * src/nautilus-index-title.c: (nautilus_index_title_set_up_icon): * src/nautilus-zoom-control.c: (set_zoom_level): * src/file-manager/fm-directory-view-list.c: (fm_directory_view_list_bump_zoom_level), (install_icon): Made some API improvements for the icon factory. Added a missing get_ to the name nautilus_get_icon_size_for_zoom_level and added convenience functions for the most common uses of the factory. * libnautilus/ntl-content-view-frame.c: * libnautilus/ntl-meta-view-frame.c: * libnautilus/ntl-view-frame.c: Weaned all the files in libnautilus itself from using the libnautilus.h include file. They instead include the parts that they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
/* Return coordinates of icon text location */
void
nautilus_icon_canvas_item_get_text_bounds (NautilusIconCanvasItem *icon_item,
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
ArtIRect *text_rect)
{
ArtIRect icon_rect;
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
g_return_if_fail (icon_item->details->editable_text != NULL);
g_return_if_fail (text_rect != NULL);
get_icon_canvas_rectangle (icon_item, &icon_rect);
compute_text_rectangle (icon_item, &icon_rect, text_rect);
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
/* Return coordinates of icon editable_text location */
void
nautilus_icon_canvas_item_get_editable_text_bounds (NautilusIconCanvasItem *icon_item,
Moved the "embedded text" feature into the icon factory and NautilusFile. * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_close), (nautilus_metafile_read_cancel), (metafile_read_failed), (metafile_read_complete), (metafile_read_callback), (metafile_read_some), (metafile_read_open_callback), (metafile_read_start), (nautilus_directory_request_read_metafile), (metafile_write_done), (metafile_write_failed), (metafile_write_callback), (metafile_write_create_callback), (nautilus_metafile_write_start), (metafile_write), (lacks_top_left), (wants_top_left), (has_problem), (select_needy_file), (count_lines), (top_left_read_done), (top_left_read_failed), (top_left_read_complete), (top_left_read_close), (top_left_read_callback), (top_left_read_some), (top_left_open_callback), (start_getting_top_lefts), (state_changed): Added code to read top lefts of files in the background. Restructured things to accomodate this new code nicely with a minimum of copy and paste (there still was plenty of copy and paste so there's room for improvement). * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_destroy): Name changes from above required revising some asserts. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_get_top_left_text): Now it returns something besides just NULL. (nautilus_extract_top_left_text): Function that remembers only the part of the top left text that we want to keep around. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER), (nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER): Needed some new marshal functions. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_initialize_class), (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_arg), (nautilus_icon_canvas_item_get_arg), (nautilus_icon_canvas_item_get_image), (nautilus_icon_canvas_item_set_image), (nautilus_icon_canvas_item_draw): Removed the old embedded text support. It came with a whole lot of baggage, also removed. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (nautilus_icon_container_initialize_class): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both. * libnautilus-extensions/nautilus-icon-dnd.c: (nautilus_icon_dnd_begin_drag): Updated for change in icon factory API. * src/file-manager/fm-directory-view.c: (finish_loading_uri): Ask for top-left text attribute for all directories. * src/file-manager/fm-icon-view.c: (get_icon_images_callback): Moved pixbuf computing code into the FMIconView class. We might decide later to move it back again, but for now the embedded text makes it easier to do it this way. (get_icon_text_callback): Merged get_icon_editable_text and get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
ArtIRect *text_rect)
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
{
ArtIRect icon_rect;
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
g_return_if_fail (icon_item->details->editable_text != NULL);
g_return_if_fail (text_rect != NULL);
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
get_icon_canvas_rectangle (icon_item, &icon_rect);
compute_editable_text_rectangle (icon_item, &icon_rect, text_rect);
}
const char *
nautilus_icon_canvas_item_get_editable_text (NautilusIconCanvasItem *icon_item)
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
{
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item), NULL);
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
return icon_item->details->editable_text;
}
void
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
nautilus_icon_canvas_item_set_renaming (NautilusIconCanvasItem *item, gboolean state)
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
{
Added commands for Auto vs. Manual layout, but the guts behind them is not yet implemented. Did some cleanup on the new renaming code. * nautilus-glib-extensions.c: * nautilus-glib-extensions.h: Added nautilus_g_list_exactly_one_item and nautilus_g_list_more_than_one_item. These are more-efficient versions of g_list_length (x) == 1 and g_list_length (x) > 1. * nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Add a line break between the editable text and the additional text. (nautilus_icon_canvas_get_text_bounds), (nautilus_icon_canvas_get_editable_text_bounds), (nautilus_icon_canvas_get_editable_text), (nautilus_icon_canvas_set_renaming): Replaced g_assert with g_return_if_fail calls, and added the complete set of g_return_if_fail. (nautilus_icon_canvas_set_renaming): Don't update the item unless the renaming state has actually changed. * nautilus-icon-canvas-item.h: Fixed formatting. * nautilus-icon-container.c: * nautilus-icon-container.h: Added nautilus_icon_container_set_auto_layout and nautilus_icon_container_is_auto_layout. For now they are placeholders that just modify a boolean. * nautilus-icon-private.h: Added the auto_layout boolean. * nautilus-icon-text-item.c: * nautilus-icon-text-item.h: Just some formatting and other minor cleanup. * nautilus-metadata.h: Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT. * nautilus-location-bar.c (drag_data_received_cb): Use the new nautilus_g_list_more_than_one_item function. * fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the new nautilus_g_list_exactly_one_item. * fm-icon-text-window.c (attribute_names_string_is_good), (set_preference_string), (synch_menus_with_preference), (preference_changed_callback), (changed_attributes_option_menu_cb): Got rid of the hard-coded first item "name" which is no longer needed. Also changed to handle bad data in the preferences. * fm-icon-view.c (fm_icon_view_initialize_class): Updated since there's no "name" item needed any more. (fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT and simplified the logic. (fm_icon_view_append_selection_context_menu_items): Merged MENU_PATH_RENAME with MENU_RENAME_TEXT. (update_layout_menus), (auto_layout_callback), (manual_layout_callback), (fm_icon_view_merge_menus): Added menu items for auto layout and for manual layout. (fm_icon_view_begin_loading): Load setting for auto layout from metadata. (fm_icon_view_get_icon_text_attribute_names): Changed to get rid of the "name" first item from the list of text attributes. (get_icon_editable_text_callback): Simplified since the editable text is always the icon name. Also got rid of copied and pasted code that's no longer needed for this case. (get_icon_additional_text_callback): Got rid of special case for name, since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
g_return_if_fail (state == FALSE || state == TRUE);
if (item->details->is_renaming == state) {
return;
}
Added functionality to allow files to be renamed in icov view. This 2000-04-18 Gene Z. Ragan <gzr@eazel.com> Added functionality to allow files to be renamed in icov view. This feature is available by either context click on the icon or selecting a single file and choosing "Rename" form the File menu. * libnautilus-extensions/nautilus-icon-text-item.c * libnautilus-extensions/nautilus-icon-text-item.h: New files. This is an editable icon text item used in the renaming feature. It is based on GnomeIconTextItem but modified to fix bugs in the original code and add extended functionality need by nautilus. If thse changes were rolled into the current GnomeIconTextItem, it would break gmc. * libnautilus-extensions/Makefile.am Modified file so that the two new files listed above would properly be included in generated makefiles. * libnautilus-extensions/nautilus-icon-canvas-item.c Split text class variable into two variables, editable_text and additonal_text. editable_text refers to attributes that the user can change via rename in place. additional_text is any other text that the user cannot edit via the rename in place feature. Added a boolean flag, is_renaming, to check against during various operations that effect the renaming feature. Removed ARG_TEXT argument ID and replaced with ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_initialize_class): Function now check for both ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. Removed check for ARG_TEXT. (nautilus_icon_canvas_item_destroy): Both editable_text and additonal_text are freed. (nautilus_icon_canvas_item_set_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (nautilus_icon_canvas_item_get_arg): Removed ARG_TEXT and added handling of ARG_EDITABLE_TEXT and ARG_ADDITIONAL_TEXT. (draw_or_measure_label_text): Modified function to not draw the label icon text if we are renaming in place. (draw_or_measure_label_text): Function now combines editable and additional text when performing the measuring operation. (compute_editable_text_rectangle): Added function to compute bounds of editable text. This is used to determine size and placement of editable text item when in renaming mode. (nautilus_icon_canvas_get_text_bounds): Public API to get bounds of icon label text. (nautilus_icon_canvas_get_editable_text_bounds): Public API to get bounds of editable icon label text. (hit_test_pixbuf): Added check against is_renaming flag. (nautilus_icon_canvas_get_editable_text): Public API to get editable text string. (nautilus_icon_canvas_item_set_renaming): Public API to toggle is_renaming flag. * libnautilus-extensions/nautilus-icon-canvas-item.h Added public API prototypes to functions described above. * libnautilus-extensions/nautilus-icon-container.c Added GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITONAL_TEXT signals. Removed GET_ICON_TEXT signal. Added ICON_TEXT_CHANGED signal. (icon_toggle_selected): Renaming mode is now exited when a selection/deselection occurs. (key_press_event): GDK_Return ends rename mode and attempts to accept modification. GDK_Escpae ends rename mode and reverts modification to original. (nautilus_icon_container_initialize_class): icon_text_changed, get_icon_editable_text and get_icon_additional_text signals are registered. (editing_started): New function. Called when an edit begins. Inits class member variables for edit mode. (editing_stopped): New function. Called when edit ends. Cleans up edit mode. (nautilus_icon_container_initialize): rename_widget and original_text private variables are set to NULL. (icon_toggle_selected): Added call to end_renaming_mode. (nautilus_icon_container_update_icon): Added emitting of GET_ICON_EDITABLE_TEXT and GET_ICON_ADDITIONAL_TEXT signals. Updated gnome_canvas_item_set to use new arguments defined in nautilus-icon-text-item. (nautilus_icon_container_show_rename_widget): New function. Creates and displays renaming_widget. Creates cached copy of original editable text for later compare, connects signals and enters renaming mode. (end_renaming_mode): New function. Cleans up and end renaiming mode. (hide_rename_widget): Called by end_renaming_mode to hide and free renaming_widget. * libnautilus-extensions/nautilus-icon-container.h Added prototypes for public functions described above. * libnautilus-extensions/nautilus-icon-private.h Added boolean for renaming. Added a NautilusIconTextItem variable for the renaiming widget. * src/file-manager/fm-icon-view.c Added defines MENU_PATH_RENAME. Added a char * to hold original editable text for a later compare. Removed get_icon_text_callback and added get_icon_editable_text_callback and get_icon_additonal_text_callback. These return the editable and additonal text of the icon view. (rename_icon_callback): Added callback that attempts to rename the NautilusFile the icon view represents. Action in not taken if there has been no change to the editable text. If the operation fails, the user is notified. (fm_icon_view_append_selection_context_menu_items): Added Rename menu item. (append_bonobo_menu_item): Added Rename menu item and callback. (update_bonobo_menu_item): Added senesitivity check for the Rename item. It is enabled only if a single item is selected. (fm_icon_view_icon_text_changed_callback): Added function to attempt to change the filename to the new text. Notify user if operation fails. (get_icon_editable_text_callback): This callback returns the text items that areeditable by the user using the "Rename" command. In the case of FMIconView, this would be the attribute with the name "name". (get_icon_additional_text_callback): This callback returns the text items that are not editable by the user using the "Rename" command.
2000-04-17 21:07:33 +00:00
item->details->is_renaming = state;
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
}
libnautilus-extensions/nautilus-icon-canvas-item.c Return value of 2000-04-21 Gene Z. Ragan <gzr@eazel.com> * libnautilus-extensions/nautilus-icon-canvas-item.c * libnautilus-extensions/nautilus-icon-canvas-item.h (nautilus_icon_canvas_item_get_max_text_width): Return value of MAX_TEXT_WIDTH constant. Used is positoning the rename text widget. * libnautilus-extensions/nautilus-icon-container.c Added signal "icon_text_edit_occurred" called when the text rename widget recieves some sort of edit, such as a keyboard entry. (rename_text_dirty): Returns boolean indicating edit state of text in rename widget. Used in undo operation. (text_edited_callback): Signal callback called when NautilusIconTextItem text is edited. (nautilus_icon_container_start_renaming_selected_item): Fixed positioning code to address bug #543 (nautilus_icon_container_undo_renaming_selected_item): Added simple undo code. This needs to be replaced with a global undo system. * libnautilus-extensions/nautilus-icon-text-item.c (iti_paint_text): Fixed drawing of i-beam to address bug #506 (iti_event): Added keyboard handling for simple undo (nautilus_icon_text_item_get_margins): Returns values of MARGIN_X and MARGIN_X constants. Used when positioning text item in canvas. * src/file-manager/fm-directory-view.c Moved menu item title constants to header file. This is needed so FMIconView can get menu position paths when placing items in the bonobo and contect menus. Renamed the constants to be specific to FMDirectoryView. (fm_directory_view_get_context_menu_index): Added function to return index of requested menu item. * src/file-manager/fm-icon-view.c (fm_icon_view_icon_text_edit_callback): Callback that connect to NautilusIconContainer signal. (undo_rename_icon_callback): Added simple undo functionality. (insert_one_context_menu_item): Added function to insert context menu add a specific index. Fixed bug #499, Rename menu in bad place in context menu.
2000-04-22 04:24:53 +00:00
int
nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
{
return MAX_TEXT_WIDTH;
}