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

2199 lines
63 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>
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
#include <libgnome/gnome-i18n.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>
#include <libart_lgpl/art_rgb.h>
#include <libart_lgpl/art_rgb_affine.h>
#include <libart_lgpl/art_rgb_rgba_affine.h>
#include <libart_lgpl/art_svp_vpath.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"
#include "nautilus-global-preferences.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"
Some build fixes. * acconfig.h: * configure.in: Removed the NAUTILUS_PREFIX that I added. I did it wrong. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_pixmap_file): * components/hardware/nautilus-hardware-view.c: (setup_overview_form): * components/services/startup/nautilus-view/nautilus-service-startup-view.c: (setup_form_title), (setup_signup_form), (setup_config_form): * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf): * libnautilus-extensions/nautilus-icon-factory.c: (make_full_icon_path): * src/nautilus-application.c: (display_caveat): * src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (make_category_link): * src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize): Replaced most uses of gnome_pixmap_file on "nautilus/" with a call to a new nautilus_pixmap_file in an attempt to make installations where nautilus has a different prefix from gnome-libs work. I now think this is a waste of time, but Mathieu Lacage says this is still an improvement. * components/help/Makefile.am: * components/help/hyperbola-filefmt.c: (fmt_map_entry): Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX. * components/websearch/ntl-web-search.c: (web_search_populate_engines): Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX. * components/mozilla/nautilus-mozilla-content-view.c: (nautilus_mozilla_content_view_initialize), (mozilla_content_view_set_busy_cursor), (mozilla_content_view_request_progress_change), (mozilla_content_view_clear_busy_cursor), (mozilla_load_location_callback), (bonobo_mozilla_callback), (mozilla_merge_bonobo_items_callback), (mozilla_title_changed_callback), (mozilla_location_changed_callback), (mozilla_net_status_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_open_uri_callback): Took a cut at fixing the Mozilla component for the new API. Ramiro will have to take care of the rest. * components/services/install/lib/Makefile.am: * components/services/time/command-line/Makefile.am: * components/services/time/nautilus-view/Makefile.am: * components/services/time/service/Makefile.am: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/service/Makefile.am: * libnautilus/Makefile.am: Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested in the form of a patch by Martijn van Beers. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory), (nautilus_get_pixmap_directory): * libnautilus-extensions/nautilus-link-set.c: (get_link_set_document): * src/Makefile.am: * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (get_xml_path), (make_properties_from_directory): * src/nautilus-link-set-window.c: (get_link_set_names): * src/file-manager/Makefile.am: * src/file-manager/fm-properties-window.c: (get_property_names): Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_uri_from_local_path): Added a new helper function for use when you have a path and need a URI. This does a better job than just adding a "file://" on the front. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (get_first_callback), (nautilus_gtk_container_get_first_child): * src/nautilus-window-toolbars.c: (setup_button): * src/nautilus-window.c: (replace_special_current_view_in_content_view_menu): Implemented the first_child function and used it where appropriate. * libnautilus-extensions/nautilus-preferences-item.c: (add_icon_themes): Use nautilus_get_pixmap_directory intead of misusing gnome_pixmap_file by calling it on a directory name. * nautilus-installer/src/support.c: (create_pixmap), (create_image): Added FIXMEs since it isn't clear if this code will work with a Nautilus prefix that's not the same as the gnome-libs prefix. * Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
#include "nautilus-file-utilities.h"
#include "nautilus-icon-factory.h"
#include "nautilus-theme.h"
/* Comment this out if the new smooth fonts code give you problems
* This isnt meant to be permanent. Its just a precaution.
*/
#define EMBLEM_SPACING 2
#define MAX_TEXT_WIDTH_STANDARD 135
#define MAX_TEXT_WIDTH_TIGHTER 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
/* The list of characters that cause line breaks can be localized. */
#define LINE_BREAK_CHARACTERS _(" -_,;.?/&")
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;
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
NautilusEmblemAttachPoints *attach_points;
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;
/* preview state */
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
guint is_active : 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
/* 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;
/* Font stuff whilst in smooth mode */
guint smooth_font_size;
NautilusScalableFont *smooth_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
};
/* 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,
ARG_SMOOTH_FONT_SIZE,
ARG_SMOOTH_FONT
};
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;
int index;
GList *emblem;
} EmblemLayout;
enum {
BOUNDS_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
static guint32 highlight_background_color = NAUTILUS_RGBA_COLOR_PACK (0x00, 0x00, 0x00, 0xFF);
static guint32 highlight_text_color = NAUTILUS_RGBA_COLOR_PACK (0xFF, 0xFF, 0xFF, 0xFF);
static guint32 highlight_text_info_color = NAUTILUS_RGBA_COLOR_PACK (0xCC, 0xCC, 0xCC, 0xFF);
/* GtkObject */
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 void nautilus_icon_canvas_item_render (GnomeCanvasItem *item,
GnomeCanvasBuf *buffer);
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_or_measure_label_text_aa (NautilusIconCanvasItem *item,
GdkPixbuf *destination_pixbuf,
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);
static void draw_pixbuf_aa (GdkPixbuf *pixbuf,
GnomeCanvasBuf *buf,
double affine[6],
int x_offset,
int y_offset);
static gboolean icon_canvas_item_is_smooth (const NautilusIconCanvasItem *icon_item);
static void draw_dashed_rectangle_aa (guchar *pixels, int rowstride, gboolean has_alpha,
int widt, int height, int left, int right, int top, int 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
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);
gtk_object_add_arg_type ("NautilusIconCanvasItem::smooth_font_size",
GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_SMOOTH_FONT_SIZE);
gtk_object_add_arg_type ("NautilusIconCanvasItem::smooth_font",
GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SMOOTH_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
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__NONE,
GTK_TYPE_NONE, 0);
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->render = nautilus_icon_canvas_item_render;
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->point = nautilus_icon_canvas_item_point;
item_class->bounds = nautilus_icon_canvas_item_bounds;
item_class->event = nautilus_icon_canvas_item_event;
}
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;
icon_item->details->smooth_font_size = 12;
icon_item->details->smooth_font = nautilus_scalable_font_get_default_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
/* 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);
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
g_free (details->attach_points);
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);
}
gtk_object_unref (GTK_OBJECT (icon_item->details->smooth_font));
icon_item->details->smooth_font = 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
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;
case ARG_SMOOTH_FONT:
nautilus_icon_canvas_item_set_smooth_font (NAUTILUS_ICON_CANVAS_ITEM (object),
NAUTILUS_SCALABLE_FONT (GTK_VALUE_OBJECT (*arg)));
break;
case ARG_SMOOTH_FONT_SIZE:
nautilus_icon_canvas_item_set_smooth_font_size (NAUTILUS_ICON_CANVAS_ITEM (object),
GTK_VALUE_UINT (*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;
case ARG_SMOOTH_FONT:
gtk_object_ref (GTK_OBJECT (details->smooth_font));
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (details->smooth_font);
break;
case ARG_SMOOTH_FONT_SIZE:
GTK_VALUE_UINT (*arg) = details->smooth_font_size;
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
{
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 (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));
}
void
nautilus_icon_canvas_item_set_attach_points (NautilusIconCanvasItem *item,
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
NautilusEmblemAttachPoints *attach_points)
{
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
g_free (item->details->attach_points);
item->details->attach_points = NULL;
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
if (attach_points != NULL && attach_points->num_points != 0) {
item->details->attach_points = g_new (NautilusEmblemAttachPoints, 1);
*item->details->attach_points = *attach_points;
}
}
/* 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
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;
}
}
static gboolean
in_single_click_mode ()
{
/* Perhaps this should be computed elsewhere and passed in. */
return nautilus_preferences_get_enum
(NAUTILUS_PREFERENCES_CLICK_POLICY, NAUTILUS_CLICK_POLICY_DOUBLE) ==
NAUTILUS_CLICK_POLICY_SINGLE;
}
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;
guint32 label_color;
GnomeCanvasItem *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
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;
Fix all the warnings -Wuninitialized found. Quite a number of them were 2000-09-05 Pavel Cisler <pavel@eazel.com> * components/help/converters/gnome-db2html2/gdb3html.c: (xml_parse_document): * components/help/hyperbola-nav-index.c: (end_element): * components/services/summary/nautilus-view/nautilus-summary-view.c : (logout_button_cb): * components/services/time/service/trilobite-eazel-time-service.c: (trilobite_eazel_time_service_do_http_request): * components/tree/nautilus-tree-view.c: * configure.in: * libnautilus-extensions/bonobo-stream-vfs.c: (bonobo_stream_vfs_open): * libnautilus-extensions/nautilus-background.c: (nautilus_background_draw), (nautilus_background_draw_aa): * libnautilus-extensions/nautilus-customization-data.c: (nautilus_customization_data_new): * libnautilus-extensions/nautilus-directory-background.c: (nautilus_directory_background_write_desktop_settings): * libnautilus-extensions/nautilus-file-operations.c: (nautilus_file_operations_move_to_trash), (do_empty_trash): * libnautilus-extensions/nautilus-file.c: (nautilus_file_dump): * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-factory.c: (get_image_from_cache): * libnautilus-extensions/nautilus-icon-text-item.c: (iti_paint_text): * libnautilus-extensions/nautilus-list.c: (draw_cell), (draw_row): * libnautilus-extensions/nautilus-mime-actions.c: (nautilus_mime_add_application_to_short_list_for_uri): * libnautilus-extensions/nautilus-program-chooser.c: (program_file_pair_get_short_status_text), (program_file_pair_get_long_status_text): * libnautilus-extensions/nautilus-program-choosing.c: (nautilus_choose_component_for_file), (nautilus_choose_application_for_file): * libnautilus-extensions/nautilus-scalable-font.c: (nautilus_scalable_font_draw_text_lines_with_dimensions): * libnautilus-extensions/nautilus-theme.c: (nautilus_theme_make_selector): * librsvg/rsvg-ft.c: (rsvg_ft_get_glyph): * librsvg/test-ft-gtk.c: (set_text): * librsvg/test-ft.c: (save_pixbuf_to_file_internal), (save_pixbuf_to_file): * librsvg/test-rsvg.c: (save_pixbuf_to_file_internal), (save_pixbuf_to_file): * src/file-manager/fm-directory-view.c: (display_pending_files), (compute_menu_item_info): * src/file-manager/fm-icon-view.c: (compute_menu_item_info): * src/file-manager/fm-list-view.c: (get_column_from_attribute): * src/nautilus-application.c: (nautilus_application_startup): * src/nautilus-search-bar-criterion.c: (nautilus_search_bar_criterion_next_new), (nautilus_search_bar_criterion_get_location), (get_date_modified_location_for): * src/nautilus-sidebar-tabs.c: (draw_one_tab_themed), (draw_or_layout_all_tabs): * src/nautilus-toolbar.c: (nautilus_toolbar_size_allocate): * src/nautilus-window-manage-views.c: (nautilus_window_get_current_location_title): * test/test-nautilus-label.c: (justification_changed_callback): Fix all the warnings -Wuninitialized found. Quite a number of them were actual bugs. Turn on -Wuninitialized in configure.in now that ORBit generates warning-free code.
2000-09-05 20:38:10 +00:00
gc = NULL;
icon_width = 0;
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
canvas_item = GNOME_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
if (drawable != NULL) {
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
gc = gdk_gc_new (canvas_item->canvas->layout.bin_window);
gdk_gc_get_values (gc, &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
}
max_text_width = floor (nautilus_icon_canvas_item_get_max_text_width (item));
/* if the icon is highlighted, do some set-up */
if (needs_highlight && drawable != NULL && !details->is_renaming) {
gdk_rgb_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_rgb_gc_set_foreground (gc, highlight_text_color);
}
if (!needs_highlight && drawable != NULL) {
label_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), TRUE);
gdk_rgb_gc_set_foreground (gc, label_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,
LINE_BREAK_CHARACTERS,
max_text_width, TRUE);
/* Draw text if we are not in user rename mode */
if (drawable != NULL && !details->is_renaming) {
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;
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
gnome_icon_paint_text
(icon_text_info, drawable, gc,
text_left, icon_bottom + height_so_far,
GTK_JUSTIFY_CENTER);
/* if it's highlighted, embolden by drawing twice */
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
if (needs_highlight) {
gnome_icon_paint_text
(icon_text_info, drawable, gc,
text_left + 1, icon_bottom + height_so_far,
GTK_JUSTIFY_CENTER);
}
/* if it's prelit, and we're in click-to-activate mode, underline the text */
if (details->is_prelit && in_single_click_mode ()) {
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
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
}
}
if (drawable != NULL && i == 0) {
if (needs_highlight) {
gdk_rgb_gc_set_foreground (gc, highlight_text_info_color);
} else {
label_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), FALSE);
gdk_rgb_gc_set_foreground (gc, label_color);
}
}
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) {
height_so_far += 2; /* extra slop for nicer highlighting */
width_so_far += 4; /* account for emboldening, plus extra to make it look nicer */
}
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
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);
gdk_gc_set_foreground (gc, &save_gc.foreground);
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);
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
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)
{
if (icon_canvas_item_is_smooth (item)) {
draw_or_measure_label_text_aa (item, NULL, 0, 0);
}
else {
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;
char *knob_filename;
GdkPixbuf *knob_pixbuf;
int knob_width, knob_height;
if (!item->details->show_stretch_handles) {
return;
}
gc = gdk_gc_new (drawable);
knob_filename = nautilus_theme_get_image_path ("knob.png");
knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename);
knob_width = gdk_pixbuf_get_width (knob_pixbuf);
knob_height = gdk_pixbuf_get_height (knob_pixbuf);
draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y0);
draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y1 - knob_height);
draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y0);
draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y1 - knob_height);
g_free(knob_filename);
gdk_pixbuf_unref(knob_pixbuf);
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);
Added the idl directory. * Makefile.am: Added the idl directory. * libnautilus-extensions/nautilus-gnome-extensions.h: * libnautilus-extensions/nautilus-gnome-extensions.c: (nautilus_simple_dialog): Turned on line wrapping for the label in the simple dialog. (turn_on_line_wrap_flag), (show_ok_box), (nautilus_error_dialog), (nautilus_error_dialog_parented): Made alternate versions of gnome_error_dialog and gnome_error_dialog_parented that turn on line wrapping for the message label. * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text): Made the list of characters to break lines on localizable. * libnautilus-extensions/nautilus-icon-dnd.c: (confirm_switch_to_manual_layout): Took newlines out of messages since the dialog now does line wrapping. * src/file-manager/dfos-xfer.c: (handle_xfer_vfs_error), (handle_xfer_overwrite): Took out some extraneous spaces. I could have also removed the newlines since the functions call something that does line wrapping, but I decided not to. * src/file-manager/fm-properties-window.c: (name_field_update_to_match_file): Fixed a double delete bug. This may have been what Ali was running into when he was clicking quickly on all the emblems in succession. * src/nautilus-property-browser.c: Did a cleanup pass on the entire file. Marked things localizable and marked some bugs with FIXME among other things. * src/ntl-window-msgs.c: (nautilus_window_update_state): Added code to check for NULL so that we won't core dump when trying to "go back" from the first failed view. (nautilus_window_progress_indicate), (nautilus_window_end_location_change_callback): Got rid of newlines from messages and called the function that now does line wrapping.
2000-05-12 23:08:45 +00:00
gdk_draw_rectangle
(drawable, gc, FALSE,
rect->x0 + (knob_width - 1) / 2,
rect->y0 + (knob_height - 1) / 2,
rect->x1 - rect->x0 - (knob_width - 1) - 1,
rect->y1 - rect->y0 - (knob_height - 1) - 1);
gdk_gc_unref (gc);
}
/* draw the stretch handles in the anti-aliased canvas */
static void
draw_stretch_handles_aa (NautilusIconCanvasItem *item, GnomeCanvasBuf *buf,
const ArtIRect *rect)
{
int knob_width, knob_height;
GnomeCanvasItem *canvas_item;
char *knob_filename;
GdkPixbuf *knob_pixbuf;
ArtIRect box_rect, draw_rect;
double affine[6];
if (!item->details->show_stretch_handles) {
return;
}
canvas_item = GNOME_CANVAS_ITEM (item);
knob_filename = nautilus_theme_get_image_path ("knob.png");
knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename);
knob_width = gdk_pixbuf_get_width (knob_pixbuf);
knob_height = gdk_pixbuf_get_height (knob_pixbuf);
art_affine_identity (affine);
draw_pixbuf_aa (knob_pixbuf, buf, affine, rect->x0, rect->y0);
draw_pixbuf_aa (knob_pixbuf, buf, affine, rect->x0, rect->y1 - knob_height);
draw_pixbuf_aa (knob_pixbuf, buf, affine, rect->x1 - knob_width, rect->y0);
draw_pixbuf_aa (knob_pixbuf, buf, affine, rect->x1 - knob_width, rect->y1 - knob_height);
/* now draw a box to connect the dots */
box_rect.x0 = rect->x0 + (knob_width - 1) / 2;
box_rect.y0 = rect->y0 + (knob_height - 1) / 2;
box_rect.x1 = rect->x1 - (knob_width - 1) / 2;
box_rect.y1 = rect->y1 - (knob_height - 1) / 2;
art_irect_intersect (&draw_rect, &box_rect, &buf->rect);
if (!art_irect_empty (&draw_rect)) {
draw_dashed_rectangle_aa (buf->buf, buf->buf_rowstride, FALSE,
buf->rect.x1 - buf->rect.x0,
buf->rect.y1 - buf->rect.y0,
box_rect.x0 - buf->rect.x0,
box_rect.y0 - buf->rect.y0,
box_rect.x1 - buf->rect.x0,
box_rect.y1 - buf->rect.y0);
}
g_free(knob_filename);
gdk_pixbuf_unref(knob_pixbuf);
}
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->index = 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;
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
NautilusEmblemAttachPoints *attach_points;
/* 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;
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
attach_points = layout->icon_item->details->attach_points;
if (attach_points != NULL) {
if (layout->index >= attach_points->num_points) {
return FALSE;
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
}
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf fix)). Also took care of bug 3145 (zillions of 'main_loops != NULL' assertion failures when quitting) and bug 3138 (Some code in the icon factory is cut and pasted from elsewhere). And a few unrelated things that came up while I was busy working on these. * configure.in: Applied patch from Dan Winship to fix handling of CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-icon-factory-private.h: * libnautilus-extensions/nautilus-thumbnails.c: * libnautilus-extensions/nautilus-thumbnails.h: Broke out the thumbnailing code into its own source file for clarity. * libnautilus-extensions/nautilus-directory.c: * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_directory_and_parents): Moved nautilus_make_directory_and_parents into a place where the thumbnail code can share it instead of requiring its own copy. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (destroy_global_prefs_dialog), (global_preferences_get_dialog), (nautilus_global_preferences_dialog_update), (nautilus_global_preferences_initialize): * libnautilus-extensions/nautilus-preferences.h: * libnautilus-extensions/nautilus-preferences.c: (preferences_initialize_if_needed), (preferences_shutdown): * src/nautilus-application.c: (nautilus_application_destroy): Changed code so that it cleans up with g_atexit instead of with an explicit shutdown call. This makes it sequence correctly with other atexit code. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_destroy), (nautilus_icon_canvas_item_set_attach_points), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-container.c: (nautilus_icon_container_update_icon): Added a Nautilus prefix to the EmblemAttachPoints typedef, since it's public. * libnautilus-extensions/nautilus-icon-factory.h: * libnautilus-extensions/nautilus-icon-factory.c: Changed the icon factory structure so that it will actually free pixbufs when done with them. Made some other small fixes to the icon factory in passing, including removing some redundant code and fixing the logic for getting custom icons and deleting the icon factory and g_atexit time. * src/file-manager/fm-icon-view.c: (play_file), (preview_sound): Restructured the logic for playing sound previews a little to get rid of compiler warnings and close some loopholes in the old code. * src/nautilus-main.c: (is_event_loop_needed), (quit_if_in_main_loop), (nautilus_gtk_main_quit_all), (event_loop_unregister), (nautilus_main_event_loop_register), (nautilus_main_is_event_loop_mainstay), (nautilus_main_event_loop_quit), (main): Fixed the main loop quitting logic so that it is a bit simpler and works with the gnome-vfs code that runs event handling after the last main loop is gone.
2000-09-20 00:44:07 +00:00
x = layout->icon_rect.x0 + attach_points->points[layout->index].x;
y = layout->icon_rect.y0 + attach_points->points[layout->index].y;
layout->index += 1;
/* 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;
}
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;
Fix all the warnings -Wuninitialized found. Quite a number of them were 2000-09-05 Pavel Cisler <pavel@eazel.com> * components/help/converters/gnome-db2html2/gdb3html.c: (xml_parse_document): * components/help/hyperbola-nav-index.c: (end_element): * components/services/summary/nautilus-view/nautilus-summary-view.c : (logout_button_cb): * components/services/time/service/trilobite-eazel-time-service.c: (trilobite_eazel_time_service_do_http_request): * components/tree/nautilus-tree-view.c: * configure.in: * libnautilus-extensions/bonobo-stream-vfs.c: (bonobo_stream_vfs_open): * libnautilus-extensions/nautilus-background.c: (nautilus_background_draw), (nautilus_background_draw_aa): * libnautilus-extensions/nautilus-customization-data.c: (nautilus_customization_data_new): * libnautilus-extensions/nautilus-directory-background.c: (nautilus_directory_background_write_desktop_settings): * libnautilus-extensions/nautilus-file-operations.c: (nautilus_file_operations_move_to_trash), (do_empty_trash): * libnautilus-extensions/nautilus-file.c: (nautilus_file_dump): * libnautilus-extensions/nautilus-icon-canvas-item.c: (draw_or_measure_label_text), (emblem_layout_next): * libnautilus-extensions/nautilus-icon-factory.c: (get_image_from_cache): * libnautilus-extensions/nautilus-icon-text-item.c: (iti_paint_text): * libnautilus-extensions/nautilus-list.c: (draw_cell), (draw_row): * libnautilus-extensions/nautilus-mime-actions.c: (nautilus_mime_add_application_to_short_list_for_uri): * libnautilus-extensions/nautilus-program-chooser.c: (program_file_pair_get_short_status_text), (program_file_pair_get_long_status_text): * libnautilus-extensions/nautilus-program-choosing.c: (nautilus_choose_component_for_file), (nautilus_choose_application_for_file): * libnautilus-extensions/nautilus-scalable-font.c: (nautilus_scalable_font_draw_text_lines_with_dimensions): * libnautilus-extensions/nautilus-theme.c: (nautilus_theme_make_selector): * librsvg/rsvg-ft.c: (rsvg_ft_get_glyph): * librsvg/test-ft-gtk.c: (set_text): * librsvg/test-ft.c: (save_pixbuf_to_file_internal), (save_pixbuf_to_file): * librsvg/test-rsvg.c: (save_pixbuf_to_file_internal), (save_pixbuf_to_file): * src/file-manager/fm-directory-view.c: (display_pending_files), (compute_menu_item_info): * src/file-manager/fm-icon-view.c: (compute_menu_item_info): * src/file-manager/fm-list-view.c: (get_column_from_attribute): * src/nautilus-application.c: (nautilus_application_startup): * src/nautilus-search-bar-criterion.c: (nautilus_search_bar_criterion_next_new), (nautilus_search_bar_criterion_get_location), (get_date_modified_location_for): * src/nautilus-sidebar-tabs.c: (draw_one_tab_themed), (draw_or_layout_all_tabs): * src/nautilus-toolbar.c: (nautilus_toolbar_size_allocate): * src/nautilus-window-manage-views.c: (nautilus_window_get_current_location_title): * test/test-nautilus-label.c: (justification_changed_callback): Fix all the warnings -Wuninitialized found. Quite a number of them were actual bugs. Turn on -Wuninitialized in configure.in now that ORBit generates warning-free code.
2000-09-05 20:38:10 +00:00
default:
g_assert_not_reached ();
x = 0;
y = 0;
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);
}
static void
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x_offset, int y_offset)
{
void (* affine_function)
(art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride,
const art_u8 *src, int src_width, int src_height, int src_rowstride,
const double affine[6],
ArtFilterLevel level,
ArtAlphaGamma *alpha_gamma);
affine[4] += x_offset;
affine[5] += y_offset;
affine_function = gdk_pixbuf_get_has_alpha (pixbuf)
? art_rgb_rgba_affine
: art_rgb_affine;
(* affine_function)
(buf->buf,
buf->rect.x0, buf->rect.y0,
buf->rect.x1, buf->rect.y1,
buf->buf_rowstride,
gdk_pixbuf_get_pixels (pixbuf),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
gdk_pixbuf_get_rowstride (pixbuf),
affine,
ART_FILTER_NEAREST,
NULL);
affine[4] -= x_offset;
affine[5] -= y_offset;
}
/* shared code to highlight or dim the passed-in pixbuf */
static GdkPixbuf *
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
map_pixbuf (NautilusIconCanvasItem *icon_item)
{
GnomeCanvas *canvas;
char *audio_filename;
GdkPixbuf *temp_pixbuf, *old_pixbuf, *audio_pixbuf;
temp_pixbuf = icon_item->details->pixbuf;
canvas = GNOME_CANVAS_ITEM(icon_item)->canvas;
if (icon_item->details->is_prelit) {
temp_pixbuf = nautilus_create_spotlight_pixbuf (icon_item->details->pixbuf);
/* FIXME bugzilla.eazel.com 2471: This hard-wired image is inappropriate to
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
* this level of code, which shouldn't know that the
* preview is audio, nor should it have an icon
* hard-wired in.
*/
/* if the icon is currently being previewed, superimpose an image to indicate that */
/* audio is the only kind of previewing right now, so this code isn't as general as it could be */
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
if (icon_item->details->is_active) {
/* Load the audio symbol. */
Some build fixes. * acconfig.h: * configure.in: Removed the NAUTILUS_PREFIX that I added. I did it wrong. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_pixmap_file): * components/hardware/nautilus-hardware-view.c: (setup_overview_form): * components/services/startup/nautilus-view/nautilus-service-startup-view.c: (setup_form_title), (setup_signup_form), (setup_config_form): * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf): * libnautilus-extensions/nautilus-icon-factory.c: (make_full_icon_path): * src/nautilus-application.c: (display_caveat): * src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (make_category_link): * src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize): Replaced most uses of gnome_pixmap_file on "nautilus/" with a call to a new nautilus_pixmap_file in an attempt to make installations where nautilus has a different prefix from gnome-libs work. I now think this is a waste of time, but Mathieu Lacage says this is still an improvement. * components/help/Makefile.am: * components/help/hyperbola-filefmt.c: (fmt_map_entry): Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX. * components/websearch/ntl-web-search.c: (web_search_populate_engines): Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX. * components/mozilla/nautilus-mozilla-content-view.c: (nautilus_mozilla_content_view_initialize), (mozilla_content_view_set_busy_cursor), (mozilla_content_view_request_progress_change), (mozilla_content_view_clear_busy_cursor), (mozilla_load_location_callback), (bonobo_mozilla_callback), (mozilla_merge_bonobo_items_callback), (mozilla_title_changed_callback), (mozilla_location_changed_callback), (mozilla_net_status_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_open_uri_callback): Took a cut at fixing the Mozilla component for the new API. Ramiro will have to take care of the rest. * components/services/install/lib/Makefile.am: * components/services/time/command-line/Makefile.am: * components/services/time/nautilus-view/Makefile.am: * components/services/time/service/Makefile.am: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/service/Makefile.am: * libnautilus/Makefile.am: Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested in the form of a patch by Martijn van Beers. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory), (nautilus_get_pixmap_directory): * libnautilus-extensions/nautilus-link-set.c: (get_link_set_document): * src/Makefile.am: * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (get_xml_path), (make_properties_from_directory): * src/nautilus-link-set-window.c: (get_link_set_names): * src/file-manager/Makefile.am: * src/file-manager/fm-properties-window.c: (get_property_names): Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_uri_from_local_path): Added a new helper function for use when you have a path and need a URI. This does a better job than just adding a "file://" on the front. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (get_first_callback), (nautilus_gtk_container_get_first_child): * src/nautilus-window-toolbars.c: (setup_button): * src/nautilus-window.c: (replace_special_current_view_in_content_view_menu): Implemented the first_child function and used it where appropriate. * libnautilus-extensions/nautilus-preferences-item.c: (add_icon_themes): Use nautilus_get_pixmap_directory intead of misusing gnome_pixmap_file by calling it on a directory name. * nautilus-installer/src/support.c: (create_pixmap), (create_image): Added FIXMEs since it isn't clear if this code will work with a Nautilus prefix that's not the same as the gnome-libs prefix. * Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
audio_filename = nautilus_pixmap_file ("audio.png");
if (audio_filename != NULL) {
audio_pixbuf = gdk_pixbuf_new_from_file (audio_filename);
} else {
audio_pixbuf = NULL;
}
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
/* Composite it onto the icon. */
if (audio_pixbuf != NULL) {
gdk_pixbuf_composite
(audio_pixbuf,
temp_pixbuf,
0, 0,
gdk_pixbuf_get_width (temp_pixbuf),
gdk_pixbuf_get_height(temp_pixbuf),
0, 0,
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
canvas->pixels_per_unit,
canvas->pixels_per_unit,
GDK_INTERP_BILINEAR, 0xFF);
gdk_pixbuf_unref (audio_pixbuf);
}
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
g_free (audio_filename);
}
}
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
if (icon_item->details->is_highlighted_for_selection
|| icon_item->details->is_highlighted_for_drop) {
old_pixbuf = temp_pixbuf;
temp_pixbuf = nautilus_create_darkened_pixbuf (temp_pixbuf,
0.8 * 255,
0.8 * 255);
if (old_pixbuf != icon_item->details->pixbuf) {
gdk_pixbuf_unref (old_pixbuf);
}
}
return temp_pixbuf;
}
/* Draw the icon item for non-anti-aliased mode. */
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;
GdkPixbuf *emblem_pixbuf, *temp_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 = map_pixbuf(icon_item);
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);
}
static void draw_dashed_rectangle_aa (guchar *pixels, int rowstride, gboolean has_alpha,
int width, int height, int left, int top, int right, int bottom)
{
guchar red, green, blue, alpha, dash_color, dash_alpha;
guint pixel_offset;
int x, y, x1, y1, x2, y2;
guchar *row_offset, *offset;
int index, dash_width;
dash_width = 1;
pixel_offset = has_alpha ? 4 : 3;
/* main color is black */
red = 0;
green = 0;
blue = 0;
alpha = 255;
/* dask color is white/transparent */
dash_color = 255;
dash_alpha = 0;
/* clip to the buffer bounds */
if (left < 0)
x1 = 0;
else
x1 = left;
if (top < 0)
y1 = 0;
else
y1 = top;
if (right < width) {
x2 = right;
} else {
x2 = width - 1;
}
if (bottom < height) {
y2 = bottom;
} else {
y2 = height - 1;
}
/* Draw top line */
if (top >= 0) {
row_offset = pixels + y1 * rowstride;
offset = row_offset + (x1 * pixel_offset);
index = 0;
for (x = x1; x < x2; x++)
{
if (index < dash_width) {
*(offset++) = red;
*(offset++) = green;
*(offset++) = blue;
} else {
*(offset++) = dash_color;
*(offset++) = dash_color;
*(offset++) = dash_color;
}
if (has_alpha) {
if (index < dash_width) {
*(offset++) = alpha;
} else {
*(offset++) = dash_alpha;
}
}
index++;
if (index > dash_width) {
index = 0;
}
}
}
/* Draw bottom line */
if (bottom < height) {
row_offset = pixels + (y2 -1) * rowstride;
offset = row_offset + (x1 * pixel_offset);
index = 0;
for (x = x1; x < x2; x++)
{
if (index < dash_width) {
*(offset++) = red;
*(offset++) = green;
*(offset++) = blue;
} else {
*(offset++) = dash_color;
*(offset++) = dash_color;
*(offset++) = dash_color;
}
if (has_alpha) {
if (index < dash_width) {
*(offset++) = alpha;
} else {
*(offset++) = dash_alpha;
}
}
index++;
if (index > dash_width) {
index = 0;
}
}
}
/* Draw left line */
row_offset = pixels + y1 * rowstride;
index = 0;
for (y = y1; y < y2; y++)
{
offset = row_offset + (x1 * pixel_offset);
if (index < dash_width) {
*(offset++) = red;
*(offset++) = green;
*(offset++) = blue;
} else {
*(offset++) = dash_color;
*(offset++) = dash_color;
*(offset++) = dash_color;
}
if (has_alpha) {
if (index < dash_width) {
*offset = alpha;
} else {
*offset = dash_alpha;
}
}
row_offset += rowstride;
index++;
if (index > dash_width) {
index = 0;
}
}
/* Draw right line */
row_offset = pixels + y1 * rowstride;
index = 0;
for (y = y1; y < y2; y++)
{
offset = row_offset + ((x2 -1) * pixel_offset);
if (index < dash_width) {
*(offset++) = red;
*(offset++) = green;
*(offset++) = blue;
} else {
*(offset++) = dash_color;
*(offset++) = dash_color;
*(offset++) = dash_color;
}
if (has_alpha) {
if (index < dash_width) {
*offset = alpha;
} else {
*offset = dash_alpha;
}
}
row_offset += rowstride;
index++;
if (index > dash_width) {
index = 0;
}
}
}
static void
draw_focus_rect (GdkPixbuf *pixbuf, int left, int top, int right, int bottom)
{
int rowstride, width, height;
guchar *pixels;
gboolean has_alpha;
g_return_if_fail (pixbuf != NULL);
pixels = gdk_pixbuf_get_pixels (pixbuf);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
draw_dashed_rectangle_aa (pixels, rowstride, has_alpha,
width, height, left, top, right, bottom);
}
static void
draw_or_measure_label_text_aa (NautilusIconCanvasItem *item,
GdkPixbuf *destination_pixbuf,
int icon_left,
int icon_bottom)
{
NautilusIconCanvasItemDetails *details;
int width_so_far, height_so_far;
guint32 label_name_color;
guint32 label_info_color;
GnomeCanvasItem *canvas_item;
int max_text_width;
int icon_width, text_left, box_left;
NautilusTextLayout *icon_text_layout;
char **pieces;
const char *text_piece;
int i;
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;
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 (!have_editable && !have_additional) {
details->text_height = 0;
details->text_width = 0;
return;
}
/* 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;
canvas_item = GNOME_CANVAS_ITEM (item);
if (destination_pixbuf == NULL ) {
icon_width = 0;
} else {
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
}
max_text_width = floor (nautilus_icon_canvas_item_get_max_text_width (item));
label_name_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), TRUE);
label_info_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), FALSE);
pieces = g_strsplit (combined_text, "\n", 0);
for (i = 0; (text_piece = pieces[i]) != NULL; i++) {
guint32 label_color;
if (needs_highlight) {
if (i == 0) {
label_color = highlight_text_color;
}
else {
label_color = highlight_text_info_color;
}
} else {
if (i == 0) {
label_color = label_name_color;
}
else {
label_color = label_info_color;
}
}
/* Replace empty string with space for measurement and drawing.
* This makes empty lines appear, instead of being collapsed out.
*/
if (text_piece[0] == '\0') {
text_piece = " ";
}
icon_text_layout = nautilus_text_layout_new (details->smooth_font,
details->smooth_font_size,
text_piece,
LINE_BREAK_CHARACTERS,
max_text_width,
TRUE);
/* Draw text if we are not in user rename mode */
if (destination_pixbuf != NULL && !details->is_renaming) {
gboolean underlined;
text_left = icon_left + (icon_width - icon_text_layout->width) / 2;
/* if it's prelit, and we're in click-to-activate mode, underline the text */
underlined = (details->is_prelit && in_single_click_mode ());
/* draw the shadow in black */
if (needs_highlight) {
icon_bottom += 3; /* leave some space for selection frame */
text_left -= 1;
nautilus_text_layout_paint (icon_text_layout,
destination_pixbuf,
text_left + 2,
icon_bottom + height_so_far + 1,
GTK_JUSTIFY_CENTER,
NAUTILUS_RGB_COLOR_BLACK,
FALSE,
underlined);
}
nautilus_text_layout_paint (icon_text_layout,
destination_pixbuf,
text_left,
icon_bottom + height_so_far,
GTK_JUSTIFY_CENTER,
label_color,
FALSE,
underlined);
/* if it's highlighted, embolden by drawing twice */
if (needs_highlight) {
nautilus_text_layout_paint (icon_text_layout,
destination_pixbuf,
text_left + 1,
icon_bottom + height_so_far,
GTK_JUSTIFY_CENTER,
label_color,
FALSE,
underlined);
}
}
width_so_far = MAX (width_so_far, icon_text_layout->width);
height_so_far += icon_text_layout->height;
nautilus_text_layout_free (icon_text_layout);
}
g_strfreev (pieces);
/* add some extra space for highlighting */
if (needs_highlight) {
height_so_far += 8; /* extra slop for nicer highlighting */
width_so_far += 15; /* account for emboldening, plus extra to make it look nicer */
}
if (destination_pixbuf != 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);
box_left = icon_left + (icon_width - width_so_far) / 2;
/* Indicate keyboard selection by framing the text with a gray-stippled rectangle */
if (details->is_highlighted_as_keyboard_focus) {
draw_focus_rect (destination_pixbuf, 0, 0, width_so_far - 1, height_so_far - 1);
}
} else {
/* If measuring, remember the width & height. */
details->text_width = width_so_far;
details->text_height = height_so_far;
}
g_free (combined_text);
}
static void
draw_label_text_aa (NautilusIconCanvasItem *icon_item, GnomeCanvasBuf *buf, double i2c[6], int x_delta)
{
GdkPixbuf *text_pixbuf;
NautilusIconContainer *container;
gboolean needs_highlight;
gboolean have_editable;
gboolean have_additional;
/* make sure this is really necessary */
have_editable = icon_item->details->editable_text != NULL
&& icon_item->details->editable_text[0] != '\0';
have_additional = icon_item->details->additional_text != NULL
&& icon_item->details->additional_text[0] != '\0';
/* No font or no text, then do no work. */
if (icon_item->details->smooth_font == NULL
|| (!have_editable && !have_additional)) {
icon_item->details->text_height = 0;
icon_item->details->text_width = 0;
return;
}
if (icon_item->details->is_renaming) {
/* FIXME bugzilla.eazel.com 2472:
* Why is it OK to leave text_height and
* text_width alone in this code path?
*/
return;
}
/* Set up the background. */
needs_highlight = icon_item->details->is_highlighted_for_selection
|| icon_item->details->is_highlighted_for_drop;
if (needs_highlight) {
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
text_pixbuf = nautilus_stretch_frame_image (container->details->highlight_frame, 9, 8, 9, 8,
icon_item->details->text_width,
icon_item->details->text_height, TRUE);
} else {
text_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
TRUE,
8,
icon_item->details->text_width,
icon_item->details->text_height);
nautilus_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
NAUTILUS_RGBA_COLOR_PACK (0, 0, 0, 0));
}
draw_or_measure_label_text_aa (icon_item, text_pixbuf, x_delta, 0);
/* Draw the pixbuf containing the label. */
i2c[4] -= x_delta;
draw_pixbuf_aa (text_pixbuf, buf, i2c, 0, 0);
i2c[4] += x_delta;
gdk_pixbuf_unref (text_pixbuf);
}
/* draw the item for anti-aliased mode */
static void
nautilus_icon_canvas_item_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
{
ArtIRect icon_rect, emblem_rect;
EmblemLayout emblem_layout;
GdkPixbuf *emblem_pixbuf, *temp_pixbuf;
NautilusIconCanvasItem *icon_item;
double i2c[6];
int x_delta;
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
/* map the pixbuf for selection or other effects */
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
temp_pixbuf = map_pixbuf (icon_item);
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
/* Compute the affine transform, but force the scale to 1.0
* because the icon factory does the scaling for us.
*/
gnome_canvas_item_i2c_affine (item, i2c);
i2c[0] = 1.0;
i2c[3] = 1.0;
/* force it to integer pixel boundaries to avoid losing some of the left edge */
i2c[4] = floor (i2c[4]);
i2c[5] = floor (i2c[5]);
if (buf->is_bg) {
gnome_canvas_buf_ensure_buf (buf);
buf->is_bg = FALSE;
}
/* draw the icon */
draw_pixbuf_aa (temp_pixbuf, buf, i2c, 0, 0);
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
if (temp_pixbuf != icon_item->details->pixbuf) {
gdk_pixbuf_unref (temp_pixbuf);
}
/* draw the emblems */
get_icon_canvas_rectangle (icon_item, &icon_rect);
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0 - icon_rect.x0,
emblem_rect.y0 - icon_rect.y0);
}
/* draw the stretch handles */
draw_stretch_handles_aa (icon_item, buf, &icon_rect);
/* draw the text */
i2c[5] += icon_rect.y1 - icon_rect.y0;
x_delta = (icon_item->details->text_width - (icon_rect.x1 - icon_rect.x0)) / 2;
draw_label_text_aa (icon_item, buf, i2c, x_delta);
}
/* 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);
/* FIXME bugzilla.eazel.com 2473:
* We should emit our own signal here,
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
* not one from the container; it could hook
* up to that signal and emit one of its
* own. Doing it this way hard-codes what
* "user_data" is. Also, the two signals
* should be separate. The "unpreview" signal
* does not have a return value.
*/
icon_item->details->is_active = nautilus_icon_container_emit_preview_signal
(NAUTILUS_ICON_CONTAINER (item->canvas),
NAUTILUS_ICON_CANVAS_ITEM (item)->user_data,
TRUE);
}
return TRUE;
case GDK_LEAVE_NOTIFY:
if (icon_item->details->is_prelit
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
|| 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.
*/
/* FIXME bugzilla.eazel.com 2473:
* We should emit our own signal here,
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
* not one from the containe; it could hook up
* to that signal and emit one of its
* ownr. Doing it this way hard-codes what
* "user_data" is. Also, the two signals
* should be separate. The "unpreview" signal
* does not have a return value.
*/
nautilus_icon_container_emit_preview_signal
(NAUTILUS_ICON_CONTAINER (item->canvas),
NAUTILUS_ICON_CANVAS_ITEM (item)->user_data,
FALSE);
icon_item->details->is_prelit = FALSE;
icon_item->details->is_active = 0;
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;
}
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 whether the item is in smooth mode */
static gboolean
icon_canvas_item_is_smooth (const NautilusIconCanvasItem *icon_item)
{
GnomeCanvas *parent_canvas;
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item), FALSE);
parent_canvas = GNOME_CANVAS (GNOME_CANVAS_ITEM (icon_item)->canvas);
return parent_canvas->aa;
}
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 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;
char *knob_filename;
GdkPixbuf *knob_pixbuf;
int knob_width, knob_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
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
}
knob_filename = nautilus_theme_get_image_path ("knob.png");
knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename);
knob_width = gdk_pixbuf_get_width (knob_pixbuf);
knob_height = gdk_pixbuf_get_height (knob_pixbuf);
g_free(knob_filename);
gdk_pixbuf_unref(knob_pixbuf);
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 + knob_width
|| probe_canvas_rect->x1 >= icon_rect.x1 - knob_width)
&& (probe_canvas_rect->y0 < icon_rect.y0 + knob_height
|| probe_canvas_rect->y1 >= icon_rect.y1 - knob_height);
}
gboolean
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +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
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;
}
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
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
Some icon layout fixes. * libnautilus-extensions/nautilus-icon-canvas-item.h: * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf), (draw_label_text_aa), (nautilus_icon_canvas_item_render), (nautilus_icon_canvas_item_event), (nautilus_icon_canvas_item_hit_test_stretch_handles), (nautilus_icon_canvas_item_get_max_text_width): Added comments and FIXMEs and fixed formatting. Removed unused functions and changed all the functions to return values in world coordinates rather than doing some in canvas coordinates. * libnautilus-extensions/nautilus-icon-container.c: (nautilus_gtk_adjustment_set_value): Added a function that clamps to the scroll bar range. The original in Gtk allows scrolling past the end of where the scroll bar does. (scroll): Call the new function. This fixes the "auto-scroll past edge of the screen" problem. (reveal_icon): Use the new function even though it shouldn't matter here. (set_scroll_region): Add some padding on the left and right and fix some of the math. Also use the new function to clamp the value instead of trying to do it by hand here. I think this fixes the dancing icon problem. (get_icon_space_width), (lay_down_one_line), (relayout): Wrote new layout code that works more simply and is closer to the layout we want. This fixes a few bugs, but for now it's only for auto layout -- I still need to fix manual layout. (nautilus_icon_container_update_icon): Made the maximum size for icons take the X and Y scale factors into account too. Now we probably need maximum scale factors, but without this stretching was quite broken. (nautilus_icon_container_start_renaming_selected_item): Simplified some of the renaming code to require a bit less from the canvas item. (nautilus_icon_container_emit_preview_signal): Let booleans be booleans. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-private.h: Moved nautilus_icon_container_set_anti_aliased_mode into the private header.
2000-06-23 17:51:53 +00:00
double
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
nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
{
GnomeCanvasItem *canvas_item;
canvas_item = GNOME_CANVAS_ITEM (item);
if (nautilus_icon_container_is_tighter_layout (NAUTILUS_ICON_CONTAINER (canvas_item->canvas))) {
return MAX_TEXT_WIDTH_TIGHTER * canvas_item->canvas->pixels_per_unit;
} else {
return MAX_TEXT_WIDTH_STANDARD * canvas_item->canvas->pixels_per_unit;
}
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
}
void
nautilus_icon_canvas_item_set_smooth_font (NautilusIconCanvasItem *icon_item,
NautilusScalableFont *font)
{
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
g_return_if_fail (NAUTILUS_IS_SCALABLE_FONT (font));
gtk_object_unref (GTK_OBJECT (icon_item->details->smooth_font));
gtk_object_ref (GTK_OBJECT (font));
icon_item->details->smooth_font = font;
/* Only need to update if in smooth mode */
if (icon_canvas_item_is_smooth (icon_item)) {
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (icon_item));
}
}
void
nautilus_icon_canvas_item_set_smooth_font_size (NautilusIconCanvasItem *icon_item,
guint font_size)
{
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
g_return_if_fail (font_size > 0);
if (icon_item->details->smooth_font_size == font_size) {
return;
}
icon_item->details->smooth_font_size = font_size;
/* Only need to update if in smooth mode */
if (icon_canvas_item_is_smooth (icon_item)) {
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (icon_item));
}
}