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-05-12 23:08:45 +00:00
|
|
|
#include <libgnome/gnome-i18n.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-09-25 18:20:11 +00:00
|
|
|
#include <libart_lgpl/art_rgb.h>
|
2000-05-22 22:06:46 +00:00
|
|
|
#include <libart_lgpl/art_rgb_affine.h>
|
|
|
|
#include <libart_lgpl/art_rgb_rgba_affine.h>
|
2000-05-30 21:59:07 +00:00
|
|
|
#include <libart_lgpl/art_svp_vpath.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"
|
2000-05-19 18:54:02 +00:00
|
|
|
#include "nautilus-global-preferences.h"
|
Some of the underlying work to prepare for emblems on the icons.
* style-guide.html: Some minor updates to the style guide,
including rules about headers.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icons_for_file),
(nautilus_scalable_icon_get), (nautilus_icon_factor_clear),
(nautilus_icon_factory_load_file),
(nautilus_gdk_pixbuf_composite_corner),
(nautilus_icon_factor_load_icon), (nautilus_scalable_icon_hash),
(nautilus_scalable_icon_equal),
(nautilus_icon_factory_get_icon_for_file), (load_specific_image):
Added interface for getting emblem icons for a file, and got rid
of the symbolic-link overlay that was previously built into the
icon.
* libnautilus/gnome-icon-container.c (update_icon):
Get pixbufs for all emblems and pass into the icon object.
* libnautilus/nautilus-icons-controller.c
(nautius_icons_controller_get_icon_image):
src/file-manager/fm-icons-controller.h,
src/file-manager/fm-icons-controller.c
(fm_icons_controller_get_icon_image): Return a list of emblem
images along with the main image.
* libnautilus/nautilus-icons-view-icon-item.h,
libnautilus/nautilus-icons-view-icon-item.c
(nautilus_icons_view_icon_item_set_emblems),
(nautilus_icons_view_icon_item_destroy): Keep a list of emblem
pixbufs in each icon. We don't draw them quite yet.
* libnautilus/gdk-extensions.h, libnautilus/gdk-extensions.c:
(nautilus_gdk_pixbuf_list_ref), (nautilus_gdk_pixbuf_list_unref),
(nautilus_gdk_pixbuf_list_free): Convenience functions for
manipulating lists of GdkPixbuf objects.
* libnautilus/nautilus-directory.h,
libnautilus/nautilus-directory.c: (nautilus_file_list_ref),
(nautilus_file_list_unref), (nautilus_file_list_free): Convenience
functions for manipulating lists of NautilusFile objects. Also got
rid of NautilusFileList typedef.
* libnautilus/nautilus-icon-factory.h,
libnautilus/nautilus-icon-factory.h:
(nautilus_scalable_icon_list_free): Convenience function for
manipulating lists of NautilusScalableIcon objects.
* libnautilus/nautilus-glib-extensions.h,
libnautilus/nautilus-glib-extensions.c: (nautilus_g_list_equal):
Function to compare two GLists to see if they are
identical. Particularly useful with lists of reference-counted
objects.
* src/file-manager/fm-directory-view-icons.c
(fm_directory_view_icons_destroy),
(add_icon_if_already_positioned),
(fm_directory_view_icons_append_selection_context_menu_items),
(display_icons_not_already_positioned),
(fm_direectory_view_icons_get_selection):
src/file-manager/fm-directory-view-list.c
(fm_directory_view_list_get_selection):
src/file-manager/fm-directory-view.c (display_selection_info),
(display_pending_files), (add_files_cb), (open_in_new_window_cb),
(fm_directory_view_real_append_selection_context_menu_items): Got
rid of use of NautilusFileList typedef, corrected ref. counting of
files in the lists by using new calls.
* src/nautilus-bookmarklist.c, src/nautilus-bookmarks-menu.c,
src/nautilus-index-tabs.c,
src/file-manager/fm-directory-view-icons.c,
src/file-manager/fm-directory-view.c,
src/file-manager/fm-icons-controller.c: A bit of reformatting.
2000-02-24 00:54:57 +00:00
|
|
|
#include "nautilus-gtk-macros.h"
|
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"
|
Some build fixes.
* acconfig.h:
* configure.in:
Removed the NAUTILUS_PREFIX that I added. I did it wrong.
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_pixmap_file):
* components/hardware/nautilus-hardware-view.c:
(setup_overview_form):
* components/services/startup/nautilus-view/nautilus-service-startup-view.c:
(setup_form_title), (setup_signup_form), (setup_config_form):
* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf):
* libnautilus-extensions/nautilus-icon-factory.c:
(make_full_icon_path):
* src/nautilus-application.c: (display_caveat):
* src/nautilus-property-browser.c:
(nautilus_property_browser_initialize),
(nautilus_emblem_dialog_new), (make_category_link):
* src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize):
Replaced most uses of gnome_pixmap_file on "nautilus/"
with a call to a new nautilus_pixmap_file in an attempt to
make installations where nautilus has a different prefix
from gnome-libs work. I now think this is a waste of time,
but Mathieu Lacage says this is still an improvement.
* components/help/Makefile.am:
* components/help/hyperbola-filefmt.c: (fmt_map_entry):
Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX.
* components/websearch/ntl-web-search.c:
(web_search_populate_engines):
Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX.
* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_initialize),
(mozilla_content_view_set_busy_cursor),
(mozilla_content_view_request_progress_change),
(mozilla_content_view_clear_busy_cursor),
(mozilla_load_location_callback), (bonobo_mozilla_callback),
(mozilla_merge_bonobo_items_callback),
(mozilla_title_changed_callback),
(mozilla_location_changed_callback), (mozilla_net_status_callback),
(mozilla_link_message_callback), (mozilla_progress_callback),
(mozilla_open_uri_callback):
Took a cut at fixing the Mozilla component for the new API.
Ramiro will have to take care of the rest.
* components/services/install/lib/Makefile.am:
* components/services/time/command-line/Makefile.am:
* components/services/time/nautilus-view/Makefile.am:
* components/services/time/service/Makefile.am:
* components/services/trilobite/libtrilobite/Makefile.am:
* components/services/trilobite/sample/command-line/Makefile.am:
* components/services/trilobite/sample/service/Makefile.am:
* libnautilus/Makefile.am:
Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested
in the form of a patch by Martijn van Beers.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_get_user_main_directory),
(nautilus_get_pixmap_directory):
* libnautilus-extensions/nautilus-link-set.c:
(get_link_set_document):
* src/Makefile.am:
* src/nautilus-property-browser.c:
(nautilus_property_browser_drag_data_get), (make_drag_image),
(get_xml_path), (make_properties_from_directory):
* src/nautilus-link-set-window.c: (get_link_set_names):
* src/file-manager/Makefile.am:
* src/file-manager/fm-properties-window.c: (get_property_names):
Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX.
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_get_uri_from_local_path): Added a new helper function for
use when you have a path and need a URI. This does a better job
than just adding a "file://" on the front.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(get_first_callback), (nautilus_gtk_container_get_first_child):
* src/nautilus-window-toolbars.c: (setup_button):
* src/nautilus-window.c:
(replace_special_current_view_in_content_view_menu):
Implemented the first_child function and used it where appropriate.
* libnautilus-extensions/nautilus-preferences-item.c:
(add_icon_themes): Use nautilus_get_pixmap_directory intead of
misusing gnome_pixmap_file by calling it on a directory name.
* nautilus-installer/src/support.c: (create_pixmap),
(create_image): Added FIXMEs since it isn't clear if this code
will work with a Nautilus prefix that's not the same as the
gnome-libs prefix.
* Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
|
|
|
#include "nautilus-file-utilities.h"
|
2000-08-02 08:11:46 +00:00
|
|
|
#include "nautilus-icon-factory.h"
|
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn in the
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn
in the right place or hit-tested properly, by removing some
bogus offsets.
fixed bugs 764 and 2626, icon stretching is way too slow, by only
doing the relayout and update position when the stretching is
finished, instead of doing it every time the mouse moves during
the stretch. Also, made it relayout if necessary after stretching
is finished, like it was intending to do.
2000-09-21 22:44:09 +00:00
|
|
|
#include "nautilus-theme.h"
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
/* Comment this out if the new smooth fonts code give you problems
|
|
|
|
* This isnt meant to be permanent. Its just a precaution.
|
|
|
|
*/
|
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-09-08 07:23:42 +00:00
|
|
|
|
|
|
|
#define MAX_TEXT_WIDTH_STANDARD 135
|
|
|
|
#define MAX_TEXT_WIDTH_TIGHTER 80
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
|
2000-09-13 18:42:18 +00:00
|
|
|
/* The list of characters that cause line breaks can be localized. */
|
|
|
|
#define LINE_BREAK_CHARACTERS _(" -_,;.?/&")
|
|
|
|
|
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;
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
NautilusEmblemAttachPoints *attach_points;
|
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
|
|
|
|
2000-05-31 05:28:31 +00:00
|
|
|
/* preview state */
|
2000-06-23 17:51:53 +00:00
|
|
|
guint is_active : 1;
|
2000-05-31 05:28:31 +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-05-30 06:51:37 +00:00
|
|
|
|
2000-04-17 21:07:33 +00:00
|
|
|
gboolean is_renaming;
|
2000-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
/* Font stuff whilst in smooth mode */
|
|
|
|
guint smooth_font_size;
|
|
|
|
NautilusScalableFont *smooth_font;
|
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-09-06 05:19:59 +00:00
|
|
|
ARG_MODIFIER,
|
|
|
|
ARG_SMOOTH_FONT_SIZE,
|
|
|
|
ARG_SMOOTH_FONT
|
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;
|
2000-08-02 08:11:46 +00:00
|
|
|
int index;
|
2000-03-07 01:10:04 +00:00
|
|
|
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-09-07 20:17:09 +00:00
|
|
|
static guint32 highlight_background_color = NAUTILUS_RGBA_COLOR_PACK (0x00, 0x00, 0x00, 0xFF);
|
|
|
|
static guint32 highlight_text_color = NAUTILUS_RGBA_COLOR_PACK (0xFF, 0xFF, 0xFF, 0xFF);
|
2000-09-26 00:07:49 +00:00
|
|
|
static guint32 highlight_text_info_color = NAUTILUS_RGBA_COLOR_PACK (0xCC, 0xCC, 0xCC, 0xFF);
|
2000-08-07 05:55:25 +00:00
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* GtkObject */
|
2000-09-06 05:19:59 +00:00
|
|
|
static void nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class);
|
|
|
|
static void nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *item);
|
|
|
|
static void nautilus_icon_canvas_item_destroy (GtkObject *object);
|
|
|
|
static int nautilus_icon_canvas_item_event (GnomeCanvasItem *item,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void nautilus_icon_canvas_item_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
static void nautilus_icon_canvas_item_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* GnomeCanvasItem */
|
2000-09-06 05:19:59 +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 void nautilus_icon_canvas_item_render (GnomeCanvasItem *item,
|
|
|
|
GnomeCanvasBuf *buffer);
|
|
|
|
static double nautilus_icon_canvas_item_point (GnomeCanvasItem *item,
|
|
|
|
double x,
|
|
|
|
double y,
|
|
|
|
int cx,
|
|
|
|
int cy,
|
|
|
|
GnomeCanvasItem **actual_item);
|
|
|
|
static void nautilus_icon_canvas_item_bounds (GnomeCanvasItem *item,
|
|
|
|
double *x1,
|
|
|
|
double *y1,
|
|
|
|
double *x2,
|
|
|
|
double *y2);
|
|
|
|
|
2000-01-25 21:17:05 +00:00
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
|
2000-01-31 22:25:21 +00:00
|
|
|
/* private */
|
2000-09-06 05:19:59 +00:00
|
|
|
static void draw_or_measure_label_text (NautilusIconCanvasItem *item,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom);
|
2000-09-07 20:17:09 +00:00
|
|
|
static void draw_or_measure_label_text_aa (NautilusIconCanvasItem *item,
|
|
|
|
GdkPixbuf *destination_pixbuf,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom);
|
2000-09-06 05:19:59 +00:00
|
|
|
static void draw_label_text (NautilusIconCanvasItem *item,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom);
|
|
|
|
static void measure_label_text (NautilusIconCanvasItem *item);
|
|
|
|
static void get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
|
|
|
|
ArtIRect *rect);
|
|
|
|
static void emblem_layout_reset (EmblemLayout *layout,
|
|
|
|
NautilusIconCanvasItem *icon_item,
|
|
|
|
const ArtIRect *icon_rect);
|
|
|
|
static gboolean emblem_layout_next (EmblemLayout *layout,
|
|
|
|
GdkPixbuf **emblem_pixbuf,
|
|
|
|
ArtIRect *emblem_rect);
|
|
|
|
static void draw_pixbuf (GdkPixbuf *pixbuf,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
int x,
|
|
|
|
int y);
|
|
|
|
static gboolean hit_test_stretch_handle (NautilusIconCanvasItem *item,
|
|
|
|
const ArtIRect *canvas_rect);
|
|
|
|
static void draw_pixbuf_aa (GdkPixbuf *pixbuf,
|
|
|
|
GnomeCanvasBuf *buf,
|
|
|
|
double affine[6],
|
|
|
|
int x_offset,
|
|
|
|
int y_offset);
|
|
|
|
static gboolean icon_canvas_item_is_smooth (const NautilusIconCanvasItem *icon_item);
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
|
2000-09-07 20:17:09 +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-09-06 05:19:59 +00:00
|
|
|
gtk_object_add_arg_type ("NautilusIconCanvasItem::smooth_font_size",
|
|
|
|
GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_SMOOTH_FONT_SIZE);
|
|
|
|
gtk_object_add_arg_type ("NautilusIconCanvasItem::smooth_font",
|
|
|
|
GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SMOOTH_FONT);
|
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),
|
2000-05-15 21:56:52 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
|
|
|
GTK_TYPE_NONE, 0);
|
2000-03-17 23:03:39 +00:00
|
|
|
|
|
|
|
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;
|
2000-05-22 22:06:46 +00:00
|
|
|
item_class->render = nautilus_icon_canvas_item_render;
|
2000-03-22 00:29:07 +00:00
|
|
|
item_class->point = nautilus_icon_canvas_item_point;
|
|
|
|
item_class->bounds = nautilus_icon_canvas_item_bounds;
|
|
|
|
item_class->event = nautilus_icon_canvas_item_event;
|
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-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
icon_item->details->smooth_font_size = 12;
|
|
|
|
icon_item->details->smooth_font = nautilus_scalable_font_get_default_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
|
|
|
/* 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);
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
g_free (details->attach_points);
|
2000-08-02 08:11:46 +00:00
|
|
|
|
2000-03-29 02:02:45 +00:00
|
|
|
if (details->font != NULL) {
|
|
|
|
gdk_font_unref (details->font);
|
|
|
|
}
|
2000-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
gtk_object_unref (GTK_OBJECT (icon_item->details->smooth_font));
|
|
|
|
icon_item->details->smooth_font = NULL;
|
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-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
case ARG_SMOOTH_FONT:
|
|
|
|
nautilus_icon_canvas_item_set_smooth_font (NAUTILUS_ICON_CANVAS_ITEM (object),
|
|
|
|
NAUTILUS_SCALABLE_FONT (GTK_VALUE_OBJECT (*arg)));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ARG_SMOOTH_FONT_SIZE:
|
|
|
|
nautilus_icon_canvas_item_set_smooth_font_size (NAUTILUS_ICON_CANVAS_ITEM (object),
|
|
|
|
GTK_VALUE_UINT (*arg));
|
|
|
|
break;
|
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-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
case ARG_SMOOTH_FONT:
|
|
|
|
gtk_object_ref (GTK_OBJECT (details->smooth_font));
|
|
|
|
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (details->smooth_font);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ARG_SMOOTH_FONT_SIZE:
|
|
|
|
GTK_VALUE_UINT (*arg) = details->smooth_font_size;
|
|
|
|
break;
|
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-06-21 02:17:44 +00:00
|
|
|
NautilusIconCanvasItemDetails *details;
|
|
|
|
|
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));
|
|
|
|
|
2000-06-21 02:17:44 +00:00
|
|
|
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-08-02 08:11:46 +00:00
|
|
|
void
|
|
|
|
nautilus_icon_canvas_item_set_attach_points (NautilusIconCanvasItem *item,
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
NautilusEmblemAttachPoints *attach_points)
|
2000-08-02 08:11:46 +00:00
|
|
|
{
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
g_free (item->details->attach_points);
|
|
|
|
item->details->attach_points = NULL;
|
2000-08-02 08:11:46 +00:00
|
|
|
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
if (attach_points != NULL && attach_points->num_points != 0) {
|
|
|
|
item->details->attach_points = g_new (NautilusEmblemAttachPoints, 1);
|
|
|
|
*item->details->attach_points = *attach_points;
|
2000-08-02 08:11:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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);
|
2000-05-15 21:56:52 +00:00
|
|
|
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, update,
|
|
|
|
(item, affine, clip_path, flags));
|
2000-03-17 23:03:39 +00:00
|
|
|
}
|
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
|
2000-05-15 21:56:52 +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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-05-19 18:54:02 +00:00
|
|
|
static gboolean
|
|
|
|
in_single_click_mode ()
|
|
|
|
{
|
|
|
|
/* Perhaps this should be computed elsewhere and passed in. */
|
|
|
|
return nautilus_preferences_get_enum
|
2000-09-15 01:05:50 +00:00
|
|
|
(NAUTILUS_PREFERENCES_CLICK_POLICY, NAUTILUS_CLICK_POLICY_DOUBLE) ==
|
2000-05-19 18:54:02 +00:00
|
|
|
NAUTILUS_CLICK_POLICY_SINGLE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
/* Draw the text in a box, using gnomelib routines. */
|
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;
|
2000-08-01 02:00:05 +00:00
|
|
|
guint32 label_color;
|
2000-05-12 16:24:01 +00:00
|
|
|
GnomeCanvasItem *canvas_item;
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
int max_text_width;
|
|
|
|
int icon_width, text_left, box_left;
|
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
|
|
|
|
Fix all the warnings -Wuninitialized found. Quite a number of them were
2000-09-05 Pavel Cisler <pavel@eazel.com>
* components/help/converters/gnome-db2html2/gdb3html.c:
(xml_parse_document):
* components/help/hyperbola-nav-index.c: (end_element):
* components/services/summary/nautilus-view/nautilus-summary-view.c
: (logout_button_cb):
* components/services/time/service/trilobite-eazel-time-service.c:
(trilobite_eazel_time_service_do_http_request):
* components/tree/nautilus-tree-view.c:
* configure.in:
* libnautilus-extensions/bonobo-stream-vfs.c:
(bonobo_stream_vfs_open):
* libnautilus-extensions/nautilus-background.c:
(nautilus_background_draw), (nautilus_background_draw_aa):
* libnautilus-extensions/nautilus-customization-data.c:
(nautilus_customization_data_new):
* libnautilus-extensions/nautilus-directory-background.c:
(nautilus_directory_background_write_desktop_settings):
* libnautilus-extensions/nautilus-file-operations.c:
(nautilus_file_operations_move_to_trash), (do_empty_trash):
* libnautilus-extensions/nautilus-file.c: (nautilus_file_dump):
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(draw_or_measure_label_text), (emblem_layout_next):
* libnautilus-extensions/nautilus-icon-factory.c:
(get_image_from_cache):
* libnautilus-extensions/nautilus-icon-text-item.c:
(iti_paint_text):
* libnautilus-extensions/nautilus-list.c: (draw_cell), (draw_row):
* libnautilus-extensions/nautilus-mime-actions.c:
(nautilus_mime_add_application_to_short_list_for_uri):
* libnautilus-extensions/nautilus-program-chooser.c:
(program_file_pair_get_short_status_text),
(program_file_pair_get_long_status_text):
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_choose_component_for_file),
(nautilus_choose_application_for_file):
* libnautilus-extensions/nautilus-scalable-font.c:
(nautilus_scalable_font_draw_text_lines_with_dimensions):
* libnautilus-extensions/nautilus-theme.c:
(nautilus_theme_make_selector):
* librsvg/rsvg-ft.c: (rsvg_ft_get_glyph):
* librsvg/test-ft-gtk.c: (set_text):
* librsvg/test-ft.c: (save_pixbuf_to_file_internal),
(save_pixbuf_to_file):
* librsvg/test-rsvg.c: (save_pixbuf_to_file_internal),
(save_pixbuf_to_file):
* src/file-manager/fm-directory-view.c: (display_pending_files),
(compute_menu_item_info):
* src/file-manager/fm-icon-view.c: (compute_menu_item_info):
* src/file-manager/fm-list-view.c: (get_column_from_attribute):
* src/nautilus-application.c: (nautilus_application_startup):
* src/nautilus-search-bar-criterion.c:
(nautilus_search_bar_criterion_next_new),
(nautilus_search_bar_criterion_get_location),
(get_date_modified_location_for):
* src/nautilus-sidebar-tabs.c: (draw_one_tab_themed),
(draw_or_layout_all_tabs):
* src/nautilus-toolbar.c: (nautilus_toolbar_size_allocate):
* src/nautilus-window-manage-views.c:
(nautilus_window_get_current_location_title):
* test/test-nautilus-label.c: (justification_changed_callback):
Fix all the warnings -Wuninitialized found.
Quite a number of them were actual bugs.
Turn on -Wuninitialized in configure.in now that ORBit generates
warning-free code.
2000-09-05 20:38:10 +00:00
|
|
|
gc = NULL;
|
|
|
|
icon_width = 0;
|
|
|
|
|
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
|
|
|
|
2000-05-12 16:24:01 +00:00
|
|
|
canvas_item = GNOME_CANVAS_ITEM (item);
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
if (drawable != NULL) {
|
2000-03-07 01:10:04 +00:00
|
|
|
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
|
2000-05-12 16:24:01 +00:00
|
|
|
gc = gdk_gc_new (canvas_item->canvas->layout.bin_window);
|
2000-08-01 05:23:52 +00:00
|
|
|
gdk_gc_get_values (gc, &save_gc);
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
}
|
|
|
|
|
2000-09-08 07:23:42 +00:00
|
|
|
max_text_width = floor (nautilus_icon_canvas_item_get_max_text_width (item));
|
2000-08-01 02:00:05 +00:00
|
|
|
|
2000-05-12 06:28:32 +00:00
|
|
|
/* if the icon is highlighted, do some set-up */
|
2000-05-12 16:24:01 +00:00
|
|
|
if (needs_highlight && drawable != NULL && !details->is_renaming) {
|
2000-09-07 19:12:12 +00:00
|
|
|
gdk_rgb_gc_set_foreground (gc, highlight_background_color);
|
2000-05-12 06:28:32 +00:00
|
|
|
|
2000-05-12 16:24:01 +00:00
|
|
|
gdk_draw_rectangle
|
|
|
|
(drawable, gc, TRUE,
|
Added some code to check if file is a mountable item. If so, the proper
2000-07-25 Gene Z. Ragan <gzr@eazel.com>
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_for_file):
Added some code to check if file is a mountable item. If so,
the proper icon is selected.
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_add):
* src/file-manager/fm-desktop-icon-view.c: (get_icon_container),
(fm_desktop_icon_view_initialize), (mount_device_is_mounted),
(mount_device_cdrom_set_state), (mount_device_floppy_set_state),
(mount_device_ext2_set_state), (mount_device_set_state),
(local_device_set_state_empty), (mount_device_mount),
(mount_device_activate_cdrom), (mount_device_activate_floppy),
(mount_device_activate_ext2), (mount_device_activate),
(mount_device_deactivate), (mount_device_check_change),
(mount_devices_update_is_mounted), (mount_devices_check_status),
(my_g_check_permissions), (mouunt_device_floppy_add),
(mount_device_ext2_add), (cdrom_ioctl_frenzy),
(mount_device_iso9660_add), (mount_device_add_aliases),
(add_mount_device), (mntent_is_removable_fs), (mntent_has_option),
(find_mount_devices), (make_mount_link), (get_iso9660_volume_name),
(get_ext2_volume_name):
New functions to add mounted volumes to the desktop. This is work in
progress and is being checked in just to keep me sane. Don't expect it
to work yet.
2000-07-25 09:02:34 +00:00
|
|
|
icon_left + (icon_width - details->text_width) / 2,
|
2000-05-12 16:24:01 +00:00
|
|
|
icon_bottom,
|
|
|
|
details->text_width, details->text_height);
|
|
|
|
|
2000-09-07 19:12:12 +00:00
|
|
|
gdk_rgb_gc_set_foreground (gc, highlight_text_color);
|
2000-05-12 06:28:32 +00:00
|
|
|
}
|
|
|
|
|
2000-07-27 08:16:02 +00:00
|
|
|
if (!needs_highlight && drawable != NULL) {
|
2000-08-07 05:55:25 +00:00
|
|
|
label_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), TRUE);
|
2000-08-01 02:00:05 +00:00
|
|
|
gdk_rgb_gc_set_foreground (gc, label_color);
|
2000-07-27 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
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-09-13 18:42:18 +00:00
|
|
|
(details->font, text_piece,
|
|
|
|
LINE_BREAK_CHARACTERS,
|
|
|
|
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-05-12 16:24:01 +00:00
|
|
|
if (drawable != NULL && !details->is_renaming) {
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
text_left = icon_left + (icon_width - icon_text_info->width) / 2;
|
Added some code to check if file is a mountable item. If so, the proper
2000-07-25 Gene Z. Ragan <gzr@eazel.com>
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_for_file):
Added some code to check if file is a mountable item. If so,
the proper icon is selected.
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_add):
* src/file-manager/fm-desktop-icon-view.c: (get_icon_container),
(fm_desktop_icon_view_initialize), (mount_device_is_mounted),
(mount_device_cdrom_set_state), (mount_device_floppy_set_state),
(mount_device_ext2_set_state), (mount_device_set_state),
(local_device_set_state_empty), (mount_device_mount),
(mount_device_activate_cdrom), (mount_device_activate_floppy),
(mount_device_activate_ext2), (mount_device_activate),
(mount_device_deactivate), (mount_device_check_change),
(mount_devices_update_is_mounted), (mount_devices_check_status),
(my_g_check_permissions), (mouunt_device_floppy_add),
(mount_device_ext2_add), (cdrom_ioctl_frenzy),
(mount_device_iso9660_add), (mount_device_add_aliases),
(add_mount_device), (mntent_is_removable_fs), (mntent_has_option),
(find_mount_devices), (make_mount_link), (get_iso9660_volume_name),
(get_ext2_volume_name):
New functions to add mounted volumes to the desktop. This is work in
progress and is being checked in just to keep me sane. Don't expect it
to work yet.
2000-07-25 09:02:34 +00:00
|
|
|
|
2000-05-12 23:08:45 +00:00
|
|
|
gnome_icon_paint_text
|
|
|
|
(icon_text_info, drawable, gc,
|
|
|
|
text_left, icon_bottom + height_so_far,
|
|
|
|
GTK_JUSTIFY_CENTER);
|
2000-05-12 06:28:32 +00:00
|
|
|
|
|
|
|
/* if it's highlighted, embolden by drawing twice */
|
2000-05-12 23:08:45 +00:00
|
|
|
if (needs_highlight) {
|
|
|
|
gnome_icon_paint_text
|
|
|
|
(icon_text_info, drawable, gc,
|
|
|
|
text_left + 1, icon_bottom + height_so_far,
|
|
|
|
GTK_JUSTIFY_CENTER);
|
|
|
|
}
|
|
|
|
|
2000-05-19 18:54:02 +00:00
|
|
|
/* if it's prelit, and we're in click-to-activate mode, underline the text */
|
|
|
|
if (details->is_prelit && in_single_click_mode ()) {
|
2000-05-12 23:08:45 +00:00
|
|
|
gnome_icon_underline_text
|
|
|
|
(icon_text_info, drawable, gc,
|
|
|
|
text_left + 1, icon_bottom + height_so_far);
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
}
|
2000-01-31 22:25:21 +00:00
|
|
|
}
|
2000-08-07 05:55:25 +00:00
|
|
|
|
|
|
|
if (drawable != NULL && i == 0) {
|
|
|
|
if (needs_highlight) {
|
2000-09-07 19:12:12 +00:00
|
|
|
gdk_rgb_gc_set_foreground (gc, highlight_text_info_color);
|
2000-08-07 05:55:25 +00:00
|
|
|
} else {
|
|
|
|
label_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), FALSE);
|
|
|
|
gdk_rgb_gc_set_foreground (gc, label_color);
|
|
|
|
}
|
|
|
|
}
|
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:37:43 +00:00
|
|
|
|
2000-08-01 02:00:05 +00:00
|
|
|
if (needs_highlight) {
|
2000-05-12 06:37:43 +00:00
|
|
|
height_so_far += 2; /* extra slop for nicer highlighting */
|
|
|
|
width_so_far += 4; /* account for emboldening, plus extra to make it look nicer */
|
|
|
|
}
|
2000-01-31 01:30:16 +00:00
|
|
|
|
Reworked the canvas item class used by the icon
container. Straightened out the use of various coordinate systems
and bounds calculations and removed much unused code inherited
from the GdkPixbuf canvas item class that Andy cloned our code
from. Changed the class so it doesn't scale icons any more -- we
leave that to the icon factory so the scaled icons can be cached.
* libnautilus/gnome-icon-container-dnd.c:
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.c:
* libnautilus/nautilus-icons-view-icon-item.c:
* libnautilus/nautilus-icons-view-icon-item.h:
Made extensive changes to the icon item class, including getting
rid of the "x", "y", "width", and "height" attributes, adding a
new "font" attribute, changing the "label" attribute name to "text"
to be more consistent with other canvas items, simplifying the
update logic for now (we can recomplicate it later if need be),
changing the pixbuf to have a fixed size in pixels instead of being
scaled with the pixels_per_unit and changing the pixbuf when we change
zoom levels, and other misc. cleanup.
(nautilus_icons_view_icon_item_get_arg):
Fixed bug for "label" which would return a non-strdup'd piece of text.
(draw_or_measure_text_box):
Fixed bug where width of the selection box would be based on the
length of the last line of text, not the widest, and extra GCs would
be created for each line of text.
* libnautilus/nautilus-icons-controller.h:
* libnautilus/nautilus-icons-controller.c:
(nautilus_icons_controller_get_icon_image):
* src/file-manager/fm-icons-controller.c:
(fm_icons_controller_get_icon_image):
Changed the interface so that the icons controller specifies the icon
as a NautilusScalableIcon instead of a GdkPixbuf. This lets the icon
container get the appropriate icon for size as it zooms.
* libnautilus/gdk-extensions.h:
* libnautilus/gdk-extensions.c:
(nautilus_gdk_font_equal):
Added a version of gdk_font_equal that works with NULL for the font.
Maybe we need a naming scheme for these NULL-tolerant variations on
basic calls.
* src/ntl-uri-map.c: (nautilus_navinfo_free):
* src/ntl-window-msgs.c: (nautilus_window_change_location_2):
Fixed a NULL dereference that would happen when @navi was NULL.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile):
Fixed error handling for case when gnome_vfs_read fails. Fixed
error handling for case where metafile_info.size won't fit into a
size_t. Switched back to g_malloc instead of g_alloca, since the
size of a file might be too big for the stack. In the long run, we
will feed the file data directly to the XML code, so this is a bit
temporary. Removed the assert that Elliot added to help track
down the giant files sizes coming from gnome-vfs; the failure in
g_malloc will be easy to debug, unlike the failure in
g_alloca. (The assert was added without a ChangeLog entry.)
2000-02-10 00:33:49 +00:00
|
|
|
if (drawable != NULL) {
|
|
|
|
/* Current calculations should match what we measured before drawing.
|
|
|
|
* This assumes that we will always make a separate call to measure
|
|
|
|
* before the call to draw. We might later decide to use this function
|
|
|
|
* differently and change these asserts.
|
|
|
|
*/
|
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-08-01 07:42:27 +00:00
|
|
|
|
|
|
|
gdk_gc_set_foreground (gc, &save_gc.foreground);
|
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);
|
2000-05-12 23:08:45 +00:00
|
|
|
gdk_draw_rectangle
|
|
|
|
(drawable, gc, FALSE,
|
|
|
|
box_left, icon_bottom - 2,
|
|
|
|
width_so_far, 2 + height_so_far);
|
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-09-07 20:17:09 +00:00
|
|
|
if (icon_canvas_item_is_smooth (item)) {
|
|
|
|
draw_or_measure_label_text_aa (item, NULL, 0, 0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
draw_or_measure_label_text (item, NULL, 0, 0);
|
|
|
|
}
|
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-09-07 20:17:09 +00:00
|
|
|
int icon_left, int icon_bottom)
|
2000-02-02 20:18:57 +00:00
|
|
|
{
|
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);
|
|
|
|
|
2000-05-12 23:08:45 +00:00
|
|
|
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-03-07 01:10:04 +00:00
|
|
|
|
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);
|
2000-05-12 23:08:45 +00:00
|
|
|
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);
|
2000-03-07 01:10:04 +00:00
|
|
|
|
|
|
|
gdk_gc_unref (gc);
|
|
|
|
}
|
|
|
|
|
2000-05-30 21:59:07 +00:00
|
|
|
|
|
|
|
/* draw the stretch handles in the anti-aliased canvas */
|
|
|
|
|
|
|
|
static void
|
|
|
|
draw_stretch_handles_aa (NautilusIconCanvasItem *item, GnomeCanvasBuf *buf,
|
|
|
|
const ArtIRect *rect)
|
|
|
|
{
|
2000-06-17 01:43:30 +00:00
|
|
|
int knob_width, knob_height;
|
2000-06-21 02:17:44 +00:00
|
|
|
ArtIRect icon_rect;
|
2000-06-17 01:43:30 +00:00
|
|
|
char *knob_filename;
|
|
|
|
GdkPixbuf *knob_pixbuf;
|
|
|
|
double affine[6];
|
|
|
|
|
2000-05-30 21:59:07 +00:00
|
|
|
if (!item->details->show_stretch_handles) {
|
|
|
|
return;
|
|
|
|
}
|
2000-06-17 01:43:30 +00:00
|
|
|
|
2000-06-21 02:17:44 +00:00
|
|
|
get_icon_canvas_rectangle (item, &icon_rect);
|
|
|
|
|
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn in the
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn
in the right place or hit-tested properly, by removing some
bogus offsets.
fixed bugs 764 and 2626, icon stretching is way too slow, by only
doing the relayout and update position when the stretching is
finished, instead of doing it every time the mouse moves during
the stretch. Also, made it relayout if necessary after stretching
is finished, like it was intending to do.
2000-09-21 22:44:09 +00:00
|
|
|
knob_filename = nautilus_theme_get_image_path ("knob.png");
|
2000-06-17 01:43:30 +00:00
|
|
|
knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename);
|
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn in the
fixed bugs 3084, 3119, 3134, icon stretch handles are not drawn
in the right place or hit-tested properly, by removing some
bogus offsets.
fixed bugs 764 and 2626, icon stretching is way too slow, by only
doing the relayout and update position when the stretching is
finished, instead of doing it every time the mouse moves during
the stretch. Also, made it relayout if necessary after stretching
is finished, like it was intending to do.
2000-09-21 22:44:09 +00:00
|
|
|
knob_width = gdk_pixbuf_get_width (knob_pixbuf);
|
|
|
|
knob_height = gdk_pixbuf_get_height (knob_pixbuf);
|
2000-06-17 01:43:30 +00:00
|
|
|
|
2000-09-25 18:20:11 +00:00
|
|
|
art_affine_identity (affine);
|
2000-05-30 21:59:07 +00:00
|
|
|
|
2000-06-21 02:17:44 +00:00
|
|
|
draw_pixbuf_aa (knob_pixbuf, buf, affine, icon_rect.x0, icon_rect.y0);
|
|
|
|
draw_pixbuf_aa (knob_pixbuf, buf, affine, icon_rect.x0, icon_rect.y1 - knob_height);
|
|
|
|
draw_pixbuf_aa (knob_pixbuf, buf, affine, icon_rect.x1 - knob_width, icon_rect.y0);
|
|
|
|
draw_pixbuf_aa (knob_pixbuf, buf, affine, icon_rect.x1 - knob_width, icon_rect.y1 - knob_height);
|
2000-05-30 21:59:07 +00:00
|
|
|
|
2000-06-17 01:43:30 +00:00
|
|
|
g_free(knob_filename);
|
|
|
|
gdk_pixbuf_unref(knob_pixbuf);
|
2000-05-30 21:59:07 +00:00
|
|
|
}
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
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;
|
2000-08-02 08:11:46 +00:00
|
|
|
layout->index = 0;
|
2000-03-07 01:10:04 +00:00
|
|
|
layout->emblem = icon_item->details->emblem_pixbufs;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
emblem_layout_next (EmblemLayout *layout,
|
|
|
|
GdkPixbuf **emblem_pixbuf,
|
|
|
|
ArtIRect *emblem_rect)
|
|
|
|
{
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
int width, height, x, y;
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
NautilusEmblemAttachPoints *attach_points;
|
2000-08-02 08:11:46 +00:00
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* 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);
|
|
|
|
|
2000-08-02 08:11:46 +00:00
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
/* Advance to the next emblem. */
|
|
|
|
layout->emblem = layout->emblem->next;
|
|
|
|
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
attach_points = layout->icon_item->details->attach_points;
|
|
|
|
if (attach_points != NULL) {
|
|
|
|
if (layout->index >= attach_points->num_points) {
|
2000-08-02 08:11:46 +00:00
|
|
|
return FALSE;
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
}
|
2000-08-02 08:11:46 +00:00
|
|
|
|
Fixed bug 640 (icon cache never frees images (awaiting GdkPixbuf
fix)). Also took care of bug 3145 (zillions of 'main_loops !=
NULL' assertion failures when quitting) and bug 3138 (Some code in
the icon factory is cut and pasted from elsewhere). And a few
unrelated things that came up while I was busy working on these.
* configure.in: Applied patch from Dan Winship to fix handling of
CFLAGS and LDFLAGS. Fixes some missing quoting and other mistakes.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-icon-factory-private.h:
* libnautilus-extensions/nautilus-thumbnails.c:
* libnautilus-extensions/nautilus-thumbnails.h:
Broke out the thumbnailing code into its own source file for
clarity.
* libnautilus-extensions/nautilus-directory.c:
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_make_directory_and_parents):
Moved nautilus_make_directory_and_parents into a place where the
thumbnail code can share it instead of requiring its own copy.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(destroy_global_prefs_dialog), (global_preferences_get_dialog),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_initialize):
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-preferences.c:
(preferences_initialize_if_needed), (preferences_shutdown):
* src/nautilus-application.c: (nautilus_application_destroy):
Changed code so that it cleans up with g_atexit instead of with an
explicit shutdown call. This makes it sequence correctly with
other atexit code.
* libnautilus-extensions/nautilus-icon-canvas-item.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_destroy),
(nautilus_icon_canvas_item_set_attach_points),
(emblem_layout_next):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
Added a Nautilus prefix to the EmblemAttachPoints typedef, since
it's public.
* libnautilus-extensions/nautilus-icon-factory.h:
* libnautilus-extensions/nautilus-icon-factory.c:
Changed the icon factory structure so that it will actually free
pixbufs when done with them. Made some other small fixes to the
icon factory in passing, including removing some redundant code
and fixing the logic for getting custom icons and deleting the
icon factory and g_atexit time.
* src/file-manager/fm-icon-view.c: (play_file), (preview_sound):
Restructured the logic for playing sound previews a little to get
rid of compiler warnings and close some loopholes in the old code.
* src/nautilus-main.c: (is_event_loop_needed),
(quit_if_in_main_loop), (nautilus_gtk_main_quit_all),
(event_loop_unregister), (nautilus_main_event_loop_register),
(nautilus_main_is_event_loop_mainstay),
(nautilus_main_event_loop_quit), (main): Fixed the main loop
quitting logic so that it is a bit simpler and works with the
gnome-vfs code that runs event handling after the last main loop
is gone.
2000-09-20 00:44:07 +00:00
|
|
|
x = layout->icon_rect.x0 + attach_points->points[layout->index].x;
|
|
|
|
y = layout->icon_rect.y0 + attach_points->points[layout->index].y;
|
2000-08-02 08:11:46 +00:00
|
|
|
|
|
|
|
layout->index += 1;
|
|
|
|
|
|
|
|
/* Return the rectangle and pixbuf. */
|
|
|
|
*emblem_pixbuf = pixbuf;
|
|
|
|
emblem_rect->x0 = x - width / 2;
|
|
|
|
emblem_rect->y0 = y - height / 2;
|
|
|
|
emblem_rect->x1 = emblem_rect->x0 + width;
|
|
|
|
emblem_rect->y1 = emblem_rect->y0 + height;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-03-07 01:10:04 +00:00
|
|
|
for (;;) {
|
|
|
|
|
|
|
|
/* Find the side to lay out along. */
|
|
|
|
switch (layout->side) {
|
|
|
|
case RIGHT_SIDE:
|
|
|
|
x = layout->icon_rect.x1;
|
|
|
|
y = layout->icon_rect.y0;
|
|
|
|
break;
|
|
|
|
case BOTTOM_SIDE:
|
|
|
|
x = layout->icon_rect.x1;
|
|
|
|
y = layout->icon_rect.y1;
|
|
|
|
break;
|
|
|
|
case LEFT_SIDE:
|
|
|
|
x = layout->icon_rect.x0;
|
|
|
|
y = layout->icon_rect.y1;
|
|
|
|
break;
|
|
|
|
case TOP_SIDE:
|
|
|
|
x = layout->icon_rect.x0;
|
|
|
|
y = layout->icon_rect.y0;
|
|
|
|
break;
|
Fix all the warnings -Wuninitialized found. Quite a number of them were
2000-09-05 Pavel Cisler <pavel@eazel.com>
* components/help/converters/gnome-db2html2/gdb3html.c:
(xml_parse_document):
* components/help/hyperbola-nav-index.c: (end_element):
* components/services/summary/nautilus-view/nautilus-summary-view.c
: (logout_button_cb):
* components/services/time/service/trilobite-eazel-time-service.c:
(trilobite_eazel_time_service_do_http_request):
* components/tree/nautilus-tree-view.c:
* configure.in:
* libnautilus-extensions/bonobo-stream-vfs.c:
(bonobo_stream_vfs_open):
* libnautilus-extensions/nautilus-background.c:
(nautilus_background_draw), (nautilus_background_draw_aa):
* libnautilus-extensions/nautilus-customization-data.c:
(nautilus_customization_data_new):
* libnautilus-extensions/nautilus-directory-background.c:
(nautilus_directory_background_write_desktop_settings):
* libnautilus-extensions/nautilus-file-operations.c:
(nautilus_file_operations_move_to_trash), (do_empty_trash):
* libnautilus-extensions/nautilus-file.c: (nautilus_file_dump):
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(draw_or_measure_label_text), (emblem_layout_next):
* libnautilus-extensions/nautilus-icon-factory.c:
(get_image_from_cache):
* libnautilus-extensions/nautilus-icon-text-item.c:
(iti_paint_text):
* libnautilus-extensions/nautilus-list.c: (draw_cell), (draw_row):
* libnautilus-extensions/nautilus-mime-actions.c:
(nautilus_mime_add_application_to_short_list_for_uri):
* libnautilus-extensions/nautilus-program-chooser.c:
(program_file_pair_get_short_status_text),
(program_file_pair_get_long_status_text):
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_choose_component_for_file),
(nautilus_choose_application_for_file):
* libnautilus-extensions/nautilus-scalable-font.c:
(nautilus_scalable_font_draw_text_lines_with_dimensions):
* libnautilus-extensions/nautilus-theme.c:
(nautilus_theme_make_selector):
* librsvg/rsvg-ft.c: (rsvg_ft_get_glyph):
* librsvg/test-ft-gtk.c: (set_text):
* librsvg/test-ft.c: (save_pixbuf_to_file_internal),
(save_pixbuf_to_file):
* librsvg/test-rsvg.c: (save_pixbuf_to_file_internal),
(save_pixbuf_to_file):
* src/file-manager/fm-directory-view.c: (display_pending_files),
(compute_menu_item_info):
* src/file-manager/fm-icon-view.c: (compute_menu_item_info):
* src/file-manager/fm-list-view.c: (get_column_from_attribute):
* src/nautilus-application.c: (nautilus_application_startup):
* src/nautilus-search-bar-criterion.c:
(nautilus_search_bar_criterion_next_new),
(nautilus_search_bar_criterion_get_location),
(get_date_modified_location_for):
* src/nautilus-sidebar-tabs.c: (draw_one_tab_themed),
(draw_or_layout_all_tabs):
* src/nautilus-toolbar.c: (nautilus_toolbar_size_allocate):
* src/nautilus-window-manage-views.c:
(nautilus_window_get_current_location_title):
* test/test-nautilus-label.c: (justification_changed_callback):
Fix all the warnings -Wuninitialized found.
Quite a number of them were actual bugs.
Turn on -Wuninitialized in configure.in now that ORBit generates
warning-free code.
2000-09-05 20:38:10 +00:00
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
break;
|
2000-03-07 01:10:04 +00:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
static void
|
2000-05-23 23:36:08 +00:00
|
|
|
draw_pixbuf_aa (GdkPixbuf *pixbuf, GnomeCanvasBuf *buf, double affine[6], int x_offset, int y_offset)
|
2000-05-23 08:03:25 +00:00
|
|
|
{
|
2000-05-25 00:05:47 +00:00
|
|
|
void (* affine_function)
|
|
|
|
(art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride,
|
|
|
|
const art_u8 *src, int src_width, int src_height, int src_rowstride,
|
|
|
|
const double affine[6],
|
|
|
|
ArtFilterLevel level,
|
|
|
|
ArtAlphaGamma *alpha_gamma);
|
|
|
|
|
2000-05-23 23:36:08 +00:00
|
|
|
affine[4] += x_offset;
|
|
|
|
affine[5] += y_offset;
|
2000-05-25 00:05:47 +00:00
|
|
|
|
|
|
|
affine_function = gdk_pixbuf_get_has_alpha (pixbuf)
|
|
|
|
? art_rgb_rgba_affine
|
|
|
|
: art_rgb_affine;
|
2000-05-23 08:03:25 +00:00
|
|
|
|
2000-05-25 00:05:47 +00:00
|
|
|
(* affine_function)
|
|
|
|
(buf->buf,
|
|
|
|
buf->rect.x0, buf->rect.y0,
|
|
|
|
buf->rect.x1, buf->rect.y1,
|
|
|
|
buf->buf_rowstride,
|
|
|
|
gdk_pixbuf_get_pixels (pixbuf),
|
|
|
|
gdk_pixbuf_get_width (pixbuf),
|
|
|
|
gdk_pixbuf_get_height (pixbuf),
|
|
|
|
gdk_pixbuf_get_rowstride (pixbuf),
|
|
|
|
affine,
|
|
|
|
ART_FILTER_NEAREST,
|
|
|
|
NULL);
|
|
|
|
|
2000-05-23 23:36:08 +00:00
|
|
|
affine[4] -= x_offset;
|
|
|
|
affine[5] -= y_offset;
|
2000-05-23 08:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* shared code to highlight or dim the passed-in pixbuf */
|
|
|
|
static GdkPixbuf *
|
2000-06-23 17:51:53 +00:00
|
|
|
map_pixbuf (NautilusIconCanvasItem *icon_item)
|
2000-05-23 08:03:25 +00:00
|
|
|
{
|
2000-05-31 05:28:31 +00:00
|
|
|
GnomeCanvas *canvas;
|
|
|
|
char *audio_filename;
|
|
|
|
GdkPixbuf *temp_pixbuf, *old_pixbuf, *audio_pixbuf;
|
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
temp_pixbuf = icon_item->details->pixbuf;
|
2000-05-31 05:28:31 +00:00
|
|
|
canvas = GNOME_CANVAS_ITEM(icon_item)->canvas;
|
2000-05-23 08:03:25 +00:00
|
|
|
|
|
|
|
if (icon_item->details->is_prelit) {
|
|
|
|
temp_pixbuf = nautilus_create_spotlight_pixbuf (icon_item->details->pixbuf);
|
2000-05-31 05:28:31 +00:00
|
|
|
|
Added more bug numbers to FIXMEs. 94 to go.
* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf),
(draw_label_text_aa), (nautilus_icon_canvas_item_event):
* libnautilus-extensions/nautilus-icon-container.c: (icon_free),
(get_all_icon_bounds), (lay_down_icons_tblr), (lay_down_icons),
(nautilus_icon_container_move_icon), (stop_rubberbanding),
(destroy), (hide_rename_widget):
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_container_dropped_icon_feedback),
(receive_dropped_keyword), (auto_scroll_timeout_callback),
(nautilus_icon_container_find_drop_target),
(nautilus_icon_dnd_update_drop_target), (nautilus_icon_dnd_fini):
* libnautilus-extensions/nautilus-link-set.c: (link_set_path_name),
(expand_uri):
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_get_root_property),
(nautilus_link_get_additional_text), (make_local_path),
(nautilus_link_get_image_uri), (nautilus_link_get_link_uri),
(nautilus_link_get_link_type):
* src/nautilus-sidebar-title.c:
(nautilus_sidebar_title_select_text_color), (update_font),
(update_title), (update_more_info), (update_emblems),
(update_notes):
2000-08-28 23:36:35 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 2471: This hard-wired image is inappropriate to
|
2000-06-23 17:51:53 +00:00
|
|
|
* this level of code, which shouldn't know that the
|
|
|
|
* preview is audio, nor should it have an icon
|
|
|
|
* hard-wired in.
|
|
|
|
*/
|
|
|
|
|
2000-05-31 05:28:31 +00:00
|
|
|
/* if the icon is currently being previewed, superimpose an image to indicate that */
|
|
|
|
/* audio is the only kind of previewing right now, so this code isn't as general as it could be */
|
2000-06-23 17:51:53 +00:00
|
|
|
if (icon_item->details->is_active) {
|
|
|
|
/* Load the audio symbol. */
|
Some build fixes.
* acconfig.h:
* configure.in:
Removed the NAUTILUS_PREFIX that I added. I did it wrong.
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_pixmap_file):
* components/hardware/nautilus-hardware-view.c:
(setup_overview_form):
* components/services/startup/nautilus-view/nautilus-service-startup-view.c:
(setup_form_title), (setup_signup_form), (setup_config_form):
* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf):
* libnautilus-extensions/nautilus-icon-factory.c:
(make_full_icon_path):
* src/nautilus-application.c: (display_caveat):
* src/nautilus-property-browser.c:
(nautilus_property_browser_initialize),
(nautilus_emblem_dialog_new), (make_category_link):
* src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize):
Replaced most uses of gnome_pixmap_file on "nautilus/"
with a call to a new nautilus_pixmap_file in an attempt to
make installations where nautilus has a different prefix
from gnome-libs work. I now think this is a waste of time,
but Mathieu Lacage says this is still an improvement.
* components/help/Makefile.am:
* components/help/hyperbola-filefmt.c: (fmt_map_entry):
Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX.
* components/websearch/ntl-web-search.c:
(web_search_populate_engines):
Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX.
* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_initialize),
(mozilla_content_view_set_busy_cursor),
(mozilla_content_view_request_progress_change),
(mozilla_content_view_clear_busy_cursor),
(mozilla_load_location_callback), (bonobo_mozilla_callback),
(mozilla_merge_bonobo_items_callback),
(mozilla_title_changed_callback),
(mozilla_location_changed_callback), (mozilla_net_status_callback),
(mozilla_link_message_callback), (mozilla_progress_callback),
(mozilla_open_uri_callback):
Took a cut at fixing the Mozilla component for the new API.
Ramiro will have to take care of the rest.
* components/services/install/lib/Makefile.am:
* components/services/time/command-line/Makefile.am:
* components/services/time/nautilus-view/Makefile.am:
* components/services/time/service/Makefile.am:
* components/services/trilobite/libtrilobite/Makefile.am:
* components/services/trilobite/sample/command-line/Makefile.am:
* components/services/trilobite/sample/service/Makefile.am:
* libnautilus/Makefile.am:
Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested
in the form of a patch by Martijn van Beers.
* libnautilus-extensions/Makefile.am:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_get_user_main_directory),
(nautilus_get_pixmap_directory):
* libnautilus-extensions/nautilus-link-set.c:
(get_link_set_document):
* src/Makefile.am:
* src/nautilus-property-browser.c:
(nautilus_property_browser_drag_data_get), (make_drag_image),
(get_xml_path), (make_properties_from_directory):
* src/nautilus-link-set-window.c: (get_link_set_names):
* src/file-manager/Makefile.am:
* src/file-manager/fm-properties-window.c: (get_property_names):
Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX.
* libnautilus-extensions/nautilus-file-utilities.h:
* libnautilus-extensions/nautilus-file-utilities.c:
(nautilus_get_uri_from_local_path): Added a new helper function for
use when you have a path and need a URI. This does a better job
than just adding a "file://" on the front.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(get_first_callback), (nautilus_gtk_container_get_first_child):
* src/nautilus-window-toolbars.c: (setup_button):
* src/nautilus-window.c:
(replace_special_current_view_in_content_view_menu):
Implemented the first_child function and used it where appropriate.
* libnautilus-extensions/nautilus-preferences-item.c:
(add_icon_themes): Use nautilus_get_pixmap_directory intead of
misusing gnome_pixmap_file by calling it on a directory name.
* nautilus-installer/src/support.c: (create_pixmap),
(create_image): Added FIXMEs since it isn't clear if this code
will work with a Nautilus prefix that's not the same as the
gnome-libs prefix.
* Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
|
|
|
audio_filename = nautilus_pixmap_file ("audio.png");
|
2000-09-02 07:56:40 +00:00
|
|
|
if (audio_filename != NULL) {
|
|
|
|
audio_pixbuf = gdk_pixbuf_new_from_file (audio_filename);
|
|
|
|
} else {
|
|
|
|
audio_pixbuf = NULL;
|
|
|
|
}
|
2000-05-31 05:28:31 +00:00
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
/* Composite it onto the icon. */
|
|
|
|
if (audio_pixbuf != NULL) {
|
|
|
|
gdk_pixbuf_composite
|
|
|
|
(audio_pixbuf,
|
|
|
|
temp_pixbuf,
|
|
|
|
0, 0,
|
|
|
|
gdk_pixbuf_get_width (temp_pixbuf),
|
|
|
|
gdk_pixbuf_get_height(temp_pixbuf),
|
2000-08-12 07:00:39 +00:00
|
|
|
0, 0,
|
2000-06-23 17:51:53 +00:00
|
|
|
canvas->pixels_per_unit,
|
|
|
|
canvas->pixels_per_unit,
|
|
|
|
GDK_INTERP_BILINEAR, 0xFF);
|
|
|
|
|
|
|
|
gdk_pixbuf_unref (audio_pixbuf);
|
2000-05-31 05:28:31 +00:00
|
|
|
}
|
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
g_free (audio_filename);
|
2000-05-31 05:28:31 +00:00
|
|
|
}
|
2000-05-23 08:03:25 +00:00
|
|
|
}
|
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
if (icon_item->details->is_highlighted_for_selection
|
|
|
|
|| icon_item->details->is_highlighted_for_drop) {
|
2000-05-23 08:03:25 +00:00
|
|
|
old_pixbuf = temp_pixbuf;
|
|
|
|
temp_pixbuf = nautilus_create_darkened_pixbuf (temp_pixbuf,
|
|
|
|
0.8 * 255,
|
|
|
|
0.8 * 255);
|
|
|
|
if (old_pixbuf != icon_item->details->pixbuf) {
|
|
|
|
gdk_pixbuf_unref (old_pixbuf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return temp_pixbuf;
|
|
|
|
}
|
|
|
|
|
2000-05-22 22:06:46 +00:00
|
|
|
/* Draw the icon item for non-anti-aliased mode. */
|
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-05-23 08:03:25 +00:00
|
|
|
GdkPixbuf *emblem_pixbuf, *temp_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-05-23 08:03:25 +00:00
|
|
|
temp_pixbuf = map_pixbuf(icon_item);
|
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-09-25 18:20:11 +00:00
|
|
|
static void
|
|
|
|
draw_focus_rect (GdkPixbuf *pixbuf, int left, int top, int right, int bottom)
|
|
|
|
{
|
|
|
|
GdkRectangle area;
|
|
|
|
guint32 color, color_dash;
|
2000-09-25 23:36:44 +00:00
|
|
|
guchar red, green, blue, alpha, dash_color, dash_alpha;
|
2000-09-25 18:20:11 +00:00
|
|
|
guint width, height;
|
|
|
|
gboolean has_alpha;
|
|
|
|
guint pixel_offset, rowstride;
|
|
|
|
int x, y, x1, y1, x2, y2;
|
|
|
|
guchar *pixels, *row_offset, *offset;
|
|
|
|
int index, dash_width;
|
|
|
|
|
|
|
|
g_return_if_fail (pixbuf != NULL);
|
|
|
|
|
|
|
|
dash_width = 1;
|
|
|
|
|
|
|
|
color = NAUTILUS_RGBA_COLOR_PACK (0, 0, 0, 255);
|
2000-09-25 23:36:44 +00:00
|
|
|
color_dash = NAUTILUS_RGBA_COLOR_PACK (255, 255, 255, 0);
|
2000-09-25 18:20:11 +00:00
|
|
|
|
|
|
|
width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
height = gdk_pixbuf_get_height (pixbuf);
|
|
|
|
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
|
|
|
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
|
|
|
has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
|
|
|
|
|
|
|
|
pixel_offset = has_alpha ? 4 : 3;
|
|
|
|
|
|
|
|
area.x = 0;
|
|
|
|
area.y = 0;
|
|
|
|
area.width = width;
|
|
|
|
area.height = height;
|
|
|
|
|
|
|
|
red = NAUTILUS_RGBA_COLOR_GET_R (color);
|
|
|
|
green = NAUTILUS_RGBA_COLOR_GET_G (color);
|
|
|
|
blue = NAUTILUS_RGBA_COLOR_GET_B (color);
|
|
|
|
alpha = NAUTILUS_RGBA_COLOR_GET_A (color);
|
|
|
|
dash_color = NAUTILUS_RGBA_COLOR_GET_R (color_dash);
|
2000-09-25 23:36:44 +00:00
|
|
|
dash_alpha = NAUTILUS_RGBA_COLOR_GET_A (color_dash);
|
2000-09-25 18:20:11 +00:00
|
|
|
|
|
|
|
x1 = area.x;
|
|
|
|
y1 = area.y;
|
|
|
|
x2 = area.x + area.width;
|
|
|
|
y2 = area.y + area.height;
|
|
|
|
|
|
|
|
/* Draw top line */
|
|
|
|
row_offset = pixels + y1 * rowstride;
|
|
|
|
offset = row_offset + (x1 * pixel_offset);
|
|
|
|
index = 0;
|
|
|
|
for (x = x1; x < x2; x++)
|
|
|
|
{
|
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = red;
|
|
|
|
*(offset++) = green;
|
|
|
|
*(offset++) = blue;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
}
|
|
|
|
|
2000-09-25 23:36:44 +00:00
|
|
|
if (has_alpha) {
|
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = alpha;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_alpha;
|
|
|
|
}
|
2000-09-25 18:20:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if (index > dash_width) {
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Draw bottom line */
|
|
|
|
row_offset = pixels + (y2 -1) * rowstride;
|
|
|
|
offset = row_offset + (x1 * pixel_offset);
|
|
|
|
index = 0;
|
|
|
|
for (x = x1; x < x2; x++)
|
|
|
|
{
|
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = red;
|
|
|
|
*(offset++) = green;
|
|
|
|
*(offset++) = blue;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_alpha) {
|
2000-09-25 23:36:44 +00:00
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = alpha;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_alpha;
|
|
|
|
}
|
2000-09-25 18:20:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if (index > dash_width) {
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Draw left line */
|
|
|
|
row_offset = pixels + y1 * rowstride;
|
|
|
|
index = 0;
|
|
|
|
for (y = y1; y < y2; y++)
|
|
|
|
{
|
|
|
|
offset = row_offset + (x1 * pixel_offset);
|
|
|
|
|
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = red;
|
|
|
|
*(offset++) = green;
|
|
|
|
*(offset++) = blue;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_alpha) {
|
2000-09-25 23:36:44 +00:00
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = alpha;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_alpha;
|
|
|
|
}
|
2000-09-25 18:20:11 +00:00
|
|
|
}
|
|
|
|
row_offset += rowstride;
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if (index > dash_width) {
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Draw right line */
|
|
|
|
row_offset = pixels + y1 * rowstride;
|
|
|
|
index = 0;
|
|
|
|
for (y = y1; y < y2; y++)
|
|
|
|
{
|
|
|
|
offset = row_offset + ((x2 -1) * pixel_offset);
|
|
|
|
|
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = red;
|
|
|
|
*(offset++) = green;
|
|
|
|
*(offset++) = blue;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
*(offset++) = dash_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_alpha) {
|
2000-09-25 23:36:44 +00:00
|
|
|
if (index < dash_width) {
|
|
|
|
*(offset++) = alpha;
|
|
|
|
} else {
|
|
|
|
*(offset++) = dash_alpha;
|
|
|
|
}
|
2000-09-25 18:20:11 +00:00
|
|
|
}
|
|
|
|
row_offset += rowstride;
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if (index > dash_width) {
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
static void
|
|
|
|
draw_or_measure_label_text_aa (NautilusIconCanvasItem *item,
|
|
|
|
GdkPixbuf *destination_pixbuf,
|
|
|
|
int icon_left,
|
|
|
|
int icon_bottom)
|
|
|
|
{
|
|
|
|
NautilusIconCanvasItemDetails *details;
|
|
|
|
int width_so_far, height_so_far;
|
|
|
|
guint32 label_name_color;
|
|
|
|
guint32 label_info_color;
|
|
|
|
GnomeCanvasItem *canvas_item;
|
|
|
|
int max_text_width;
|
|
|
|
int icon_width, text_left, box_left;
|
|
|
|
NautilusTextLayout *icon_text_layout;
|
|
|
|
char **pieces;
|
|
|
|
const char *text_piece;
|
|
|
|
int i;
|
|
|
|
char *combined_text;
|
|
|
|
gboolean have_editable, have_additional, needs_highlight;
|
|
|
|
|
|
|
|
details = item->details;
|
|
|
|
needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
|
|
|
|
|
|
|
|
have_editable = details->editable_text != NULL && details->editable_text[0] != '\0';
|
|
|
|
have_additional = details->additional_text != NULL && details->additional_text[0] != '\0';
|
|
|
|
|
|
|
|
/* No font or no text, then do no work. */
|
|
|
|
if (!have_editable && !have_additional) {
|
|
|
|
details->text_height = 0;
|
|
|
|
details->text_width = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Combine editable and additional text for processing */
|
|
|
|
combined_text = g_strconcat
|
|
|
|
(have_editable ? details->editable_text : "",
|
|
|
|
(have_editable && have_additional) ? "\n" : "",
|
|
|
|
have_additional ? details->additional_text : "",
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
width_so_far = 0;
|
|
|
|
height_so_far = 0;
|
|
|
|
|
|
|
|
canvas_item = GNOME_CANVAS_ITEM (item);
|
2000-09-13 21:40:25 +00:00
|
|
|
if (destination_pixbuf == NULL ) {
|
|
|
|
icon_width = 0;
|
|
|
|
} else {
|
2000-09-07 20:17:09 +00:00
|
|
|
icon_width = details->pixbuf == NULL ? 0 : gdk_pixbuf_get_width (details->pixbuf);
|
|
|
|
}
|
|
|
|
|
2000-09-08 07:23:42 +00:00
|
|
|
max_text_width = floor (nautilus_icon_canvas_item_get_max_text_width (item));
|
2000-09-07 20:17:09 +00:00
|
|
|
|
|
|
|
label_name_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), TRUE);
|
|
|
|
label_info_color = nautilus_icon_container_get_label_color (NAUTILUS_ICON_CONTAINER (canvas_item->canvas), FALSE);
|
|
|
|
|
|
|
|
pieces = g_strsplit (combined_text, "\n", 0);
|
|
|
|
|
|
|
|
for (i = 0; (text_piece = pieces[i]) != NULL; i++) {
|
|
|
|
guint32 label_color;
|
|
|
|
|
|
|
|
if (needs_highlight) {
|
|
|
|
if (i == 0) {
|
|
|
|
label_color = highlight_text_color;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
label_color = highlight_text_info_color;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (i == 0) {
|
|
|
|
label_color = label_name_color;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
label_color = label_info_color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Replace empty string with space for measurement and drawing.
|
|
|
|
* This makes empty lines appear, instead of being collapsed out.
|
|
|
|
*/
|
|
|
|
if (text_piece[0] == '\0') {
|
|
|
|
text_piece = " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
icon_text_layout = nautilus_text_layout_new (details->smooth_font,
|
|
|
|
details->smooth_font_size,
|
2000-09-13 18:42:18 +00:00
|
|
|
text_piece,
|
|
|
|
LINE_BREAK_CHARACTERS,
|
2000-09-07 20:17:09 +00:00
|
|
|
max_text_width,
|
|
|
|
TRUE);
|
|
|
|
|
|
|
|
/* Draw text if we are not in user rename mode */
|
|
|
|
if (destination_pixbuf != NULL && !details->is_renaming) {
|
|
|
|
gboolean underlined;
|
|
|
|
|
|
|
|
text_left = icon_left + (icon_width - icon_text_layout->width) / 2;
|
|
|
|
|
|
|
|
/* if it's prelit, and we're in click-to-activate mode, underline the text */
|
|
|
|
underlined = (details->is_prelit && in_single_click_mode ());
|
2000-09-23 01:59:28 +00:00
|
|
|
|
|
|
|
/* draw the shadow in black */
|
|
|
|
if (needs_highlight) {
|
2000-09-27 01:36:44 +00:00
|
|
|
icon_bottom += 3; /* leave some space for selection frame */
|
|
|
|
text_left -= 1;
|
2000-09-23 01:59:28 +00:00
|
|
|
nautilus_text_layout_paint (icon_text_layout,
|
|
|
|
destination_pixbuf,
|
|
|
|
text_left + 2,
|
|
|
|
icon_bottom + height_so_far + 1,
|
|
|
|
GTK_JUSTIFY_CENTER,
|
|
|
|
NAUTILUS_RGB_COLOR_BLACK,
|
|
|
|
FALSE,
|
|
|
|
underlined);
|
|
|
|
}
|
2000-09-07 20:17:09 +00:00
|
|
|
|
2000-09-23 01:59:28 +00:00
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
nautilus_text_layout_paint (icon_text_layout,
|
|
|
|
destination_pixbuf,
|
|
|
|
text_left,
|
|
|
|
icon_bottom + height_so_far,
|
|
|
|
GTK_JUSTIFY_CENTER,
|
|
|
|
label_color,
|
|
|
|
FALSE,
|
|
|
|
underlined);
|
|
|
|
|
|
|
|
/* if it's highlighted, embolden by drawing twice */
|
|
|
|
if (needs_highlight) {
|
|
|
|
nautilus_text_layout_paint (icon_text_layout,
|
|
|
|
destination_pixbuf,
|
|
|
|
text_left + 1,
|
|
|
|
icon_bottom + height_so_far,
|
|
|
|
GTK_JUSTIFY_CENTER,
|
|
|
|
label_color,
|
|
|
|
FALSE,
|
|
|
|
underlined);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
width_so_far = MAX (width_so_far, icon_text_layout->width);
|
|
|
|
height_so_far += icon_text_layout->height;
|
|
|
|
|
|
|
|
nautilus_text_layout_free (icon_text_layout);
|
|
|
|
}
|
|
|
|
g_strfreev (pieces);
|
|
|
|
|
2000-09-26 00:07:49 +00:00
|
|
|
/* add some extra space for highlighting */
|
2000-09-07 20:17:09 +00:00
|
|
|
if (needs_highlight) {
|
2000-09-27 01:36:44 +00:00
|
|
|
height_so_far += 8; /* extra slop for nicer highlighting */
|
|
|
|
width_so_far += 15; /* account for emboldening, plus extra to make it look nicer */
|
2000-09-07 20:17:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (destination_pixbuf != NULL) {
|
|
|
|
/* Current calculations should match what we measured before drawing.
|
|
|
|
* This assumes that we will always make a separate call to measure
|
|
|
|
* before the call to draw. We might later decide to use this function
|
|
|
|
* differently and change these asserts.
|
|
|
|
*/
|
|
|
|
g_assert (height_so_far == details->text_height);
|
|
|
|
g_assert (width_so_far == details->text_width);
|
|
|
|
|
|
|
|
box_left = icon_left + (icon_width - width_so_far) / 2;
|
2000-05-24 15:43:36 +00:00
|
|
|
|
2000-09-25 18:22:58 +00:00
|
|
|
/* Indicate keyboard selection by framing the text with a gray-stippled rectangle */
|
2000-09-07 20:17:09 +00:00
|
|
|
if (details->is_highlighted_as_keyboard_focus) {
|
2000-09-25 18:20:11 +00:00
|
|
|
draw_focus_rect (destination_pixbuf, box_left, icon_bottom - 2, width_so_far, 2 + height_so_far);
|
2000-09-07 20:17:09 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* If measuring, remember the width & height. */
|
|
|
|
details->text_width = width_so_far;
|
|
|
|
details->text_height = height_so_far;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (combined_text);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
draw_label_text_aa (NautilusIconCanvasItem *icon_item, GnomeCanvasBuf *buf, double i2c[6], int x_delta)
|
|
|
|
{
|
2000-09-23 07:21:56 +00:00
|
|
|
GdkPixbuf *text_pixbuf;
|
|
|
|
NautilusIconContainer *container;
|
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
gboolean needs_highlight;
|
|
|
|
gboolean have_editable;
|
|
|
|
gboolean have_additional;
|
|
|
|
|
|
|
|
/* make sure this is really necessary */
|
|
|
|
|
|
|
|
have_editable = icon_item->details->editable_text != NULL
|
|
|
|
&& icon_item->details->editable_text[0] != '\0';
|
|
|
|
have_additional = icon_item->details->additional_text != NULL
|
|
|
|
&& icon_item->details->additional_text[0] != '\0';
|
|
|
|
|
|
|
|
/* No font or no text, then do no work. */
|
|
|
|
if (icon_item->details->smooth_font == NULL
|
|
|
|
|| (!have_editable && !have_additional)) {
|
|
|
|
icon_item->details->text_height = 0;
|
|
|
|
icon_item->details->text_width = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_item->details->is_renaming) {
|
|
|
|
/* FIXME bugzilla.eazel.com 2472:
|
|
|
|
* Why is it OK to leave text_height and
|
|
|
|
* text_width alone in this code path?
|
|
|
|
*/
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set up the background. */
|
|
|
|
needs_highlight = icon_item->details->is_highlighted_for_selection
|
|
|
|
|| icon_item->details->is_highlighted_for_drop;
|
|
|
|
|
|
|
|
if (needs_highlight) {
|
2000-09-23 07:21:56 +00:00
|
|
|
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
|
|
|
|
|
|
|
text_pixbuf = nautilus_stretch_frame_image (container->details->highlight_frame, 9, 8, 9, 8,
|
2000-09-23 01:59:28 +00:00
|
|
|
icon_item->details->text_width,
|
2000-09-23 07:21:56 +00:00
|
|
|
icon_item->details->text_height, TRUE);
|
2000-09-23 01:59:28 +00:00
|
|
|
} else {
|
|
|
|
text_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
|
|
|
|
TRUE,
|
|
|
|
8,
|
|
|
|
icon_item->details->text_width,
|
|
|
|
icon_item->details->text_height);
|
|
|
|
|
2000-09-07 20:17:09 +00:00
|
|
|
nautilus_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
|
|
|
|
NAUTILUS_RGBA_COLOR_PACK (0, 0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
draw_or_measure_label_text_aa (icon_item, text_pixbuf, x_delta, 0);
|
|
|
|
|
|
|
|
/* Draw the pixbuf containing the label. */
|
|
|
|
i2c[4] -= x_delta;
|
|
|
|
draw_pixbuf_aa (text_pixbuf, buf, i2c, 0, 0);
|
|
|
|
i2c[4] += x_delta;
|
|
|
|
gdk_pixbuf_unref (text_pixbuf);
|
|
|
|
}
|
2000-05-22 22:06:46 +00:00
|
|
|
|
|
|
|
/* draw the item for anti-aliased mode */
|
|
|
|
|
|
|
|
static void
|
|
|
|
nautilus_icon_canvas_item_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
|
|
|
|
{
|
2000-05-23 08:03:25 +00:00
|
|
|
ArtIRect icon_rect, emblem_rect;
|
|
|
|
EmblemLayout emblem_layout;
|
|
|
|
GdkPixbuf *emblem_pixbuf, *temp_pixbuf;
|
2000-05-22 22:06:46 +00:00
|
|
|
NautilusIconCanvasItem *icon_item;
|
|
|
|
double i2c[6];
|
2000-05-25 00:05:47 +00:00
|
|
|
int x_delta;
|
2000-05-22 22:06:46 +00:00
|
|
|
|
|
|
|
icon_item = NAUTILUS_ICON_CANVAS_ITEM (item);
|
2000-05-23 08:03:25 +00:00
|
|
|
|
|
|
|
/* map the pixbuf for selection or other effects */
|
2000-06-23 17:51:53 +00:00
|
|
|
temp_pixbuf = map_pixbuf (icon_item);
|
2000-05-22 22:06:46 +00:00
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
/* Compute the affine transform, but force the scale to 1.0
|
|
|
|
* because the icon factory does the scaling for us.
|
|
|
|
*/
|
2000-05-22 22:06:46 +00:00
|
|
|
gnome_canvas_item_i2c_affine (item, i2c);
|
2000-06-06 18:07:46 +00:00
|
|
|
i2c[0] = 1.0;
|
|
|
|
i2c[3] = 1.0;
|
|
|
|
|
2000-08-05 00:48:15 +00:00
|
|
|
/* force it to integer pixel boundaries to avoid losing some of the left edge */
|
|
|
|
i2c[4] = floor (i2c[4]);
|
|
|
|
i2c[5] = floor (i2c[5]);
|
|
|
|
|
2000-06-06 18:07:46 +00:00
|
|
|
if (buf->is_bg) {
|
|
|
|
gnome_canvas_buf_ensure_buf (buf);
|
|
|
|
buf->is_bg = FALSE;
|
|
|
|
}
|
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
/* draw the icon */
|
2000-06-17 01:43:30 +00:00
|
|
|
draw_pixbuf_aa (temp_pixbuf, buf, i2c, 0, 0);
|
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
if (temp_pixbuf != icon_item->details->pixbuf) {
|
|
|
|
gdk_pixbuf_unref (temp_pixbuf);
|
|
|
|
}
|
2000-05-23 08:03:25 +00:00
|
|
|
|
|
|
|
/* draw the emblems */
|
2000-05-23 23:36:08 +00:00
|
|
|
get_icon_canvas_rectangle (icon_item, &icon_rect);
|
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
emblem_layout_reset (&emblem_layout, icon_item, &icon_rect);
|
|
|
|
while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
|
2000-05-23 23:36:08 +00:00
|
|
|
draw_pixbuf_aa (emblem_pixbuf, buf, i2c, emblem_rect.x0 - icon_rect.x0,
|
|
|
|
emblem_rect.y0 - icon_rect.y0);
|
2000-05-23 08:03:25 +00:00
|
|
|
}
|
2000-05-30 21:59:07 +00:00
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
/* draw the stretch handles */
|
2000-05-30 21:59:07 +00:00
|
|
|
draw_stretch_handles_aa (icon_item, buf, &icon_rect);
|
|
|
|
|
2000-05-23 08:03:25 +00:00
|
|
|
/* draw the text */
|
2000-05-24 15:43:36 +00:00
|
|
|
i2c[5] += icon_rect.y1 - icon_rect.y0;
|
|
|
|
x_delta = (icon_item->details->text_width - (icon_rect.x1 - icon_rect.x0)) / 2;
|
|
|
|
draw_label_text_aa (icon_item, buf, i2c, x_delta);
|
2000-05-22 22:06:46 +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);
|
Added more bug numbers to FIXMEs. 94 to go.
* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf),
(draw_label_text_aa), (nautilus_icon_canvas_item_event):
* libnautilus-extensions/nautilus-icon-container.c: (icon_free),
(get_all_icon_bounds), (lay_down_icons_tblr), (lay_down_icons),
(nautilus_icon_container_move_icon), (stop_rubberbanding),
(destroy), (hide_rename_widget):
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_container_dropped_icon_feedback),
(receive_dropped_keyword), (auto_scroll_timeout_callback),
(nautilus_icon_container_find_drop_target),
(nautilus_icon_dnd_update_drop_target), (nautilus_icon_dnd_fini):
* libnautilus-extensions/nautilus-link-set.c: (link_set_path_name),
(expand_uri):
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_get_root_property),
(nautilus_link_get_additional_text), (make_local_path),
(nautilus_link_get_image_uri), (nautilus_link_get_link_uri),
(nautilus_link_get_link_type):
* src/nautilus-sidebar-title.c:
(nautilus_sidebar_title_select_text_color), (update_font),
(update_title), (update_more_info), (update_emblems),
(update_notes):
2000-08-28 23:36:35 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 2473:
|
|
|
|
* We should emit our own signal here,
|
2000-06-23 17:51:53 +00:00
|
|
|
* not one from the container; it could hook
|
|
|
|
* up to that signal and emit one of its
|
|
|
|
* own. Doing it this way hard-codes what
|
|
|
|
* "user_data" is. Also, the two signals
|
|
|
|
* should be separate. The "unpreview" signal
|
|
|
|
* does not have a return value.
|
|
|
|
*/
|
|
|
|
icon_item->details->is_active = nautilus_icon_container_emit_preview_signal
|
|
|
|
(NAUTILUS_ICON_CONTAINER (item->canvas),
|
|
|
|
NAUTILUS_ICON_CANVAS_ITEM (item)->user_data,
|
|
|
|
TRUE);
|
2000-03-09 21:09:20 +00:00
|
|
|
}
|
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
|
2000-06-23 17:51:53 +00:00
|
|
|
|| icon_item->details->is_highlighted_for_drop) {
|
2000-04-11 10:09:28 +00:00
|
|
|
/* When leaving, turn of the prelight state and the
|
|
|
|
* higlighted for drop. The latter gets turned on
|
|
|
|
* by the drag&drop motion callback.
|
|
|
|
*/
|
Added more bug numbers to FIXMEs. 94 to go.
* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf),
(draw_label_text_aa), (nautilus_icon_canvas_item_event):
* libnautilus-extensions/nautilus-icon-container.c: (icon_free),
(get_all_icon_bounds), (lay_down_icons_tblr), (lay_down_icons),
(nautilus_icon_container_move_icon), (stop_rubberbanding),
(destroy), (hide_rename_widget):
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_container_dropped_icon_feedback),
(receive_dropped_keyword), (auto_scroll_timeout_callback),
(nautilus_icon_container_find_drop_target),
(nautilus_icon_dnd_update_drop_target), (nautilus_icon_dnd_fini):
* libnautilus-extensions/nautilus-link-set.c: (link_set_path_name),
(expand_uri):
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_get_root_property),
(nautilus_link_get_additional_text), (make_local_path),
(nautilus_link_get_image_uri), (nautilus_link_get_link_uri),
(nautilus_link_get_link_type):
* src/nautilus-sidebar-title.c:
(nautilus_sidebar_title_select_text_color), (update_font),
(update_title), (update_more_info), (update_emblems),
(update_notes):
2000-08-28 23:36:35 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 2473:
|
|
|
|
* We should emit our own signal here,
|
2000-06-23 17:51:53 +00:00
|
|
|
* not one from the containe; it could hook up
|
|
|
|
* to that signal and emit one of its
|
|
|
|
* ownr. Doing it this way hard-codes what
|
|
|
|
* "user_data" is. Also, the two signals
|
|
|
|
* should be separate. The "unpreview" signal
|
|
|
|
* does not have a return value.
|
|
|
|
*/
|
|
|
|
nautilus_icon_container_emit_preview_signal
|
|
|
|
(NAUTILUS_ICON_CONTAINER (item->canvas),
|
|
|
|
NAUTILUS_ICON_CANVAS_ITEM (item)->user_data,
|
|
|
|
FALSE);
|
2000-03-09 21:09:20 +00:00
|
|
|
icon_item->details->is_prelit = FALSE;
|
2000-05-30 06:51:37 +00:00
|
|
|
icon_item->details->is_active = 0;
|
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
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2000-09-06 05:19:59 +00:00
|
|
|
/* Check whether the item is in smooth mode */
|
|
|
|
static gboolean
|
|
|
|
icon_canvas_item_is_smooth (const NautilusIconCanvasItem *icon_item)
|
|
|
|
{
|
|
|
|
GnomeCanvas *parent_canvas;
|
|
|
|
|
|
|
|
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item), FALSE);
|
|
|
|
|
|
|
|
parent_canvas = GNOME_CANVAS (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
|
|
|
|
|
|
|
return parent_canvas->aa;
|
|
|
|
}
|
|
|
|
|
Added icon stretching and did some cleanups.
Stretched icons aren't yet persistent (the scale factor is not
saved in metadata), but that's not much more work.
* libnautilus/gnome-icon-container-private.h:
* libnautilus/gnome-icon-container.h:
* libnautilus/gnome-icon-container.c: (icon_new), (icon_position),
(icon_set_position), (icon_get_size), (icon_set_size),
(icon_toggle_selected), (icon_select), (icon_set_selected),
(button_press_event), (gnome_icon_container_begin_stretch),
(start_stretching), (gnome_icon_container_stretch),
(continue_stretching), (gnome_icon_container_end_stretch),
(end_stretching), (button_release_event), (motion_notify_event),
(handle_icon_button_press), (gnome_icon_container_clear),
(request_update_one), (update_icon), (get_first_selected_icon),
(gnome_icon_container_show_stretch_handles),
(gnome_icon_container_has_stretch_handles),
(gnome_icon_container_is_stretched),
(gnome_icon_container_unstretch), (compute_stretch),
(nautilus_self_check_compute_stretch),
(nautilus_self_check_gnome_icon_container):
* libnautilus/nautilus-icons-view-icon-item.h:
* libnautilus/nautilus-icons-view-icon-item.c:
(nautilus_icons_view_icon_item_draw),
(nautilus_icons_view_icon_item_point),
(nautilus_icons_view_icon_item_set_show_stretch_handles),
(nautilus_icons_view_icon_item_get_hit_stretch_handle):
* libnautilus/nautilus-lib-self-check-functions.h:
Added machinery for stretching icons.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-directory-view.c:
(append_item_context_menu_items),
(fm_directory_view_real_append_item_context_menu_items),
(fm_directory_view_initialize_class), (create_item_context_menu):
Added machinery for views to have view-specific menu items for
icons as well as for the window as a whole.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class),
(fm_directory_view_icons_append_item_context_menu_items),
(show_stretch_handles_cb), (unstretch_item_cb):
Added menu items for stretching icons.
* libnautilus/gnome-icon-container.c: (start_rubberbanding):
Fixed bug that would result in two rubberband timeouts at
once if you did rubberbanding quickly.
* components/notes/.cvsignore: Andy's new component needs a
.cvsignore file for its generated pieces.
* libnautilus/nautilus-directory.c:
(nautilus_directory_try_to_read_metafile),
(nautilus_directory_read_metafile):
Simplified logic in metafile-reading functions and fixed a bug
where the vfs handle would be left open if certain categories
of errors occurred.
* libnautilus/nautilus-gtk-extensions.h:
Added a missing gtk_marshal function.
* libnautilus/nautilus-icon-factory.h:
* libnautilus/nautilus-icon-factory.c:
(nautilus_icon_size_for_zoom_level),
(nautilus_get_icon_size_for_zoom_level),
(nautilus_icon_factory_get_pixbuf_for_file),
(nautilus_icon_factory_get_pixmap_and_mask_for_file):
* src/nautilus-index-title.c: (nautilus_index_title_set_up_icon):
* src/nautilus-zoom-control.c: (set_zoom_level):
* src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_bump_zoom_level), (install_icon):
Made some API improvements for the icon factory. Added a missing
get_ to the name nautilus_get_icon_size_for_zoom_level and added
convenience functions for the most common uses of the factory.
* libnautilus/ntl-content-view-frame.c:
* libnautilus/ntl-meta-view-frame.c:
* libnautilus/ntl-view-frame.c:
Weaned all the files in libnautilus itself from using the
libnautilus.h include file. They instead include the parts that
they need. Also added some missing <config.h> includes.
2000-02-16 19:43:10 +00:00
|
|
|
/* Check if one of the stretch handles was hit. */
|
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-06-23 17:51:53 +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
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
void
|
Added commands for Auto vs. Manual layout, but the guts behind
them is not yet implemented.
Did some cleanup on the new renaming code.
* nautilus-glib-extensions.c:
* nautilus-glib-extensions.h:
Added nautilus_g_list_exactly_one_item and
nautilus_g_list_more_than_one_item. These are more-efficient
versions of g_list_length (x) == 1 and g_list_length (x) > 1.
* nautilus-icon-canvas-item.c:
(draw_or_measure_label_text): Add a line break between the
editable text and the additional text.
(nautilus_icon_canvas_get_text_bounds),
(nautilus_icon_canvas_get_editable_text_bounds),
(nautilus_icon_canvas_get_editable_text),
(nautilus_icon_canvas_set_renaming):
Replaced g_assert with g_return_if_fail calls, and added the
complete set of g_return_if_fail.
(nautilus_icon_canvas_set_renaming): Don't update the item
unless the renaming state has actually changed.
* nautilus-icon-canvas-item.h: Fixed formatting.
* nautilus-icon-container.c:
* nautilus-icon-container.h:
Added nautilus_icon_container_set_auto_layout and
nautilus_icon_container_is_auto_layout. For now they are
placeholders that just modify a boolean.
* nautilus-icon-private.h:
Added the auto_layout boolean.
* nautilus-icon-text-item.c:
* nautilus-icon-text-item.h:
Just some formatting and other minor cleanup.
* nautilus-metadata.h:
Added NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT.
* nautilus-location-bar.c (drag_data_received_cb): Use the new
nautilus_g_list_more_than_one_item function.
* fm-directory-view.c (bonobo_menu_open_cb), (open_cb): Use the
new nautilus_g_list_exactly_one_item.
* fm-icon-text-window.c (attribute_names_string_is_good),
(set_preference_string), (synch_menus_with_preference),
(preference_changed_callback),
(changed_attributes_option_menu_cb): Got rid of the hard-coded
first item "name" which is no longer needed. Also changed to
handle bad data in the preferences.
* fm-icon-view.c (fm_icon_view_initialize_class): Updated since
there's no "name" item needed any more.
(fm_icon_view_compute_menu_item_info): Merged MENU_PATH_RENAME
with MENU_RENAME_TEXT and simplified the logic.
(fm_icon_view_append_selection_context_menu_items): Merged
MENU_PATH_RENAME with MENU_RENAME_TEXT.
(update_layout_menus), (auto_layout_callback),
(manual_layout_callback), (fm_icon_view_merge_menus): Added menu
items for auto layout and for manual layout.
(fm_icon_view_begin_loading): Load setting for auto layout from
metadata.
(fm_icon_view_get_icon_text_attribute_names): Changed to get rid
of the "name" first item from the list of text attributes.
(get_icon_editable_text_callback): Simplified since the editable text
is always the icon name. Also got rid of copied and pasted code that's
no longer needed for this case.
(get_icon_additional_text_callback): Got rid of special case for name,
since the name is no longer treated as an attribute.
2000-04-18 01:32:55 +00:00
|
|
|
nautilus_icon_canvas_item_set_renaming (NautilusIconCanvasItem *item, gboolean state)
|
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
|
|
|
|
2000-06-23 17:51:53 +00:00
|
|
|
double
|
2000-04-22 04:24:53 +00:00
|
|
|
nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
|
|
|
|
{
|
2000-09-08 07:23:42 +00:00
|
|
|
GnomeCanvasItem *canvas_item;
|
|
|
|
|
|
|
|
canvas_item = GNOME_CANVAS_ITEM (item);
|
|
|
|
if (nautilus_icon_container_is_tighter_layout (NAUTILUS_ICON_CONTAINER (canvas_item->canvas))) {
|
|
|
|
return MAX_TEXT_WIDTH_TIGHTER * canvas_item->canvas->pixels_per_unit;
|
|
|
|
} else {
|
|
|
|
return MAX_TEXT_WIDTH_STANDARD * canvas_item->canvas->pixels_per_unit;
|
|
|
|
}
|
|
|
|
|
2000-04-22 04:24:53 +00:00
|
|
|
}
|
2000-09-06 05:19:59 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
nautilus_icon_canvas_item_set_smooth_font (NautilusIconCanvasItem *icon_item,
|
|
|
|
NautilusScalableFont *font)
|
|
|
|
{
|
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
|
|
|
|
g_return_if_fail (NAUTILUS_IS_SCALABLE_FONT (font));
|
|
|
|
|
|
|
|
gtk_object_unref (GTK_OBJECT (icon_item->details->smooth_font));
|
|
|
|
|
|
|
|
gtk_object_ref (GTK_OBJECT (font));
|
|
|
|
|
|
|
|
icon_item->details->smooth_font = font;
|
|
|
|
|
|
|
|
/* Only need to update if in smooth mode */
|
|
|
|
if (icon_canvas_item_is_smooth (icon_item)) {
|
|
|
|
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (icon_item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nautilus_icon_canvas_item_set_smooth_font_size (NautilusIconCanvasItem *icon_item,
|
|
|
|
guint font_size)
|
|
|
|
{
|
|
|
|
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (icon_item));
|
|
|
|
g_return_if_fail (font_size > 0);
|
|
|
|
|
|
|
|
if (icon_item->details->smooth_font_size == font_size) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-09-07 17:36:07 +00:00
|
|
|
icon_item->details->smooth_font_size = font_size;
|
|
|
|
|
2000-09-06 05:19:59 +00:00
|
|
|
/* Only need to update if in smooth mode */
|
|
|
|
if (icon_canvas_item_is_smooth (icon_item)) {
|
|
|
|
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (icon_item));
|
|
|
|
}
|
|
|
|
}
|