2000-01-31 01:30:16 +00:00
|
|
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
/* Nautilus - Icon canvas item class for icon container.
|
2000-01-25 21:17:05 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2000 Eazel, Inc
|
|
|
|
*
|
2000-03-09 03:09:37 +00:00
|
|
|
* Author: Andy Hertzfeld <andy@eazel.com>
|
2000-01-25 21:17:05 +00:00
|
|
|
*
|
|
|
|
* 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>
|
2000-03-22 00:29:07 +00:00
|
|
|
#include "nautilus-icon-canvas-item.h"
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-01-31 01:30:16 +00:00
|
|
|
#include <math.h>
|
2000-02-07 20:34:11 +00:00
|
|
|
#include <string.h>
|
2000-02-22 10:09:59 +00:00
|
|
|
#include <stdio.h>
|
2000-03-17 23:03:39 +00:00
|
|
|
#include <gtk/gtksignal.h>
|
2000-01-25 21:17:05 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
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>
|
2000-03-22 00:29:07 +00:00
|
|
|
#include "nautilus-icon-private.h"
|
2000-02-07 20:34:11 +00:00
|
|
|
#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"
|
2000-03-16 21:10:42 +00:00
|
|
|
#include "nautilus-gdk-extensions.h"
|
2000-04-04 01:00:13 +00:00
|
|
|
#include "nautilus-gdk-pixbuf-extensions.h"
|
Some of the underlying work to prepare for emblems on the icons.
* style-guide.html: Some minor updates to the style guide,
including rules about headers.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icons_for_file),
(nautilus_scalable_icon_get), (nautilus_icon_factor_clear),
(nautilus_icon_factory_load_file),
(nautilus_gdk_pixbuf_composite_corner),
(nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash),
(nautilus_scalable_icon_equal),
(nautilus_icon_factory_get_icon_for_file), (load_specific_image):
Added interface for getting emblem icons for a file, and got rid
of the symbolic-link overlay that was previously built into the
icon.
* libnautilus/gnome-icon-container.c (update_icon):
Get pixbufs for all emblems and pass into the icon object.
* libnautilus/nautilus-icons-controller.c
(nautius_icons_controller_get_icon_image):
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c
(fm_icons_controller_get_icon_image): Return a list of emblem
images along with the main image.
* libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_set_emblems),
(nautilus_icons_view_icon_item_destroy): Keep a list of emblem
pixbufs in each icon. We don't draw them quite yet.
* libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c:
(nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref),
(nautilus_gdk_pixbuf_list_free): Convenience functions for
manipulating lists of GdkPixbuf objects.
* libnautilus/nautilus-directory.h,
libnautilus/nautilus-directory.c: (nautilus_file_list_ref),
(nautilus_file_list_unref), (nautilus_file_list_free): Convenience
functions for manipulating lists of NautilusFile objects. Also got
rid of NautilusFileList typedef.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.h:
(nautilus_scalable_icon_list_free): Convenience function for
manipulating lists of NautilusScalableIcon objects.
* libnautilus/nautilus-glib-extensions.h,
libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal):
Function to compare two GLists to see if they are
identical. Particularly useful with lists of reference-counted
objects.
* src/file-manager/fm-directory-view-icons.c
(fm_directory_view_icons_destroy),
(add_icon_if_already_positioned),
(fm_directory_view_icons_append_selection_context_menu_items),
(display_icons_not_already_positioned),
(fm_direectory_view_icons_get_selection):
src/file-manager/fm-directory-view-list.c
(fm_directory_view_list_get_selection):
src/file-manager/fm-directory-view.c (display_selection_info),
(display_pending_files), (add_files_cb), (open_in_new_window_cb),
(fm_directory_view_real_append_selection_context_menu_items): Got
rid of use of NautilusFileList typedef, corrected ref. counting of
files in the lists by using new calls.
* src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c,
src/nautilus-index-tabs.c,
src/file-manager/fm-directory-view-icons.c,
src/file-manager/fm-directory-view.c,
src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
|
|
|
#include "nautilus-gtk-macros.h"
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
#include "nautilus-gnome-extensions.h"
|
2000-03-25 00:36:57 +00:00
|
|
|
#include "nautilus-graphic-effects.h"
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-06 22:09:29 +00:00
|
|
|
#define STRETCH_HANDLE_THICKNESS 5
|
2000-03-09 21:09:20 +00:00
|
|
|
#define EMBLEM_SPACING 2
|
2000-03-21 23:18:01 +00:00
|
|
|
#define MAX_TEXT_WIDTH 80
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
|
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. */
|
2000-01-25 21:17:05 +00:00
|
|
|
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;
|
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;
|
2000-01-25 21:17:05 +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
|
|
|
/* Size of the text at current font. */
|
|
|
|
int text_width;
|
|
|
|
int text_height;
|
2000-01-25 21:17:05 +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
|
|
|
/* Highlight state. */
|
|
|
|
guint is_highlighted_for_selection : 1;
|
2000-03-21 23:18:01 +00:00
|
|
|
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;
|
2000-03-09 03:09:37 +00:00
|
|
|
guint is_prelit : 1;
|
2000-04-17 21:07:33 +00:00
|
|
|
|
|
|
|
gboolean is_renaming;
|
2000-01-31 01:30:16 +00:00
|
|
|
};
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Object argument IDs. */
|
2000-01-25 21:17:05 +00:00
|
|
|
enum {
|
|
|
|
ARG_0,
|
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,
|
2000-03-21 23:18:01 +00:00
|
|
|
ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS,
|
2000-02-22 10:09:59 +00:00
|
|
|
ARG_HIGHLIGHTED_FOR_DROP,
|
2000-04-12 21:32:24 +00:00
|
|
|
ARG_MODIFIER
|
2000-01-25 21:17:05 +00:00
|
|
|
};
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
typedef enum {
|
|
|
|
RIGHT_SIDE,
|
|
|
|
BOTTOM_SIDE,
|
|
|
|
LEFT_SIDE,
|
|
|
|
TOP_SIDE
|
|
|
|
} RectangleSide;
|
|
|
|
|
|
|
|
typedef struct {
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
2000-03-07 01:10:04 +00:00
|
|
|
ArtIRect icon_rect;
|
|
|
|
RectangleSide side;
|
|
|
|
int position;
|
|
|
|
GList *emblem;
|
|
|
|
} EmblemLayout;
|
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
enum {
|
|
|
|
BOUNDS_CHANGED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
2000-05-12 06:28:32 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
static guint signals[LAST_SIGNAL];
|
|
|
|
|
2000-05-12 06:28:32 +00:00
|
|
|
static GdkColor highlight_background_color;
|
|
|
|
static GdkColor highlight_text_color;
|
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* GtkObject */
|
2000-03-22 00:29:07 +00:00
|
|
|
static void nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class);
|
|
|
|
static void nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *item);
|
2000-04-14 01:19:53 +00:00
|
|
|
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);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* GnomeCanvasItem */
|
2000-04-14 01:19:53 +00:00
|
|
|
static void nautilus_icon_canvas_item_update (GnomeCanvasItem *item,
|
|
|
|
double *affine,
|
|
|
|
ArtSVP *clip_path,
|
|
|
|
int flags);
|
|
|
|
static void nautilus_icon_canvas_item_draw (GnomeCanvasItem *item,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
static double nautilus_icon_canvas_item_point (GnomeCanvasItem *item,
|
|
|
|
double x,
|
|
|
|
double y,
|
|
|
|
int cx,
|
|
|
|
int cy,
|
|
|
|
GnomeCanvasItem **actual_item);
|
|
|
|
static void nautilus_icon_canvas_item_bounds (GnomeCanvasItem *item,
|
|
|
|
double *x1,
|
|
|
|
double *y1,
|
|
|
|
double *x2,
|
|
|
|
double *y2);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* private */
|
2000-04-14 01:19:53 +00:00
|
|
|
static void draw_or_measure_label_text (NautilusIconCanvasItem *item,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom);
|
|
|
|
static void draw_label_text (NautilusIconCanvasItem *item,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom);
|
|
|
|
static void measure_label_text (NautilusIconCanvasItem *item);
|
|
|
|
static void get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
|
|
|
|
ArtIRect *rect);
|
|
|
|
static void emblem_layout_reset (EmblemLayout *layout,
|
|
|
|
NautilusIconCanvasItem *icon_item,
|
|
|
|
const ArtIRect *icon_rect);
|
|
|
|
static gboolean emblem_layout_next (EmblemLayout *layout,
|
|
|
|
GdkPixbuf **emblem_pixbuf,
|
|
|
|
ArtIRect *emblem_rect);
|
|
|
|
static void draw_pixbuf (GdkPixbuf *pixbuf,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int x,
|
|
|
|
int y);
|
|
|
|
static gboolean hit_test_stretch_handle (NautilusIconCanvasItem *item,
|
|
|
|
const ArtIRect *canvas_rect);
|
2000-03-07 01:10:04 +00:00
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusIconCanvasItem, nautilus_icon_canvas_item, GNOME_TYPE_CANVAS_ITEM)
|
2000-01-25 21:17:05 +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
|
|
|
/* Class initialization function for the icon canvas item. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GnomeCanvasItemClass *item_class;
|
|
|
|
|
2000-01-31 01:30:16 +00:00
|
|
|
object_class = GTK_OBJECT_CLASS (class);
|
|
|
|
item_class = GNOME_CANVAS_ITEM_CLASS (class);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
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);
|
2000-03-22 00:29:07 +00:00
|
|
|
gtk_object_add_arg_type ("NautilusIconCanvasItem::font",
|
2000-03-28 01:30:14 +00:00
|
|
|
GTK_TYPE_BOXED, GTK_ARG_READWRITE, ARG_FONT);
|
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);
|
2000-03-22 00:29:07 +00:00
|
|
|
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_as_keyboard_focus",
|
2000-03-21 23:18:01 +00:00
|
|
|
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS);
|
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);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
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;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
signals[BOUNDS_CHANGED]
|
|
|
|
= gtk_signal_new ("bounds_changed",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
2000-03-22 00:29:07 +00:00
|
|
|
GTK_SIGNAL_OFFSET (NautilusIconCanvasItemClass,
|
2000-03-17 23:03:39 +00:00
|
|
|
bounds_changed),
|
|
|
|
gtk_marshal_NONE__POINTER,
|
|
|
|
GTK_TYPE_NONE, 1,
|
|
|
|
GTK_TYPE_POINTER);
|
|
|
|
|
|
|
|
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
item_class->update = nautilus_icon_canvas_item_update;
|
|
|
|
item_class->draw = nautilus_icon_canvas_item_draw;
|
|
|
|
item_class->point = nautilus_icon_canvas_item_point;
|
|
|
|
item_class->bounds = nautilus_icon_canvas_item_bounds;
|
|
|
|
item_class->event = nautilus_icon_canvas_item_event;
|
2000-05-12 06:28:32 +00:00
|
|
|
|
|
|
|
/* set up the highlight colors - soon, get these from preferences */
|
|
|
|
gdk_color_parse ("rgb:00/00/00", &highlight_background_color);
|
|
|
|
gdk_color_parse ("rgb:FF/FF/FF", &highlight_text_color);
|
2000-01-25 21:17:05 +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
|
|
|
/* Object initialization function for the icon item. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *icon_item)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
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;
|
2000-04-17 21:07:33 +00:00
|
|
|
|
|
|
|
icon_item->details->is_renaming = FALSE;
|
2000-01-25 21:17:05 +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
|
|
|
/* Destroy handler for the icon canvas item. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_destroy (GtkObject *object)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
|
|
|
GnomeCanvasItem *item;
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (object));
|
2000-01-25 21:17:05 +00:00
|
|
|
|
|
|
|
item = GNOME_CANVAS_ITEM (object);
|
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;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
|
|
|
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) {
|
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);
|
2000-04-17 21:07:33 +00:00
|
|
|
g_free (details->editable_text);
|
|
|
|
g_free (details->additional_text);
|
2000-03-29 02:02:45 +00:00
|
|
|
if (details->font != NULL) {
|
|
|
|
gdk_font_unref (details->font);
|
|
|
|
}
|
2000-04-12 21:32:24 +00:00
|
|
|
|
2000-01-31 01:30:16 +00:00
|
|
|
g_free (details);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-01-31 01:30:16 +00:00
|
|
|
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
2000-01-25 21:17:05 +00:00
|
|
|
}
|
|
|
|
|
2000-03-06 22:09:29 +00:00
|
|
|
/* 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)
|
|
|
|
{
|
2000-04-11 15:11:19 +00:00
|
|
|
return gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB
|
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))
|
2000-03-07 01:10:04 +00:00
|
|
|
&& gdk_pixbuf_get_bits_per_sample (pixbuf) == 8;
|
2000-03-06 22:09:29 +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
|
|
|
/* Set_arg handler for the icon item. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
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;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
|
|
|
switch (arg_id) {
|
|
|
|
|
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
|
|
|
}
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
g_free (details->additional_text);
|
|
|
|
details->additional_text = g_strdup (GTK_VALUE_STRING (*arg));
|
2000-01-25 21:17:05 +00:00
|
|
|
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
|
|
|
}
|
2000-01-25 21:17:05 +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;
|
2000-01-25 21:17:05 +00:00
|
|
|
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);
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
2000-01-26 00:29:08 +00:00
|
|
|
|
2000-03-21 23:18:01 +00:00
|
|
|
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
|
|
|
}
|
2000-03-21 23:18:01 +00:00
|
|
|
details->is_highlighted_as_keyboard_focus = GTK_VALUE_BOOL (*arg);
|
2000-01-26 00:29:08 +00:00
|
|
|
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);
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
2000-02-22 10:09:59 +00:00
|
|
|
|
2000-01-25 21:17:05 +00:00
|
|
|
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;
|
2000-01-25 21:17:05 +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
|
|
|
|
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));
|
2000-01-25 21:17:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get_arg handler for the icon item */
|
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-01-31 01:30:16 +00:00
|
|
|
switch (arg_id) {
|
|
|
|
|
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);
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
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;
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
2000-03-28 01:30:14 +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_SELECTION:
|
|
|
|
GTK_VALUE_BOOL (*arg) = details->is_highlighted_for_selection;
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-21 23:18:01 +00:00
|
|
|
case ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS:
|
|
|
|
GTK_VALUE_BOOL (*arg) = details->is_highlighted_as_keyboard_focus;
|
2000-01-26 00:29:08 +00:00
|
|
|
break;
|
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;
|
2000-01-25 21:17:05 +00:00
|
|
|
break;
|
2000-02-22 10:09:59 +00:00
|
|
|
|
2000-01-25 21:17:05 +00:00
|
|
|
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
|
|
|
{
|
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
|
|
|
|
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
|
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
|
|
|
{
|
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
|
|
|
|
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
|
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)
|
|
|
|
{
|
2000-03-06 22:09:29 +00:00
|
|
|
GList *p;
|
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
|
2000-03-06 22:09:29 +00:00
|
|
|
|
2000-02-24 07:09:32 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2000-03-06 22:09:29 +00:00
|
|
|
/* 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));
|
|
|
|
}
|
|
|
|
|
2000-03-10 03:20:54 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
recompute_bounding_box (NautilusIconCanvasItem *icon_item)
|
2000-01-25 21:17:05 +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
|
|
|
/* The bounds stored in the item is the same as what get_bounds
|
2000-03-10 03:20:54 +00:00
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
2000-01-25 21:17:05 +00:00
|
|
|
GnomeCanvasItem *item;
|
2000-03-10 03:20:54 +00:00
|
|
|
ArtPoint top_left, bottom_right;
|
|
|
|
double i2c[6];
|
2000-01-25 21:17:05 +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
|
|
|
item = GNOME_CANVAS_ITEM (icon_item);
|
2000-03-10 03:20:54 +00:00
|
|
|
|
|
|
|
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
|
|
|
}
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_update_bounds (NautilusIconCanvasItem *item)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-17 23:03:39 +00:00
|
|
|
ArtIRect before, after;
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-17 23:03:39 +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);
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
/* 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));
|
2000-01-25 21:17:05 +00:00
|
|
|
}
|
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
/* Update handler for the icon canvas item. */
|
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_update (GnomeCanvasItem *item,
|
2000-03-17 23:03:39 +00:00
|
|
|
double *affine,
|
|
|
|
ArtSVP *clip_path,
|
|
|
|
int flags)
|
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_update_bounds (NAUTILUS_ICON_CANVAS_ITEM (item));
|
2000-03-17 23:03:39 +00:00
|
|
|
nautilus_gnome_canvas_item_request_redraw (item);
|
|
|
|
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, update, (item, affine, clip_path, flags));
|
|
|
|
}
|
2000-01-25 21:17:05 +00:00
|
|
|
|
|
|
|
/* Rendering */
|
|
|
|
|
2000-04-08 01:59:16 +00:00
|
|
|
/* routine to underline the text in a gnome_icon_text structure */
|
|
|
|
|
|
|
|
static void
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
gnome_icon_underline_text (GnomeIconTextInfo *text_info, GdkDrawable *drawable, GdkGC *gc, int x, int y)
|
2000-04-08 01:59:16 +00:00
|
|
|
{
|
|
|
|
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;
|
2000-04-08 01:59:16 +00:00
|
|
|
GnomeIconTextInfoRow *row;
|
|
|
|
int xpos;
|
|
|
|
|
|
|
|
y += text_info->font->ascent;
|
|
|
|
|
|
|
|
for (item = text_info->rows; item; item = item->next) {
|
|
|
|
if (item->data) {
|
|
|
|
row = item->data;
|
|
|
|
xpos = (text_info->width - row->width) / 2;
|
|
|
|
text_width = gdk_text_width_wc(text_info->font, row->text_wc, row->text_length);
|
|
|
|
gdk_draw_line(drawable, gc, x + xpos, y + 1, x + xpos + text_width, y + 1);
|
|
|
|
|
|
|
|
y += text_info->baseline_skip;
|
|
|
|
} else
|
|
|
|
y += text_info->baseline_skip / 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
/* Draw the text in a box, using gnomelib routines. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
draw_or_measure_label_text (NautilusIconCanvasItem *item,
|
2000-03-17 23:03:39 +00:00
|
|
|
GdkDrawable *drawable,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-04-17 21:07:33 +00:00
|
|
|
int width_so_far, height_so_far;
|
|
|
|
GdkGC* gc;
|
2000-05-12 06:28:32 +00:00
|
|
|
GdkGCValues save_gc;
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
int max_text_width;
|
|
|
|
int icon_width, text_left, box_left;
|
2000-01-31 22:25:21 +00:00
|
|
|
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;
|
2000-05-12 06:28:32 +00:00
|
|
|
gboolean have_editable, have_additional, needs_highlight;
|
2000-02-02 20:18:57 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
details = item->details;
|
2000-05-12 06:28:32 +00:00
|
|
|
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;
|
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;
|
|
|
|
}
|
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);
|
2000-04-19 00:24:42 +00:00
|
|
|
|
2000-02-02 20:18:57 +00:00
|
|
|
width_so_far = 0;
|
|
|
|
height_so_far = 0;
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
|
|
|
|
if (drawable != NULL) {
|
2000-03-07 01:10:04 +00:00
|
|
|
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
|
2000-03-17 23:03:39 +00:00
|
|
|
gc = gdk_gc_new (GNOME_CANVAS_ITEM (item)->canvas->layout.bin_window);
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
}
|
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
max_text_width = floor (MAX_TEXT_WIDTH * GNOME_CANVAS_ITEM (item)->canvas->pixels_per_unit);
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
|
2000-05-12 06:28:32 +00:00
|
|
|
/* if the icon is highlighted, do some set-up */
|
|
|
|
|
|
|
|
if (needs_highlight && drawable != NULL) {
|
|
|
|
GnomeCanvasItem *canvas_item = GNOME_CANVAS_ITEM(item);
|
|
|
|
gdk_gc_get_values(gc, &save_gc);
|
|
|
|
|
|
|
|
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas_item->canvas)), &highlight_background_color, FALSE, TRUE);
|
|
|
|
gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas_item->canvas)), &highlight_text_color, FALSE, TRUE);
|
|
|
|
|
|
|
|
gdk_gc_set_foreground(gc, &highlight_background_color);
|
|
|
|
|
|
|
|
gdk_draw_rectangle (drawable, gc, TRUE, icon_left + (icon_width - details->text_width) / 2, icon_bottom, details->text_width, details->text_height);
|
|
|
|
gdk_gc_set_foreground(gc, &highlight_text_color);
|
|
|
|
}
|
|
|
|
|
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++) {
|
2000-02-04 02:40:56 +00:00
|
|
|
/* 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.
|
2000-02-04 02:40:56 +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 (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
|
|
|
}
|
2000-01-31 22:25:21 +00:00
|
|
|
|
2000-02-02 20:18:57 +00:00
|
|
|
icon_text_info = gnome_icon_layout_text
|
2000-03-28 01:30:14 +00:00
|
|
|
(details->font, text_piece, " -_,;.?/&", max_text_width, TRUE);
|
2000-01-31 22:25:21 +00:00
|
|
|
|
2000-04-19 00:24:42 +00:00
|
|
|
/* Draw text if we are not in user rename mode */
|
2000-04-17 21:07:33 +00:00
|
|
|
if (drawable != NULL && details->is_renaming == FALSE) {
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
text_left = icon_left + (icon_width - icon_text_info->width) / 2;
|
2000-05-12 06:28:32 +00:00
|
|
|
|
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
gnome_icon_paint_text (icon_text_info, drawable, gc,
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
text_left, icon_bottom + height_so_far, GTK_JUSTIFY_CENTER);
|
2000-05-12 06:28:32 +00:00
|
|
|
|
|
|
|
/* if it's highlighted, embolden by drawing twice */
|
|
|
|
if (needs_highlight)
|
2000-03-28 01:30:14 +00:00
|
|
|
gnome_icon_paint_text (icon_text_info, drawable, gc,
|
2000-05-12 06:28:32 +00:00
|
|
|
text_left + 1, icon_bottom + height_so_far, GTK_JUSTIFY_CENTER);
|
|
|
|
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
|
2000-04-08 01:59:16 +00:00
|
|
|
/* if it's prelit, underline the text */
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
if (details->is_prelit) {
|
|
|
|
gnome_icon_underline_text (icon_text_info, drawable, gc, text_left + 1, icon_bottom + height_so_far);
|
2000-05-12 06:28:32 +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
|
|
|
}
|
2000-01-31 22:25:21 +00:00
|
|
|
}
|
|
|
|
|
2000-02-02 20:18:57 +00:00
|
|
|
width_so_far = MAX (width_so_far, icon_text_info->width);
|
|
|
|
height_so_far += icon_text_info->height;
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
|
|
|
|
gnome_icon_text_info_free (icon_text_info);
|
2000-01-31 01:30:16 +00:00
|
|
|
}
|
2000-02-02 20:18:57 +00:00
|
|
|
g_strfreev (pieces);
|
2000-05-12 06:28:32 +00:00
|
|
|
|
|
|
|
if (needs_highlight && drawable != NULL)
|
|
|
|
gdk_gc_set_foreground(gc, &save_gc.foreground);
|
2000-01-31 01:30:16 +00:00
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
height_so_far += 2; /* extra slop for nicer highlighting */
|
2000-05-12 06:28:32 +00:00
|
|
|
if (needs_highlight)
|
|
|
|
width_so_far += 2; /* account for emboldening */
|
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
if (drawable != NULL) {
|
|
|
|
/* Current calculations should match what we measured before drawing.
|
|
|
|
* This assumes that we will always make a separate call to measure
|
|
|
|
* before the call to draw. We might later decide to use this function
|
|
|
|
* differently and change these asserts.
|
|
|
|
*/
|
2000-02-02 20:18:57 +00:00
|
|
|
g_assert (height_so_far == details->text_height);
|
|
|
|
g_assert (width_so_far == details->text_width);
|
2000-01-31 22:25:21 +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
|
|
|
box_left = icon_left + (icon_width - width_so_far) / 2;
|
2000-01-31 22:25:21 +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
|
|
|
/* indicate keyboard selection by framing the text with a gray-stippled rectangle */
|
2000-03-21 23:18:01 +00:00
|
|
|
if (details->is_highlighted_as_keyboard_focus) {
|
2000-04-08 01:05:59 +00:00
|
|
|
gdk_gc_set_stipple (gc, nautilus_stipple_bitmap ());
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
gdk_gc_set_fill (gc, GDK_STIPPLED);
|
|
|
|
gdk_draw_rectangle (drawable, gc, FALSE,
|
|
|
|
box_left, icon_bottom - 2,
|
|
|
|
width_so_far, 2 + height_so_far);
|
2000-01-31 22:25:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2000-02-02 20:18:57 +00:00
|
|
|
/* 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;
|
2000-02-02 20:18:57 +00:00
|
|
|
}
|
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);
|
2000-02-02 20:18:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
measure_label_text (NautilusIconCanvasItem *item)
|
2000-02-02 20:18:57 +00:00
|
|
|
{
|
2000-03-17 23:03:39 +00:00
|
|
|
draw_or_measure_label_text (item, NULL, 0, 0);
|
2000-02-02 20:18:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
draw_label_text (NautilusIconCanvasItem *item, GdkDrawable *drawable,
|
2000-02-02 20:18:57 +00:00
|
|
|
int icon_left, int icon_bottom)
|
|
|
|
{
|
2000-03-17 23:03:39 +00:00
|
|
|
draw_or_measure_label_text (item, drawable, icon_left, icon_bottom);
|
2000-01-25 21:17:05 +00:00
|
|
|
}
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
draw_stretch_handles (NautilusIconCanvasItem *item, GdkDrawable *drawable,
|
2000-03-07 01:10:04 +00:00
|
|
|
const ArtIRect *rect)
|
|
|
|
{
|
|
|
|
GdkGC *gc;
|
|
|
|
|
|
|
|
if (!item->details->show_stretch_handles) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gc = gdk_gc_new (drawable);
|
|
|
|
|
|
|
|
gdk_draw_rectangle (drawable, gc, TRUE,
|
|
|
|
rect->x0,
|
|
|
|
rect->y0,
|
|
|
|
STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS);
|
|
|
|
gdk_draw_rectangle (drawable, gc, TRUE,
|
|
|
|
rect->x1 - STRETCH_HANDLE_THICKNESS,
|
|
|
|
rect->y0,
|
|
|
|
STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS);
|
|
|
|
gdk_draw_rectangle (drawable, gc, TRUE,
|
|
|
|
rect->x0,
|
|
|
|
rect->y1 - STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS);
|
|
|
|
gdk_draw_rectangle (drawable, gc, TRUE,
|
|
|
|
rect->x1 - STRETCH_HANDLE_THICKNESS,
|
|
|
|
rect->y1 - STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS,
|
|
|
|
STRETCH_HANDLE_THICKNESS);
|
|
|
|
|
2000-04-08 01:05:59 +00:00
|
|
|
gdk_gc_set_stipple (gc, nautilus_stipple_bitmap ());
|
2000-03-07 01:10:04 +00:00
|
|
|
gdk_gc_set_fill (gc, GDK_STIPPLED);
|
|
|
|
gdk_draw_rectangle (drawable, gc, FALSE,
|
|
|
|
rect->x0 + (STRETCH_HANDLE_THICKNESS - 1) / 2,
|
|
|
|
rect->y0 + (STRETCH_HANDLE_THICKNESS - 1) / 2,
|
|
|
|
rect->x1 - rect->x0 - (STRETCH_HANDLE_THICKNESS - 1) - 1,
|
|
|
|
rect->y1 - rect->y0 - (STRETCH_HANDLE_THICKNESS - 1) - 1);
|
|
|
|
|
|
|
|
gdk_gc_unref (gc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
emblem_layout_reset (EmblemLayout *layout, NautilusIconCanvasItem *icon_item, const ArtIRect *icon_rect)
|
2000-03-07 01:10:04 +00:00
|
|
|
{
|
|
|
|
layout->icon_item = icon_item;
|
|
|
|
layout->icon_rect = *icon_rect;
|
|
|
|
layout->side = RIGHT_SIDE;
|
|
|
|
layout->position = 0;
|
|
|
|
layout->emblem = icon_item->details->emblem_pixbufs;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
emblem_layout_next (EmblemLayout *layout,
|
|
|
|
GdkPixbuf **emblem_pixbuf,
|
|
|
|
ArtIRect *emblem_rect)
|
|
|
|
{
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
int width, height, x, y;
|
|
|
|
|
|
|
|
/* Check if we have layed out all of the pixbufs. */
|
|
|
|
if (layout->emblem == NULL) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the pixbuf. */
|
|
|
|
pixbuf = layout->emblem->data;
|
|
|
|
width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
height = gdk_pixbuf_get_height (pixbuf);
|
|
|
|
|
|
|
|
/* Advance to the next emblem. */
|
|
|
|
layout->emblem = layout->emblem->next;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
|
|
|
/* Find the side to lay out along. */
|
|
|
|
switch (layout->side) {
|
|
|
|
case RIGHT_SIDE:
|
|
|
|
x = layout->icon_rect.x1;
|
|
|
|
y = layout->icon_rect.y0;
|
|
|
|
break;
|
|
|
|
case BOTTOM_SIDE:
|
|
|
|
x = layout->icon_rect.x1;
|
|
|
|
y = layout->icon_rect.y1;
|
|
|
|
break;
|
|
|
|
case LEFT_SIDE:
|
|
|
|
x = layout->icon_rect.x0;
|
|
|
|
y = layout->icon_rect.y1;
|
|
|
|
break;
|
|
|
|
case TOP_SIDE:
|
|
|
|
x = layout->icon_rect.x0;
|
|
|
|
y = layout->icon_rect.y0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (layout->position != 0) {
|
|
|
|
switch (layout->side) {
|
|
|
|
case RIGHT_SIDE:
|
|
|
|
y += layout->position + height / 2;
|
|
|
|
break;
|
|
|
|
case BOTTOM_SIDE:
|
|
|
|
x -= layout->position + width / 2;
|
|
|
|
break;
|
|
|
|
case LEFT_SIDE:
|
|
|
|
y -= layout->position + height / 2;
|
|
|
|
break;
|
|
|
|
case TOP_SIDE:
|
|
|
|
x += layout->position + width / 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check to see if emblem fits in current side. */
|
2000-03-09 21:09:20 +00:00
|
|
|
if (x >= layout->icon_rect.x0 && x <= layout->icon_rect.x1
|
|
|
|
&& y >= layout->icon_rect.y0 && y <= layout->icon_rect.y1) {
|
2000-03-07 01:10:04 +00:00
|
|
|
|
|
|
|
/* 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)
|
|
|
|
{
|
2000-04-27 17:18:04 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 703:
|
|
|
|
* Dither would be better if we passed dither values.
|
|
|
|
*/
|
2000-03-07 01:10:04 +00:00
|
|
|
gdk_pixbuf_render_to_drawable_alpha (pixbuf, drawable, 0, 0, x, y,
|
|
|
|
gdk_pixbuf_get_width (pixbuf),
|
|
|
|
gdk_pixbuf_get_height (pixbuf),
|
|
|
|
GDK_PIXBUF_ALPHA_BILEVEL, 128, GDK_RGB_DITHER_MAX,
|
|
|
|
0, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
/* Draw the icon item. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
2000-03-29 02:02:45 +00:00
|
|
|
int x, int y, int width, int height)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-03-07 01:10:04 +00:00
|
|
|
ArtIRect icon_rect, emblem_rect;
|
|
|
|
EmblemLayout emblem_layout;
|
2000-03-29 02:02:45 +00:00
|
|
|
GdkPixbuf *emblem_pixbuf, *temp_pixbuf, *old_pixbuf;
|
2000-04-17 21:07:33 +00:00
|
|
|
|
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. */
|
2000-03-07 01:10:04 +00:00
|
|
|
if (details->pixbuf == NULL) {
|
|
|
|
return;
|
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
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Compute icon rectangle in drawable coordinates. */
|
2000-03-17 23:03:39 +00:00
|
|
|
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
2000-03-07 01:10:04 +00:00
|
|
|
icon_rect.x0 -= x;
|
|
|
|
icon_rect.y0 -= y;
|
|
|
|
icon_rect.x1 -= x;
|
|
|
|
icon_rect.y1 -= y;
|
2000-03-09 03:09:37 +00:00
|
|
|
|
2000-03-26 05:20:55 +00:00
|
|
|
/* if the pre-lit or selection flag is set, make a pre-lit or darkened pixbuf and draw that instead */
|
2000-03-07 01:10:04 +00:00
|
|
|
|
2000-03-28 01:54:17 +00:00
|
|
|
temp_pixbuf = details->pixbuf;
|
|
|
|
|
2000-03-29 02:02:45 +00:00
|
|
|
if (details->is_prelit) {
|
|
|
|
temp_pixbuf = nautilus_create_spotlight_pixbuf (details->pixbuf);
|
|
|
|
}
|
2000-03-28 01:54:17 +00:00
|
|
|
|
2000-04-07 20:31:42 +00:00
|
|
|
if (details->is_highlighted_for_selection || details->is_highlighted_for_drop) {
|
2000-03-29 02:02:45 +00:00
|
|
|
old_pixbuf = temp_pixbuf;
|
|
|
|
temp_pixbuf = nautilus_create_darkened_pixbuf (temp_pixbuf,
|
2000-03-30 19:30:54 +00:00
|
|
|
0.8 * 255,
|
|
|
|
0.8 * 255);
|
2000-03-29 02:02:45 +00:00
|
|
|
if (old_pixbuf != details->pixbuf) {
|
|
|
|
gdk_pixbuf_unref (old_pixbuf);
|
|
|
|
}
|
2000-03-28 01:54:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
draw_pixbuf (temp_pixbuf, drawable, icon_rect.x0, icon_rect.y0);
|
2000-03-29 02:02:45 +00:00
|
|
|
if (temp_pixbuf != details->pixbuf) {
|
|
|
|
gdk_pixbuf_unref (temp_pixbuf);
|
|
|
|
}
|
2000-03-07 01:10:04 +00:00
|
|
|
|
|
|
|
/* 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
|
|
|
}
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Draw stretching handles (if necessary). */
|
|
|
|
draw_stretch_handles (icon_item, drawable, &icon_rect);
|
|
|
|
|
2000-02-22 10:09:59 +00:00
|
|
|
/* Draw the label text. */
|
2000-03-17 23:03:39 +00:00
|
|
|
draw_label_text (icon_item, drawable, icon_rect.x0, icon_rect.y1);
|
2000-01-25 21:17:05 +00:00
|
|
|
}
|
|
|
|
|
2000-03-09 03:09:37 +00:00
|
|
|
/* handle events */
|
|
|
|
|
2000-03-09 21:09:20 +00:00
|
|
|
static int
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_event (GnomeCanvasItem *item, GdkEvent *event)
|
2000-03-09 03:09:37 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
2000-03-09 21:09:20 +00:00
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
|
2000-03-09 21:09:20 +00:00
|
|
|
|
2000-03-09 03:09:37 +00:00
|
|
|
switch (event->type) {
|
2000-03-09 21:09:20 +00:00
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
if (!icon_item->details->is_prelit) {
|
|
|
|
icon_item->details->is_prelit = TRUE;
|
|
|
|
gnome_canvas_item_request_update (item);
|
|
|
|
}
|
2000-03-14 05:55:03 +00:00
|
|
|
return TRUE;
|
2000-03-09 03:09:37 +00:00
|
|
|
|
2000-03-09 21:09:20 +00:00
|
|
|
case GDK_LEAVE_NOTIFY:
|
2000-04-11 10:09:28 +00:00
|
|
|
if (icon_item->details->is_prelit
|
|
|
|
|| icon_item->details->is_highlighted_for_drop) {
|
|
|
|
/* When leaving, turn of the prelight state and the
|
|
|
|
* higlighted for drop. The latter gets turned on
|
|
|
|
* by the drag&drop motion callback.
|
|
|
|
*/
|
2000-03-09 21:09:20 +00:00
|
|
|
icon_item->details->is_prelit = FALSE;
|
2000-04-11 10:09:28 +00:00
|
|
|
icon_item->details->is_highlighted_for_drop = FALSE;
|
2000-03-09 21:09:20 +00:00
|
|
|
gnome_canvas_item_request_update (item);
|
|
|
|
}
|
2000-03-14 05:55:03 +00:00
|
|
|
return TRUE;
|
2000-03-09 21:09:20 +00:00
|
|
|
|
|
|
|
default:
|
2000-03-14 05:55:03 +00:00
|
|
|
/* Don't eat up other events; icon container might use them. */
|
|
|
|
return FALSE;
|
2000-03-09 21:09:20 +00:00
|
|
|
}
|
2000-03-09 03:09:37 +00:00
|
|
|
}
|
|
|
|
|
2000-03-10 03:20:54 +00:00
|
|
|
static void
|
Moved the "embedded text" feature into the icon factory and
NautilusFile.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(metafile_read_close), (nautilus_metafile_read_cancel),
(metafile_read_failed), (metafile_read_complete),
(metafile_read_callback), (metafile_read_some),
(metafile_read_open_callback), (metafile_read_start),
(nautilus_directory_request_read_metafile), (metafile_write_done),
(metafile_write_failed), (metafile_write_callback),
(metafile_write_create_callback), (nautilus_metafile_write_start),
(metafile_write), (lacks_top_left), (wants_top_left),
(has_problem), (select_needy_file), (count_lines),
(top_left_read_done), (top_left_read_failed),
(top_left_read_complete), (top_left_read_close),
(top_left_read_callback), (top_left_read_some),
(top_left_open_callback), (start_getting_top_lefts),
(state_changed):
Added code to read top lefts of files in the background.
Restructured things to accomodate this new code nicely with
a minimum of copy and paste (there still was plenty of copy
and paste so there's room for improvement).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_destroy):
Name changes from above required revising some asserts.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_top_left_text): Now it returns something
besides just NULL.
(nautilus_extract_top_left_text): Function that remembers only
the part of the top left text that we want to keep around.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER),
(nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER):
Needed some new marshal functions.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_initialize_class),
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_arg),
(nautilus_icon_canvas_item_get_arg),
(nautilus_icon_canvas_item_get_image),
(nautilus_icon_canvas_item_set_image),
(nautilus_icon_canvas_item_draw):
Removed the old embedded text support. It came with a whole lot
of baggage, also removed.
* libnautilus-extensions/nautilus-icon-container.h:
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon): Moved pixbuf computing code
into the FMIconView class. We might decide later to move it back
again, but for now the embedded text makes it easier to do it
this way.
(nautilus_icon_container_initialize_class): Merged
get_icon_editable_text and get_icon_additional_text back into
a single signal that gets both.
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_dnd_begin_drag): Updated for change in icon factory
API.
* src/file-manager/fm-directory-view.c: (finish_loading_uri):
Ask for top-left text attribute for all directories.
* src/file-manager/fm-icon-view.c: (get_icon_images_callback):
Moved pixbuf computing code into the FMIconView class. We might
decide later to move it back again, but for now the embedded text
makes it easier to do it this way.
(get_icon_text_callback): Merged get_icon_editable_text and
get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
|
|
|
compute_text_rectangle (NautilusIconCanvasItem *item,
|
|
|
|
const ArtIRect *icon_rect,
|
|
|
|
ArtIRect *text_rect)
|
2000-03-10 03:20:54 +00:00
|
|
|
{
|
|
|
|
/* 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;
|
|
|
|
}
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
static void
|
Moved the "embedded text" feature into the icon factory and
NautilusFile.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(metafile_read_close), (nautilus_metafile_read_cancel),
(metafile_read_failed), (metafile_read_complete),
(metafile_read_callback), (metafile_read_some),
(metafile_read_open_callback), (metafile_read_start),
(nautilus_directory_request_read_metafile), (metafile_write_done),
(metafile_write_failed), (metafile_write_callback),
(metafile_write_create_callback), (nautilus_metafile_write_start),
(metafile_write), (lacks_top_left), (wants_top_left),
(has_problem), (select_needy_file), (count_lines),
(top_left_read_done), (top_left_read_failed),
(top_left_read_complete), (top_left_read_close),
(top_left_read_callback), (top_left_read_some),
(top_left_open_callback), (start_getting_top_lefts),
(state_changed):
Added code to read top lefts of files in the background.
Restructured things to accomodate this new code nicely with
a minimum of copy and paste (there still was plenty of copy
and paste so there's room for improvement).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_destroy):
Name changes from above required revising some asserts.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_top_left_text): Now it returns something
besides just NULL.
(nautilus_extract_top_left_text): Function that remembers only
the part of the top left text that we want to keep around.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER),
(nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER):
Needed some new marshal functions.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_initialize_class),
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_arg),
(nautilus_icon_canvas_item_get_arg),
(nautilus_icon_canvas_item_get_image),
(nautilus_icon_canvas_item_set_image),
(nautilus_icon_canvas_item_draw):
Removed the old embedded text support. It came with a whole lot
of baggage, also removed.
* libnautilus-extensions/nautilus-icon-container.h:
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon): Moved pixbuf computing code
into the FMIconView class. We might decide later to move it back
again, but for now the embedded text makes it easier to do it
this way.
(nautilus_icon_container_initialize_class): Merged
get_icon_editable_text and get_icon_additional_text back into
a single signal that gets both.
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_dnd_begin_drag): Updated for change in icon factory
API.
* src/file-manager/fm-directory-view.c: (finish_loading_uri):
Ask for top-left text attribute for all directories.
* src/file-manager/fm-icon-view.c: (get_icon_images_callback):
Moved pixbuf computing code into the FMIconView class. We might
decide later to move it back again, but for now the embedded text
makes it easier to do it this way.
(get_icon_text_callback): Merged get_icon_editable_text and
get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
|
|
|
compute_editable_text_rectangle (NautilusIconCanvasItem *item,
|
|
|
|
const ArtIRect *icon_rect,
|
|
|
|
ArtIRect *text_rect)
|
2000-04-17 21:07:33 +00:00
|
|
|
{
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
int text_width, text_height;
|
|
|
|
|
|
|
|
g_assert (item->details->editable_text != NULL);
|
2000-04-17 21:07:33 +00:00
|
|
|
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
/* Get editable text dimensions */
|
|
|
|
text_width = gdk_text_width (item->details->font, item->details->editable_text,
|
|
|
|
strlen (item->details->editable_text));
|
|
|
|
text_height = gdk_text_height (item->details->font, item->details->editable_text,
|
|
|
|
strlen (item->details->editable_text));
|
2000-04-17 21:07:33 +00:00
|
|
|
|
|
|
|
/* Compute text rectangle. */
|
|
|
|
text_rect->x0 = (icon_rect->x0 + icon_rect->x1) / 2 - text_width / 2;
|
|
|
|
text_rect->y0 = icon_rect->y1;
|
|
|
|
text_rect->x1 = text_rect->x0 + text_width;
|
|
|
|
text_rect->y1 = text_rect->y0 + text_height;
|
|
|
|
}
|
|
|
|
|
Some of the underlying work to prepare for emblems on the icons.
* style-guide.html: Some minor updates to the style guide,
including rules about headers.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icons_for_file),
(nautilus_scalable_icon_get), (nautilus_icon_factor_clear),
(nautilus_icon_factory_load_file),
(nautilus_gdk_pixbuf_composite_corner),
(nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash),
(nautilus_scalable_icon_equal),
(nautilus_icon_factory_get_icon_for_file), (load_specific_image):
Added interface for getting emblem icons for a file, and got rid
of the symbolic-link overlay that was previously built into the
icon.
* libnautilus/gnome-icon-container.c (update_icon):
Get pixbufs for all emblems and pass into the icon object.
* libnautilus/nautilus-icons-controller.c
(nautius_icons_controller_get_icon_image):
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c
(fm_icons_controller_get_icon_image): Return a list of emblem
images along with the main image.
* libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_set_emblems),
(nautilus_icons_view_icon_item_destroy): Keep a list of emblem
pixbufs in each icon. We don't draw them quite yet.
* libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c:
(nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref),
(nautilus_gdk_pixbuf_list_free): Convenience functions for
manipulating lists of GdkPixbuf objects.
* libnautilus/nautilus-directory.h,
libnautilus/nautilus-directory.c: (nautilus_file_list_ref),
(nautilus_file_list_unref), (nautilus_file_list_free): Convenience
functions for manipulating lists of NautilusFile objects. Also got
rid of NautilusFileList typedef.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.h:
(nautilus_scalable_icon_list_free): Convenience function for
manipulating lists of NautilusScalableIcon objects.
* libnautilus/nautilus-glib-extensions.h,
libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal):
Function to compare two GLists to see if they are
identical. Particularly useful with lists of reference-counted
objects.
* src/file-manager/fm-directory-view-icons.c
(fm_directory_view_icons_destroy),
(add_icon_if_already_positioned),
(fm_directory_view_icons_append_selection_context_menu_items),
(display_icons_not_already_positioned),
(fm_direectory_view_icons_get_selection):
src/file-manager/fm-directory-view-list.c
(fm_directory_view_list_get_selection):
src/file-manager/fm-directory-view.c (display_selection_info),
(display_pending_files), (add_files_cb), (open_in_new_window_cb),
(fm_directory_view_real_append_selection_context_menu_items): Got
rid of use of NautilusFileList typedef, corrected ref. counting of
files in the lists by using new calls.
* src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c,
src/nautilus-index-tabs.c,
src/file-manager/fm-directory-view-icons.c,
src/file-manager/fm-directory-view.c,
src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
|
|
|
static gboolean
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
hit_test_pixbuf (GdkPixbuf *pixbuf, const ArtIRect *pixbuf_location, const ArtIRect *probe_rect)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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;
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-22 19:36:44 +00:00
|
|
|
/* You can get here without a pixbuf in some strange cases. */
|
2000-03-07 01:10:04 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Check to see if it's within the rectangle at all. */
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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;
|
|
|
|
}
|
2000-03-07 01:10:04 +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 there's no alpha channel, it's opaque and we have a hit. */
|
2000-03-07 01:10:04 +00:00
|
|
|
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;
|
|
|
|
}
|
2000-03-07 01:10:04 +00:00
|
|
|
g_assert (gdk_pixbuf_get_n_channels (pixbuf) == 4);
|
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. */
|
2000-03-22 19:36:44 +00:00
|
|
|
for (x = relative_rect.x0; x < relative_rect.x1; x++) {
|
|
|
|
for (y = relative_rect.y0; y < relative_rect.y1; y++) {
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
pixel = gdk_pixbuf_get_pixels (pixbuf)
|
|
|
|
+ y * gdk_pixbuf_get_rowstride (pixbuf)
|
|
|
|
+ x * 4;
|
|
|
|
if (pixel[3] >= 128) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
2000-03-07 01:10:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2000-03-22 00:29:07 +00:00
|
|
|
hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect)
|
2000-03-07 01:10:04 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-03-10 03:20:54 +00:00
|
|
|
ArtIRect icon_rect, text_rect, emblem_rect;
|
2000-03-07 01:10:04 +00:00
|
|
|
EmblemLayout emblem_layout;
|
|
|
|
GdkPixbuf *emblem_pixbuf;
|
|
|
|
|
|
|
|
details = icon_item->details;
|
|
|
|
|
|
|
|
/* Check for hits in the stretch handles. */
|
2000-03-21 23:18:01 +00:00
|
|
|
if (hit_test_stretch_handle (icon_item, canvas_rect)) {
|
2000-03-07 01:10:04 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for hit in the icon. */
|
2000-03-17 23:03:39 +00:00
|
|
|
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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;
|
|
|
|
}
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-03-10 03:20:54 +00:00
|
|
|
/* 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) {
|
2000-03-10 03:20:54 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* 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)) {
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) {
|
2000-03-07 01:10:04 +00:00
|
|
|
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
|
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
|
|
|
{
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +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;
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
canvas_rect.x0 = cx;
|
|
|
|
canvas_rect.y0 = cy;
|
Fixed typo that broke all hit testing except for rubber band selection!
* libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_point):
Fixed typo that broke all hit testing except for rubber band
selection! (Sorry.)
* libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection, set_uri_list_selection),
libnautilus/gnome-icon-container-private.h,
libnautilus/gnome-icon-container.h,
libnautilus/gnome-icon-container.c
(gnome_icon_container_get_icon_uri,
gnome_icon_container_initialize_class, gnome_icon_container_new,
update_icon, gnome_icon_container_update,
gnome_icon_container_request_update),
src/file-manager/fm-directory-view-icons.c (create_icon_container,
get_icon_images_cb, get_icon_uri_cb, get_icon_text_cb,
get_icon_property_cb): Change code that used to use a separate
controller object to just use signals on the icon container
instead.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c,
src/file-manager/fm-directory-view.c: Add new signal marshal
functions as needed and changed the name of one of the old
functions.
* libnautilus/Makefile.am,
libnautilus/nautilus-icons-controller.h,
libnautilus/nautilus-icons-controller.c,
src/file-manager/Makefile.am,
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c: Removed the old controller
object, it was a bad idea.
2000-03-11 00:46:40 +00:00
|
|
|
canvas_rect.x1 = cx + 1;
|
|
|
|
canvas_rect.y1 = cy + 1;
|
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 {
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
/* 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
|
|
|
}
|
2000-01-25 21:17:05 +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. */
|
2000-01-25 21:17:05 +00:00
|
|
|
static void
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_bounds (GnomeCanvasItem *item,
|
|
|
|
double *x1, double *y1, double *x2, double *y2)
|
2000-01-25 21:17:05 +00:00
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
|
|
|
NautilusIconCanvasItemDetails *details;
|
2000-03-07 01:10:04 +00:00
|
|
|
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;
|
2000-03-07 01:10:04 +00:00
|
|
|
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);
|
|
|
|
|
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;
|
2000-03-07 01:10:04 +00:00
|
|
|
|
2000-03-17 23:03:39 +00:00
|
|
|
measure_label_text (icon_item);
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* 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) {
|
2000-03-07 01:10:04 +00:00
|
|
|
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 {
|
2000-03-07 01:10:04 +00:00
|
|
|
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
|
|
|
}
|
2000-01-31 01:30:16 +00:00
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Compute text rectangle. */
|
2000-03-10 03:20:54 +00:00
|
|
|
compute_text_rectangle (icon_item, &icon_rect, &text_rect);
|
2000-03-07 01:10:04 +00:00
|
|
|
|
|
|
|
/* 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);
|
2000-01-25 21:17:05 +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
|
|
|
|
|
|
|
/* Return the result. */
|
|
|
|
pixels_per_unit = item->canvas->pixels_per_unit;
|
2000-03-07 01:10:04 +00:00
|
|
|
*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
|
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;
|
2000-01-31 01:30:16 +00:00
|
|
|
|
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);
|
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;
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
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
|
2000-03-22 00:29:07 +00:00
|
|
|
get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
|
2000-03-21 23:18:01 +00:00
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
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
|
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
|
|
|
{
|
2000-03-22 00:29:07 +00:00
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
g_return_if_fail (show_stretch_handles == FALSE || show_stretch_handles == TRUE);
|
|
|
|
|
Some of the underlying work to prepare for emblems on the icons.
* style-guide.html: Some minor updates to the style guide,
including rules about headers.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icons_for_file),
(nautilus_scalable_icon_get), (nautilus_icon_factor_clear),
(nautilus_icon_factory_load_file),
(nautilus_gdk_pixbuf_composite_corner),
(nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash),
(nautilus_scalable_icon_equal),
(nautilus_icon_factory_get_icon_for_file), (load_specific_image):
Added interface for getting emblem icons for a file, and got rid
of the symbolic-link overlay that was previously built into the
icon.
* libnautilus/gnome-icon-container.c (update_icon):
Get pixbufs for all emblems and pass into the icon object.
* libnautilus/nautilus-icons-controller.c
(nautius_icons_controller_get_icon_image):
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c
(fm_icons_controller_get_icon_image): Return a list of emblem
images along with the main image.
* libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_set_emblems),
(nautilus_icons_view_icon_item_destroy): Keep a list of emblem
pixbufs in each icon. We don't draw them quite yet.
* libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c:
(nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref),
(nautilus_gdk_pixbuf_list_free): Convenience functions for
manipulating lists of GdkPixbuf objects.
* libnautilus/nautilus-directory.h,
libnautilus/nautilus-directory.c: (nautilus_file_list_ref),
(nautilus_file_list_unref), (nautilus_file_list_free): Convenience
functions for manipulating lists of NautilusFile objects. Also got
rid of NautilusFileList typedef.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.h:
(nautilus_scalable_icon_list_free): Convenience function for
manipulating lists of NautilusScalableIcon objects.
* libnautilus/nautilus-glib-extensions.h,
libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal):
Function to compare two GLists to see if they are
identical. Particularly useful with lists of reference-counted
objects.
* src/file-manager/fm-directory-view-icons.c
(fm_directory_view_icons_destroy),
(add_icon_if_already_positioned),
(fm_directory_view_icons_append_selection_context_menu_items),
(display_icons_not_already_positioned),
(fm_direectory_view_icons_get_selection):
src/file-manager/fm-directory-view-list.c
(fm_directory_view_list_get_selection):
src/file-manager/fm-directory-view.c (display_selection_info),
(display_pending_files), (add_files_cb), (open_in_new_window_cb),
(fm_directory_view_real_append_selection_context_menu_items): Got
rid of use of NautilusFileList typedef, corrected ref. counting of
files in the lists by using new calls.
* src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c,
src/nautilus-index-tabs.c,
src/file-manager/fm-directory-view-icons.c,
src/file-manager/fm-directory-view.c,
src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
|
|
|
if (!item->details->show_stretch_handles == !show_stretch_handles) {
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
return;
|
Some of the underlying work to prepare for emblems on the icons.
* style-guide.html: Some minor updates to the style guide,
including rules about headers.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icons_for_file),
(nautilus_scalable_icon_get), (nautilus_icon_factor_clear),
(nautilus_icon_factory_load_file),
(nautilus_gdk_pixbuf_composite_corner),
(nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash),
(nautilus_scalable_icon_equal),
(nautilus_icon_factory_get_icon_for_file), (load_specific_image):
Added interface for getting emblem icons for a file, and got rid
of the symbolic-link overlay that was previously built into the
icon.
* libnautilus/gnome-icon-container.c (update_icon):
Get pixbufs for all emblems and pass into the icon object.
* libnautilus/nautilus-icons-controller.c
(nautius_icons_controller_get_icon_image):
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c
(fm_icons_controller_get_icon_image): Return a list of emblem
images along with the main image.
* libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_set_emblems),
(nautilus_icons_view_icon_item_destroy): Keep a list of emblem
pixbufs in each icon. We don't draw them quite yet.
* libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c:
(nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref),
(nautilus_gdk_pixbuf_list_free): Convenience functions for
manipulating lists of GdkPixbuf objects.
* libnautilus/nautilus-directory.h,
libnautilus/nautilus-directory.c: (nautilus_file_list_ref),
(nautilus_file_list_unref), (nautilus_file_list_free): Convenience
functions for manipulating lists of NautilusFile objects. Also got
rid of NautilusFileList typedef.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.h:
(nautilus_scalable_icon_list_free): Convenience function for
manipulating lists of NautilusScalableIcon objects.
* libnautilus/nautilus-glib-extensions.h,
libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal):
Function to compare two GLists to see if they are
identical. Particularly useful with lists of reference-counted
objects.
* src/file-manager/fm-directory-view-icons.c
(fm_directory_view_icons_destroy),
(add_icon_if_already_positioned),
(fm_directory_view_icons_append_selection_context_menu_items),
(display_icons_not_already_positioned),
(fm_direectory_view_icons_get_selection):
src/file-manager/fm-directory-view-list.c
(fm_directory_view_list_get_selection):
src/file-manager/fm-directory-view.c (display_selection_info),
(display_pending_files), (add_files_cb), (open_in_new_window_cb),
(fm_directory_view_real_append_selection_context_menu_items): Got
rid of use of NautilusFileList typedef, corrected ref. counting of
files in the lists by using new calls.
* src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c,
src/nautilus-index-tabs.c,
src/file-manager/fm-directory-view-icons.c,
src/file-manager/fm-directory-view.c,
src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
|
|
|
}
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
|
|
|
|
item->details->show_stretch_handles = show_stretch_handles;
|
|
|
|
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if one of the stretch handles was hit. */
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
static gboolean
|
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
|
|
|
{
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
ArtIRect icon_rect;
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
|
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
|
|
|
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
/* Quick check to see if the rect hits the icon at all. */
|
2000-03-17 23:03:39 +00:00
|
|
|
get_icon_canvas_rectangle (item, &icon_rect);
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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
|
|
|
}
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
/* Check for hits in the stretch handles. */
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
return (probe_canvas_rect->x0 < icon_rect.x0 + STRETCH_HANDLE_THICKNESS
|
|
|
|
|| probe_canvas_rect->x1 >= icon_rect.x1 - STRETCH_HANDLE_THICKNESS)
|
|
|
|
&& (probe_canvas_rect->y0 < icon_rect.y0 + STRETCH_HANDLE_THICKNESS
|
|
|
|
|| probe_canvas_rect->y1 >= icon_rect.y1 - STRETCH_HANDLE_THICKNESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_hit_test_stretch_handles (NautilusIconCanvasItem *item,
|
|
|
|
const ArtPoint *world_point)
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
{
|
|
|
|
ArtIRect canvas_rect;
|
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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;
|
2000-03-21 23:18:01 +00:00
|
|
|
return hit_test_stretch_handle (item, &canvas_rect);
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2000-03-22 00:29:07 +00:00
|
|
|
nautilus_icon_canvas_item_hit_test_rectangle (NautilusIconCanvasItem *item,
|
|
|
|
const ArtDRect *world_rect)
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
{
|
|
|
|
ArtIRect canvas_rect;
|
|
|
|
|
2000-03-22 00:29:07 +00:00
|
|
|
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
|
Fixed rubber banding to hit test with all the parts of the icon, not just
* libnautilus/Makefile.am, libnautilus/gnome-icon-container-dnd.c
(set_gnome_icon_list_selection,
gnome_icon_container_dnd_begin_drag),
libnautilus/gnome-icon-container.c (icon_is_in_region,
start_stretching), libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c (hit_stretch_handle,
hit_test_pixbuf, hit_test, nautilus_icons_view_icon_item_point,
nautilus_icons_view_icon_item_get_icon_world_rectangle,
nautilus_icons_view_icon_item_get_icon_rectangle,
nautilus_icons_view_icon_item_get_icon_window_rectangle,
nautilus_icons_view_icon_item_get_hit_stretch_handle,
hit_stretch_handle,
nautilus_icons_view_icon_item_hit_test_stretch_handles,
nautilus_icons_view_icon_item_hit_test_rectangle):
Fixed rubber banding to hit test with all the parts of the icon,
not just the icon pixbuf itself. Did this by changing all the
internal hit testing to use rects instead of points. At the same
time changed the external interface to always use world
coordinates for clarity.
* libnautilus/nautilus-directory.c (compare_file_with_name),
libnautilus/nautilus-file.c (nautilus_file_set_keywords): Fixed
some void * problems that upset newer versions of GCC but not the
older one that I'm using.
* libnautilus/nautilus-gtk-extensions.h,
libnautilus/nautilus-gtk-extensions.c: Formatting and include
statements fix up.
2000-03-10 22:47:48 +00:00
|
|
|
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
|
|
|
}
|
2000-04-17 21:07:33 +00:00
|
|
|
|
2000-04-19 00:24:42 +00:00
|
|
|
|
|
|
|
/* Return coordinates of icon text location */
|
|
|
|
void
|
|
|
|
nautilus_icon_canvas_item_get_text_bounds (NautilusIconCanvasItem *icon_item,
|
Moved the "embedded text" feature into the icon factory and
NautilusFile.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(metafile_read_close), (nautilus_metafile_read_cancel),
(metafile_read_failed), (metafile_read_complete),
(metafile_read_callback), (metafile_read_some),
(metafile_read_open_callback), (metafile_read_start),
(nautilus_directory_request_read_metafile), (metafile_write_done),
(metafile_write_failed), (metafile_write_callback),
(metafile_write_create_callback), (nautilus_metafile_write_start),
(metafile_write), (lacks_top_left), (wants_top_left),
(has_problem), (select_needy_file), (count_lines),
(top_left_read_done), (top_left_read_failed),
(top_left_read_complete), (top_left_read_close),
(top_left_read_callback), (top_left_read_some),
(top_left_open_callback), (start_getting_top_lefts),
(state_changed):
Added code to read top lefts of files in the background.
Restructured things to accomodate this new code nicely with
a minimum of copy and paste (there still was plenty of copy
and paste so there's room for improvement).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_destroy):
Name changes from above required revising some asserts.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_top_left_text): Now it returns something
besides just NULL.
(nautilus_extract_top_left_text): Function that remembers only
the part of the top left text that we want to keep around.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER),
(nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER):
Needed some new marshal functions.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_initialize_class),
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_arg),
(nautilus_icon_canvas_item_get_arg),
(nautilus_icon_canvas_item_get_image),
(nautilus_icon_canvas_item_set_image),
(nautilus_icon_canvas_item_draw):
Removed the old embedded text support. It came with a whole lot
of baggage, also removed.
* libnautilus-extensions/nautilus-icon-container.h:
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon): Moved pixbuf computing code
into the FMIconView class. We might decide later to move it back
again, but for now the embedded text makes it easier to do it
this way.
(nautilus_icon_container_initialize_class): Merged
get_icon_editable_text and get_icon_additional_text back into
a single signal that gets both.
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_dnd_begin_drag): Updated for change in icon factory
API.
* src/file-manager/fm-directory-view.c: (finish_loading_uri):
Ask for top-left text attribute for all directories.
* src/file-manager/fm-icon-view.c: (get_icon_images_callback):
Moved pixbuf computing code into the FMIconView class. We might
decide later to move it back again, but for now the embedded text
makes it easier to do it this way.
(get_icon_text_callback): Merged get_icon_editable_text and
get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
|
|
|
ArtIRect *text_rect)
|
2000-04-19 00:24:42 +00:00
|
|
|
{
|
|
|
|
ArtIRect icon_rect;
|
|
|
|
|
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
|
|
|
|
g_return_if_fail (icon_item->details->editable_text != NULL);
|
|
|
|
g_return_if_fail (text_rect != NULL);
|
|
|
|
|
|
|
|
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
|
|
|
compute_text_rectangle (icon_item, &icon_rect, text_rect);
|
|
|
|
}
|
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
/* Return coordinates of icon editable_text location */
|
|
|
|
void
|
2000-04-19 00:24:42 +00:00
|
|
|
nautilus_icon_canvas_item_get_editable_text_bounds (NautilusIconCanvasItem *icon_item,
|
Moved the "embedded text" feature into the icon factory and
NautilusFile.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(metafile_read_close), (nautilus_metafile_read_cancel),
(metafile_read_failed), (metafile_read_complete),
(metafile_read_callback), (metafile_read_some),
(metafile_read_open_callback), (metafile_read_start),
(nautilus_directory_request_read_metafile), (metafile_write_done),
(metafile_write_failed), (metafile_write_callback),
(metafile_write_create_callback), (nautilus_metafile_write_start),
(metafile_write), (lacks_top_left), (wants_top_left),
(has_problem), (select_needy_file), (count_lines),
(top_left_read_done), (top_left_read_failed),
(top_left_read_complete), (top_left_read_close),
(top_left_read_callback), (top_left_read_some),
(top_left_open_callback), (start_getting_top_lefts),
(state_changed):
Added code to read top lefts of files in the background.
Restructured things to accomodate this new code nicely with
a minimum of copy and paste (there still was plenty of copy
and paste so there's room for improvement).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_destroy):
Name changes from above required revising some asserts.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_top_left_text): Now it returns something
besides just NULL.
(nautilus_extract_top_left_text): Function that remembers only
the part of the top left text that we want to keep around.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER),
(nautilus_gtk_marshal_POINTER__POINTER_INT_INT_POINTER_POINTER):
Needed some new marshal functions.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_initialize_class),
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_arg),
(nautilus_icon_canvas_item_get_arg),
(nautilus_icon_canvas_item_get_image),
(nautilus_icon_canvas_item_set_image),
(nautilus_icon_canvas_item_draw):
Removed the old embedded text support. It came with a whole lot
of baggage, also removed.
* libnautilus-extensions/nautilus-icon-container.h:
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon): Moved pixbuf computing code
into the FMIconView class. We might decide later to move it back
again, but for now the embedded text makes it easier to do it
this way.
(nautilus_icon_container_initialize_class): Merged
get_icon_editable_text and get_icon_additional_text back into
a single signal that gets both.
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_dnd_begin_drag): Updated for change in icon factory
API.
* src/file-manager/fm-directory-view.c: (finish_loading_uri):
Ask for top-left text attribute for all directories.
* src/file-manager/fm-icon-view.c: (get_icon_images_callback):
Moved pixbuf computing code into the FMIconView class. We might
decide later to move it back again, but for now the embedded text
makes it easier to do it this way.
(get_icon_text_callback): Merged get_icon_editable_text and
get_icon_additional_text back into a single signal that gets both.
2000-05-05 17:38:39 +00:00
|
|
|
ArtIRect *text_rect)
|
2000-04-17 21:07:33 +00:00
|
|
|
{
|
|
|
|
ArtIRect icon_rect;
|
|
|
|
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
|
|
|
|
g_return_if_fail (icon_item->details->editable_text != NULL);
|
|
|
|
g_return_if_fail (text_rect != NULL);
|
2000-04-17 21:07:33 +00:00
|
|
|
|
|
|
|
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
|
|
|
compute_editable_text_rectangle (icon_item, &icon_rect, text_rect);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2000-04-19 00:24:42 +00:00
|
|
|
nautilus_icon_canvas_item_get_editable_text (NautilusIconCanvasItem *icon_item)
|
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);
|
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
return icon_item->details->editable_text;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
nautilus_icon_canvas_item_set_renaming (NautilusIconCanvasItem *item, gboolean state)
|
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;
|
|
|
|
}
|
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
item->details->is_renaming = state;
|
|
|
|
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (item));
|
|
|
|
}
|
2000-04-22 04:24:53 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
|
|
|
|
{
|
|
|
|
return MAX_TEXT_WIDTH;
|
|
|
|
}
|