nautilus-extensions -> nautilus-private renaming.

This commit is contained in:
Ramiro Estrugo 2001-05-04 03:14:43 +00:00
parent fdea327acb
commit 90d404095e
268 changed files with 401 additions and 63460 deletions

View file

@ -18,7 +18,7 @@ INCLUDES = \
LDADD =\
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(EEL_LIBS) \
$(LIBRSVG_LIBS) \
$(BONOBO_LIBS) \

View file

@ -25,7 +25,7 @@
#include <bonobo.h>
#include <eel/eel-debug.h>
#include <gnome.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <liboaf/liboaf.h>
#include "hyperbola-nav.h"

View file

@ -6,7 +6,7 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libnautilus-extensions/nautilus-theme.h>
#include <libnautilus-private/nautilus-theme.h>
#include <libnautilus/libnautilus.h>
#include "hyperbola-nav.h"

View file

@ -10,7 +10,7 @@ INCLUDES=\
LDADD=\
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -33,8 +33,8 @@
#include <eel/eel-gtk-macros.h>
#include <gtk/gtkclist.h>
#include <gtk/gtkscrolledwindow.h>
#include <libnautilus-extensions/nautilus-bookmark.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-bookmark.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus/nautilus-view-standard-main.h>
#define FACTORY_IID "OAFIID:nautilus_history_view_factory:912d6634-d18f-40b6-bb83-bdfe16f1d15e"

View file

@ -15,7 +15,7 @@ INCLUDES = \
nautilus_image_view_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -21,7 +21,7 @@ nautilus_content_loser_SOURCES = \
nautilus_content_loser_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -21,7 +21,7 @@ nautilus_sidebar_loser_SOURCES = \
nautilus_sidebar_loser_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -25,7 +25,7 @@
Darin Adler <darin@eazel.com>
*/
/* FIXME: This file copied intactly from libnautilus-extensions
/* FIXME: This file copied intactly from libnautilus-private
* to circuvent licensing issue with Mozilla component. In
* future, when nautilus-extensions is split into public libraries,
* we can lose this file and use the extensions directly

View file

@ -24,7 +24,7 @@
Author: John Sullivan <sullivan@eazel.com>
*/
/* FIXME: This file copied intactly from libnautilus-extensions
/* FIXME: This file copied intactly from libnautilus-private
* to circuvent licensing issue with Mozilla component. In
* future, when nautilus-extensions is split into public libraries,
* we can lose this file and use the extensions directly

View file

@ -58,7 +58,7 @@ nautilus_music_view_SOURCES = \
nautilus_music_view_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -29,7 +29,7 @@
#include "nautilus-music-view.h"
#include <libnautilus/nautilus-view-standard-main.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <eel/eel-debug.h>
#define FACTORY_IID "OAFIID:nautilus_music_view_factory:1be0c129-87cd-4daa-9d3a-94397de9bce2"

View file

@ -32,11 +32,11 @@
#include "pixmaps.h"
#include <eel/eel-background.h>
#include <libnautilus-extensions/nautilus-directory-background.h>
#include <libnautilus-extensions/nautilus-directory-notify.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-private/nautilus-directory-background.h>
#include <libnautilus-private/nautilus-directory-notify.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
@ -44,8 +44,8 @@
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <libnautilus-extensions/nautilus-metadata.h>
#include <libnautilus-extensions/nautilus-sound.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-sound.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <eel/eel-string.h>

View file

@ -14,7 +14,7 @@ INCLUDES=\
LDADD=\
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -60,15 +60,15 @@
#include <eel/eel-vfs-extensions.h>
#include <eel/eel-xml-extensions.h>
#include <libnautilus-extensions/nautilus-entry.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-font-factory.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-metadata.h>
#include <libnautilus-extensions/nautilus-theme.h>
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
#include <libnautilus-private/nautilus-entry.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-theme.h>
#include <libnautilus-private/nautilus-undo-signal-handlers.h>
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-view-standard-main.h>

View file

@ -11,7 +11,7 @@ INCLUDES=\
LDADD=\
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -34,11 +34,11 @@
#include <gtk/gtkmain.h>
#include <gtk/gtktext.h>
#include <gtk/gtkvbox.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-font-factory.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-metadata.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-view-standard-main.h>
@ -46,7 +46,7 @@
* Undo not working in notes-view.
*/
#if 0
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
#include <libnautilus-private/nautilus-undo-signal-handlers.h>
#endif
#define NOTES_DEFAULT_BACKGROUND_COLOR "rgb:FFFF/FFFF/BBBB"

View file

@ -20,7 +20,7 @@ nautilus_text_view_SOURCES = \
nautilus_text_view_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -28,7 +28,7 @@
#include <config.h>
#include "nautilus-text-view.h"
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus/nautilus-view-standard-main.h>
#include <eel/eel-debug.h>

View file

@ -45,11 +45,11 @@
#include <gtk/gtkeventbox.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-font-factory.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-bonobo-extensions.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus/libnautilus.h>
#include <libnautilus/nautilus-clipboard.h>
#include <limits.h>

View file

@ -20,7 +20,7 @@ nautilus_throbber_SOURCES = \
nautilus_throbber_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(top_builddir)/libnautilus-private/libnautilus-private.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(NULL)

View file

@ -27,7 +27,7 @@
#include <eel/eel-debug.h>
#include <libgnomevfs/gnome-vfs-init.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
static int object_count = 0;

View file

@ -35,13 +35,13 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-pixmap.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <eel/eel-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
#include <libnautilus-extensions/nautilus-theme.h>
#include <libnautilus-private/nautilus-icon-factory.h>
#include <libnautilus-private/nautilus-theme.h>
#include <libnautilus/nautilus-bonobo-workarounds.h>
#include <math.h>

View file

@ -29,7 +29,7 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <libnautilus-extensions/nautilus-preferences.h>
#include <libnautilus-private/nautilus-preferences.h>
struct NautilusTreeExpansionStateDetails {
GHashTable *table;

View file

@ -29,7 +29,7 @@
#include "nautilus-tree-node-private.h"
#include <gtk/gtksignal.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <stdio.h>

View file

@ -27,8 +27,8 @@
#include "nautilus-tree-node.h"
#include "nautilus-tree-node-private.h"
#include <libnautilus-extensions/nautilus-directory.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-gtk-macros.h>

View file

@ -28,8 +28,8 @@
#include <gtk/gtkobject.h>
#include <glib.h>
#include <libnautilus-extensions/nautilus-directory.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-file.h>
typedef struct NautilusTreeNode NautilusTreeNode;
typedef struct NautilusTreeNodeClass NautilusTreeNodeClass;

View file

@ -34,8 +34,8 @@
#include <gtk/gtksignal.h>
#include <libgnome/gnome-i18n.h>
#include <eel/eel-background.h>
#include <libnautilus-extensions/nautilus-file-operations.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-private/nautilus-file-operations.h>
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>

View file

@ -41,11 +41,11 @@
#include <gtk/gtksignal.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-factory.h>
#include <stdio.h>
#define DISPLAY_TIMEOUT_INTERVAL_MSECS 500

View file

@ -61,7 +61,7 @@
/*
* The following dialog widgetry code cut-n-pasted from libnautilus-extension.
* The reason why we dont use libnautilus-extensions is that we dont want to
* The reason why we dont use libnautilus-private is that we dont want to
* incur its dependencies, especially libnautilus and thus libbonobo.
*/
static void find_message_label_callback (GtkWidget *widget,

View file

@ -1,15 +0,0 @@
.deps
.libs
*.lo
Makefile
Makefile.in
libnautilus-extensions.la
*-skels.c
*-stubs.c
*-common.c
fsextension.h
fsextension_idl_stamp
nautilus-undo-manager-component.h
nautilus_undo_manager_component_idl_stamp
nautilus-metafile-server.h
nautilus_metafile_server_idl_stamp

View file

@ -1,211 +0,0 @@
include $(top_srcdir)/Makefile.shared
lib_LTLIBRARIES=libnautilus-extensions.la
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/libnautilus \
-I$(top_srcdir)/cut-n-paste-code \
$(NAUTILUS_PRIVATE_CFLAGS) \
$(ESD_CFLAGS) \
$(MEDUSA_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
$(NULL)
dependency_static_libs = \
$(top_builddir)/cut-n-paste-code/widgets/e-paned/libe-paned.la \
$(top_builddir)/cut-n-paste-code/widgets/gimphwrapbox/libgtkhwrapbox.la \
$(NULL)
if HAVE_CDDA
CDDALIBADD = -lcdda_paranoia -lcdda_interface
else
CDDALIBADD =
endif
libnautilus_extensions_la_LDFLAGS = \
$(dependency_static_libs) \
$(NAUTILUS_PRIVATE_LIBS) \
$(ESD_LIBS) \
$(LIBJPEG) \
$(MEDUSA_LIBS) \
$(CDDALIBADD) \
$(NULL)
nautilus_metafile_server_idl_sources = \
nautilus-metafile-server-stubs.c \
nautilus-metafile-server-skels.c \
nautilus-metafile-server.h \
nautilus-metafile-server-common.c \
$(NULL)
libnautilus_extensions_la_SOURCES = \
$(nautilus_metafile_server_idl_sources) \
nautilus-audio-player.c \
nautilus-bonobo-extensions.c \
nautilus-bookmark.c \
nautilus-customization-data.c \
nautilus-dateedit-extensions.c \
nautilus-default-file-icon.c \
nautilus-directory-async.c \
nautilus-directory-background.c \
nautilus-directory-metafile-monitor.c \
nautilus-directory-metafile.c \
nautilus-directory.c \
nautilus-drag-window.c \
nautilus-druid-page-eazel.c \
nautilus-druid.c \
nautilus-entry.c \
nautilus-file-changes-queue.c \
nautilus-file-dnd.c \
nautilus-file-operations-progress.c \
nautilus-file-operations.c \
nautilus-file-utilities.c \
nautilus-file.c \
nautilus-font-factory.c \
nautilus-gconf-extensions.c \
nautilus-generous-bin.c \
nautilus-global-preferences.c \
nautilus-horizontal-splitter.c \
nautilus-icon-canvas-item.c \
nautilus-icon-container.c \
nautilus-icon-dnd.c \
nautilus-icon-factory.c \
nautilus-icon-text-item.c \
nautilus-keep-last-vertical-box.c \
nautilus-lib-self-check-functions.c \
nautilus-link-set.c \
nautilus-link.c \
nautilus-medusa-support.c \
nautilus-merged-directory.c \
nautilus-metafile-factory.c \
nautilus-metafile.c \
nautilus-mime-actions.c \
nautilus-monitor.c \
nautilus-preferences-box.c \
nautilus-preferences-group.c \
nautilus-preferences-item.c \
nautilus-preferences-pane.c \
nautilus-preferences.c \
nautilus-program-chooser.c \
nautilus-program-choosing.c \
nautilus-search-uri.c \
nautilus-sidebar-functions.c \
nautilus-sound.c \
nautilus-theme.c \
nautilus-thumbnails.c \
nautilus-thumbnails-jpeg.c \
nautilus-trash-directory.c \
nautilus-trash-file.c \
nautilus-trash-monitor.c \
nautilus-undo-context.c \
nautilus-undo-manager.c \
nautilus-undo-signal-handlers.c \
nautilus-vfs-directory.c \
nautilus-vfs-file.c \
nautilus-view-identifier.c \
nautilus-volume-monitor.c \
$(NULL)
# Everything is private for now
noinst_HEADERS = \
nautilus-audio-player.h \
nautilus-bonobo-extensions.h \
nautilus-bookmark.h \
nautilus-cdrom-extensions.h \
nautilus-customization-data.h \
nautilus-dateedit-extensions.h \
nautilus-default-file-icon.h \
nautilus-directory-background.h \
nautilus-directory-metafile-monitor.h \
nautilus-directory-metafile.h \
nautilus-directory-notify.h \
nautilus-directory-private.h \
nautilus-directory.h \
nautilus-drag-window.h \
nautilus-druid-page-eazel.h \
nautilus-druid.h \
nautilus-entry.h \
nautilus-file-attributes.h \
nautilus-file-changes-queue.h \
nautilus-file-dnd.h \
nautilus-file-operations-progress.h \
nautilus-file-operations.h \
nautilus-file-private.h \
nautilus-file-utilities.h \
nautilus-file.h \
nautilus-font-factory.h \
nautilus-gconf-extensions.h \
nautilus-generous-bin.h \
nautilus-global-preferences.h \
nautilus-horizontal-splitter.h \
nautilus-icon-canvas-item.h \
nautilus-icon-container.h \
nautilus-icon-dnd.h \
nautilus-icon-factory-private.h \
nautilus-icon-factory.h \
nautilus-icon-private.h \
nautilus-icon-text-item.h \
nautilus-iso9660.h \
nautilus-keep-last-vertical-box.h \
nautilus-lib-self-check-functions.h \
nautilus-link-set.h \
nautilus-link.h \
nautilus-medusa-support.h \
nautilus-merged-directory.h \
nautilus-metadata.h \
nautilus-metafile-factory.h \
nautilus-metafile.h \
nautilus-mime-actions.h \
nautilus-monitor.h \
nautilus-preferences-box.h \
nautilus-preferences-group.h \
nautilus-preferences-item.h \
nautilus-preferences-pane.h \
nautilus-preferences.h \
nautilus-program-chooser.h \
nautilus-program-choosing.h \
nautilus-search-uri.h \
nautilus-sidebar-functions.h \
nautilus-sound.h \
nautilus-theme.h \
nautilus-thumbnails.h \
nautilus-thumbnails-jpeg.h \
nautilus-trash-directory.h \
nautilus-trash-file.h \
nautilus-trash-monitor.h \
nautilus-undo-context.h \
nautilus-undo-manager.h \
nautilus-undo-signal-handlers.h \
nautilus-vfs-directory.h \
nautilus-vfs-file.h \
nautilus-view-identifier.h \
nautilus-volume-monitor.h \
$(NULL)
$(lib_LTLIBRARIES): $(dependency_static_libs)
$(nautilus_metafile_server_idl_sources): nautilus_metafile_server_idl_stamp
nautilus_metafile_server_idl_stamp: nautilus-metafile-server.idl $(ORBIT_IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) $(srcdir)/nautilus-metafile-server.idl
touch nautilus_metafile_server_idl_stamp
$(libnautilus_extensions_la_OBJECTS): nautilus_metafile_server_idl_stamp
EXTRA_DIST = \
nautilus-metafile-server.idl \
$(NULL)
BUILT_SOURCES = \
$(nautilus_metafile_server_idl_sources) \
$(NULL)
CLEANFILES = \
$(nautilus_metafile_server_idl_sources) \
nautilus_metafile_server_idl_stamp \
$(NULL)
dist-hook:
cd $(distdir); rm -f $(CLEANFILES)

View file

@ -1,19 +0,0 @@
README for nautilus/libnautilus-extensions
This library, libnautilus-extensions, is totally private to nautilus.
If you are writing a nautilus component, you should not use this
library or link with it in any way.
Soon, libnautilus-extensions will be renamed to nautilus-internals to
emphasize the fact that this is code that is internal to nautilus and
not available for public consumption.
If you think that there is something interesting in this library that
you would like to use in a third party component, please send mail to
the nautilus mailing list at:
nautilus-list@lists.eazel.com

View file

@ -1,549 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-audio-player.c - Simple threaded audio file playback.
Copyright (C) 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Gene Z. Ragan <gzr@eazel.com>
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <esd.h>
#include "nautilus-audio-player.h"
/* BUFFER_FRAMES represents the size of the buffer in frames. */
#define BUFFER_FRAMES 4096
#define PLAYER_STREAM_NAME "nautilus-audio-player"
typedef enum {
FORMAT_U8,
FORMAT_S8,
FORMAT_U16_LE,
FORMAT_U16_BE,
FORMAT_U16_NE,
FORMAT_S16_LE,
FORMAT_S16_BE,
FORMAT_S16_NE
}
AudioFormat;
typedef struct {
pthread_t buffer_thread;
gint fd;
gpointer buffer;
gboolean going, prebuffer, paused;
gint buffer_size, prebuffer_size, block_size;
gint rd_index, wr_index;
gint output_time_offset;
guint64 written, output_bytes;
gint bps, ebps;
gint flush;
gint channels, frequency, latency;
AudioFormat format;
esd_format_t esd_format;
gint input_bps, input_format, input_frequency, input_channels;
char *hostname;
ESDConfig esd_config;
void *(*esd_translate)(void *, gint);
} ESDInfo;
static gboolean esdout_open (ESDInfo *info,
AudioFormat format,
gint rate,
gint nch);
static void esdout_close (ESDInfo *info);
static void esdout_set_audio_params (ESDInfo *info);
static void esdout_write (ESDInfo *info,
gpointer data,
int length);
static int esdout_used (ESDInfo *info);
static gboolean esdout_playing (ESDInfo *info);
static void *
player_thread (void *arg)
{
NautilusAudioPlayerData *data;
AFframecount frames_read;
int sample_format, frame_size, channel_count, sample_width;
double rate;
void *buffer;
ESDInfo info;
data = arg;
if (data == NULL) {
pthread_exit (NULL);
return (void *) 0;
}
/* Read information from file */
afGetSampleFormat (data->handle, AF_DEFAULT_TRACK, &sample_format, &sample_width);
frame_size = afGetFrameSize (data->handle, AF_DEFAULT_TRACK, 1);
channel_count = afGetChannels (data->handle, AF_DEFAULT_TRACK);
rate = afGetRate (data->handle, AF_DEFAULT_TRACK);
/* Attempt to open ESD */
if (!esdout_open (&info, sample_width == 16 ? FORMAT_S16_NE : FORMAT_U8, (int)rate, channel_count)) {
pthread_exit (NULL);
return (void *) 0;
}
/* Read audio data from file and send it to the esd output thread */
buffer = malloc (BUFFER_FRAMES * frame_size);
frames_read = afReadFrames (data->handle, AF_DEFAULT_TRACK, buffer, BUFFER_FRAMES);
while (frames_read > 0 && data->running) {
esdout_write (&info, buffer, frames_read * frame_size);
frames_read = afReadFrames (data->handle, AF_DEFAULT_TRACK, buffer, BUFFER_FRAMES);
}
afCloseFile (data->handle);
/* Now wait for the esd output thread to complete it task */
while (esdout_playing (&info) && data->running) {
usleep (20000);
}
/* Shutdown esd output thread */
esdout_close (&info);
g_free (buffer);
pthread_exit (NULL);
return (void *) 0;
}
NautilusAudioPlayerData *
nautilus_audio_player_play (const char *filename)
{
AFfilehandle handle;
NautilusAudioPlayerData *data;
handle = afOpenFile (filename, "r", NULL);
if (handle == AF_NULL_FILEHANDLE) {
return NULL;
}
data = g_new0 (NautilusAudioPlayerData, 1);
data->handle = handle;
data->running = TRUE;
pthread_create (&data->player_id, NULL, player_thread, data);
return data;
}
void
nautilus_audio_player_stop (NautilusAudioPlayerData *data)
{
if (data == NULL) {
return;
}
data->running = FALSE;
pthread_join (data->player_id, NULL);
}
static void
esdout_init (ESDInfo *info)
{
memset (&info->esd_config, 0, sizeof (ESDConfig));
info->fd = 0;
info->going = FALSE;
info->paused = FALSE;
info->buffer = NULL;
info->block_size = BUFFER_FRAMES;
info->rd_index = 0;
info->wr_index = 0;
info->output_time_offset = 0;
info->written = 0;
info->output_bytes = 0;
info->hostname = NULL;
info->esd_config.port = ESD_DEFAULT_PORT;
info->esd_config.buffer_size = 3000;
info->esd_config.prebuffer = 25;
}
static void
esdout_write (ESDInfo *info, gpointer data, int length)
{
int count, offset;
offset = 0;
info->written += length;
while (length > 0) {
count = MIN (length, info->buffer_size - info->wr_index);
memcpy ((char *)info->buffer + info->wr_index, (char *)data + offset, count);
info->wr_index = (info->wr_index + count) % info->buffer_size;
length -= count;
offset += count;
}
}
static gint
get_latency (ESDInfo *config)
{
int fd, amount = 0;
#ifndef HAVE_ESD_GET_LATENCY
esd_server_info_t *info;
#endif
fd = esd_open_sound (config->hostname);
if (fd == -1) {
return 0;
}
#ifdef HAVE_ESD_GET_LATENCY
amount = get_latency (fd);
#else
info = esd_get_server_info (fd);
if (info != NULL) {
if (info->format & ESD_STEREO) {
if (info->format & ESD_BITS16)
amount = (44100 * (ESD_BUF_SIZE + 64)) / info->rate;
else
amount = (44100 * (ESD_BUF_SIZE + 128)) / info->rate;
} else {
if (info->format & ESD_BITS16)
amount = (2 * 44100 * (ESD_BUF_SIZE + 128)) / info->rate;
else
amount = (2 * 44100 * (ESD_BUF_SIZE + 256)) / info->rate;
}
free (info);
}
amount += ESD_BUF_SIZE * 2;
#endif
esd_close (fd);
return amount;
}
static void *
esd_stou8 (void *data, gint length)
{
int len = length;
unsigned char *dat = (unsigned char *)data;
while (len-- > 0)
*dat++ ^= 0x80;
return data;
}
static void *
esd_utos16sw (void *data, gint length)
{
int len = length;
short *dat = data;
while ( len > 0 ) {
*dat = GUINT16_SWAP_LE_BE ( *dat ) ^ 0x8000;
dat++;
len-=2;
}
return data;
}
static void *
esd_utos16 (void *data, gint length)
{
int len = length;
short *dat = data;
while ( len > 0 ) {
*dat ^= 0x8000;
dat++;
len-=2;
}
return data;
}
static void *
esd_16sw (void *data, gint length)
{
int len = length;
short *dat = data;
while ( len > 0 ) {
*dat = GUINT16_SWAP_LE_BE( *dat );
dat++;
len-=2;
}
return data;
}
static void
esdout_setup_format (ESDInfo *info, AudioFormat format, gint rate, gint nch)
{
gboolean swap_sign = FALSE;
gboolean swap_16 = FALSE;
info->format = format;
info->frequency = rate;
info->channels = nch;
switch (format) {
case FORMAT_S8:
swap_sign = TRUE;
case FORMAT_U8:
info->esd_format = ESD_BITS8;
break;
case FORMAT_U16_LE:
case FORMAT_U16_BE:
case FORMAT_U16_NE:
swap_sign = TRUE;
case FORMAT_S16_LE:
case FORMAT_S16_BE:
case FORMAT_S16_NE:
info->esd_format = ESD_BITS16;
break;
}
#ifdef WORDS_BIGENDIAN
if (format == FORMAT_U16_LE || format == FORMAT_S16_LE) {
#else
if (format == FORMAT_U16_BE || format == FORMAT_S16_BE) {
#endif
swap_16 = TRUE;
}
info->esd_translate = (void*(*)())NULL;
if (info->esd_format == ESD_BITS8) {
if (swap_sign == TRUE) {
info->esd_translate = esd_stou8;
}
} else {
if (swap_sign == TRUE) {
if (swap_16 == TRUE) {
info->esd_translate = esd_utos16sw;
} else {
info->esd_translate = esd_utos16;
}
} else {
if (swap_16 == TRUE) {
info->esd_translate = esd_16sw;
}
}
}
info->bps = rate * nch;
if (info->esd_format == ESD_BITS16) {
info->bps *= 2;
}
if (nch == 1) {
info->esd_format |= ESD_MONO;
} else {
info->esd_format |= ESD_STEREO;
}
info->esd_format |= ESD_STREAM | ESD_PLAY;
info->latency = ((get_latency (info) * info->frequency) / 44100) * info->channels;
if (info->format != FORMAT_U8 && info->format != FORMAT_S8) {
info->latency *= 2;
}
}
static gint
esdout_used (ESDInfo *info)
{
if (info->wr_index >= info->rd_index) {
return info->wr_index - info->rd_index;
}
return info->buffer_size - (info->rd_index - info->wr_index);
}
static void
esdout_write_audio (ESDInfo *info, gint length)
{
AudioFormat new_format;
gint new_frequency, new_channels;
char *data;
data = (char *)info->buffer + info->rd_index;
new_format = info->input_format;
new_frequency = info->input_frequency;
new_channels = info->input_channels;
if (new_format != info->format || new_frequency != info->frequency || new_channels != info->channels) {
info->output_time_offset += (gint) ((info->output_bytes * 1000) / info->ebps);
info->output_bytes = 0;
esdout_setup_format (info, new_format, new_frequency, new_channels);
info->frequency = new_frequency;
info->channels = new_channels;
close (info->fd);
esdout_set_audio_params (info);
}
if (info->esd_translate) {
info->output_bytes += write (info->fd, info->esd_translate (data, length), length);
} else {
info->output_bytes += write (info->fd, data, length);
}
}
static void
esdout_close (ESDInfo *info)
{
info->going = FALSE;
info->wr_index = 0;
info->rd_index = 0;
info->going = 0;
g_free (info->hostname);
info->hostname = NULL;
pthread_join (info->buffer_thread, NULL);
}
static void *
esdout_loop (void *arg)
{
int length, count, used;
ESDInfo *info;
info = arg;
while (info->going) {
used = esdout_used (info);
if (used > info->prebuffer_size) {
info->prebuffer = FALSE;
}
if (used > 0 && !info->paused && !info->prebuffer) {
length = MIN (info->block_size, used);
while (length > 0) {
count = MIN (length, info->buffer_size - info->rd_index);
esdout_write_audio (info, count);
info->rd_index = (info->rd_index + count) % info->buffer_size;
length -= count;
}
} else {
usleep (10000);
}
if (info->flush != -1) {
info->output_time_offset = info->flush;
info->written = (guint64)(info->flush / 10) * (guint64)(info->input_bps / 100);
info->rd_index = info->wr_index = info->output_bytes = 0;
info->flush = -1;
info->prebuffer = TRUE;
}
}
close (info->fd);
g_free (info->buffer);
while (info->going) {
usleep (10000);
}
pthread_exit (NULL);
return (void *) 0;
}
static void
esdout_set_audio_params (ESDInfo *info)
{
info->fd = esd_play_stream (info->esd_format, info->frequency, info->hostname, PLAYER_STREAM_NAME);
info->ebps = info->frequency * info->channels;
if (info->format == FORMAT_U16_BE || info->format == FORMAT_U16_LE || info->format == FORMAT_S16_BE
|| info->format == FORMAT_S16_LE || info->format == FORMAT_S16_NE || info->format == FORMAT_U16_NE) {
info->ebps *= 2;
}
}
static gboolean
esdout_open (ESDInfo *info, AudioFormat format, gint rate, gint nch)
{
esdout_init (info);
esdout_setup_format (info, format, rate, nch);
info->input_format = info->format;
info->input_channels = info->channels;
info->input_frequency = info->frequency;
info->input_bps = info->bps;
info->buffer_size = (info->esd_config.buffer_size * info->input_bps) / 1000;
if (info->buffer_size < 8192) {
info->buffer_size = 8192;
}
info->prebuffer_size = (info->buffer_size * info->esd_config.prebuffer) / 100;
if (info->buffer_size - info->prebuffer_size < 4096) {
info->prebuffer_size = info->buffer_size - 4096;
}
info->buffer = g_malloc0 (info->buffer_size);
info->flush = -1;
info->prebuffer = TRUE;
info->wr_index = info->rd_index = info->output_time_offset = info->written = info->output_bytes = 0;
info->paused = FALSE;
if (info->hostname != NULL) {
g_free (info->hostname);
}
if (info->esd_config.use_remote) {
info->hostname = g_strdup_printf ("%s:%d", info->esd_config.server, info->esd_config.port);
} else {
info->hostname = NULL;
}
esdout_set_audio_params (info);
if (info->fd == -1) {
g_free (info->buffer);
info->buffer = NULL;
return FALSE;
}
info->going = TRUE;
pthread_create (&info->buffer_thread, NULL, esdout_loop, info);
return TRUE;
}
static gboolean
esdout_playing (ESDInfo *info)
{
if (!info->going) {
return FALSE;
}
if (esdout_used (info) <= 0) {
return FALSE;
}
return TRUE;
}

View file

@ -1,55 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-audio-player.h - Simple threaded audio file playback.
Copyright (C) 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Gene Z. Ragan <gzr@eazel.com>
*/
#ifndef NAUTILUS_AUDIO_PLAYER__
#define NAUTILUS_AUDIO_PLAYER__
#include <config.h>
#include <sys/types.h>
#include <audiofile.h>
#include <pthread.h>
#include <glib.h>
typedef struct {
gboolean use_remote;
gchar *server;
gint port;
gint buffer_size;
gint prebuffer;
} ESDConfig;
typedef struct {
AFfilehandle handle;
pthread_t player_id;
gboolean running;
ESDConfig esd_config;
} NautilusAudioPlayerData;
NautilusAudioPlayerData *nautilus_audio_player_play (const char *filename);
void nautilus_audio_player_stop (NautilusAudioPlayerData *data);
#endif

View file

@ -1,630 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.c - implementation of new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000, 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
Darin Adler <darin@eazel.com>
*/
#include <config.h>
#include "nautilus-bonobo-extensions.h"
#include <eel/eel-string.h>
#include <bonobo/bonobo-ui-util.h>
#include <gtk/gtkmain.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <liboaf/oaf-async.h>
struct NautilusBonoboActivationHandle {
NautilusBonoboActivationHandle **early_completion_hook;
NautilusBonoboActivationCallback callback;
gpointer callback_data;
Bonobo_Unknown activated_object;
gboolean cancel;
guint idle_id;
};
typedef enum {
NUMBERED_MENU_ITEM_PLAIN,
NUMBERED_MENU_ITEM_TOGGLE,
NUMBERED_MENU_ITEM_RADIO
} NumberedMenuItemType;
void
nautilus_bonobo_set_accelerator (BonoboUIComponent *ui,
const char *path,
const char *accelerator)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
bonobo_ui_component_set_prop (ui, path,
"accel",
accelerator,
NULL);
}
void
nautilus_bonobo_set_label (BonoboUIComponent *ui,
const char *path,
const char *label)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
bonobo_ui_component_set_prop (ui, path,
"label",
label,
NULL);
}
void
nautilus_bonobo_set_tip (BonoboUIComponent *ui,
const char *path,
const char *tip)
{
g_return_if_fail (ui != NULL);
bonobo_ui_component_set_prop (ui, path,
"tip",
tip,
NULL);
}
void
nautilus_bonobo_set_sensitive (BonoboUIComponent *ui,
const char *path,
gboolean sensitive)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
bonobo_ui_component_set_prop (ui, path,
"sensitive",
sensitive ? "1" : "0",
NULL);
}
void
nautilus_bonobo_set_toggle_state (BonoboUIComponent *ui,
const char *path,
gboolean state)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
bonobo_ui_component_set_prop (ui, path,
"state",
state ? "1" : "0",
NULL);
}
void
nautilus_bonobo_set_hidden (BonoboUIComponent *ui,
const char *path,
gboolean hidden)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
bonobo_ui_component_set_prop (ui, path,
"hidden",
hidden ? "1" : "0",
NULL);
}
char *
nautilus_bonobo_get_label (BonoboUIComponent *ui,
const char *path)
{
g_return_val_if_fail (BONOBO_IS_UI_COMPONENT (ui), FALSE);
return bonobo_ui_component_get_prop (ui, path, "label", NULL);
}
gboolean
nautilus_bonobo_get_hidden (BonoboUIComponent *ui,
const char *path)
{
char *value;
gboolean hidden;
g_return_val_if_fail (BONOBO_IS_UI_COMPONENT (ui), FALSE);
value = bonobo_ui_component_get_prop (ui, path, "hidden", NULL);
if (value == NULL) {
/* No hidden attribute means not hidden. */
hidden = FALSE;
} else {
/* Anything other than "0" counts as TRUE */
hidden = strcmp (value, "0") != 0;
}
g_free (value);
return hidden;
}
static char *
get_numbered_menu_item_name (BonoboUIComponent *ui,
const char *container_path,
guint index)
{
return g_strdup_printf ("%u", index);
}
char *
nautilus_bonobo_get_numbered_menu_item_path (BonoboUIComponent *ui,
const char *container_path,
guint index)
{
char *item_name;
char *item_path;
g_return_val_if_fail (BONOBO_IS_UI_COMPONENT (ui), NULL);
g_return_val_if_fail (container_path != NULL, NULL);
item_name = get_numbered_menu_item_name (ui, container_path, index);
item_path = g_strconcat (container_path, "/", item_name, NULL);
g_free (item_name);
return item_path;
}
char *
nautilus_bonobo_get_numbered_menu_item_command (BonoboUIComponent *ui,
const char *container_path,
guint index)
{
char *command_name;
char *path;
g_return_val_if_fail (BONOBO_IS_UI_COMPONENT (ui), NULL);
g_return_val_if_fail (container_path != NULL, NULL);
path = nautilus_bonobo_get_numbered_menu_item_path (ui, container_path, index);
command_name = gnome_vfs_escape_string (path);
g_free (path);
return command_name;
}
guint
nautilus_bonobo_get_numbered_menu_item_index_from_command (const char *command)
{
char *path;
char *index_string;
int index;
gboolean got_index;
path = gnome_vfs_unescape_string (command, NULL);
index_string = strrchr (path, '/');
if (index_string == NULL) {
got_index = FALSE;
} else {
got_index = eel_str_to_int (index_string + 1, &index);
}
g_free (path);
g_return_val_if_fail (got_index, 0);
return index;
}
char *
nautilus_bonobo_get_numbered_menu_item_container_path_from_command (const char *command)
{
char *path;
char *index_string;
char *container_path;
path = gnome_vfs_unescape_string (command, NULL);
index_string = strrchr (path, '/');
container_path = index_string == NULL
? NULL
: g_strndup (path, index_string - path);
g_free (path);
return container_path;
}
static void
add_numbered_menu_item_internal (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label,
NumberedMenuItemType type,
GdkPixbuf *pixbuf,
const char *radio_group_name)
{
char *xml_item, *xml_command;
char *encoded_label, *command_name;
char *item_name, *pixbuf_data;
g_assert (BONOBO_IS_UI_COMPONENT (ui));
g_assert (container_path != NULL);
g_assert (label != NULL);
g_assert (type == NUMBERED_MENU_ITEM_PLAIN || pixbuf == NULL);
g_assert (type == NUMBERED_MENU_ITEM_RADIO || radio_group_name == NULL);
g_assert (type != NUMBERED_MENU_ITEM_RADIO || radio_group_name != NULL);
/* Because we are constructing the XML ourselves, we need to
* encode the label.
*/
encoded_label = bonobo_ui_util_encode_str (label);
item_name = get_numbered_menu_item_name
(ui, container_path, index);
command_name = nautilus_bonobo_get_numbered_menu_item_command
(ui, container_path, index);
switch (type) {
case NUMBERED_MENU_ITEM_TOGGLE:
xml_item = g_strdup_printf ("<menuitem name=\"%s\" label=\"%s\" id=\"%s\" type=\"toggle\"/>\n",
item_name, encoded_label, command_name);
break;
case NUMBERED_MENU_ITEM_RADIO:
xml_item = g_strdup_printf ("<menuitem name=\"%s\" label=\"%s\" id=\"%s\" type=\"radio\" group=\"%s\"/>\n",
item_name, encoded_label, command_name, radio_group_name);
break;
case NUMBERED_MENU_ITEM_PLAIN:
if (pixbuf != NULL) {
pixbuf_data = bonobo_ui_util_pixbuf_to_xml (pixbuf);
xml_item = g_strdup_printf ("<menuitem name=\"%s\" label=\"%s\" verb=\"%s\" pixtype=\"pixbuf\" pixname=\"%s\"/>\n",
item_name, encoded_label, command_name, pixbuf_data);
g_free (pixbuf_data);
} else {
xml_item = g_strdup_printf ("<menuitem name=\"%s\" label=\"%s\" verb=\"%s\"/>\n",
item_name, encoded_label, command_name);
}
break;
default:
g_assert_not_reached ();
xml_item = NULL; /* keep compiler happy */
}
g_free (encoded_label);
g_free (item_name);
bonobo_ui_component_set (ui, container_path, xml_item, NULL);
g_free (xml_item);
/* Make the command node here too, so callers can immediately set
* properties on it (otherwise it doesn't get created until some
* time later).
*/
xml_command = g_strdup_printf ("<cmd name=\"%s\"/>\n", command_name);
bonobo_ui_component_set (ui, "/commands", xml_command, NULL);
g_free (xml_command);
g_free (command_name);
}
/* Add a menu item specified by number into a given path. Used for
* dynamically creating a related series of menu items. Each index
* must be unique (normal use is to call this in a loop, and
* increment the index for each item).
*/
void
nautilus_bonobo_add_numbered_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label,
GdkPixbuf *pixbuf)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (container_path != NULL);
g_return_if_fail (label != NULL);
add_numbered_menu_item_internal (ui, container_path, index, label, NUMBERED_MENU_ITEM_PLAIN, pixbuf, NULL);
}
/* Add a menu item specified by number into a given path. Used for
* dynamically creating a related series of toggle menu items. Each index
* must be unique (normal use is to call this in a loop, and
* increment the index for each item).
*/
void
nautilus_bonobo_add_numbered_toggle_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (container_path != NULL);
g_return_if_fail (label != NULL);
add_numbered_menu_item_internal (ui, container_path, index, label, NUMBERED_MENU_ITEM_TOGGLE, NULL, NULL);
}
/* Add a menu item specified by number into a given path. Used for
* dynamically creating a related series of radio menu items. Each index
* must be unique (normal use is to call this in a loop, and
* increment the index for each item).
*/
void
nautilus_bonobo_add_numbered_radio_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label,
const char *radio_group_name)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (container_path != NULL);
g_return_if_fail (label != NULL);
add_numbered_menu_item_internal (ui, container_path, index, label, NUMBERED_MENU_ITEM_RADIO, NULL, radio_group_name);
}
void
nautilus_bonobo_add_submenu (BonoboUIComponent *ui,
const char *path,
const char *label)
{
char *xml_string, *encoded_label, *name;
/* Because we are constructing the XML ourselves, we need to
* encode the label.
*/
encoded_label = bonobo_ui_util_encode_str (label);
/* Labels may contain characters that are illegal in names. So
* we create the name by URI-encoding the label.
*/
name = gnome_vfs_escape_string (label);
xml_string = g_strdup_printf ("<submenu name=\"%s\" label=\"%s\"/>\n",
name, encoded_label);
bonobo_ui_component_set (ui, path, xml_string, NULL);
g_free (encoded_label);
g_free (name);
g_free (xml_string);
}
void
nautilus_bonobo_add_menu_separator (BonoboUIComponent *ui, const char *path)
{
bonobo_ui_component_set (ui, path, "<separator/>", NULL);
}
static void
remove_commands (BonoboUIComponent *ui, const char *container_path)
{
BonoboUINode *path_node;
BonoboUINode *child_node;
char *verb_name;
char *id_name;
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (container_path != NULL);
path_node = bonobo_ui_component_get_tree (ui, container_path, TRUE, NULL);
if (path_node == NULL) {
return;
}
bonobo_ui_component_freeze (ui, NULL);
for (child_node = bonobo_ui_node_children (path_node);
child_node != NULL;
child_node = bonobo_ui_node_next (child_node)) {
verb_name = bonobo_ui_node_get_attr (child_node, "verb");
if (verb_name != NULL) {
bonobo_ui_component_remove_verb (ui, verb_name);
bonobo_ui_node_free_string (verb_name);
} else {
/* Only look for an id if there's no verb */
id_name = bonobo_ui_node_get_attr (child_node, "id");
if (id_name != NULL) {
bonobo_ui_component_remove_listener (ui, id_name);
bonobo_ui_node_free_string (id_name);
}
}
}
bonobo_ui_component_thaw (ui, NULL);
bonobo_ui_node_free (path_node);
}
/**
* nautilus_bonobo_remove_menu_items_and_verbs
*
* Removes all menu items contained in a menu or placeholder, and
* their verbs.
*
* @uih: The BonoboUIHandler for this menu item.
* @container_path: The standard bonobo-style path specifier for this placeholder or submenu.
*/
void
nautilus_bonobo_remove_menu_items_and_commands (BonoboUIComponent *ui,
const char *container_path)
{
char *remove_wildcard;
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (container_path != NULL);
remove_commands (ui, container_path);
/* For speed, remove menu items themselves all in one fell swoop,
* though we removed the verbs one-by-one.
*/
remove_wildcard = g_strdup_printf ("%s/*", container_path);
bonobo_ui_component_rm (ui, remove_wildcard, NULL);
g_free (remove_wildcard);
}
/* Call to set the user-visible label of a menu item to a string
* containing an underscore accelerator. The underscore is stripped
* off before setting the label of the command, because pop-up menu
* and toolbar button labels shouldn't have the underscore.
*/
void
nautilus_bonobo_set_label_for_menu_item_and_command (BonoboUIComponent *ui,
const char *menu_item_path,
const char *command_path,
const char *label_with_underscore)
{
char *label_no_underscore;
label_no_underscore = eel_str_strip_chr (label_with_underscore, '_');
nautilus_bonobo_set_label (ui,
menu_item_path,
label_with_underscore);
nautilus_bonobo_set_label (ui,
command_path,
label_no_underscore);
g_free (label_no_underscore);
}
void
nautilus_bonobo_set_icon (BonoboUIComponent *ui,
const char *path,
const char *icon_relative_path)
{
g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
g_return_if_fail (path != NULL);
g_return_if_fail (icon_relative_path != NULL);
/* We don't do a get_prop here before setting since it just
* means more round-trip CORBA calls.
*/
bonobo_ui_component_set_prop (ui, path,
"pixname",
icon_relative_path, NULL);
bonobo_ui_component_set_prop (ui, path,
"pixtype",
"filename", NULL);
}
static void
activation_handle_done (NautilusBonoboActivationHandle *handle)
{
if (handle->early_completion_hook != NULL) {
g_assert (*handle->early_completion_hook == handle);
*handle->early_completion_hook = NULL;
}
}
static gboolean
activation_idle_callback (gpointer callback_data)
{
NautilusBonoboActivationHandle *handle;
handle = (NautilusBonoboActivationHandle *) callback_data;
(* handle->callback) (handle,
handle->activated_object,
handle->callback_data);
activation_handle_done (handle);
g_free (handle);
return FALSE;
}
static void
activation_cancel (NautilusBonoboActivationHandle *handle)
{
bonobo_object_release_unref (handle->activated_object, NULL);
activation_handle_done (handle);
g_free (handle);
}
static void
oaf_activation_callback (Bonobo_Unknown activated_object,
const char *error_reason,
gpointer callback_data)
{
NautilusBonoboActivationHandle *handle;
handle = (NautilusBonoboActivationHandle *) callback_data;
handle->activated_object = activated_object;
if (handle->cancel) {
activation_cancel (handle);
} else {
handle->idle_id = gtk_idle_add (activation_idle_callback,
handle);
}
}
/**
* nautilus_bonobo_activate_from_id:
* @iid: iid of component to activate.
* @callback: callback to call when activation finished.
* @user_data: data to pass to callback when activation finished.
*
* This function will return NULL if something bad happened during
* activation.
*/
NautilusBonoboActivationHandle *
nautilus_bonobo_activate_from_id (const char *iid,
NautilusBonoboActivationCallback callback,
gpointer callback_data)
{
NautilusBonoboActivationHandle *handle;
g_return_val_if_fail (iid != NULL, NULL);
g_return_val_if_fail (callback != NULL, NULL);
handle = g_new0 (NautilusBonoboActivationHandle, 1);
handle->early_completion_hook = &handle;
handle->callback = callback;
handle->callback_data = callback_data;
oaf_activate_from_id_async ((char *) iid, 0,
oaf_activation_callback,
handle, NULL);
if (handle != NULL) {
handle->early_completion_hook = NULL;
}
return handle;
}
/**
* nautilus_bonobo_activate_stop:
* @iid: iid of component to activate.
* @callback: callback to call when activation finished.
* @user_data: data to pass to callback when activation finished.
*
* Stops activation of a component. Your callback will not be called
* after this call.
*/
void
nautilus_bonobo_activate_cancel (NautilusBonoboActivationHandle *handle)
{
if (handle == NULL) {
return;
}
activation_handle_done (handle);
if (handle->idle_id == 0) {
/* no way to cancel the OAF part, so we just set a flag */
handle->cancel = TRUE;
} else {
gtk_idle_remove (handle->idle_id);
activation_cancel (handle);
}
}

View file

@ -1,142 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.h - interface for new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
#define NAUTILUS_BONOBO_EXTENSIONS_H
#include <bonobo/bonobo-ui-component.h>
#include <bonobo/bonobo-xobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
typedef struct NautilusBonoboActivationHandle NautilusBonoboActivationHandle;
typedef void (*NautilusBonoboActivationCallback) (NautilusBonoboActivationHandle *handle,
Bonobo_Unknown activated_object,
gpointer callback_data);
void nautilus_bonobo_set_accelerator (BonoboUIComponent *ui,
const char *path,
const char *accelerator);
char * nautilus_bonobo_get_label (BonoboUIComponent *ui,
const char *path);
void nautilus_bonobo_set_label (BonoboUIComponent *ui,
const char *path,
const char *label);
void nautilus_bonobo_set_tip (BonoboUIComponent *ui,
const char *path,
const char *tip);
void nautilus_bonobo_set_sensitive (BonoboUIComponent *ui,
const char *path,
gboolean sensitive);
void nautilus_bonobo_set_toggle_state (BonoboUIComponent *ui,
const char *path,
gboolean state);
void nautilus_bonobo_set_hidden (BonoboUIComponent *ui,
const char *path,
gboolean hidden);
gboolean nautilus_bonobo_get_hidden (BonoboUIComponent *ui,
const char *path);
void nautilus_bonobo_add_numbered_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label,
GdkPixbuf *pixbuf);
void nautilus_bonobo_add_numbered_toggle_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label);
void nautilus_bonobo_add_numbered_radio_menu_item (BonoboUIComponent *ui,
const char *container_path,
guint index,
const char *label,
const char *radio_group_name);
char * nautilus_bonobo_get_numbered_menu_item_command (BonoboUIComponent *ui,
const char *container_path,
guint index);
char * nautilus_bonobo_get_numbered_menu_item_path (BonoboUIComponent *ui,
const char *container_path,
guint index);
guint nautilus_bonobo_get_numbered_menu_item_index_from_command
(const char *command);
char * nautilus_bonobo_get_numbered_menu_item_container_path_from_command
(const char *command);
void nautilus_bonobo_add_submenu (BonoboUIComponent *ui,
const char *container_path,
const char *label);
void nautilus_bonobo_add_menu_separator (BonoboUIComponent *ui,
const char *path);
void nautilus_bonobo_remove_menu_items_and_commands (BonoboUIComponent *ui,
const char *container_path);
void nautilus_bonobo_set_label_for_menu_item_and_command (BonoboUIComponent *ui,
const char *menu_item_path,
const char *command_path,
const char *label_with_underscore);
void nautilus_bonobo_set_icon (BonoboUIComponent *ui,
const char *path,
const char *icon_relative_path);
NautilusBonoboActivationHandle *nautilus_bonobo_activate_from_id (const char *iid,
NautilusBonoboActivationCallback callback,
gpointer callback_data);
void nautilus_bonobo_activate_cancel (NautilusBonoboActivationHandle *handle);
/* This macro is a copy of BONOBO_X_TYPE_FUNC_FULL (from bonobo-xobject.h)
* with the addition of support for the parent_class which is defined by
* EEL_DEFINE_CLASS_BOILERPLATE and used by EEL_CALL_PARENT.
*
* Note: the argument order matches BONOBO_X_TYPE_FUNC_FULL which is different
* than EEL_DEFINE_CLASS_BOILERPLATE.
*/
#define NAUTILUS_BONOBO_X_BOILERPLATE(class_name, corba_name, parent, prefix) \
static gpointer parent_class; /* Nautilus change */ \
GtkType \
prefix##_get_type (void) \
{ \
GtkType ptype; \
static GtkType type = 0; \
\
if (type == 0) { \
static GtkTypeInfo info = { \
#class_name, \
sizeof (class_name), \
sizeof (class_name##Class), \
(GtkClassInitFunc)prefix##_class_init, \
(GtkObjectInitFunc)prefix##_init, \
NULL, NULL, (GtkClassInitFunc) NULL \
}; \
ptype = (parent); \
type = bonobo_x_type_unique (ptype, \
POA_##corba_name##__init, POA_##corba_name##__fini, \
GTK_STRUCT_OFFSET (class_name##Class, epv), \
&info); \
parent_class = gtk_type_class (ptype); /* Nautilus change */ \
} \
return type; \
}
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */

View file

@ -1,609 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bookmark.c - implementation of individual bookmarks.
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
*/
#include <config.h>
#include "nautilus-bookmark.h"
#include "nautilus-icon-factory.h"
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtkaccellabel.h>
#include <gtk/gtksignal.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gtkpixmapmenuitem.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
enum {
APPEARANCE_CHANGED,
CONTENTS_CHANGED,
LAST_SIGNAL
};
#define GENERIC_BOOKMARK_ICON_NAME "i-bookmark"
#define MISSING_BOOKMARK_ICON_NAME "i-bookmark-missing"
static guint signals[LAST_SIGNAL];
struct NautilusBookmarkDetails
{
char *name;
char *uri;
NautilusScalableIcon *icon;
NautilusFile *file;
};
static void nautilus_bookmark_connect_file (NautilusBookmark *file);
static void nautilus_bookmark_disconnect_file (NautilusBookmark *file);
static void nautilus_bookmark_initialize_class (NautilusBookmarkClass *class);
static void nautilus_bookmark_initialize (NautilusBookmark *bookmark);
static GtkWidget *create_pixmap_widget_for_bookmark (NautilusBookmark *bookmark);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusBookmark, nautilus_bookmark, GTK_TYPE_OBJECT)
/* GtkObject methods. */
static void
nautilus_bookmark_destroy (GtkObject *object)
{
NautilusBookmark *bookmark;
g_assert (NAUTILUS_IS_BOOKMARK (object));
bookmark = NAUTILUS_BOOKMARK(object);
nautilus_bookmark_disconnect_file (bookmark);
g_free (bookmark->details->name);
g_free (bookmark->details->uri);
g_free (bookmark->details);
/* Chain up */
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
/* Initialization. */
static void
nautilus_bookmark_initialize_class (NautilusBookmarkClass *class)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (class);
object_class->destroy = nautilus_bookmark_destroy;
signals[APPEARANCE_CHANGED] =
gtk_signal_new ("appearance_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusBookmarkClass, appearance_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
signals[CONTENTS_CHANGED] =
gtk_signal_new ("contents_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusBookmarkClass, contents_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
nautilus_bookmark_initialize (NautilusBookmark *bookmark)
{
bookmark->details = g_new0 (NautilusBookmarkDetails, 1);
}
/**
* nautilus_bookmark_compare_with:
*
* Check whether two bookmarks are considered identical.
* @a: first NautilusBookmark*.
* @b: second NautilusBookmark*.
*
* Return value: 0 if @a and @b have same name and uri, 1 otherwise
* (GCompareFunc style)
**/
int
nautilus_bookmark_compare_with (gconstpointer a, gconstpointer b)
{
NautilusBookmark *bookmark_a;
NautilusBookmark *bookmark_b;
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (a), 1);
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (b), 1);
bookmark_a = NAUTILUS_BOOKMARK (a);
bookmark_b = NAUTILUS_BOOKMARK (b);
if (strcmp (bookmark_a->details->name,
bookmark_b->details->name) != 0) {
return 1;
}
if (!eel_uris_match (bookmark_a->details->uri,
bookmark_b->details->uri)) {
return 1;
}
return 0;
}
/**
* nautilus_bookmark_compare_uris:
*
* Check whether the uris of two bookmarks are for the same location.
* @a: first NautilusBookmark*.
* @b: second NautilusBookmark*.
*
* Return value: 0 if @a and @b have matching uri, 1 otherwise
* (GCompareFunc style)
**/
int
nautilus_bookmark_compare_uris (gconstpointer a, gconstpointer b)
{
NautilusBookmark *bookmark_a;
NautilusBookmark *bookmark_b;
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (a), 1);
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (b), 1);
bookmark_a = NAUTILUS_BOOKMARK (a);
bookmark_b = NAUTILUS_BOOKMARK (b);
return !eel_uris_match (bookmark_a->details->uri,
bookmark_b->details->uri);
}
NautilusBookmark *
nautilus_bookmark_copy (NautilusBookmark *bookmark)
{
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (bookmark), NULL);
return nautilus_bookmark_new_with_icon (
bookmark->details->uri,
bookmark->details->name,
bookmark->details->icon);
}
char *
nautilus_bookmark_get_name (NautilusBookmark *bookmark)
{
g_return_val_if_fail(NAUTILUS_IS_BOOKMARK (bookmark), NULL);
return g_strdup (bookmark->details->name);
}
gboolean
nautilus_bookmark_get_pixmap_and_mask (NautilusBookmark *bookmark,
guint icon_size,
GdkPixmap **pixmap_return,
GdkBitmap **mask_return)
{
GdkPixbuf *pixbuf;
pixbuf = nautilus_bookmark_get_pixbuf (bookmark, icon_size, FALSE);
if (pixbuf == NULL) {
return FALSE;
}
gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap_return, mask_return, EEL_STANDARD_ALPHA_THRESHHOLD);
gdk_pixbuf_unref (pixbuf);
return TRUE;
}
GdkPixbuf *
nautilus_bookmark_get_pixbuf (NautilusBookmark *bookmark,
guint icon_size,
gboolean optimize_for_anti_aliasing)
{
GdkPixbuf *result;
NautilusScalableIcon *icon;
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (bookmark), NULL);
icon = nautilus_bookmark_get_icon (bookmark);
if (icon == NULL) {
return NULL;
}
result = nautilus_icon_factory_get_pixbuf_for_icon
(icon,
icon_size, icon_size, icon_size, icon_size,
optimize_for_anti_aliasing,
NULL, TRUE);
nautilus_scalable_icon_unref (icon);
return result;
}
NautilusScalableIcon *
nautilus_bookmark_get_icon (NautilusBookmark *bookmark)
{
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (bookmark), NULL);
/* Try to connect a file in case file exists now but didn't earlier. */
nautilus_bookmark_connect_file (bookmark);
if (bookmark->details->icon != NULL) {
nautilus_scalable_icon_ref (bookmark->details->icon);
}
return bookmark->details->icon;
}
char *
nautilus_bookmark_get_uri (NautilusBookmark *bookmark)
{
g_return_val_if_fail(NAUTILUS_IS_BOOKMARK (bookmark), NULL);
/* Try to connect a file in case file exists now but didn't earlier.
* This allows a bookmark to update its image properly in the case
* where a new file appears with the same URI as a previously-deleted
* file. Calling connect_file here means that attempts to activate the
* bookmark will update its image if possible.
*/
nautilus_bookmark_connect_file (bookmark);
return g_strdup (bookmark->details->uri);
}
/**
* nautilus_bookmark_set_name:
*
* Change the user-displayed name of a bookmark.
* @new_name: The new user-displayed name for this bookmark, mustn't be NULL.
*
**/
void
nautilus_bookmark_set_name (NautilusBookmark *bookmark, const char *new_name)
{
g_return_if_fail(NAUTILUS_IS_BOOKMARK (bookmark));
g_return_if_fail (new_name != NULL);
if (strcmp (new_name, bookmark->details->name) == 0) {
return;
}
g_free (bookmark->details->name);
bookmark->details->name = g_strdup (new_name);
gtk_signal_emit (GTK_OBJECT (bookmark), signals[APPEARANCE_CHANGED]);
}
static gboolean
nautilus_bookmark_icon_is_different (NautilusBookmark *bookmark,
NautilusScalableIcon *new_icon)
{
char *new_uri, *new_mime_type, *new_name;
char *old_uri, *old_mime_type, *old_name;
gboolean result;
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
g_assert (new_icon != NULL);
/* Bookmarks don't store the modifier or embedded text. */
nautilus_scalable_icon_get_text_pieces
(new_icon, &new_uri, &new_mime_type, &new_name, NULL, NULL);
if (bookmark->details->icon == NULL) {
result = !eel_str_is_empty (new_uri)
|| !eel_str_is_empty (new_mime_type)
|| !eel_str_is_empty (new_name);
} else {
nautilus_scalable_icon_get_text_pieces
(bookmark->details->icon, &old_uri, &old_mime_type, &old_name, NULL, NULL);
result = eel_strcmp (old_uri, new_uri) != 0
|| eel_strcmp (old_mime_type, new_mime_type) != 0
|| eel_strcmp (old_name, new_name) != 0;
g_free (old_uri);
g_free (old_mime_type);
g_free (old_name);
}
g_free (new_uri);
g_free (new_mime_type);
g_free (new_name);
return result;
}
/**
* Update icon if there's a better one available.
* Return TRUE if the icon changed.
*/
static gboolean
nautilus_bookmark_update_icon (NautilusBookmark *bookmark)
{
NautilusScalableIcon *new_icon;
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
if (bookmark->details->file == NULL) {
return FALSE;
}
if (nautilus_icon_factory_is_icon_ready_for_file (bookmark->details->file)) {
new_icon = nautilus_icon_factory_get_icon_for_file (bookmark->details->file, NULL);
if (nautilus_bookmark_icon_is_different (bookmark, new_icon)) {
if (bookmark->details->icon != NULL) {
nautilus_scalable_icon_unref (bookmark->details->icon);
}
bookmark->details->icon = new_icon;
return TRUE;
}
nautilus_scalable_icon_unref (new_icon);
}
return FALSE;
}
static void
bookmark_file_changed_callback (NautilusFile *file, NautilusBookmark *bookmark)
{
char *file_uri;
gboolean should_emit_appearance_changed_signal;
gboolean should_emit_contents_changed_signal;
g_assert (NAUTILUS_IS_FILE (file));
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
g_assert (file == bookmark->details->file);
should_emit_appearance_changed_signal = FALSE;
should_emit_contents_changed_signal = FALSE;
file_uri = nautilus_file_get_uri (file);
if (!eel_uris_match (bookmark->details->uri, file_uri)) {
g_free (bookmark->details->uri);
bookmark->details->uri = file_uri;
should_emit_contents_changed_signal = TRUE;
} else {
g_free (file_uri);
}
if (nautilus_file_is_gone (file)) {
/* The file we were monitoring has been deleted,
* or moved in a way that we didn't notice. Make
* a spanking new NautilusFile object for this
* location so if a new file appears in this place
* we will notice.
*/
nautilus_bookmark_disconnect_file (bookmark);
nautilus_bookmark_connect_file (bookmark);
should_emit_appearance_changed_signal = TRUE;
} else if (nautilus_bookmark_update_icon (bookmark)) {
/* File hasn't gone away, but it has changed
* in a way that affected its icon.
*/
should_emit_appearance_changed_signal = TRUE;
}
if (should_emit_appearance_changed_signal) {
gtk_signal_emit (GTK_OBJECT (bookmark), signals[APPEARANCE_CHANGED]);
}
if (should_emit_contents_changed_signal) {
gtk_signal_emit (GTK_OBJECT (bookmark), signals[CONTENTS_CHANGED]);
}
}
/**
* nautilus_bookmark_set_icon_to_default:
*
* Reset the icon to either the missing bookmark icon or the generic
* bookmark icon, depending on whether the file still exists.
*/
static void
nautilus_bookmark_set_icon_to_default (NautilusBookmark *bookmark)
{
const char *icon_name;
if (bookmark->details->icon != NULL) {
nautilus_scalable_icon_unref (bookmark->details->icon);
}
if (nautilus_bookmark_uri_known_not_to_exist (bookmark)) {
icon_name = MISSING_BOOKMARK_ICON_NAME;
} else {
icon_name = GENERIC_BOOKMARK_ICON_NAME;
}
bookmark->details->icon = nautilus_scalable_icon_new_from_text_pieces
(NULL, NULL, icon_name, NULL, NULL);
}
/**
* nautilus_bookmark_new:
*
* Create a new NautilusBookmark from a text uri and a display name.
* The initial icon for the bookmark will be based on the information
* already available without any explicit action on NautilusBookmark's
* part.
*
* @uri: Any uri, even a malformed or non-existent one.
* @name: A string to display to the user as the bookmark's name.
*
* Return value: A newly allocated NautilusBookmark.
*
**/
NautilusBookmark *
nautilus_bookmark_new (const char *uri, const char *name)
{
return nautilus_bookmark_new_with_icon (uri, name, NULL);
}
static void
nautilus_bookmark_disconnect_file (NautilusBookmark *bookmark)
{
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
if (bookmark->details->file != NULL) {
gtk_signal_disconnect_by_func (GTK_OBJECT (bookmark->details->file),
bookmark_file_changed_callback,
bookmark);
nautilus_file_unref (bookmark->details->file);
bookmark->details->file = NULL;
}
if (bookmark->details->icon != NULL) {
nautilus_scalable_icon_unref (bookmark->details->icon);
bookmark->details->icon = NULL;
}
}
static void
nautilus_bookmark_connect_file (NautilusBookmark *bookmark)
{
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
if (bookmark->details->file != NULL) {
return;
}
if (!nautilus_bookmark_uri_known_not_to_exist (bookmark)) {
bookmark->details->file = nautilus_file_get (bookmark->details->uri);
g_assert (!nautilus_file_is_gone (bookmark->details->file));
gtk_signal_connect (GTK_OBJECT (bookmark->details->file),
"changed",
bookmark_file_changed_callback,
bookmark);
}
/* Set icon based on available information; don't force network i/o
* to get any currently unknown information.
*/
if (!nautilus_bookmark_update_icon (bookmark)) {
if (bookmark->details->icon == NULL || bookmark->details->file == NULL) {
nautilus_bookmark_set_icon_to_default (bookmark);
}
}
}
NautilusBookmark *
nautilus_bookmark_new_with_icon (const char *uri, const char *name,
NautilusScalableIcon *icon)
{
NautilusBookmark *new_bookmark;
new_bookmark = NAUTILUS_BOOKMARK (gtk_object_new (NAUTILUS_TYPE_BOOKMARK, NULL));
gtk_object_ref (GTK_OBJECT (new_bookmark));
gtk_object_sink (GTK_OBJECT (new_bookmark));
new_bookmark->details->name = g_strdup (name);
new_bookmark->details->uri = g_strdup (uri);
if (icon != NULL) {
nautilus_scalable_icon_ref (icon);
}
new_bookmark->details->icon = icon;
nautilus_bookmark_connect_file (new_bookmark);
return new_bookmark;
}
static GtkWidget *
create_pixmap_widget_for_bookmark (NautilusBookmark *bookmark)
{
GdkPixmap *gdk_pixmap;
GdkBitmap *mask;
if (!nautilus_bookmark_get_pixmap_and_mask (bookmark,
NAUTILUS_ICON_SIZE_FOR_MENUS,
&gdk_pixmap,
&mask)) {
return NULL;
}
return gtk_pixmap_new (gdk_pixmap, mask);
}
/**
* nautilus_bookmarnuk_menu_item_new:
*
* Return a menu item representing a bookmark.
* @bookmark: The bookmark the menu item represents.
* Return value: A newly-created bookmark, not yet shown.
**/
GtkWidget *
nautilus_bookmark_menu_item_new (NautilusBookmark *bookmark)
{
GtkWidget *menu_item;
GtkWidget *pixmap_widget;
GtkWidget *label;
char *display_name;
/* Could check gnome_preferences_get_menus_have_icons here, but these
* are more important than stock menu icons, since they're connected to
* user data. For now let's not let them be turn-offable and see if
* anyone objects strenuously.
*/
menu_item = gtk_pixmap_menu_item_new ();
pixmap_widget = create_pixmap_widget_for_bookmark (bookmark);
if (pixmap_widget != NULL) {
gtk_widget_show (pixmap_widget);
gtk_pixmap_menu_item_set_pixmap (GTK_PIXMAP_MENU_ITEM (menu_item), pixmap_widget);
}
display_name = eel_truncate_text_for_menu_item (bookmark->details->name);
label = gtk_label_new (display_name);
g_free (display_name);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_container_add (GTK_CONTAINER (menu_item), label);
gtk_widget_show (label);
return menu_item;
}
gboolean
nautilus_bookmark_uri_known_not_to_exist (NautilusBookmark *bookmark)
{
char *path_name;
gboolean exists;
/* Convert to a path, returning FALSE if not local. */
path_name = gnome_vfs_get_local_path_from_uri (bookmark->details->uri);
if (path_name == NULL) {
return FALSE;
}
/* Now check if the file exists (sync. call OK because it is local). */
exists = g_file_exists (path_name);
g_free (path_name);
return !exists;
}

View file

@ -1,101 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bookmark.h - interface for individual bookmarks.
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_BOOKMARK_H
#define NAUTILUS_BOOKMARK_H
#include "nautilus-icon-factory.h"
#include <gtk/gtkwidget.h>
#include <gdk/gdktypes.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
typedef struct NautilusBookmark NautilusBookmark;
#define NAUTILUS_TYPE_BOOKMARK \
(nautilus_bookmark_get_type ())
#define NAUTILUS_BOOKMARK(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_BOOKMARK, NautilusBookmark))
#define NAUTILUS_BOOKMARK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_BOOKMARK, NautilusBookmarkClass))
#define NAUTILUS_IS_BOOKMARK(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_BOOKMARK))
#define NAUTILUS_IS_BOOKMARK_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_BOOKMARK))
typedef struct NautilusBookmarkDetails NautilusBookmarkDetails;
struct NautilusBookmark {
GtkObject object;
NautilusBookmarkDetails *details;
};
struct NautilusBookmarkClass {
GtkObjectClass parent_class;
/* Signals that clients can connect to. */
/* The appearance_changed signal is emitted when the bookmark's
* name or icon has changed.
*/
void (* appearance_changed) (NautilusBookmark *bookmark);
/* The contents_changed signal is emitted when the bookmark's
* URI has changed.
*/
void (* contents_changed) (NautilusBookmark *bookmark);
};
typedef struct NautilusBookmarkClass NautilusBookmarkClass;
GtkType nautilus_bookmark_get_type (void);
NautilusBookmark * nautilus_bookmark_new (const char *uri,
const char *name);
NautilusBookmark * nautilus_bookmark_new_with_icon (const char *uri,
const char *name,
NautilusScalableIcon *icon);
NautilusBookmark * nautilus_bookmark_copy (NautilusBookmark *bookmark);
char * nautilus_bookmark_get_name (NautilusBookmark *bookmark);
char * nautilus_bookmark_get_uri (NautilusBookmark *bookmark);
NautilusScalableIcon *nautilus_bookmark_get_icon (NautilusBookmark *bookmark);
void nautilus_bookmark_set_name (NautilusBookmark *bookmark,
const char *new_name);
gboolean nautilus_bookmark_uri_known_not_to_exist (NautilusBookmark *bookmark);
int nautilus_bookmark_compare_with (gconstpointer a,
gconstpointer b);
int nautilus_bookmark_compare_uris (gconstpointer a,
gconstpointer b);
/* Helper functions for displaying bookmarks */
gboolean nautilus_bookmark_get_pixmap_and_mask (NautilusBookmark *bookmark,
guint icon_size,
GdkPixmap **pixmap_return,
GdkBitmap **mask_return);
GdkPixbuf * nautilus_bookmark_get_pixbuf (NautilusBookmark *bookmark,
guint icon_size,
gboolean optimize_for_anti_aliasing);
GtkWidget * nautilus_bookmark_menu_item_new (NautilusBookmark *bookmark);
#endif /* NAUTILUS_BOOKMARK_H */

View file

@ -1,235 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* fm-cdrom-extension.c - CDROM handliong constants copied from <linux/cdrom.h>.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Gene Z. Ragan <gzr@eazel.com>
*/
#ifndef FM_CDROM_EXTENSIONS_H
#define FM_CDROM_EXTENSIONS_H
#include <sys/types.h>
#ifdef HAVE_SYS_CDIO_H
#include <sys/cdio.h>
#else
/*******************************************************
* The CD-ROM IOCTL commands -- these should be supported by
* all the various cdrom drivers. For the CD-ROM ioctls, we
* will commandeer byte 0x53, or 'S'.
*******************************************************/
#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
(struct cdrom_ti) */
#define CDROMREADTOCHDR 0x5305 /* Read TOC header
(struct cdrom_tochdr) */
#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
(struct cdrom_tocentry) */
#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
#define CDROMSTART 0x5308 /* Start the cdrom drive */
#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
#define CDROMVOLCTRL 0x530a /* Control output volume
(struct cdrom_volctrl) */
#define CDROMSUBCHNL 0x530b /* Read subchannel data
(struct cdrom_subchnl) */
#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
(struct cdrom_read) */
#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
(struct cdrom_read) */
#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
address of multi session disks
(struct cdrom_multisession) */
#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
if available (struct cdrom_mcn) */
#define CDROM_GET_UPC CDROM_GET_MCN /* This one is depricated,
but here anyway for compatability */
#define CDROMRESET 0x5312 /* hard-reset the drive */
#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
(struct cdrom_volctrl) */
#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
(struct cdrom_read) */
/*
* These ioctls are used only used in aztcd.c and optcd.c
*/
#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
#define CDROMSEEK 0x5316 /* seek msf address */
/*
* This ioctl is only used by the scsi-cd driver.
It is for playing audio in logical block addressing mode.
*/
#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
/*
* These ioctls are only used in optcd.c
*/
#define CDROMREADALL 0x5318 /* read all 2646 bytes */
#endif /* HAVE_SYS_CDIO_H */
/*
* These ioctls are (now) only in ide-cd.c for controlling
* drive spindown time. They should be implemented in the
* Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
* GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
* -Erik
*/
#define CDROMGETSPINDOWN 0x531d
#define CDROMSETSPINDOWN 0x531e
/*
* These ioctls are implemented through the uniform CD-ROM driver
* They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
* drivers are eventually ported to the uniform CD-ROM driver interface.
*/
#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
/* This ioctl is only used by sbpcd at the moment */
#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
/* DVD-ROM Specific ioctls */
#define DVD_READ_STRUCT 0x5390 /* Read structure */
#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
#define DVD_AUTH 0x5392 /* Authentication */
#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
/* Some generally useful CD-ROM information -- mostly based on the above */
#define CD_MINS 74 /* max. minutes per CD, not really a limit */
#define CD_SECS 60 /* seconds per minute */
#define CD_FRAMES 75 /* frames per second */
#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
/* most drives don't deliver everything: */
#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
/* CD-ROM address types (cdrom_tocentry.cdte_format) */
#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
#define CDROM_DATA_TRACK 0x04
/* The leadout track is always 0xAA, regardless of # of tracks on disc */
#define CDROM_LEADOUT 0xAA
/* audio states (from SCSI-2, but seen with other drives, too) */
#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
/* capability flags used with the uniform CD-ROM driver */
#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
#define CDC_LOCK 0x4 /* disable manual eject */
#define CDC_SELECT_SPEED 0x8 /* programmable speed */
#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
#define CDC_MCN 0x40 /* Medium Catalog Number */
#define CDC_MEDIA_CHANGED 0x80 /* media changed */
#define CDC_PLAY_AUDIO 0x100 /* audio functions */
#define CDC_RESET 0x200 /* hard reset device */
#define CDC_IOCTLS 0x400 /* driver has non-standard ioctls */
#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
#define CDC_CD_R 0x2000 /* drive is a CD-R */
#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
#define CDC_DVD 0x8000 /* drive is a DVD */
#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
#define CDS_NO_INFO 0 /* if not implemented */
#define CDS_NO_DISC 1
#define CDS_TRAY_OPEN 2
#define CDS_DRIVE_NOT_READY 3
#define CDS_DISC_OK 4
/* return values for the CDROM_DISC_STATUS ioctl */
/* can also return CDS_NO_[INFO|DISC], from above */
#define CDS_AUDIO 100
#define CDS_DATA_1 101
#define CDS_DATA_2 102
#define CDS_XA_2_1 103
#define CDS_XA_2_2 104
#define CDS_MIXED 105
/* User-configurable behavior options for the uniform CD-ROM driver */
#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
#define CDO_LOCK 0x8 /* lock tray on open files */
#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
/* Special codes used when specifying changer slots. */
#define CDSL_NONE ((int) (~0U>>1)-1)
#define CDSL_CURRENT ((int) (~0U>>1))
/* For partition based multisession access. IDE can handle 64 partitions
* per drive - SCSI CD-ROM's use minors to differentiate between the
* various drives, so we can't do multisessions the same way there.
* Use the -o session=x option to mount on them.
*/
#define CD_PART_MAX 64
#define CD_PART_MASK (CD_PART_MAX - 1)
#endif /* FM_CDROM_EXTENSIONS_H */

View file

@ -1,452 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 2000 Eazel, Inc.
*
* Nautilus is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Nautilus 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Rebecca Schulman <rebecka@eazel.com>
*/
/* nautilus-customization-data.c - functions to collect and load customization
names and imges */
#include <config.h>
#include <ctype.h>
#include <gnome-xml/parser.h>
#include <gnome-xml/xmlmemory.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs.h>
#include <string.h>
#include <libgnome/gnome-defs.h>
#include <stdlib.h>
#include "nautilus-customization-data.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include "nautilus-file-utilities.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-xml-extensions.h>
#include <eel/eel-string.h>
typedef enum {
READ_PUBLIC_CUSTOMIZATIONS,
READ_PRIVATE_CUSTOMIZATIONS
} CustomizationReadingMode;
struct NautilusCustomizationData {
char *customization_name;
CustomizationReadingMode reading_mode;
GList *public_file_list;
GList *private_file_list;
GList *current_file_list;
GHashTable *name_map_hash;
GdkPixbuf *pattern_frame;
gboolean private_data_was_displayed;
gboolean data_is_for_a_menu;
int maximum_icon_height;
int maximum_icon_width;
};
/* The Property here should be one of "emblems", "colors" or "patterns" */
static char * get_global_customization_uri (const char *customization_name);
static char * get_private_customization_uri (const char *customization_name);
static char * get_file_path_for_mode (const NautilusCustomizationData *data,
const char *file_name);
static char* format_name_for_display (NautilusCustomizationData *data, const char *name);
static char* strip_extension (const char* string_to_strip);
static void load_name_map_hash_table (NautilusCustomizationData *data);
NautilusCustomizationData*
nautilus_customization_data_new (const char *customization_name,
gboolean show_public_customizations,
gboolean data_is_for_a_menu,
int maximum_icon_height,
int maximum_icon_width)
{
NautilusCustomizationData *data;
char *public_directory_uri, *private_directory_uri;
char *temp_str;
GnomeVFSResult public_result, private_result;
data = g_new0 (NautilusCustomizationData, 1);
public_result = GNOME_VFS_OK;
if (show_public_customizations) {
public_directory_uri = get_global_customization_uri (customization_name);
public_result = gnome_vfs_directory_list_load (&data->public_file_list,
public_directory_uri,
GNOME_VFS_FILE_INFO_GET_MIME_TYPE, NULL);
g_free (public_directory_uri);
}
private_directory_uri = get_private_customization_uri (customization_name);
private_result = gnome_vfs_directory_list_load (&data->private_file_list,
private_directory_uri,
GNOME_VFS_FILE_INFO_GET_MIME_TYPE, NULL);
g_free (private_directory_uri);
if (public_result != GNOME_VFS_OK &&
private_result != GNOME_VFS_OK) {
g_warning ("Couldn't read any of the emblem directories\n");
g_free (data);
return NULL;
}
if (private_result == GNOME_VFS_OK) {
data->reading_mode = READ_PRIVATE_CUSTOMIZATIONS;
data->current_file_list = data->private_file_list;
}
if (show_public_customizations && public_result == GNOME_VFS_OK) {
data->reading_mode = READ_PUBLIC_CUSTOMIZATIONS;
data->current_file_list = data->public_file_list;
}
/* load the frame if necessary */
if (!strcmp(customization_name, "patterns")) {
temp_str = nautilus_pixmap_file ("chit_frame.png");
data->pattern_frame = gdk_pixbuf_new_from_file (temp_str);
g_free (temp_str);
} else {
data->pattern_frame = NULL;
}
data->private_data_was_displayed = FALSE;
data->data_is_for_a_menu = data_is_for_a_menu;
data->customization_name = g_strdup (customization_name);
data->maximum_icon_height = maximum_icon_height;
data->maximum_icon_width = maximum_icon_width;
load_name_map_hash_table (data);
return data;
}
GnomeVFSResult
nautilus_customization_data_get_next_element_for_display (NautilusCustomizationData *data,
char **emblem_name,
GdkPixbuf **pixbuf_out,
char **label_out)
{
GnomeVFSFileInfo *current_file_info;
char *image_file_name, *filtered_name;
GdkPixbuf *pixbuf;
GdkPixbuf *orig_pixbuf;
g_return_val_if_fail (data != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
g_return_val_if_fail (emblem_name != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
g_return_val_if_fail (pixbuf_out != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
g_return_val_if_fail (label_out != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
if (data->current_file_list == NULL) {
if (data->reading_mode == READ_PUBLIC_CUSTOMIZATIONS) {
if (data->private_file_list == NULL) {
return GNOME_VFS_ERROR_EOF;
}
data->reading_mode = READ_PRIVATE_CUSTOMIZATIONS;
data->current_file_list = data->private_file_list;
return nautilus_customization_data_get_next_element_for_display (data,
emblem_name,
pixbuf_out,
label_out);
}
else {
return GNOME_VFS_ERROR_EOF;
}
}
current_file_info = data->current_file_list->data;
data->current_file_list = data->current_file_list->next;
g_assert (current_file_info != NULL);
if (!eel_istr_has_prefix (current_file_info->mime_type, "image/") ||
eel_istr_has_prefix (current_file_info->name, ".")) {
return nautilus_customization_data_get_next_element_for_display (data,
emblem_name,
pixbuf_out,
label_out);
}
image_file_name = get_file_path_for_mode (data,
current_file_info->name);
orig_pixbuf = gdk_pixbuf_new_from_file (image_file_name);
g_free (image_file_name);
*emblem_name = g_strdup (current_file_info->name);
if (!strcmp(data->customization_name, "patterns")) {
pixbuf = nautilus_customization_make_pattern_chit (orig_pixbuf, data->pattern_frame, FALSE);
} else {
pixbuf = eel_gdk_pixbuf_scale_down_to_fit (orig_pixbuf,
data->maximum_icon_width,
data->maximum_icon_height);
gdk_pixbuf_unref (orig_pixbuf);
}
*pixbuf_out = pixbuf;
filtered_name = format_name_for_display (data, current_file_info->name);
/* If the data is for a menu,
we want to truncate it and not use the nautilus
label because anti-aliased text doesn't look right
in menus */
if (data->data_is_for_a_menu) {
*label_out = eel_truncate_text_for_menu_item (filtered_name);
}
else {
*label_out = g_strdup (filtered_name);
}
g_free (filtered_name);
if (data->reading_mode == READ_PRIVATE_CUSTOMIZATIONS) {
data->private_data_was_displayed = TRUE;
}
return GNOME_VFS_OK;
}
gboolean
nautilus_customization_data_private_data_was_displayed (NautilusCustomizationData *data)
{
return data->private_data_was_displayed;
}
void
nautilus_customization_data_destroy (NautilusCustomizationData *data)
{
g_assert (data->public_file_list != NULL ||
data->private_file_list != NULL);
if (data->pattern_frame != NULL) {
gdk_pixbuf_unref (data->pattern_frame);
}
gnome_vfs_file_info_list_free (data->public_file_list);
gnome_vfs_file_info_list_free (data->private_file_list);
if (data->name_map_hash != NULL) {
eel_g_hash_table_destroy_deep (data->name_map_hash);
}
g_free (data->customization_name);
g_free (data);
}
/* get_global_customization_directory
Get the path where a property's pixmaps are stored
@customization_name : the name of the customization to get.
Should be one of "emblems", "colors", or "paterns"
Return value: The directory name where the customization's
public pixmaps are stored */
static char *
get_global_customization_uri (const char *customization_name)
{
char *directory_path, *directory_uri;
directory_path = nautilus_make_path (NAUTILUS_DATADIR,
customization_name);
directory_uri = gnome_vfs_get_uri_from_local_path (directory_path);
g_free (directory_path);
return directory_uri;
}
/* get_private_customization_directory
Get the path where a customization's pixmaps are stored
@customization_name : the name of the customization to get.
Should be one of "emblems", "colors", or "patterns"
Return value: The directory name where the customization's
user-specific pixmaps are stored */
static char *
get_private_customization_uri (const char *customization_name)
{
char *user_directory;
char *directory_path, *directory_uri;
user_directory = nautilus_get_user_directory ();
directory_path = nautilus_make_path (user_directory,
customization_name);
g_free (user_directory);
directory_uri = gnome_vfs_get_uri_from_local_path (directory_path);
g_free (directory_path);
return directory_uri;
}
static char *
get_file_path_for_mode (const NautilusCustomizationData *data,
const char *file_name)
{
char *directory_uri, *uri, *directory_name;
if (data->reading_mode == READ_PUBLIC_CUSTOMIZATIONS) {
directory_uri = get_global_customization_uri (data->customization_name);
}
else {
directory_uri = get_private_customization_uri (data->customization_name);
}
uri = nautilus_make_path (directory_uri, file_name);
g_free (directory_uri);
directory_name = gnome_vfs_get_local_path_from_uri (uri);
g_free (uri);
return directory_name;
}
/* utility to make an attractive pattern image by compositing with a frame */
GdkPixbuf*
nautilus_customization_make_pattern_chit (GdkPixbuf *pattern_tile, GdkPixbuf *frame, gboolean dragging)
{
GdkPixbuf *pixbuf, *temp_pixbuf;
int frame_width, frame_height;
frame_width = gdk_pixbuf_get_width (frame);
frame_height = gdk_pixbuf_get_height (frame);
/* scale the pattern tile to the proper size */
pixbuf = gdk_pixbuf_scale_simple (pattern_tile, frame_width, frame_height, GDK_INTERP_BILINEAR);
/* composite the mask on top of it */
gdk_pixbuf_composite (frame, pixbuf, 0, 0, frame_width, frame_height,
0.0, 0.0, 1.0, 1.0, GDK_INTERP_BILINEAR, 255);
/* if we're dragging, get rid of the light-colored halo */
if (dragging) {
temp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, frame_width - 6, frame_height - 6);
gdk_pixbuf_copy_area (pixbuf, 2, 2, frame_width - 6, frame_height - 6, temp_pixbuf, 0, 0);
gdk_pixbuf_unref (pixbuf);
pixbuf = temp_pixbuf;
}
gdk_pixbuf_unref (pattern_tile);
return pixbuf;
}
/* utility to format the passed-in name for display by stripping the extension, mapping underscore
and capitalizing as necessary */
static char*
format_name_for_display (NautilusCustomizationData *data, const char* name)
{
char *formatted_str, *mapped_name;
/* don't display a name for the "reset" property, since its name is
contained in its image and also to help distinguish it */
if (!eel_strcmp(name, RESET_IMAGE_NAME)) {
return g_strdup("");
}
/* map file names to display names using the mappings defined in the hash table */
formatted_str = strip_extension (name);
if (data->name_map_hash != NULL) {
mapped_name = g_hash_table_lookup (data->name_map_hash, formatted_str);
if (mapped_name) {
g_free (formatted_str);
formatted_str = g_strdup (mapped_name);
}
}
return formatted_str;
}
/* utility routine to allocate a hash table and load it with the appropriate
* name mapping data from the browser xml file
*/
static void
load_name_map_hash_table (NautilusCustomizationData *data)
{
char *xml_path;
char *filename, *display_name;
xmlDocPtr browser_data;
xmlNodePtr category_node, current_node;
/* allocate the hash table */
data->name_map_hash = g_hash_table_new (g_str_hash, g_str_equal);
/* build the path name to the browser.xml file and load it */
xml_path = nautilus_make_path (NAUTILUS_DATADIR, "browser.xml");
if (xml_path) {
browser_data = xmlParseFile (xml_path);
g_free (xml_path);
if (browser_data) {
/* get the category node */
category_node = eel_xml_get_root_child_by_name_and_property (browser_data, "category", "name", data->customization_name);
current_node = category_node->childs;
/* loop through the entries, adding a mapping to the hash table */
while (current_node != NULL) {
display_name = eel_xml_get_property_translated (current_node, "display_name");
filename = xmlGetProp (current_node, "filename");
if (display_name && filename) {
g_hash_table_insert (data->name_map_hash, g_strdup (filename), g_strdup (display_name));
}
xmlFree (filename);
xmlFree (display_name);
current_node = current_node->next;
}
/* close the xml file */
xmlFreeDoc (browser_data);
}
}
}
/* utility routine to strip the extension from the passed in string */
static char*
strip_extension (const char* string_to_strip)
{
char *result_str, *temp_str;
if (string_to_strip == NULL)
return NULL;
result_str = g_strdup(string_to_strip);
temp_str = strrchr(result_str, '.');
if (temp_str)
*temp_str = '\0';
return result_str;
}

View file

@ -1,71 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 2000 Eazel, Inc.
*
* Nautilus is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Nautilus 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Rebecca Schulman <rebecka@eazel.com>
*/
/* nautilus-customization-data.h - functions to collect and load property
names and imges */
#ifndef NAUTILUS_CUSTOMIZATION_DATA_H
#define NAUTILUS_CUSTOMIZATION_DATA_H
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkwidget.h>
#include <libgnomevfs/gnome-vfs-types.h>
#define RESET_IMAGE_NAME "reset.png"
typedef struct NautilusCustomizationData NautilusCustomizationData;
NautilusCustomizationData* nautilus_customization_data_new (const char *customization_name,
gboolean show_public_customizations,
gboolean data_is_for_a_menu,
int maximum_icon_height,
int maximum_icon_width);
/* Returns the following attrbiutes for a customization object (pattern, emblem)
*
* object_name - The name of the object. Usually what is used to represent it in storage.
* object_pixbuf - Pixbuf for graphical display of the object.
* object_label - Textual label display of the object.
*/
GnomeVFSResult nautilus_customization_data_get_next_element_for_display (NautilusCustomizationData *data,
char **object_name,
GdkPixbuf **object_pixbuf,
char **object_label);
gboolean nautilus_customization_data_private_data_was_displayed (NautilusCustomizationData *data);
void nautilus_customization_data_destroy (NautilusCustomizationData *data);
GdkPixbuf* nautilus_customization_make_pattern_chit (GdkPixbuf *pattern_tile,
GdkPixbuf *frame,
gboolean dragging);
#endif /* NAUTILUS_CUSTOMIZATION_DATA_H */

View file

@ -1,43 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-dateedit-extensions.c -- Extension functions to the gnome-dateedit
widget
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Rebecca Schulman <rebecka@eazel.com>
*/
#include <config.h>
#include "nautilus-dateedit-extensions.h"
#include <eel/eel-glib-extensions.h>
char *
nautilus_gnome_date_edit_get_date_as_string (GnomeDateEdit *dateedit)
{
time_t selected_time;
selected_time = gnome_date_edit_get_date (dateedit);
if (selected_time < 0) {
return NULL;
}
/* FIXME: Why doesn't this need to be localized? */
return eel_strdup_strftime ("%-m/%-d/%Y", localtime (&selected_time));
}

View file

@ -1,34 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-dateedit-extensions.h -- Extension functions to the gnome-dateedit
widget
Copyright (C) 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Rebecca Schulman <rebecka@eazel.com>
*/
/* This is annoying, but someone forgot time.h in the gnome-dateedit
* header, so it has to be here. A bug report about this has been
* submitted.
*/
#include <time.h>
#include <libgnomeui/gnome-dateedit.h>
char *nautilus_gnome_date_edit_get_date_as_string (GnomeDateEdit *dateedit);

View file

@ -1,607 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
Default file icon used by the icon factory.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include <config.h>
#include "nautilus-default-file-icon.h"
const int nautilus_default_file_icon_width = 48;
const int nautilus_default_file_icon_height = 48;
const unsigned char nautilus_default_file_icon[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x8c, 0x8c, 0x8c, 0xff,
0x8c, 0x8c, 0x8c, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x8c, 0x8c, 0x8c, 0xff, 0xaa, 0xaa, 0xaa, 0xff, 0xa7, 0xa7, 0xa6, 0xff,
0x99, 0x99, 0x99, 0xff, 0x12, 0x12, 0x12, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x02, 0x02, 0x02, 0xff, 0x26, 0x26, 0x26, 0xff, 0x96, 0x96, 0x96, 0xff,
0xb5, 0xb5, 0xb5, 0xff, 0xb2, 0xb2, 0xb2, 0xff, 0xb1, 0xb1, 0xb0, 0xff, 0xaf, 0xaf, 0xae, 0xff,
0xae, 0xae, 0xad, 0xff, 0x4d, 0x4d, 0x4c, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x16, 0x16, 0x16, 0xff, 0x16, 0x16, 0x16, 0xff, 0x6b, 0x6b, 0x6b, 0xff, 0x9f, 0x9f, 0x9f, 0xff,
0xb9, 0xb9, 0xb8, 0xff, 0xb8, 0xb8, 0xb7, 0xff, 0xb8, 0xb8, 0xb7, 0xff, 0xb6, 0xb6, 0xb5, 0xff,
0xb4, 0xb4, 0xb4, 0xff, 0xb2, 0xb2, 0xb2, 0xff, 0xb0, 0xb0, 0xb0, 0xff, 0xaf, 0xaf, 0xaf, 0xff,
0xad, 0xad, 0xac, 0xff, 0x98, 0x98, 0x97, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0x9d, 0x9d, 0x9d, 0xff, 0xaa, 0xaa, 0xa9, 0xff,
0xac, 0xac, 0xab, 0xff, 0xb0, 0xb0, 0xaf, 0xff, 0xb8, 0xb8, 0xb8, 0xff, 0xb8, 0xb8, 0xb8, 0xff,
0xb8, 0xb8, 0xb8, 0xff, 0xb7, 0xb7, 0xb7, 0xff, 0xb6, 0xb6, 0xb6, 0xff, 0xb5, 0xb5, 0xb4, 0xff,
0xb4, 0xb4, 0xb3, 0xff, 0xb2, 0xb2, 0xb1, 0xff, 0xb1, 0xb1, 0xb0, 0xff, 0xaf, 0xaf, 0xae, 0xff,
0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xad, 0xff, 0x25, 0x25, 0x25, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xd3, 0xd3, 0xd3, 0xff, 0x7a, 0x7a, 0x7a, 0xff, 0x87, 0x87, 0x87, 0xff,
0x9f, 0x9f, 0x9f, 0xff, 0xa8, 0xa8, 0xa7, 0xff, 0xb1, 0xb1, 0xb0, 0xff, 0xb4, 0xb4, 0xb3, 0xff,
0xb5, 0xb5, 0xb5, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0xb3, 0xb3, 0xb3, 0xff,
0xb2, 0xb2, 0xb2, 0xff, 0xb1, 0xb1, 0xb1, 0xff, 0xb0, 0xb0, 0xaf, 0xff, 0xae, 0xae, 0xad, 0xff,
0xae, 0xae, 0xad, 0xff, 0xad, 0xad, 0xac, 0xff, 0x87, 0x87, 0x86, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xd5, 0xd5, 0xd5, 0xff, 0xe1, 0xe1, 0xe0, 0xff, 0x7f, 0x7f, 0x7f, 0xff, 0x6b, 0x6b, 0x6b, 0xff,
0x80, 0x80, 0x80, 0xff, 0x9f, 0x9f, 0x9f, 0xff, 0xab, 0xab, 0xab, 0xff, 0xb0, 0xb0, 0xb0, 0xff,
0xb2, 0xb2, 0xb1, 0xff, 0xb3, 0xb3, 0xb2, 0xff, 0xb1, 0xb1, 0xb0, 0xff, 0xb2, 0xb2, 0xb1, 0xff,
0xaf, 0xaf, 0xaf, 0xff, 0xb0, 0xb0, 0xb0, 0xff, 0xae, 0xae, 0xae, 0xff, 0xad, 0xad, 0xad, 0xff,
0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xac, 0xff, 0xad, 0xad, 0xac, 0xff, 0x13, 0x13, 0x13, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xa0, 0xa0, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0xdb, 0xdb, 0xdb, 0xff, 0xcb, 0xcb, 0xcb, 0xff, 0x5a, 0x5a, 0x59, 0xff,
0x78, 0x78, 0x78, 0xff, 0x99, 0x99, 0x98, 0xff, 0xa4, 0xa4, 0xa4, 0xff, 0xac, 0xac, 0xac, 0xff,
0xaf, 0xaf, 0xaf, 0xff, 0xaf, 0xaf, 0xaf, 0xff, 0xaf, 0xaf, 0xaf, 0xff, 0xaf, 0xaf, 0xae, 0xff,
0xaf, 0xaf, 0xae, 0xff, 0xae, 0xae, 0xae, 0xff, 0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xad, 0xff,
0xad, 0xad, 0xad, 0xff, 0xac, 0xac, 0xac, 0xff, 0xad, 0xad, 0xad, 0xff, 0x86, 0x86, 0x86, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x19, 0x19, 0xff, 0xd4, 0xd4, 0xd4, 0xff,
0xdf, 0xdf, 0xdf, 0xff, 0xdd, 0xdd, 0xdd, 0xff, 0xd3, 0xd3, 0xd3, 0xff, 0x52, 0x52, 0x52, 0xff,
0x72, 0x72, 0x72, 0xff, 0x90, 0x90, 0x90, 0xff, 0x9d, 0x9d, 0x9c, 0xff, 0xa6, 0xa6, 0xa5, 0xff,
0xac, 0xac, 0xac, 0xff, 0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xad, 0xff,
0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xad, 0xff, 0xad, 0xad, 0xac, 0xff, 0xad, 0xad, 0xac, 0xff,
0xac, 0xac, 0xab, 0xff, 0xad, 0xad, 0xac, 0xff, 0xad, 0xad, 0xac, 0xff, 0xad, 0xad, 0xad, 0xff,
0x13, 0x13, 0x13, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xab, 0xab, 0xab, 0xff, 0xe4, 0xe4, 0xe4, 0xff,
0xa7, 0xa7, 0xa6, 0xff, 0x62, 0x62, 0x61, 0xff, 0x4d, 0x4d, 0x4d, 0xff, 0x5d, 0x5d, 0x5d, 0xff,
0x6f, 0x6f, 0x6f, 0xff, 0x8d, 0x8d, 0x8d, 0xff, 0x98, 0x98, 0x98, 0xff, 0x9e, 0x9e, 0x9e, 0xff,
0xa5, 0xa5, 0xa5, 0xff, 0xac, 0xac, 0xab, 0xff, 0xac, 0xac, 0xac, 0xff, 0xae, 0xae, 0xad, 0xff,
0xae, 0xae, 0xae, 0xff, 0xad, 0xad, 0xad, 0xff, 0xac, 0xac, 0xac, 0xff, 0xab, 0xab, 0xab, 0xff,
0xac, 0xac, 0xac, 0xff, 0xad, 0xad, 0xac, 0xff, 0xae, 0xae, 0xad, 0xff, 0xaf, 0xaf, 0xae, 0xff,
0x87, 0x87, 0x86, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x64, 0x64, 0x64, 0xff, 0x5c, 0x5c, 0x5c, 0xff,
0x53, 0x53, 0x53, 0xff, 0x52, 0x52, 0x52, 0xff, 0x61, 0x61, 0x61, 0xff, 0x70, 0x70, 0x70, 0xff,
0x74, 0x74, 0x74, 0xff, 0x8f, 0x8f, 0x8f, 0xff, 0x99, 0x99, 0x99, 0xff, 0x9d, 0x9d, 0x9d, 0xff,
0xa7, 0xa7, 0xa7, 0xff, 0xac, 0xac, 0xac, 0xff, 0xac, 0xac, 0xac, 0xff, 0xaf, 0xaf, 0xae, 0xff,
0xaf, 0xaf, 0xaf, 0xff, 0xaf, 0xaf, 0xae, 0xff, 0xae, 0xae, 0xad, 0xff, 0xac, 0xac, 0xac, 0xff,
0xac, 0xac, 0xac, 0xff, 0xad, 0xad, 0xad, 0xff, 0xaf, 0xaf, 0xaf, 0xff, 0xb0, 0xb0, 0xb0, 0xff,
0xb1, 0xb1, 0xb1, 0xff, 0x14, 0x14, 0x14, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x42, 0x42, 0x42, 0xff, 0x7f, 0x7f, 0x7f, 0xff,
0x77, 0x77, 0x77, 0xff, 0x77, 0x77, 0x77, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff,
0x8b, 0x8b, 0x8b, 0xff, 0x92, 0x92, 0x92, 0xff, 0x9e, 0x9e, 0x9d, 0xff, 0xa4, 0xa4, 0xa3, 0xff,
0xad, 0xad, 0xac, 0xff, 0xb0, 0xb0, 0xb0, 0xff, 0xb1, 0xb1, 0xb1, 0xff, 0xb2, 0xb2, 0xb2, 0xff,
0xb3, 0xb3, 0xb3, 0xff, 0xb2, 0xb2, 0xb2, 0xff, 0xb0, 0xb0, 0xaf, 0xff, 0xae, 0xae, 0xad, 0xff,
0xaf, 0xaf, 0xae, 0xff, 0xb0, 0xb0, 0xaf, 0xff, 0xb1, 0xb1, 0xb1, 0xff, 0xb2, 0xb2, 0xb2, 0xff,
0xb3, 0xb3, 0xb3, 0xff, 0x88, 0x88, 0x88, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x1a, 0x1a, 0xff, 0x8e, 0x8e, 0x8e, 0xff,
0x98, 0x98, 0x97, 0xff, 0x82, 0x82, 0x81, 0xff, 0x8f, 0x8f, 0x8f, 0xff, 0x7f, 0x7f, 0x7f, 0xff,
0x94, 0x94, 0x94, 0xff, 0x9c, 0x9c, 0x9c, 0xff, 0xa7, 0xa7, 0xa7, 0xff, 0xaf, 0xaf, 0xaf, 0xff,
0xb1, 0xb1, 0xb1, 0xff, 0xb4, 0xb4, 0xb3, 0xff, 0xb6, 0xb6, 0xb5, 0xff, 0xb5, 0xb5, 0xb4, 0xff,
0xb5, 0xb5, 0xb5, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0xb2, 0xb2, 0xb2, 0xff,
0xb2, 0xb2, 0xb2, 0xff, 0xb4, 0xb4, 0xb3, 0xff, 0xb5, 0xb5, 0xb4, 0xff, 0xb5, 0xb5, 0xb4, 0xff,
0xb6, 0xb6, 0xb5, 0xff, 0xb7, 0xb7, 0xb6, 0xff, 0x27, 0x27, 0x27, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0xff, 0xb1, 0xb1, 0xb1, 0xff,
0xa8, 0xa8, 0xa8, 0xff, 0xa2, 0xa2, 0xa2, 0xff, 0x9f, 0x9f, 0x9f, 0xff, 0xa2, 0xa2, 0xa1, 0xff,
0xa6, 0xa6, 0xa5, 0xff, 0xaa, 0xaa, 0xaa, 0xff, 0xaf, 0xaf, 0xaf, 0xff, 0xb2, 0xb2, 0xb2, 0xff,
0xb6, 0xb6, 0xb6, 0xff, 0xb9, 0xb9, 0xb9, 0xff, 0xba, 0xba, 0xba, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0xbb, 0xbb, 0xba, 0xff, 0xba, 0xba, 0xb9, 0xff, 0xba, 0xba, 0xb9, 0xff, 0xb8, 0xb8, 0xb8, 0xff,
0xb8, 0xb8, 0xb8, 0xff, 0xb8, 0xb8, 0xb8, 0xff, 0xb8, 0xb8, 0xb8, 0xff, 0xb9, 0xb9, 0xb9, 0xff,
0xb9, 0xb9, 0xb8, 0xff, 0xb9, 0xb9, 0xb8, 0xff, 0x8f, 0x8f, 0x8e, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xbc, 0xbc, 0xbc, 0xff,
0xb6, 0xb6, 0xb6, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0xb1, 0xb1, 0xb1, 0xff, 0xb1, 0xb1, 0xb1, 0xff,
0xb0, 0xb0, 0xb0, 0xff, 0xb2, 0xb2, 0xb2, 0xff, 0xb6, 0xb6, 0xb5, 0xff, 0xba, 0xba, 0xb9, 0xff,
0xbf, 0xbf, 0xbf, 0xff, 0xbe, 0xbe, 0xbe, 0xff, 0xbf, 0xbf, 0xbf, 0xff, 0xc0, 0xc0, 0xc0, 0xff,
0xc0, 0xc0, 0xc0, 0xff, 0xbf, 0xbf, 0xbf, 0xff, 0xbf, 0xbf, 0xbf, 0xff, 0xbd, 0xbd, 0xbc, 0xff,
0xbd, 0xbd, 0xbc, 0xff, 0xbd, 0xbd, 0xbc, 0xff, 0xbc, 0xbc, 0xbc, 0xff, 0xbc, 0xbc, 0xbc, 0xff,
0xbc, 0xbc, 0xbc, 0xff, 0xbb, 0xbb, 0xbb, 0xff, 0xbb, 0xbb, 0xbb, 0xff, 0x29, 0x29, 0x29, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0xc2, 0xc2, 0xc2, 0xff, 0xbf, 0xbf, 0xbe, 0xff, 0xbb, 0xbb, 0xbb, 0xff, 0xb9, 0xb9, 0xb9, 0xff,
0xb8, 0xb8, 0xb8, 0xff, 0xb9, 0xb9, 0xb9, 0xff, 0xbe, 0xbe, 0xbe, 0xff, 0xc3, 0xc3, 0xc3, 0xff,
0xc4, 0xc4, 0xc4, 0xff, 0xc6, 0xc6, 0xc5, 0xff, 0xc8, 0xc8, 0xc7, 0xff, 0xc7, 0xc7, 0xc6, 0xff,
0xc6, 0xc6, 0xc6, 0xff, 0xc5, 0xc5, 0xc5, 0xff, 0xc4, 0xc4, 0xc4, 0xff, 0xc3, 0xc3, 0xc3, 0xff,
0xc2, 0xc2, 0xc2, 0xff, 0xc2, 0xc2, 0xc2, 0xff, 0xc2, 0xc2, 0xc1, 0xff, 0xc0, 0xc0, 0xbf, 0xff,
0xc0, 0xc0, 0xbf, 0xff, 0xbf, 0xbf, 0xbf, 0xff, 0xbd, 0xbd, 0xbd, 0xff, 0xa8, 0xa8, 0xa8, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xae, 0xae, 0xae, 0xff,
0xcd, 0xcd, 0xcd, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc5, 0xc5, 0xc5, 0xff, 0xc4, 0xc4, 0xc4, 0xff,
0xc2, 0xc2, 0xc1, 0xff, 0xc0, 0xc0, 0xc0, 0xff, 0xc6, 0xc6, 0xc6, 0xff, 0xc9, 0xc9, 0xc9, 0xff,
0xca, 0xca, 0xca, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcd, 0xcd, 0xcd, 0xff,
0xcc, 0xcc, 0xcb, 0xff, 0xcb, 0xcb, 0xca, 0xff, 0xca, 0xca, 0xc9, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
0xc7, 0xc7, 0xc7, 0xff, 0xc6, 0xc6, 0xc6, 0xff, 0xc5, 0xc5, 0xc5, 0xff, 0xc4, 0xc4, 0xc4, 0xff,
0xc4, 0xc4, 0xc4, 0xff, 0xc2, 0xc2, 0xc1, 0xff, 0xc1, 0xc1, 0xc0, 0xff, 0xc0, 0xc0, 0xbf, 0xff,
0x7d, 0x7d, 0x7c, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x50, 0x50, 0x50, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xd4, 0xd4, 0xd4, 0xff, 0xd0, 0xd0, 0xd0, 0xff, 0xcd, 0xcd, 0xcd, 0xff,
0xce, 0xce, 0xce, 0xff, 0xce, 0xce, 0xce, 0xff, 0xd0, 0xd0, 0xd0, 0xff, 0xd1, 0xd1, 0xd0, 0xff,
0xd2, 0xd2, 0xd2, 0xff, 0xd2, 0xd2, 0xd2, 0xff, 0xd2, 0xd2, 0xd2, 0xff, 0xd1, 0xd1, 0xd1, 0xff,
0xd1, 0xd1, 0xd1, 0xff, 0xd0, 0xd0, 0xd0, 0xff, 0xd0, 0xd0, 0xd0, 0xff, 0xce, 0xce, 0xcd, 0xff,
0xcd, 0xcd, 0xcc, 0xff, 0xcc, 0xcc, 0xcb, 0xff, 0xc9, 0xc9, 0xc9, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
0xc6, 0xc6, 0xc6, 0xff, 0xc5, 0xc5, 0xc5, 0xff, 0xc4, 0xc4, 0xc4, 0xff, 0xc3, 0xc3, 0xc2, 0xff,
0xc2, 0xc2, 0xc1, 0xff, 0x15, 0x15, 0x14, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xe3, 0xe3, 0xe3, 0xff, 0xe0, 0xe0, 0xdf, 0xff, 0xdb, 0xdb, 0xdb, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xd7, 0xd7, 0xd7, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xd9, 0xd9, 0xd9, 0xff, 0xd9, 0xd9, 0xd8, 0xff, 0xd8, 0xd8, 0xd7, 0xff, 0xd7, 0xd7, 0xd7, 0xff,
0xd6, 0xd6, 0xd6, 0xff, 0xd4, 0xd4, 0xd4, 0xff, 0xd4, 0xd4, 0xd4, 0xff, 0xd2, 0xd2, 0xd2, 0xff,
0xd0, 0xd0, 0xd0, 0xff, 0xce, 0xce, 0xce, 0xff, 0xcd, 0xcd, 0xcc, 0xff, 0xcc, 0xcc, 0xcb, 0xff,
0xca, 0xca, 0xc9, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc7, 0xc7, 0xc7, 0xff, 0xc6, 0xc6, 0xc6, 0xff,
0xc4, 0xc4, 0xc4, 0xff, 0x9e, 0x9e, 0x9e, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0xe8, 0xe8, 0xe8, 0xff, 0xe6, 0xe6, 0xe6, 0xff, 0xe3, 0xe3, 0xe3, 0xff,
0xe1, 0xe1, 0xe0, 0xff, 0xdf, 0xdf, 0xdf, 0xff, 0xde, 0xde, 0xde, 0xff, 0xdd, 0xdd, 0xdd, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xdc, 0xdc, 0xdc, 0xff,
0xdb, 0xdb, 0xda, 0xff, 0xdb, 0xdb, 0xda, 0xff, 0xd9, 0xd9, 0xd8, 0xff, 0xd6, 0xd6, 0xd6, 0xff,
0xd4, 0xd4, 0xd4, 0xff, 0xd2, 0xd2, 0xd2, 0xff, 0xd1, 0xd1, 0xd1, 0xff, 0xcf, 0xcf, 0xcf, 0xff,
0xce, 0xce, 0xce, 0xff, 0xcc, 0xcc, 0xcb, 0xff, 0xcb, 0xcb, 0xca, 0xff, 0xc9, 0xc9, 0xc8, 0xff,
0xc6, 0xc6, 0xc6, 0xff, 0xc4, 0xc4, 0xc4, 0xff, 0x2a, 0x2a, 0x2a, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xc9, 0xc9, 0xc9, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xec, 0xec, 0xec, 0xff, 0xe9, 0xe9, 0xe9, 0xff,
0xe6, 0xe6, 0xe6, 0xff, 0xe4, 0xe4, 0xe4, 0xff, 0xe3, 0xe3, 0xe3, 0xff, 0xe2, 0xe2, 0xe1, 0xff,
0xe0, 0xe0, 0xe0, 0xff, 0xe0, 0xe0, 0xe0, 0xff, 0xe0, 0xe0, 0xe0, 0xff, 0xdf, 0xdf, 0xdf, 0xff,
0xdf, 0xdf, 0xdf, 0xff, 0xde, 0xde, 0xde, 0xff, 0xdd, 0xdd, 0xdd, 0xff, 0xdb, 0xdb, 0xda, 0xff,
0xd9, 0xd9, 0xd8, 0xff, 0xd7, 0xd7, 0xd6, 0xff, 0xd4, 0xd4, 0xd4, 0xff, 0xd2, 0xd2, 0xd2, 0xff,
0xd1, 0xd1, 0xd1, 0xff, 0xcf, 0xcf, 0xcf, 0xff, 0xcd, 0xcd, 0xcd, 0xff, 0xcb, 0xcb, 0xcb, 0xff,
0xc9, 0xc9, 0xc8, 0xff, 0xc7, 0xc7, 0xc6, 0xff, 0xae, 0xae, 0xad, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x7b, 0x7b, 0x7b, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0xf1, 0xf1, 0xf1, 0xff, 0xee, 0xee, 0xee, 0xff,
0xeb, 0xeb, 0xeb, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0xe7, 0xe7, 0xe7, 0xff, 0xe6, 0xe6, 0xe6, 0xff,
0xe5, 0xe5, 0xe5, 0xff, 0xe5, 0xe5, 0xe5, 0xff, 0xe4, 0xe4, 0xe3, 0xff, 0xe3, 0xe3, 0xe3, 0xff,
0xe2, 0xe2, 0xe2, 0xff, 0xe1, 0xe1, 0xe1, 0xff, 0xe0, 0xe0, 0xe0, 0xff, 0xde, 0xde, 0xde, 0xff,
0xdc, 0xdc, 0xdc, 0xff, 0xda, 0xda, 0xda, 0xff, 0xd8, 0xd8, 0xd7, 0xff, 0xd6, 0xd6, 0xd5, 0xff,
0xd4, 0xd4, 0xd3, 0xff, 0xd1, 0xd1, 0xd1, 0xff, 0xcf, 0xcf, 0xcf, 0xff, 0xcd, 0xcd, 0xcd, 0xff,
0xcb, 0xcb, 0xcb, 0xff, 0xc9, 0xc9, 0xc9, 0xff, 0xc7, 0xc7, 0xc7, 0xff, 0xa0, 0xa0, 0x9f, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1c, 0x1c, 0x1c, 0xff, 0xf9, 0xf9, 0xf9, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0xf3, 0xf3, 0xf3, 0xff,
0xf1, 0xf1, 0xf0, 0xff, 0xed, 0xed, 0xed, 0xff, 0xec, 0xec, 0xec, 0xff, 0xea, 0xea, 0xea, 0xff,
0xe9, 0xe9, 0xe9, 0xff, 0xe8, 0xe8, 0xe8, 0xff, 0xe7, 0xe7, 0xe7, 0xff, 0xe7, 0xe7, 0xe7, 0xff,
0xe6, 0xe6, 0xe6, 0xff, 0xe5, 0xe5, 0xe4, 0xff, 0xe2, 0xe2, 0xe2, 0xff, 0xe0, 0xe0, 0xe0, 0xff,
0xde, 0xde, 0xde, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xda, 0xda, 0xda, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xd6, 0xd6, 0xd6, 0xff, 0xd4, 0xd4, 0xd3, 0xff, 0xd2, 0xd2, 0xd1, 0xff, 0xd0, 0xd0, 0xcf, 0xff,
0xcd, 0xcd, 0xcd, 0xff, 0xcb, 0xcb, 0xcb, 0xff, 0xc4, 0xc4, 0xc4, 0xff, 0x90, 0x90, 0x90, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xdb, 0xdb, 0xdb, 0xff, 0xfa, 0xfa, 0xfa, 0xff, 0xf7, 0xf7, 0xf7, 0xff,
0xf5, 0xf5, 0xf5, 0xff, 0xf3, 0xf3, 0xf3, 0xff, 0xf1, 0xf1, 0xf1, 0xff, 0xef, 0xef, 0xee, 0xff,
0xed, 0xed, 0xed, 0xff, 0xec, 0xec, 0xec, 0xff, 0xeb, 0xeb, 0xeb, 0xff, 0xea, 0xea, 0xea, 0xff,
0xe8, 0xe8, 0xe8, 0xff, 0xe7, 0xe7, 0xe7, 0xff, 0xe5, 0xe5, 0xe5, 0xff, 0xe3, 0xe3, 0xe3, 0xff,
0xe1, 0xe1, 0xe0, 0xff, 0xdf, 0xdf, 0xde, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xda, 0xda, 0xda, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xd6, 0xd6, 0xd6, 0xff, 0xd4, 0xd4, 0xd4, 0xff, 0xd2, 0xd2, 0xd2, 0xff,
0xd0, 0xd0, 0xcf, 0xff, 0x92, 0x92, 0x92, 0xff, 0x16, 0x16, 0x16, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xba, 0xba, 0xba, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xfb, 0xfb, 0xfb, 0xff,
0xf9, 0xf9, 0xf9, 0xff, 0xf7, 0xf7, 0xf7, 0xff, 0xf5, 0xf5, 0xf5, 0xff, 0xf3, 0xf3, 0xf3, 0xff,
0xf2, 0xf2, 0xf2, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xef, 0xef, 0xee, 0xff, 0xed, 0xed, 0xed, 0xff,
0xeb, 0xeb, 0xeb, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0xe7, 0xe7, 0xe7, 0xff, 0xe5, 0xe5, 0xe5, 0xff,
0xe3, 0xe3, 0xe3, 0xff, 0xe1, 0xe1, 0xe1, 0xff, 0xdf, 0xdf, 0xdf, 0xff, 0xdd, 0xdd, 0xdc, 0xff,
0xdb, 0xdb, 0xda, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xd6, 0xd6, 0xd6, 0xff, 0xad, 0xad, 0xad, 0xff,
0x17, 0x17, 0x17, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfd, 0xfd, 0xfd, 0xff,
0xfd, 0xfd, 0xfd, 0xff, 0xfa, 0xfa, 0xfa, 0xff, 0xf8, 0xf8, 0xf8, 0xff, 0xf6, 0xf6, 0xf6, 0xff,
0xf5, 0xf5, 0xf5, 0xff, 0xf3, 0xf3, 0xf3, 0xff, 0xf2, 0xf2, 0xf2, 0xff, 0xf0, 0xf0, 0xf0, 0xff,
0xee, 0xee, 0xee, 0xff, 0xec, 0xec, 0xeb, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0xe7, 0xe7, 0xe7, 0xff,
0xe5, 0xe5, 0xe5, 0xff, 0xe3, 0xe3, 0xe3, 0xff, 0xe1, 0xe1, 0xe1, 0xff, 0xdf, 0xdf, 0xdf, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0xb0, 0xb0, 0xaf, 0xff, 0x17, 0x17, 0x17, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xfe, 0xfe, 0xfe, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xfb, 0xfb, 0xfa, 0xff,
0xf8, 0xf8, 0xf8, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0xf2, 0xf2, 0xf2, 0xff,
0xf0, 0xf0, 0xf0, 0xff, 0xee, 0xee, 0xee, 0xff, 0xec, 0xec, 0xec, 0xff, 0xea, 0xea, 0xea, 0xff,
0xe8, 0xe8, 0xe7, 0xff, 0xe6, 0xe6, 0xe5, 0xff, 0xd5, 0xd5, 0xd5, 0xff, 0xa3, 0xa3, 0xa3, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xbe, 0xbe, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfd, 0xfd, 0xff,
0xfb, 0xfb, 0xfb, 0xff, 0xf9, 0xf9, 0xf9, 0xff, 0xf7, 0xf7, 0xf6, 0xff, 0xf4, 0xf4, 0xf4, 0xff,
0xf2, 0xf2, 0xf2, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xee, 0xee, 0xee, 0xff, 0xec, 0xec, 0xec, 0xff,
0xc6, 0xc6, 0xc6, 0xff, 0x96, 0x96, 0x96, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7d, 0x7d, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xfd, 0xfd, 0xfd, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xf9, 0xf9, 0xf9, 0xff, 0xf7, 0xf7, 0xf7, 0xff,
0xf5, 0xf5, 0xf5, 0xff, 0xf3, 0xf3, 0xf2, 0xff, 0xa0, 0xa0, 0xa0, 0xff, 0x34, 0x34, 0x34, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfd, 0xfd, 0xfd, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xcf, 0xcf, 0xcf, 0xff,
0x8f, 0x8f, 0x8f, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xbe, 0xbe, 0xbe, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe2, 0xe2, 0xe2, 0xff, 0xa7, 0xa7, 0xa7, 0xff, 0x37, 0x37, 0x37, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0xff,
0xff, 0xff, 0xff, 0xff, 0xe2, 0xe2, 0xe2, 0xff, 0xbb, 0xbb, 0xbb, 0xff, 0x7d, 0x7d, 0x7d, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

View file

@ -1,32 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
Default file icon used by the icon factory.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_DEFAULT_FILE_ICON_H
#define NAUTILUS_DEFAULT_FILE_ICON_H
extern const int nautilus_default_file_icon_width;
extern const int nautilus_default_file_icon_height;
extern const unsigned char nautilus_default_file_icon[];
#endif /* NAUTILUS_DEFAULT_FILE_ICON_H */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,39 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
nautilus-directory-background.h: Helper for the background of a widget
that is viewing a particular directory.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include <gtk/gtkwidget.h>
#include "nautilus-file.h"
#include <eel/eel-background.h>
#include "libnautilus-extensions/nautilus-icon-container.h"
void nautilus_connect_background_to_file_metadata (GtkWidget *widget,
NautilusFile *file);
void nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container,
NautilusFile *file);
void nautilus_connect_background_to_file_metadata_by_uri (GtkWidget *widget,
const char *uri);
gboolean nautilus_file_background_is_set (EelBackground *background);

View file

@ -1,135 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-directory-metafile-monitor.c
*
* Copyright (C) 2001 Eazel, Inc.
*
* 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>
#include "nautilus-directory-metafile-monitor.h"
#include "nautilus-directory-private.h"
#include "nautilus-file-private.h"
#include <eel/eel-gtk-macros.h>
#include <eel/eel-glib-extensions.h>
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
#include <libnautilus/nautilus-bonobo-workarounds.h>
struct NautilusMetafileMonitorDetails {
NautilusDirectory *directory;
};
static void nautilus_metafile_monitor_init (NautilusMetafileMonitor *monitor);
static void nautilus_metafile_monitor_class_init (NautilusMetafileMonitorClass *klass);
static void destroy (GtkObject *monitor);
static void corba_metafile_changed (PortableServer_Servant servant,
const Nautilus_FileNameList *file_names,
CORBA_Environment *ev);
static void corba_metafile_ready (PortableServer_Servant servant,
CORBA_Environment *ev);
NAUTILUS_BONOBO_X_BOILERPLATE (NautilusMetafileMonitor, Nautilus_MetafileMonitor, BONOBO_X_OBJECT_TYPE, nautilus_metafile_monitor)
static void
nautilus_metafile_monitor_class_init (NautilusMetafileMonitorClass *klass)
{
GTK_OBJECT_CLASS (klass)->destroy = destroy;
klass->epv.metafile_changed = corba_metafile_changed;
klass->epv.metafile_ready = corba_metafile_ready;
}
static void
nautilus_metafile_monitor_init (NautilusMetafileMonitor *monitor)
{
monitor->details = g_new0 (NautilusMetafileMonitorDetails, 1);
}
static void
destroy (GtkObject *object)
{
NautilusMetafileMonitor *monitor;
monitor = NAUTILUS_METAFILE_MONITOR (object);
g_free (monitor->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusMetafileMonitor *
nautilus_metafile_monitor_new (NautilusDirectory *directory)
{
NautilusMetafileMonitor *monitor;
monitor = NAUTILUS_METAFILE_MONITOR (gtk_object_new (NAUTILUS_TYPE_METAFILE_MONITOR, NULL));
monitor->details->directory = directory;
/* The monitor is owned by the directory, so we don't ref the directory. */
return monitor;
}
static void
corba_metafile_changed (PortableServer_Servant servant,
const Nautilus_FileNameList *file_names,
CORBA_Environment *ev)
{
GList *file_list;
NautilusFile *file;
CORBA_unsigned_long buf_pos;
NautilusMetafileMonitor *monitor;
monitor = NAUTILUS_METAFILE_MONITOR (bonobo_object_from_servant (servant));
file_list = NULL;
for (buf_pos = 0; buf_pos < file_names->_length; ++buf_pos) {
file = nautilus_directory_find_file_by_internal_uri
(monitor->details->directory, file_names->_buffer [buf_pos]);
if (file != NULL) {
if (nautilus_file_is_self_owned (file)) {
nautilus_file_emit_changed (file);
} else {
file_list = g_list_prepend (file_list, file);
}
}
}
if (file_list != NULL) {
file_list = g_list_reverse (file_list);
nautilus_directory_emit_change_signals (monitor->details->directory, file_list);
g_list_free (file_list);
}
}
static void
corba_metafile_ready (PortableServer_Servant servant,
CORBA_Environment *ev)
{
NautilusMetafileMonitor *monitor;
monitor = NAUTILUS_METAFILE_MONITOR (bonobo_object_from_servant (servant));
emit_change_signals_for_all_files (monitor->details->directory);
nautilus_idle_queue_add (monitor->details->directory->details->idle_queue,
(GFunc) nautilus_directory_async_state_changed,
monitor->details->directory,
NULL,
NULL);
}

View file

@ -1,55 +0,0 @@
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
/* nautilus-directory-metafile-monitor.h
*
* Copyright (C) 2001 Eazel, Inc.
*
* 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.
*/
#ifndef NAUTILUS_METAFILE_MONITOR_H
#define NAUTILUS_METAFILE_MONITOR_H
#include "nautilus-metafile-server.h"
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-xobject.h>
#include <libnautilus-extensions/nautilus-directory.h>
#define NAUTILUS_TYPE_METAFILE_MONITOR (nautilus_metafile_monitor_get_type ())
#define NAUTILUS_METAFILE_MONITOR(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_METAFILE_MONITOR, NautilusMetafileMonitor))
#define NAUTILUS_METAFILE_MONITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_METAFILE_MONITOR, NautilusMetafileMonitorClass))
#define NAUTILUS_IS_METAFILE_MONITOR(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_METAFILE_MONITOR))
#define NAUTILUS_IS_METAFILE_MONITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_METAFILE_MONITOR))
typedef struct NautilusMetafileMonitorDetails NautilusMetafileMonitorDetails;
typedef struct {
BonoboXObject parent_slot;
NautilusMetafileMonitorDetails *details;
} NautilusMetafileMonitor;
typedef struct {
BonoboXObjectClass parent_slot;
POA_Nautilus_MetafileMonitor__epv epv;
} NautilusMetafileMonitorClass;
GtkType nautilus_metafile_monitor_get_type (void);
NautilusMetafileMonitor *nautilus_metafile_monitor_new (NautilusDirectory *directory);
#endif /* NAUTILUS_METAFILE_MONITOR_H */

View file

@ -1,518 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory-metafile.c: Nautilus directory model.
Copyright (C) 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Darin Adler <darin@eazel.com>,
Mike Engber <engber@eazel.com>
*/
#include <config.h>
#include "nautilus-directory-metafile.h"
#include "nautilus-directory-private.h"
#include <libnautilus-extensions/nautilus-metafile-factory.h>
#include <libnautilus-extensions/nautilus-directory-metafile-monitor.h>
#include <libnautilus-extensions/nautilus-metafile-server.h>
#include <eel/eel-string.h>
#include <liboaf/liboaf.h>
#include <stdio.h>
static Nautilus_MetafileFactory factory = CORBA_OBJECT_NIL;
static gboolean get_factory_from_oaf = TRUE;
void
nautilus_directory_use_self_contained_metafile_factory (void)
{
g_return_if_fail (factory == CORBA_OBJECT_NIL);
get_factory_from_oaf = FALSE;
}
static void
free_factory (void)
{
bonobo_object_release_unref (factory, NULL);
}
static Nautilus_MetafileFactory
get_factory (void)
{
NautilusMetafileFactory *instance;
if (factory == CORBA_OBJECT_NIL) {
if (get_factory_from_oaf) {
factory = oaf_activate_from_id (METAFILE_FACTORY_IID, 0, NULL, NULL);
} else {
instance = nautilus_metafile_factory_get_instance ();
factory = bonobo_object_dup_ref (bonobo_object_corba_objref (BONOBO_OBJECT (instance)), NULL);
bonobo_object_unref (BONOBO_OBJECT (instance));
}
g_atexit (free_factory);
}
return factory;
}
static Nautilus_Metafile
get_metafile (NautilusDirectory *directory)
{
char *uri;
CORBA_Environment ev;
uri = nautilus_directory_get_uri (directory);
CORBA_exception_init (&ev);
if (directory->details->metafile_corba_object == CORBA_OBJECT_NIL) {
directory->details->metafile_corba_object = Nautilus_MetafileFactory_open (get_factory (), uri, &ev);
}
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
g_free (uri);
return bonobo_object_dup_ref (directory->details->metafile_corba_object, NULL);
}
gboolean
nautilus_directory_is_metadata_read (NautilusDirectory *directory)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
gboolean result;
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), FALSE);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
result = Nautilus_Metafile_is_read (metafile, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
return result;
}
char *
nautilus_directory_get_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
const char *default_metadata)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
char *result;
const char *non_null_default;
CORBA_char *corba_value;
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
g_return_val_if_fail (!eel_str_is_empty (file_name), NULL);
g_return_val_if_fail (!eel_str_is_empty (key), NULL);
/* We can't pass NULL as a CORBA_string - pass "" instead. */
non_null_default = default_metadata != NULL ? default_metadata : "";
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
corba_value = Nautilus_Metafile_get (metafile, file_name, key, non_null_default, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
if (eel_str_is_empty (corba_value)) {
/* Even though in all other respects we treat "" as NULL, we want to
* make sure the caller gets back the same default that was passed in.
*/
result = g_strdup (default_metadata);
} else {
result = g_strdup (corba_value);
}
CORBA_free (corba_value);
return result;
}
GList *
nautilus_directory_get_file_metadata_list (NautilusDirectory *directory,
const char *file_name,
const char *list_key,
const char *list_subkey)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
GList *result;
Nautilus_MetadataList *corba_value;
CORBA_unsigned_long buf_pos;
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
g_return_val_if_fail (!eel_str_is_empty (file_name), NULL);
g_return_val_if_fail (!eel_str_is_empty (list_key), NULL);
g_return_val_if_fail (!eel_str_is_empty (list_subkey), NULL);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
corba_value = Nautilus_Metafile_get_list (metafile, file_name, list_key, list_subkey, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
result = NULL;
for (buf_pos = 0; buf_pos < corba_value->_length; ++buf_pos) {
result = g_list_prepend (result, g_strdup (corba_value->_buffer [buf_pos]));
}
result = g_list_reverse (result);
CORBA_free (corba_value);
return result;
}
void
nautilus_directory_set_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
const char *default_metadata,
const char *metadata)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (!eel_str_is_empty (file_name));
g_return_if_fail (!eel_str_is_empty (key));
/* We can't pass NULL as a CORBA_string - pass "" instead.
*/
if (default_metadata == NULL) {
default_metadata = "";
}
if (metadata == NULL) {
metadata = "";
}
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_set (metafile, file_name, key, default_metadata, metadata, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
}
void
nautilus_directory_set_file_metadata_list (NautilusDirectory *directory,
const char *file_name,
const char *list_key,
const char *list_subkey,
GList *list)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
Nautilus_MetadataList *corba_list;
int len;
int buf_pos;
GList *list_ptr;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (!eel_str_is_empty (file_name));
g_return_if_fail (!eel_str_is_empty (list_key));
g_return_if_fail (!eel_str_is_empty (list_subkey));
len = g_list_length (list);
corba_list = Nautilus_MetadataList__alloc ();
corba_list->_maximum = len;
corba_list->_length = len;
corba_list->_buffer = CORBA_sequence_CORBA_string_allocbuf (len);
/* We allocate our buffer with CORBA calls, so CORBA_free will clean it
* all up if we set release to TRUE.
*/
CORBA_sequence_set_release (corba_list, CORBA_TRUE);
buf_pos = 0;
list_ptr = list;
while (list_ptr != NULL) {
corba_list->_buffer [buf_pos] = CORBA_string_dup (list_ptr->data);
list_ptr = g_list_next (list_ptr);
++buf_pos;
}
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_set_list (metafile, file_name, list_key, list_subkey, corba_list, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
CORBA_free (corba_list);
}
gboolean
nautilus_directory_get_boolean_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
gboolean default_metadata)
{
char *result_as_string;
gboolean result;
result_as_string = nautilus_directory_get_file_metadata
(directory, file_name, key,
default_metadata ? "true" : "false");
g_strdown (result_as_string);
if (strcmp (result_as_string, "true") == 0) {
result = TRUE;
} else if (strcmp (result_as_string, "false") == 0) {
result = FALSE;
} else {
if (result_as_string != NULL) {
g_warning ("boolean metadata with value other than true or false");
}
result = default_metadata;
}
g_free (result_as_string);
return result;
}
void
nautilus_directory_set_boolean_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
gboolean default_metadata,
gboolean metadata)
{
nautilus_directory_set_file_metadata
(directory, file_name, key,
default_metadata ? "true" : "false",
metadata ? "true" : "false");
}
int
nautilus_directory_get_integer_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
int default_metadata)
{
char *result_as_string;
char *default_as_string;
int result;
default_as_string = g_strdup_printf ("%d", default_metadata);
result_as_string = nautilus_directory_get_file_metadata
(directory, file_name, key, default_as_string);
/* Normally we can't get a a NULL, but we check for it here to
* handle the oddball case of a non-existent directory.
*/
if (result_as_string == NULL) {
result = default_metadata;
} else {
if (sscanf (result_as_string, " %d %*s", &result) != 1) {
result = default_metadata;
}
g_free (result_as_string);
}
g_free (default_as_string);
return result;
}
void
nautilus_directory_set_integer_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
int default_metadata,
int metadata)
{
char *value_as_string;
char *default_as_string;
value_as_string = g_strdup_printf ("%d", metadata);
default_as_string = g_strdup_printf ("%d", default_metadata);
nautilus_directory_set_file_metadata
(directory, file_name, key,
default_as_string, value_as_string);
g_free (value_as_string);
g_free (default_as_string);
}
void
nautilus_directory_copy_file_metadata (NautilusDirectory *source_directory,
const char *source_file_name,
NautilusDirectory *destination_directory,
const char *destination_file_name)
{
CORBA_Environment ev;
Nautilus_Metafile source_metafile;
char* destination_uri;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (source_directory));
g_return_if_fail (source_file_name != NULL);
g_return_if_fail (NAUTILUS_IS_DIRECTORY (destination_directory));
g_return_if_fail (destination_file_name != NULL);
destination_uri = nautilus_directory_get_uri (destination_directory);
source_metafile = get_metafile (source_directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_copy (source_metafile, source_file_name, destination_uri, destination_file_name, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (source_metafile, NULL);
g_free (destination_uri);
}
void
nautilus_directory_remove_file_metadata (NautilusDirectory *directory,
const char *file_name)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (file_name != NULL);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_remove (metafile, file_name, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
}
void
nautilus_directory_rename_file_metadata (NautilusDirectory *directory,
const char *old_file_name,
const char *new_file_name)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (old_file_name != NULL);
g_return_if_fail (new_file_name != NULL);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_rename (metafile, old_file_name, new_file_name, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, &ev);
}
void
nautilus_directory_rename_directory_metadata (NautilusDirectory *directory,
const char *new_directory_uri)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (new_directory_uri != NULL);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_rename_directory (metafile, new_directory_uri, &ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, &ev);
}
void
nautilus_directory_register_metadata_monitor (NautilusDirectory *directory)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
if (directory->details->metafile_monitor != NULL) {
/* If there's already a monitor, it's already registered. */
return;
}
directory->details->metafile_monitor = nautilus_metafile_monitor_new (directory);
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_register_monitor
(metafile,
bonobo_object_corba_objref (BONOBO_OBJECT (directory->details->metafile_monitor)),
&ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
}
void
nautilus_directory_unregister_metadata_monitor (NautilusDirectory *directory)
{
CORBA_Environment ev;
Nautilus_Metafile metafile;
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (NAUTILUS_IS_METAFILE_MONITOR (directory->details->metafile_monitor));
metafile = get_metafile (directory);
CORBA_exception_init (&ev);
Nautilus_Metafile_unregister_monitor
(metafile,
bonobo_object_corba_objref (BONOBO_OBJECT (directory->details->metafile_monitor)),
&ev);
/* FIXME bugzilla.eazel.com 6664: examine ev for errors */
CORBA_exception_free (&ev);
bonobo_object_release_unref (metafile, NULL);
directory->details->metafile_monitor = NULL;
}

View file

@ -1,83 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory-metafile.h: Nautilus directory model.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include "nautilus-directory.h"
/* Interface for file metadata. */
gboolean nautilus_directory_is_metadata_read (NautilusDirectory *directory);
char * nautilus_directory_get_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
const char *default_metadata);
GList * nautilus_directory_get_file_metadata_list (NautilusDirectory *directory,
const char *file_name,
const char *list_key,
const char *list_subkey);
gboolean nautilus_directory_get_boolean_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
gboolean default_metadata);
int nautilus_directory_get_integer_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
int default_metadata);
void nautilus_directory_set_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
const char *default_metadata,
const char *metadata);
void nautilus_directory_set_file_metadata_list (NautilusDirectory *directory,
const char *file_name,
const char *list_key,
const char *list_subkey,
GList *list);
void nautilus_directory_set_boolean_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
gboolean default_metadata,
gboolean metadata);
void nautilus_directory_set_integer_file_metadata (NautilusDirectory *directory,
const char *file_name,
const char *key,
int default_metadata,
int metadata);
void nautilus_directory_copy_file_metadata (NautilusDirectory *source_directory,
const char *source_file_name,
NautilusDirectory *destination_directory,
const char *destination_file_name);
void nautilus_directory_remove_file_metadata (NautilusDirectory *directory,
const char *file_name);
void nautilus_directory_rename_file_metadata (NautilusDirectory *directory,
const char *old_file_name,
const char *new_file_name);
void nautilus_directory_rename_directory_metadata (NautilusDirectory *directory,
const char *new_directory_uri);
void nautilus_directory_register_metadata_monitor (NautilusDirectory *directory);
void nautilus_directory_unregister_metadata_monitor (NautilusDirectory *directory);
void nautilus_directory_use_self_contained_metafile_factory (void);

View file

@ -1,55 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory-notify.h: Nautilus directory notify calls.
Copyright (C) 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include <glib.h>
#include <gdk/gdk.h>
#include <libnautilus-extensions/nautilus-file.h>
typedef struct {
char *from_uri;
char *to_uri;
} URIPair;
typedef struct {
char *uri;
gboolean set;
GdkPoint point;
} NautilusFileChangesQueuePosition;
/* Almost-public change notification calls */
void nautilus_directory_notify_files_added (GList *uris);
void nautilus_directory_notify_files_changed (GList *uris);
void nautilus_directory_notify_files_moved (GList *uri_pairs);
void nautilus_directory_notify_files_removed (GList *uris);
void nautilus_directory_schedule_metadata_copy (GList *uri_pairs);
void nautilus_directory_schedule_metadata_move (GList *uri_pairs);
void nautilus_directory_schedule_metadata_remove (GList *uris);
void nautilus_directory_schedule_position_set (GList *position_setting_list);
/* Change notification hack.
* This is called when code modifies the file and it needs to trigger
* a notification. Eventually this should become private, but for now
* it needs to be used for code like the thumbnail generation.
*/
void nautilus_file_changed (NautilusFile *file);

View file

@ -1,206 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory-private.h: Nautilus directory model.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include "nautilus-directory-metafile-monitor.h"
#include "nautilus-directory.h"
#include "nautilus-file.h"
#include "nautilus-metafile-server.h"
#include "nautilus-monitor.h"
#include <eel/eel-vfs-extensions.h>
#include <gnome-xml/tree.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus/nautilus-idle-queue.h>
typedef struct ActivationURIReadState ActivationURIReadState;
typedef struct TopLeftTextReadState TopLeftTextReadState;
typedef struct FileMonitors FileMonitors;
struct NautilusDirectoryDetails
{
/* The location. */
char *uri;
GnomeVFSURI *vfs_uri;
/* The file objects. */
NautilusFile *as_file;
GList *file_list;
GHashTable *file_hash;
/* These lists are going to be pretty short. If we think they
* are going to get big, we can use hash tables instead.
*/
GList *call_when_ready_list;
GList *monitor_list;
NautilusMonitor *monitor;
NautilusIdleQueue *idle_queue;
NautilusMetafileMonitor *metafile_monitor;
Nautilus_Metafile metafile_corba_object;
gboolean in_async_service_loop;
gboolean state_changed;
gboolean file_list_monitored;
gboolean directory_loaded;
gboolean directory_loaded_sent_notification;
GnomeVFSAsyncHandle *directory_load_in_progress;
GList *pending_file_info; /* list of GnomeVFSFileInfo's that are pending */
int confirmed_file_count;
guint dequeue_pending_idle_id;
NautilusFile *load_directory_file;
int load_file_count;
GnomeVFSDirectoryFilter *load_file_count_filter;
GHashTable *load_mime_list_hash;
GList *get_file_infos_in_progress; /* list of GnomeVFSAsyncHandle * */
NautilusFile *count_file;
GnomeVFSAsyncHandle *count_in_progress;
NautilusFile *deep_count_file;
GnomeVFSAsyncHandle *deep_count_in_progress;
char *deep_count_uri;
GList *deep_count_subdirectories;
NautilusFile *mime_list_file;
GnomeVFSAsyncHandle *mime_list_in_progress;
GHashTable *mime_list_hash;
NautilusFile *get_info_file;
GnomeVFSAsyncHandle *get_info_in_progress;
TopLeftTextReadState *top_left_read_state;
ActivationURIReadState *activation_uri_read_state;
GList *file_operations_in_progress; /* list of FileOperation * */
};
/* A request for information about one or more files. */
typedef struct {
gboolean activation_uri;
gboolean deep_count;
gboolean directory_count;
gboolean file_info;
gboolean file_list; /* always FALSE if file != NULL */
gboolean metafile;
gboolean mime_list;
gboolean top_left_text;
} Request;
NautilusDirectory *nautilus_directory_get_existing (const char *uri);
/* async. interface */
void nautilus_directory_async_state_changed (NautilusDirectory *directory);
void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory,
NautilusFile *file,
GList *file_attributes,
NautilusDirectoryCallback directory_callback,
NautilusFileCallback file_callback,
gpointer callback_data);
gboolean nautilus_directory_check_if_ready_internal (NautilusDirectory *directory,
NautilusFile *file,
GList *file_attributes);
void nautilus_directory_cancel_callback_internal (NautilusDirectory *directory,
NautilusFile *file,
NautilusDirectoryCallback directory_callback,
NautilusFileCallback file_callback,
gpointer callback_data);
void nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
NautilusFile *file,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *attributes);
void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory,
NautilusFile *file,
gconstpointer client);
void nautilus_directory_get_info_for_new_files (NautilusDirectory *directory,
GList *vfs_uris);
NautilusFile * nautilus_directory_get_existing_corresponding_file (NautilusDirectory *directory);
void nautilus_directory_invalidate_count_and_mime_list (NautilusDirectory *directory);
gboolean nautilus_directory_is_file_list_monitored (NautilusDirectory *directory);
gboolean nautilus_directory_is_anyone_monitoring_file_list (NautilusDirectory *directory);
void nautilus_directory_remove_file_monitor_link (NautilusDirectory *directory,
GList *link);
void nautilus_directory_schedule_dequeue_pending (NautilusDirectory *directory);
void nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory);
void nautilus_directory_cancel (NautilusDirectory *directory);
void nautilus_async_destroying_file (NautilusFile *file);
void nautilus_directory_force_reload_internal (NautilusDirectory *directory,
GList *file_attributes);
void nautilus_directory_cancel_loading_file_attributes (NautilusDirectory *directory,
NautilusFile *file,
GList *file_attributes);
/* Calls shared between directory, file, and async. code. */
void nautilus_directory_emit_files_added (NautilusDirectory *directory,
GList *added_files);
void nautilus_directory_emit_files_changed (NautilusDirectory *directory,
GList *changed_files);
void nautilus_directory_emit_change_signals (NautilusDirectory *directory,
GList *changed_files);
void emit_change_signals_for_all_files (NautilusDirectory *directory);
void nautilus_directory_emit_done_loading (NautilusDirectory *directory);
void nautilus_directory_emit_load_error (NautilusDirectory *directory,
GnomeVFSResult error_result);
NautilusDirectory *nautilus_directory_get_internal (const char *uri,
gboolean create);
char * nautilus_directory_get_name_for_self_as_new_file (NautilusDirectory *directory);
void nautilus_directory_set_up_request (Request *request,
GList *file_attributes);
/* Interface to the file list. */
NautilusFile * nautilus_directory_find_file_by_name (NautilusDirectory *directory,
const char *relative_uri);
NautilusFile * nautilus_directory_find_file_by_relative_uri (NautilusDirectory *directory,
const char *relative_uri);
NautilusFile * nautilus_directory_find_file_by_internal_uri (NautilusDirectory *directory,
const char *relative_uri);
void nautilus_directory_add_file (NautilusDirectory *directory,
NautilusFile *file);
void nautilus_directory_remove_file (NautilusDirectory *directory,
NautilusFile *file);
FileMonitors * nautilus_directory_remove_file_monitors (NautilusDirectory *directory,
NautilusFile *file);
void nautilus_directory_add_file_monitors (NautilusDirectory *directory,
NautilusFile *file,
FileMonitors *monitors);
void nautilus_directory_add_file (NautilusDirectory *directory,
NautilusFile *file);
GList * nautilus_directory_begin_file_name_change (NautilusDirectory *directory,
NautilusFile *file);
void nautilus_directory_end_file_name_change (NautilusDirectory *directory,
NautilusFile *file,
GList *node);
void nautilus_directory_moved (const char *from_uri,
const char *to_uri);
/* debugging functions */
int nautilus_directory_number_outstanding (void);

File diff suppressed because it is too large Load diff

View file

@ -1,207 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory.h: Nautilus directory model.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_DIRECTORY_H
#define NAUTILUS_DIRECTORY_H
#include <gtk/gtkobject.h>
#include <libgnomevfs/gnome-vfs-types.h>
/* NautilusDirectory is a class that manages the model for a directory,
real or virtual, for Nautilus, mainly the file-manager component. The directory is
responsible for managing both real data and cached metadata. On top of
the file system independence provided by gnome-vfs, the directory
object also provides:
1) A synchronization framework, which notifies via signals as the
set of known files changes.
2) An abstract interface for getting attributes and performing
operations on files.
*/
#define NAUTILUS_TYPE_DIRECTORY \
(nautilus_directory_get_type ())
#define NAUTILUS_DIRECTORY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_DIRECTORY, NautilusDirectory))
#define NAUTILUS_DIRECTORY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_DIRECTORY, NautilusDirectoryClass))
#define NAUTILUS_IS_DIRECTORY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_DIRECTORY))
#define NAUTILUS_IS_DIRECTORY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DIRECTORY))
/* NautilusFile is defined both here and in nautilus-file.h. */
#ifndef NAUTILUS_FILE_DEFINED
#define NAUTILUS_FILE_DEFINED
typedef struct NautilusFile NautilusFile;
#endif
/* FIXME bugzilla.eazel.com 5382:
* Increase or remove this limit?
*/
/* FIXME bugzilla.eazel.com 5603:
* This limit is not actually "hard", which can lead to some minor UI problems.
*/
#define NAUTILUS_DIRECTORY_FILE_LIST_HARD_LIMIT 4000
typedef struct NautilusDirectoryDetails NautilusDirectoryDetails;
typedef struct
{
GtkObject object;
NautilusDirectoryDetails *details;
} NautilusDirectory;
typedef void (*NautilusDirectoryCallback) (NautilusDirectory *directory,
GList *files,
gpointer callback_data);
typedef struct
{
GtkObjectClass parent_class;
/*** Notification signals for clients to connect to. ***/
/* The files_added signal is emitted as the directory model
* discovers new files.
*/
void (* files_added) (NautilusDirectory *directory,
GList *added_files);
/* The files_changed signal is emitted as changes occur to
* existing files that are noticed by the synchronization framework,
* including when an old file has been deleted. When an old file
* has been deleted, this is the last chance to forget about these
* file objects, which are about to be unref'd. Use a call to
* nautilus_file_is_gone () to test for this case.
*/
void (* files_changed) (NautilusDirectory *directory,
GList *changed_files);
/* The done_loading signal is emitted when a directory load
* request completes. This is needed because, at least in the
* case where the directory is empty, the caller will receive
* no kind of notification at all when a directory load
* initiated by `nautilus_directory_file_monitor_add' completes.
*/
void (* done_loading) (NautilusDirectory *directory);
void (* load_error) (NautilusDirectory *directory);
/*** Virtual functions for subclasses to override. ***/
gboolean (* contains_file) (NautilusDirectory *directory,
NautilusFile *file);
void (* call_when_ready) (NautilusDirectory *directory,
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data);
void (* cancel_callback) (NautilusDirectory *directory,
NautilusDirectoryCallback callback,
gpointer callback_data);
void (* file_monitor_add) (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *monitor_attributes);
void (* file_monitor_remove) (NautilusDirectory *directory,
gconstpointer client);
void (* force_reload) (NautilusDirectory *directory);
gboolean (* are_all_files_seen) (NautilusDirectory *directory);
gboolean (* is_not_empty) (NautilusDirectory *directory);
char * (* get_name_for_self_as_new_file) (NautilusDirectory *directory);
} NautilusDirectoryClass;
/* Basic GtkObject requirements. */
GtkType nautilus_directory_get_type (void);
/* Get a directory given a uri.
* Creates the appropriate subclass given the uri mappings.
* Returns a referenced object, not a floating one. Unref when finished.
* If two windows are viewing the same uri, the directory object is shared.
*/
NautilusDirectory *nautilus_directory_get (const char *uri);
/* Covers for gtk_object_ref and gtk_object_unref that provide two conveniences:
* 1) You don't have to cast to GtkObject *, so using these is type safe.
* 2) You are allowed to call these with NULL,
*/
void nautilus_directory_ref (NautilusDirectory *directory);
void nautilus_directory_unref (NautilusDirectory *directory);
/* Access to a URI. */
char * nautilus_directory_get_uri (NautilusDirectory *directory);
/* Is this file still alive and in this directory? */
gboolean nautilus_directory_contains_file (NautilusDirectory *directory,
NautilusFile *file);
/* Get the uri of the file in the directory, NULL if not found */
char * nautilus_directory_get_file_uri (NautilusDirectory *directory,
const char *file_name);
/* Get (and ref) a NautilusFile object for this directory. */
NautilusFile * nautilus_directory_get_corresponding_file (NautilusDirectory *directory);
/* Waiting for data that's read asynchronously.
* The file attribute and metadata keys are for files in the directory.
* If any file attributes or metadata keys are passed, it won't call
* until all the files are seen.
*/
void nautilus_directory_call_when_ready (NautilusDirectory *directory,
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data);
void nautilus_directory_cancel_callback (NautilusDirectory *directory,
NautilusDirectoryCallback callback,
gpointer callback_data);
/* Monitor the files in a directory. */
void nautilus_directory_file_monitor_add (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *attributes);
void nautilus_directory_file_monitor_remove (NautilusDirectory *directory,
gconstpointer client);
void nautilus_directory_force_reload (NautilusDirectory *directory);
/* Return true if the directory has information about all the files.
* This will be false until the directory has been read at least once.
*/
gboolean nautilus_directory_are_all_files_seen (NautilusDirectory *directory);
/* Return true if the directory is local. */
gboolean nautilus_directory_is_local (NautilusDirectory *directory);
/* Return false if directory contains anything besides a Nautilus metafile.
* Only valid if directory is monitored. Used by the Trash monitor.
*/
gboolean nautilus_directory_is_not_empty (NautilusDirectory *directory);
gboolean nautilus_directory_file_list_length_reached (NautilusDirectory *directory);
char * nautilus_directory_make_uri_canonical (const char *uri);
#endif /* NAUTILUS_DIRECTORY_H */

View file

@ -1,403 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 2001 Eazel, Inc.
*
* Nautilus is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* Nautilus 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: John Harper <jsh@eazel.com>
*
*/
/* Registering that a window may be used as a drag 'n drop source */
#include <config.h>
#include "nautilus-drag-window.h"
#include <eel/eel-gdk-extensions.h>
#include <gtk/gtk.h>
#include <X11/Xatom.h>
#include <gdk/gdkx.h>
#include <gdk/gdkprivate.h>
/* State for handling focus/raise */
typedef struct NautilusDragWindowDetails NautilusDragWindowDetails;
struct NautilusDragWindowDetails {
gboolean in_button_press;
gboolean pending_focus;
gboolean pending_raise;
Time focus_timestamp;
guint focus_timeout_tag;
};
/* Delay in milliseconds between receiving a TAKE_FOCUS or RAISE_WINDOW
* client message, and assuming that there's no following button-press
* event. This seems to be large enough to work, but small enough to be
* unnoticeable to the user.
*/
#define WINDOW_FOCUS_TIMEOUT 50
/* Key used to store a NautilusDragWindowDetails structure in each
* registered window's object data hash
*/
#define NAUTILUS_DRAG_WINDOW_DETAILS_KEY "nautilus-drag-window-details"
static Atom sawfish_wm_raise_window = 0;
/* Return the nearest ancestor of WIDGET that has type WIDGET_TYPE. But only
* if there's no widget between the two with type BLOCKING_TYPE.
*/
static GtkWidget *
get_ancestor_blocked_by (GtkWidget *widget,
GtkType widget_type,
GtkType blocking_type)
{
g_return_val_if_fail (widget != NULL, NULL);
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
while (widget != NULL)
{
if (gtk_type_is_a (GTK_WIDGET_TYPE (widget), widget_type))
return widget;
else if (gtk_type_is_a (GTK_WIDGET_TYPE (widget), blocking_type))
return NULL;
widget = widget->parent;
}
return NULL;
}
/* Returns the details structure associated with WINDOW, or a null pointer
* if no such structure exists
*/
static NautilusDragWindowDetails *
get_details (GtkWindow *window)
{
NautilusDragWindowDetails *details;
details = gtk_object_get_data (GTK_OBJECT (window),
NAUTILUS_DRAG_WINDOW_DETAILS_KEY);
return details;
}
/* Commit any pending focus/raise requests for WINDOW. */
static void
execute_pending_requests (GtkWindow *window,
NautilusDragWindowDetails *details)
{
if (GTK_WIDGET_REALIZED (window)) {
if (details->pending_focus) {
eel_gdk_window_focus (GTK_WIDGET (window)->window,
details->focus_timestamp);
details->pending_focus = FALSE;
}
if (details->pending_raise) {
gdk_window_raise (GTK_WIDGET (window)->window);
details->pending_raise = FALSE;
}
}
}
/* Called when no button-press event arrived occurred shortly after
* receiving a TAKE_FOCUS or RAISE_WINDOW request. So just commit
* the pending requests.
*/
static gint
focus_timeout_callback (gpointer data)
{
GtkWindow *window;
NautilusDragWindowDetails *details;
window = GTK_WINDOW (data);
details = get_details (window);
if (details != NULL) {
execute_pending_requests (window, details);
details->focus_timeout_tag = 0;
}
/* Only ever a one-shot timeout */
return FALSE;
}
static void
remove_focus_timeout (GtkWindow *window)
{
NautilusDragWindowDetails *details;
details = get_details (window);
if (details != NULL && details->focus_timeout_tag != 0) {
gtk_timeout_remove (details->focus_timeout_tag);
details->focus_timeout_tag = 0;
}
}
static void
set_focus_timeout (GtkWindow *window)
{
NautilusDragWindowDetails *details;
details = get_details (window);
if (details != NULL) {
remove_focus_timeout (window);
details->focus_timeout_tag
= gtk_timeout_add (WINDOW_FOCUS_TIMEOUT,
focus_timeout_callback, window);
}
}
/* Called for all button-press events; sets the `in_button_press' flag */
static gboolean
button_press_emission_callback (GtkObject *object, guint signal_id,
guint n_params, GtkArg *params,
gpointer data)
{
GtkWidget *window;
NautilusDragWindowDetails *details;
/* This blocking is kind of a hack. But it seems necessary,
* otherwise we can get duped into counting unbalanced
* press/release events, which isn't healthy
*/
window = get_ancestor_blocked_by (GTK_WIDGET (object),
GTK_TYPE_WINDOW,
GTK_TYPE_MENU_SHELL);
if (window != NULL) {
details = get_details (GTK_WINDOW (window));
if (details != NULL) {
remove_focus_timeout (GTK_WINDOW (window));
if (!details->in_button_press) {
details->in_button_press = TRUE;
} else {
/* We never got the last button
* release. Adapt.
*/
execute_pending_requests (GTK_WINDOW (window),
details);
details->in_button_press = FALSE;
}
}
}
return TRUE;
}
/* Called for button-release events; commits any pending focus/raise */
static gboolean
button_release_emission_callback (GtkObject *object, guint signal_id,
guint n_params, GtkArg *params,
gpointer data)
{
GtkWidget *window;
NautilusDragWindowDetails *details;
window = get_ancestor_blocked_by (GTK_WIDGET (object),
GTK_TYPE_WINDOW,
GTK_TYPE_MENU_SHELL);
if (window != NULL) {
details = get_details (GTK_WINDOW (window));
if (details != NULL) {
execute_pending_requests (GTK_WINDOW (window),
details);
details->in_button_press = FALSE;
}
}
return TRUE;
}
/* Called when a drag is started. If a drag-window is found above the
* widget emitting the signal, cancel any pending focus/raise requests
*/
static gboolean
drag_begin_emission_callback (GtkObject *object, guint signal_id,
guint n_params, GtkArg *params,
gpointer data)
{
GtkWidget *window;
NautilusDragWindowDetails *details;
window = gtk_widget_get_ancestor (GTK_WIDGET (object),
GTK_TYPE_WINDOW);
if (window != NULL) {
details = get_details (GTK_WINDOW (window));
if (details != NULL) {
details->pending_focus = FALSE;
details->pending_raise = FALSE;
}
}
return TRUE;
}
/* The process-wide filter for WM_PROTOCOLS client messages */
static GdkFilterReturn
wm_protocols_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
{
XEvent *xevent;
GtkWindow *window;
NautilusDragWindowDetails *details;
xevent = (XEvent *)xev;
gdk_window_get_user_data (event->any.window, (gpointer *) &window);
if (window != NULL) {
details = get_details (window);
} else {
details = NULL;
}
if ((Atom) xevent->xclient.data.l[0] == gdk_wm_delete_window) {
/* (copied from gdkevents.c) */
/* The delete window request specifies a window
* to delete. We don't actually destroy the
* window because "it is only a request". (The
* window might contain vital data that the
* program does not want destroyed). Instead
* the event is passed along to the program,
* which should then destroy the window.
*/
event->any.type = GDK_DELETE;
return GDK_FILTER_TRANSLATE;
} else if ((Atom) xevent->xclient.data.l[0] == gdk_wm_take_focus) {
if (details != NULL) {
details->pending_focus = TRUE;
details->focus_timestamp = xevent->xclient.data.l[1];
/* Wait to see if a button-press event
* is received in the near future.
*/
set_focus_timeout (window);
}
return GDK_FILTER_REMOVE;
} else if ((Atom) xevent->xclient.data.l[0] == sawfish_wm_raise_window) {
if (details != NULL) {
details->pending_raise = TRUE;
/* Wait to see if a button-press event
* is received in the near future.
*/
set_focus_timeout (window);
}
return GDK_FILTER_REMOVE;
}
else {
return GDK_FILTER_CONTINUE;
}
}
static void
nautilus_drag_window_destroy (GtkObject *object, gpointer data)
{
NautilusDragWindowDetails *details;
details = get_details (GTK_WINDOW (object));
remove_focus_timeout (GTK_WINDOW (object));
/* The `details' will be freed automatically */
}
static void
nautilus_drag_window_realize (GtkWidget *widget, gpointer data)
{
GdkAtom protocols[3];
/* Tell the window manager _not_ to focus this window by itself */
eel_gdk_window_set_wm_hints_input (widget->window, FALSE);
/* Set WM_PROTOCOLS to the usual two atoms plus something that tells
* sawfish to send messages telling us when we might want to raise
* the window. (This won't work with other wm's, but it won't
* break anything either.)
*/
protocols[0] = gdk_wm_delete_window;
protocols[1] = gdk_wm_take_focus;
protocols[2] = sawfish_wm_raise_window;
eel_gdk_window_set_wm_protocols (widget->window, protocols, 3);
}
/* Public entry point */
/* initialize the instance's fields */
void
nautilus_drag_window_register (GtkWindow *window)
{
static gboolean initialized = FALSE;
NautilusDragWindowDetails *details;
guint signal_id;
if (!initialized) {
/* Add emission hooks for the signals we need to monitor
*/
signal_id = gtk_signal_lookup ("button_press_event",
GTK_TYPE_WIDGET);
gtk_signal_add_emission_hook (signal_id,
button_press_emission_callback,
NULL);
signal_id = gtk_signal_lookup ("button_release_event",
GTK_TYPE_WIDGET);
gtk_signal_add_emission_hook (signal_id,
button_release_emission_callback,
NULL);
signal_id = gtk_signal_lookup ("drag_begin",
GTK_TYPE_WIDGET);
gtk_signal_add_emission_hook (signal_id,
drag_begin_emission_callback,
NULL);
/* Intern the necessary X atoms
*/
sawfish_wm_raise_window = XInternAtom (GDK_DISPLAY (),
"_SAWFISH_WM_RAISE_WINDOW",
False);
/* Override the standard GTK filter for handling WM_PROTOCOLS
* client messages
*/
gdk_add_client_message_filter (gdk_wm_protocols,
wm_protocols_filter, NULL);
initialized = TRUE;
}
details = g_new0 (NautilusDragWindowDetails, 1);
gtk_object_set_data_full (GTK_OBJECT (window),
NAUTILUS_DRAG_WINDOW_DETAILS_KEY,
details, g_free);
gtk_signal_connect (GTK_OBJECT (window), "realize",
nautilus_drag_window_realize, NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
nautilus_drag_window_destroy, NULL);
}

View file

@ -1,40 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 2001 Eazel, Inc.
*
* Nautilus is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* Nautilus 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: John Harper <jsh@eazel.com>
*
*/
#ifndef NAUTILUS_DRAG_WINDOW_H
#define NAUTILUS_DRAG_WINDOW_H
#include <gtk/gtkwindow.h>
/* Call this function before WINDOW has been realized. It will hook
* into the window so that it automatically supports the correct focus
* policy when dragging objects from within the window. (This policy is
* *not* to focus or raise the window when the activating click is used
* to drag something)
*/
void nautilus_drag_window_register (GtkWindow *window);
#endif /* NAUTILUS_DRAG_WINDOW_H */

View file

@ -1,697 +0,0 @@
/* gnome-druid-page-eazel.c
* Copyright (C) 1999 Red Hat, Inc.
* Copyright (C) 2000 Eazel, Inc.
*
* All rights reserved.
*
* 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.
*/
/*
@NOTATION@
*/
#include <config.h>
#include "nautilus-druid-page-eazel.h"
#include <eel/eel-gtk-macros.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/libgnomeui.h>
#include <libgnomeui/gnome-druid.h>
#include <libgnomeui/gnome-druid-page.h>
#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include "nautilus-druid.h"
#include <libgnome/gnome-i18n.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
struct NautilusDruidPageEazelDetails
{
GnomeCanvasItem *background_item;
GnomeCanvasItem *background_image_item;
GnomeCanvasItem *topbar_image_item;
int topbar_image_width;
GnomeCanvasItem *topbar_image_stretch_item;
GnomeCanvasItem *title_item;
GtkWidget *title_label;
guint title_label_signal_id;
GnomeCanvasItem *text_item;
GnomeCanvasItem *sidebar_image_item;
GnomeCanvasItem *title_image_item;
GnomeCanvasItem *widget_item;
};
static void nautilus_druid_page_eazel_initialize (NautilusDruidPageEazel *druid_page_eazel);
static void nautilus_druid_page_eazel_initialize_class (NautilusDruidPageEazelClass *klass);
static void nautilus_druid_page_eazel_destroy (GtkObject *object);
static void nautilus_druid_page_eazel_finalize (GtkObject *object);
static void nautilus_druid_page_eazel_construct (NautilusDruidPageEazel *druid_page_eazel);
static void nautilus_druid_page_eazel_configure_size(NautilusDruidPageEazel *druid_page_eazel,
gint width,
gint height);
static void nautilus_druid_page_eazel_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void nautilus_druid_page_eazel_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void nautilus_druid_page_eazel_prepare (GnomeDruidPage *page,
GtkWidget *druid,
gpointer *data);
#define TITLE_X 60.0
#define TITLE_Y 60.0
#define CONTENT_PADDING 15.0
#define DEFAULT_CONTENT_X 34.0
#define DRUID_PAGE_MIN_HEIGHT 322
#define DRUID_PAGE_MIN_WIDTH 516
#define DRUID_PAGE_BORDER 24
EEL_DEFINE_CLASS_BOILERPLATE (NautilusDruidPageEazel, nautilus_druid_page_eazel, GNOME_TYPE_DRUID_PAGE)
static void
nautilus_druid_page_eazel_initialize_class (NautilusDruidPageEazelClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
object_class = (GtkObjectClass*) klass;
widget_class = (GtkWidgetClass*) klass;
parent_class = gtk_type_class (gnome_druid_page_get_type ());
object_class->destroy = nautilus_druid_page_eazel_destroy;
object_class->finalize = nautilus_druid_page_eazel_finalize;
widget_class->size_allocate = nautilus_druid_page_eazel_size_allocate;
widget_class->size_request = nautilus_druid_page_eazel_size_request;
}
static void
nautilus_druid_page_eazel_initialize (NautilusDruidPageEazel *druid_page_eazel)
{
druid_page_eazel->details = g_new0(NautilusDruidPageEazelDetails, 1);
/* Set up the canvas */
gtk_container_set_border_width (GTK_CONTAINER (druid_page_eazel), 0);
gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
druid_page_eazel->canvas = gnome_canvas_new_aa ();
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
gtk_widget_show (druid_page_eazel->canvas);
gtk_container_add (GTK_CONTAINER (druid_page_eazel), druid_page_eazel->canvas);
nautilus_druid_page_eazel_configure_size (druid_page_eazel,
DRUID_PAGE_MIN_WIDTH,
DRUID_PAGE_MIN_HEIGHT);
}
static void
nautilus_druid_page_eazel_destroy(GtkObject *object)
{
NautilusDruidPageEazel *druid_page_eazel =
NAUTILUS_DRUID_PAGE_EAZEL(object);
druid_page_eazel->canvas = NULL;
druid_page_eazel->widget = NULL;
g_free (druid_page_eazel->title);
druid_page_eazel->title = NULL;
g_free (druid_page_eazel->text);
druid_page_eazel->text = NULL;
if (druid_page_eazel->title_image != NULL)
gdk_pixbuf_unref (druid_page_eazel->title_image);
druid_page_eazel->title_image = NULL;
if (druid_page_eazel->sidebar_image != NULL)
gdk_pixbuf_unref (druid_page_eazel->sidebar_image);
druid_page_eazel->sidebar_image = NULL;
if (druid_page_eazel->widget != NULL)
gtk_widget_unref (druid_page_eazel->widget);
druid_page_eazel->widget = NULL;
/* Chain destroy */
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
nautilus_druid_page_eazel_finalize (GtkObject *object)
{
NautilusDruidPageEazel *druid_page_eazel =
NAUTILUS_DRUID_PAGE_EAZEL(object);
g_free(druid_page_eazel->details);
druid_page_eazel->details = NULL;
/* Chain finalize */
EEL_CALL_PARENT (GTK_OBJECT_CLASS, finalize, (object));
}
static void
get_content_xy (NautilusDruidPageEazel *druid_page_eazel,
double *content_x, double *content_y)
{
double title_height;
if (druid_page_eazel->sidebar_image) {
*content_x = gdk_pixbuf_get_width (druid_page_eazel->sidebar_image);
} else {
*content_x = DEFAULT_CONTENT_X;
}
if (druid_page_eazel->title_image) {
*content_y = gdk_pixbuf_get_height (druid_page_eazel->title_image) + TITLE_Y + CONTENT_PADDING;
} else {
*content_y = TITLE_Y;
}
title_height = 0.0;
if (druid_page_eazel->title && druid_page_eazel->title[0] != '\0') {
gtk_object_get (GTK_OBJECT (druid_page_eazel->details->title_item),
"height", &title_height,
NULL);
title_height += CONTENT_PADDING;
}
if (*content_y < title_height + TITLE_Y) {
*content_y = title_height + TITLE_Y;
}
}
static void
nautilus_druid_page_eazel_configure_size (NautilusDruidPageEazel *druid_page_eazel, gint width, gint height)
{
double content_x;
double content_y;
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
get_content_xy (druid_page_eazel, &content_x, &content_y);
gnome_canvas_set_scroll_region (GNOME_CANVAS (druid_page_eazel->canvas),
0.0, 0.0, width, height);
if (druid_page_eazel->details->background_item != NULL) {
gnome_canvas_item_set (druid_page_eazel->details->background_item,
"x1", 0.0,
"y1", 0.0,
"x2", (gfloat) width,
"y2", (gfloat) height,
NULL);
}
if (druid_page_eazel->details->topbar_image_stretch_item != NULL) {
gnome_canvas_item_set (druid_page_eazel->details->topbar_image_stretch_item,
"width", (double) (width - druid_page_eazel->details->topbar_image_width),
"width_set", TRUE,
NULL);
}
if (druid_page_eazel->details->widget_item != NULL) {
gnome_canvas_item_set (druid_page_eazel->details->widget_item,
"x", content_x,
"y", content_y,
NULL);
/* Event boxes can handle not having the size set, and
* not doing so allows them to scale with their child
* widget. On the other hand, some other widgets require
* the size to be set, otherwise they won't appear on the
* canvas!
*/
if (druid_page_eazel->widget != NULL && !GTK_IS_EVENT_BOX (druid_page_eazel->widget)) {
gnome_canvas_item_set (druid_page_eazel->details->widget_item,
"width", (gfloat) width - content_x,
"height", (gfloat) height - content_y,
NULL);
}
}
if (druid_page_eazel->details->text_item != NULL) {
gnome_canvas_item_set (druid_page_eazel->details->text_item,
"x", content_x,
"y", content_y,
NULL);
}
}
static void
set_image (GnomeCanvasItem *item, const char *file,
int *width, int *height)
{
char *fullname;
if (width != NULL)
*width = 0;
if (height != NULL)
*height = 0;
fullname = nautilus_pixmap_file (file);
if (fullname != NULL) {
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (fullname);
if (pixbuf != NULL) {
if (width != NULL)
*width = gdk_pixbuf_get_width (pixbuf);
if (height != NULL)
*height = gdk_pixbuf_get_height (pixbuf);
gnome_canvas_item_set (item,
"pixbuf", pixbuf,
NULL);
gdk_pixbuf_unref (pixbuf);
}
g_free (fullname);
}
}
static void
title_label_size_allocated (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
{
NautilusDruidPageEazel *druid_page_eazel = NAUTILUS_DRUID_PAGE_EAZEL (data);
gnome_canvas_item_set (druid_page_eazel->details->title_item,
"size_pixels", TRUE,
"height", (double) allocation->height,
"width", (double) allocation->width,
NULL);
}
static void
nautilus_druid_page_eazel_construct (NautilusDruidPageEazel *druid_page_eazel)
{
druid_page_eazel->details->background_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_rect_get_type (),
"x1", 0.0,
"y1", 0.0,
"fill_color", "white",
NULL);
druid_page_eazel->details->background_image_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_pixbuf_get_type (),
"x", 0.0,
"y", 0.0,
"x_in_pixels", TRUE,
"y_in_pixels", TRUE,
NULL);
if (druid_page_eazel->background_image)
gnome_canvas_item_set (druid_page_eazel->details->background_image_item,
"pixbuf", druid_page_eazel->background_image,
NULL);
druid_page_eazel->details->sidebar_image_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_pixbuf_get_type (),
"x", 0.0,
"y", 0.0,
"x_in_pixels", TRUE,
"y_in_pixels", TRUE,
NULL);
if (druid_page_eazel->sidebar_image)
gnome_canvas_item_set (druid_page_eazel->details->sidebar_image_item,
"pixbuf", druid_page_eazel->sidebar_image,
NULL);
druid_page_eazel->details->topbar_image_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_pixbuf_get_type (),
"x", 0.0,
"y", 0.0,
"x_in_pixels", TRUE,
"y_in_pixels", TRUE,
NULL);
set_image (druid_page_eazel->details->topbar_image_item,
"druid_header.png",
&druid_page_eazel->details->topbar_image_width,
NULL);
druid_page_eazel->details->topbar_image_stretch_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_pixbuf_get_type (),
"x", (double)druid_page_eazel->details->topbar_image_width,
"y", 0.0,
"x_in_pixels", TRUE,
"y_in_pixels", TRUE,
NULL);
set_image (druid_page_eazel->details->topbar_image_stretch_item,
"druid_header_stretch.png", NULL, NULL);
druid_page_eazel->details->title_image_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_pixbuf_get_type (),
"x", TITLE_X,
"y", TITLE_Y,
"x_in_pixels", TRUE,
"y_in_pixels", TRUE,
NULL);
if (druid_page_eazel->title_image)
gnome_canvas_item_set (druid_page_eazel->details->title_image_item,
"pixbuf", druid_page_eazel->title_image,
NULL);
druid_page_eazel->details->title_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_widget_get_type (),
"x", TITLE_X,
"y", TITLE_Y,
NULL);
druid_page_eazel->details->text_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_text_get_type (),
"text", druid_page_eazel->text,
"fill_color", "black",
/* Note to localizers: this font is used for text items in Druid pages */
"fontset", _("-adobe-helvetica-bold-r-normal-*-*-120-*-*-p-*-*-*,*-r-*"),
"anchor", GTK_ANCHOR_NW,
NULL);
nautilus_druid_page_eazel_configure_size (druid_page_eazel, DRUID_PAGE_MIN_WIDTH, DRUID_PAGE_MIN_HEIGHT);
gtk_signal_connect (GTK_OBJECT (druid_page_eazel),
"prepare",
nautilus_druid_page_eazel_prepare,
NULL);
}
static void
nautilus_druid_page_eazel_prepare (GnomeDruidPage *page,
GtkWidget *druid,
gpointer *data)
{
switch (NAUTILUS_DRUID_PAGE_EAZEL (page)->position) {
case NAUTILUS_DRUID_PAGE_EAZEL_START:
gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), FALSE, TRUE, TRUE);
gnome_druid_set_show_finish (GNOME_DRUID (druid), FALSE);
gtk_widget_grab_default (GNOME_DRUID (druid)->next);
break;
case NAUTILUS_DRUID_PAGE_EAZEL_FINISH:
gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), TRUE, FALSE, TRUE);
gnome_druid_set_show_finish (GNOME_DRUID (druid), TRUE);
gtk_widget_grab_default (GNOME_DRUID (druid)->finish);
break;
case NAUTILUS_DRUID_PAGE_EAZEL_OTHER:
gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), TRUE, TRUE, TRUE);
gnome_druid_set_show_finish (GNOME_DRUID (druid), FALSE);
default:
break;
}
}
static void
nautilus_druid_page_eazel_size_allocate(GtkWidget *widget,
GtkAllocation *allocation)
{
EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
(widget, allocation));
gnome_canvas_set_scroll_region (GNOME_CANVAS (NAUTILUS_DRUID_PAGE_EAZEL (widget)->canvas),
0.0, 0.0,
allocation->width,
allocation->height);
nautilus_druid_page_eazel_configure_size (NAUTILUS_DRUID_PAGE_EAZEL (widget),
allocation->width,
allocation->height);
}
static void
nautilus_druid_page_eazel_size_request(GtkWidget *widget,
GtkRequisition *requisition)
{
NautilusDruidPageEazel *druid_page_eazel;
druid_page_eazel = NAUTILUS_DRUID_PAGE_EAZEL (widget);
EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_request,
(widget, requisition));
if (druid_page_eazel->widget) {
GtkRequisition child_requisition;
double x, y;
g_assert (druid_page_eazel->details->widget_item != NULL);
get_content_xy (druid_page_eazel, &x, &y);
gtk_widget_get_child_requisition (druid_page_eazel->widget,
&child_requisition);
if (child_requisition.width + x > requisition->width) {
requisition->width = child_requisition.width + x + DRUID_PAGE_BORDER;
}
if (child_requisition.height + y > requisition->height) {
requisition->height = child_requisition.height + y + DRUID_PAGE_BORDER;
}
}
}
/**
* nautilus_druid_page_eazel_new:
*
* Creates a new NautilusDruidPageEazel widget.
*
* Return value: Pointer to new NautilusDruidPageEazel
**/
/* Public functions */
GtkWidget *
nautilus_druid_page_eazel_new (NautilusDruidPageEazelPosition position)
{
NautilusDruidPageEazel *page;
page = NAUTILUS_DRUID_PAGE_EAZEL (gtk_widget_new (nautilus_druid_page_eazel_get_type (), NULL));
page->position = position;
page->title = g_strdup ("");
page->text = g_strdup ("");
page->title_image = NULL;
page->sidebar_image = NULL;
page->background_image = NULL;
nautilus_druid_page_eazel_construct (page);
return GTK_WIDGET (page);
}
/**
* nautilus_druid_page_eazel_new_with_vals:
* @title: The title.
* @text: The introduction text.
* @logo: The logo in the upper right corner.
* @watermark: The watermark on the left.
*
* This will create a new GNOME Druid Eazel page, with the values
* given. It is acceptable for any of them to be %NULL.
*
* Return value: GtkWidget pointer to new NautilusDruidPageEazel.
**/
GtkWidget *
nautilus_druid_page_eazel_new_with_vals (NautilusDruidPageEazelPosition position,
const gchar *title,
const gchar* text,
GdkPixbuf *title_image,
GdkPixbuf *sidebar_image,
GdkPixbuf *background_image)
{
NautilusDruidPageEazel *page;
page = NAUTILUS_DRUID_PAGE_EAZEL (gtk_widget_new (nautilus_druid_page_eazel_get_type (), NULL));
page->position = position;
page->title = g_strdup (title ? title : "");
page->text = g_strdup (text ? text : "");
if (title_image)
gdk_pixbuf_ref (title_image);
page->title_image = title_image;
if (sidebar_image)
gdk_pixbuf_ref (sidebar_image);
page->sidebar_image = sidebar_image;
if (background_image)
gdk_pixbuf_ref (background_image);
page->background_image = background_image;
nautilus_druid_page_eazel_construct (page);
return GTK_WIDGET (page);
}
void
nautilus_druid_page_eazel_set_text (NautilusDruidPageEazel *druid_page_eazel,
const gchar *text)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
g_free (druid_page_eazel->text);
druid_page_eazel->text = g_strdup (text ? text : "");
gnome_canvas_item_set (druid_page_eazel->details->text_item,
"text", druid_page_eazel->text,
NULL);
}
static GtkWidget *
make_title_label (const char *text)
{
GtkWidget *label;
GtkStyle *new_style;
GdkFont *font;
label = gtk_label_new (text);
/* Note to localizers: this font is used for page titles in Druid pages */
font = gdk_fontset_load (_("-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-*,*-r-*"));
if (font != NULL) {
new_style = gtk_style_copy (gtk_widget_get_style (label));
gdk_font_unref (new_style->font);
new_style->font = font;
gtk_widget_set_style (label, new_style);
gtk_style_unref (new_style);
}
return label;
}
void
nautilus_druid_page_eazel_set_title (NautilusDruidPageEazel *druid_page_eazel,
const gchar *title)
{
GtkWidget *label;
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
g_free (druid_page_eazel->title);
druid_page_eazel->title = g_strdup (title ? title : "");
if (druid_page_eazel->details->title_label == NULL) {
label = make_title_label (druid_page_eazel->title);
nautilus_druid_page_eazel_set_title_label (druid_page_eazel, GTK_LABEL (label));
} else {
gtk_label_set_text (GTK_LABEL (druid_page_eazel->details->title_label), druid_page_eazel->title);
}
}
void
nautilus_druid_page_eazel_set_title_label (NautilusDruidPageEazel *druid_page_eazel,
GtkLabel *label)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
g_return_if_fail (GTK_IS_LABEL (label));
if (druid_page_eazel->details->title_label != NULL) {
gtk_signal_disconnect (GTK_OBJECT (druid_page_eazel->details->title_label),
druid_page_eazel->details->title_label_signal_id);
}
gtk_widget_show (GTK_WIDGET (label));
gnome_canvas_item_set (druid_page_eazel->details->title_item,
"widget", label,
NULL);
druid_page_eazel->details->title_label = GTK_WIDGET (label);
druid_page_eazel->details->title_label_signal_id =
gtk_signal_connect (GTK_OBJECT (label), "size_allocate",
title_label_size_allocated,
druid_page_eazel);
if (druid_page_eazel->title != NULL) {
g_free (druid_page_eazel->title);
}
druid_page_eazel->title = g_strdup (label->label);
}
void
nautilus_druid_page_eazel_set_title_image (NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *title_image)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
if (druid_page_eazel->title_image)
gdk_pixbuf_unref (druid_page_eazel->title_image);
druid_page_eazel->title_image = title_image;
if (title_image != NULL)
gdk_pixbuf_ref (title_image);
gnome_canvas_item_set (druid_page_eazel->details->title_image_item,
"pixbuf", druid_page_eazel->title_image, NULL);
}
void
nautilus_druid_page_eazel_set_sidebar_image (NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *sidebar_image)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
if (druid_page_eazel->sidebar_image)
gdk_pixbuf_unref (druid_page_eazel->sidebar_image);
druid_page_eazel->sidebar_image = sidebar_image;
if (sidebar_image != NULL)
gdk_pixbuf_ref (sidebar_image);
gnome_canvas_item_set (druid_page_eazel->details->sidebar_image_item,
"pixbuf", druid_page_eazel->sidebar_image, NULL);
}
void
nautilus_druid_page_eazel_set_background_image (NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *background_image)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
if (druid_page_eazel->background_image)
gdk_pixbuf_unref (druid_page_eazel->background_image);
druid_page_eazel->background_image = background_image;
if (background_image != NULL)
gdk_pixbuf_ref (background_image);
gnome_canvas_item_set (druid_page_eazel->details->background_image_item,
"pixbuf", druid_page_eazel->background_image, NULL);
}
void
nautilus_druid_page_eazel_put_widget (NautilusDruidPageEazel *druid_page_eazel,
GtkWidget *widget)
{
g_return_if_fail (druid_page_eazel != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel));
if (druid_page_eazel->details->widget_item != NULL) {
gtk_object_destroy (GTK_OBJECT (druid_page_eazel->details->widget_item));
}
if (druid_page_eazel->widget != NULL) {
gtk_widget_unref (druid_page_eazel->widget);
}
druid_page_eazel->widget = widget;
if (widget != NULL)
gtk_widget_ref (widget);
druid_page_eazel->details->widget_item =
gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)),
gnome_canvas_widget_get_type (),
"widget", widget,
NULL);
gtk_widget_queue_resize (GTK_WIDGET (druid_page_eazel));
}

View file

@ -1,100 +0,0 @@
/* nautilus-druid-page-eazel.h
* Copyright (C) 1999 Red Hat, Inc.
*
* All rights reserved.
*
* 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.
*/
/*
@NOTATION@
*/
#ifndef NAUTILUS_DRUID_PAGE_EAZEL_H
#define NAUTILUS_DRUID_PAGE_EAZEL_H
#include <libgnomeui/gnome-canvas.h>
#include <libgnomeui/gnome-druid-page.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_DRUID_PAGE_EAZEL (nautilus_druid_page_eazel_get_type ())
#define NAUTILUS_DRUID_PAGE_EAZEL(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_DRUID_PAGE_EAZEL, NautilusDruidPageEazel))
#define NAUTILUS_DRUID_PAGE_EAZEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_DRUID_PAGE_EAZEL, NautilusDruidPageEazelClass))
#define NAUTILUS_IS_DRUID_PAGE_EAZEL(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_DRUID_PAGE_EAZEL))
#define NAUTILUS_IS_DRUID_PAGE_EAZEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DRUID_PAGE_EAZEL))
typedef enum {
/* update structure when adding enums */
NAUTILUS_DRUID_PAGE_EAZEL_START,
NAUTILUS_DRUID_PAGE_EAZEL_FINISH,
NAUTILUS_DRUID_PAGE_EAZEL_OTHER
} NautilusDruidPageEazelPosition;
typedef struct NautilusDruidPageEazel NautilusDruidPageEazel;
typedef struct NautilusDruidPageEazelDetails NautilusDruidPageEazelDetails;
typedef struct NautilusDruidPageEazelClass NautilusDruidPageEazelClass;
struct NautilusDruidPageEazel
{
GnomeDruidPage parent;
GtkWidget *canvas;
char *title;
char *text;
GdkPixbuf *title_image;
GdkPixbuf *sidebar_image;
GdkPixbuf *background_image;
GtkWidget *widget;
NautilusDruidPageEazelPosition position : 2;
/*< private >*/
NautilusDruidPageEazelDetails *details;
};
struct NautilusDruidPageEazelClass
{
GnomeDruidPageClass parent_class;
};
GtkType nautilus_druid_page_eazel_get_type (void);
GtkWidget *nautilus_druid_page_eazel_new (NautilusDruidPageEazelPosition position);
GtkWidget *nautilus_druid_page_eazel_new_with_vals (NautilusDruidPageEazelPosition position,
const gchar *title,
const gchar *text,
GdkPixbuf *title_image,
GdkPixbuf *sidebar_image,
GdkPixbuf *background_image);
void nautilus_druid_page_eazel_put_widget (NautilusDruidPageEazel *druid_page_eazel,
GtkWidget *widget);
void nautilus_druid_page_eazel_set_text (NautilusDruidPageEazel *druid_page_eazel,
const gchar *text);
void nautilus_druid_page_eazel_set_title (NautilusDruidPageEazel *druid_page_eazel,
const gchar *title);
void nautilus_druid_page_eazel_set_title_label (NautilusDruidPageEazel *druid_page_eazel,
GtkLabel *label);
void nautilus_druid_page_eazel_set_title_image (NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *title_image);
void nautilus_druid_page_eazel_set_sidebar_image (NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *sidebar_image);
void nautilus_druid_page_eazel_set_background_image(NautilusDruidPageEazel *druid_page_eazel,
GdkPixbuf *background_image);
END_GNOME_DECLS
#endif /* NAUTILUS_DRUID_PAGE_EAZEL_H */

View file

@ -1,204 +0,0 @@
/* gnome-druid.c
* Copyright (C) 1999 Red Hat, Inc.
* Copyright (C) 2000 Eazel, Inc.
* All rights reserved.
*
* 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.
*/
/*
@NOTATION@
*/
#include <config.h>
#include "nautilus-druid.h"
#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnome/gnome-i18n.h>
#include <eel/eel-gtk-macros.h>
static void nautilus_druid_initialize (NautilusDruid *druid);
static void nautilus_druid_initialize_class(NautilusDruidClass *klass);
static void nautilus_druid_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void nautilus_druid_size_allocate(GtkWidget *widget,
GtkAllocation *allocation);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusDruid, nautilus_druid, GNOME_TYPE_DRUID)
static void
nautilus_druid_initialize_class (NautilusDruidClass *klass)
{
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) klass;
parent_class = gtk_type_class (gtk_container_get_type ());
widget_class->size_request = nautilus_druid_size_request;
widget_class->size_allocate = nautilus_druid_size_allocate;
}
static void
nautilus_druid_initialize (NautilusDruid *druid)
{
}
static void
nautilus_druid_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
guint16 temp_width, temp_height;
GList *list;
GnomeDruid *druid;
GtkRequisition child_requisition;
GnomeDruidPage *child;
int border;
g_return_if_fail (widget != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID (widget));
border = GTK_CONTAINER(widget)->border_width;
druid = GNOME_DRUID (widget);
temp_height = temp_width = 0;
/* We find the maximum size of all children widgets */
for (list = druid->children; list; list = list->next) {
child = GNOME_DRUID_PAGE (list->data);
if (GTK_WIDGET_VISIBLE (child)) {
gtk_widget_size_request (GTK_WIDGET (child), &child_requisition);
temp_width = MAX (temp_width, child_requisition.width);
temp_height = MAX (temp_height, child_requisition.height);
if (GTK_WIDGET_MAPPED (child) && child != druid->current)
gtk_widget_unmap (GTK_WIDGET(child));
}
}
requisition->width = temp_width + 2 * border;
requisition->height = temp_height + 2 * border;
/* In an Attempt to show how the widgets are packed,
* here's a little diagram.
*
* [ Cancel ] ------------- [ Back ] [ Next ]
* |
* This part needs to be at least 1 button width.
* In addition, there is a GNOME_PAD_SMALL between Next and Back.
*/
/* our_button width is temp_width and temp_height */
temp_height = 0;
temp_width = 0;
gtk_widget_size_request (druid->back, &child_requisition);
temp_width = MAX (temp_width, child_requisition.width);
temp_height = MAX (temp_height, child_requisition.height);
gtk_widget_size_request (druid->next, &child_requisition);
temp_width = MAX (temp_width, child_requisition.width);
temp_height = MAX (temp_height, child_requisition.height);
gtk_widget_size_request (druid->cancel, &child_requisition);
temp_width = MAX (temp_width, child_requisition.width);
temp_height = MAX (temp_height, child_requisition.height);
gtk_widget_size_request (druid->finish, &child_requisition);
temp_width = MAX (temp_width, child_requisition.width);
temp_height = MAX (temp_height, child_requisition.height);
temp_width += border * 2;
temp_height += GNOME_PAD_SMALL;
temp_width = temp_width * 4 + GNOME_PAD_SMALL * 3;
/* pick which is bigger, the buttons, or the NautilusDruidPages */
requisition->width = MAX (temp_width, requisition->width);
requisition->height += temp_height;
}
static void
nautilus_druid_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GnomeDruid *druid;
GtkAllocation child_allocation;
gint button_height;
GList *list;
int border;
g_return_if_fail (widget != NULL);
g_return_if_fail (NAUTILUS_IS_DRUID (widget));
druid = GNOME_DRUID (widget);
widget->allocation = *allocation;
/* deal with the buttons */
child_allocation.width = child_allocation.height = 0;
child_allocation.width = druid->back->requisition.width;
child_allocation.height = druid->back->requisition.height;
child_allocation.width = MAX (child_allocation.width,
druid->next->requisition.width);
child_allocation.height = MAX (child_allocation.height,
druid->next->requisition.height);
child_allocation.width = MAX (child_allocation.width,
druid->cancel->requisition.width);
child_allocation.height = MAX (child_allocation.height,
druid->cancel->requisition.height);
child_allocation.height += GNOME_PAD_SMALL;
button_height = child_allocation.height;
child_allocation.width += 2 * GNOME_PAD_SMALL;
child_allocation.y = allocation->y + allocation->height -
GNOME_PAD_SMALL - child_allocation.height;
/* allocate cancel */
child_allocation.x = allocation->x + GNOME_PAD_SMALL;
gtk_widget_size_allocate (druid->cancel, &child_allocation);
/* Allocate next/finish */
child_allocation.x = allocation->x + allocation->width -
GNOME_PAD_SMALL - child_allocation.width;
gtk_widget_size_allocate (druid->next, &child_allocation);
gtk_widget_size_allocate (druid->finish, &child_allocation);
/* Allocate back */
child_allocation.x -= (GNOME_PAD_SMALL + child_allocation.width);
gtk_widget_size_allocate (druid->back, &child_allocation);
border = GTK_CONTAINER (widget)->border_width;
/* Put up the GnomeDruidPage */
child_allocation.x = allocation->x + border;
child_allocation.y = allocation->y + border;
child_allocation.width =
((allocation->width - 2 * border) > 0) ?
(allocation->width - 2 * border):0;
child_allocation.height =
((allocation->height - 2 * border - GNOME_PAD_SMALL - button_height) > 0) ?
(allocation->height - 2 * border - GNOME_PAD_SMALL - button_height):0;
for (list = druid->children; list; list=list->next) {
if (GTK_WIDGET_VISIBLE (list->data)) {
gtk_widget_size_allocate (GTK_WIDGET (list->data), &child_allocation);
}
}
}
/* Public methods */
GtkWidget *
nautilus_druid_new (void)
{
return gtk_widget_new (NAUTILUS_TYPE_DRUID, NULL);
}

View file

@ -1,57 +0,0 @@
/* nautilus-druid.h
* Copyright (C) 1999 Red Hat, Inc.
* Copyright (C) 2000 Eazel, Inc.
* All rights reserved.
*
* 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.
*/
/*
@NOTATION@
*/
#ifndef NAUTILUS_DRUID_H
#define NAUTILUS_DRUID_H
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-druid.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_DRUID (nautilus_druid_get_type ())
#define NAUTILUS_DRUID(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_DRUID, NautilusDruid))
#define NAUTILUS_DRUID_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_DRUID, NautilusDruidClass))
#define NAUTILUS_IS_DRUID(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_DRUID))
#define NAUTILUS_IS_DRUID_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DRUID))
typedef struct NautilusDruid NautilusDruid;
typedef struct NautilusDruidClass NautilusDruidClass;
struct NautilusDruid
{
GnomeDruid gnome_druid;
};
struct NautilusDruidClass
{
GnomeDruidClass parent_class;
};
GtkType nautilus_druid_get_type (void);
GtkWidget *nautilus_druid_new (void);
END_GNOME_DECLS
#endif /* NAUTILUS_DRUID_H */

View file

@ -1,460 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include "nautilus-entry.h"
#include <eel/eel-gtk-macros.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
#include <libgnome/gnome-i18n.h>
#include <eel/eel-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
#include <orb/orbit.h>
struct NautilusEntryDetails {
gboolean use_emacs_shortcuts;
gboolean user_edit;
gboolean special_tab_handling;
gboolean cursor_obscured;
};
enum {
USER_CHANGED,
SELECTION_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
static void nautilus_entry_initialize (NautilusEntry *entry);
static void nautilus_entry_initialize_class (NautilusEntryClass *class);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusEntry,
nautilus_entry,
GTK_TYPE_ENTRY)
static void
emacs_shortcuts_preference_changed_callback (gpointer callback_data)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (callback_data);
entry->details->use_emacs_shortcuts =
nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS);
}
static void
nautilus_entry_initialize (NautilusEntry *entry)
{
GtkWidget *widget;
widget = GTK_WIDGET (entry);
entry->details = g_new0 (NautilusEntryDetails, 1);
entry->details->user_edit = TRUE;
/* Allow pointer motion events so we can expose an obscured cursor if necessary */
gtk_widget_set_events (widget, gtk_widget_get_events (widget) | GDK_POINTER_MOTION_MASK);
nautilus_undo_set_up_nautilus_entry_for_undo (entry);
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
emacs_shortcuts_preference_changed_callback,
entry);
emacs_shortcuts_preference_changed_callback (entry);
}
GtkWidget *
nautilus_entry_new (void)
{
return gtk_widget_new (NAUTILUS_TYPE_ENTRY, NULL);
}
GtkWidget *
nautilus_entry_new_with_max_length (guint16 max)
{
GtkWidget *widget;
widget = gtk_widget_new (NAUTILUS_TYPE_ENTRY, NULL);
GTK_ENTRY (widget)->text_max_length = max;
return widget;
}
static void
nautilus_entry_destroy (GtkObject *object)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (object);
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
emacs_shortcuts_preference_changed_callback,
entry);
g_free (entry->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
obscure_cursor (NautilusEntry *entry)
{
if (entry->details->cursor_obscured) {
return;
}
entry->details->cursor_obscured = TRUE;
eel_gdk_window_set_invisible_cursor (GTK_ENTRY (entry)->text_area);
}
static gboolean
nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
{
NautilusEntry *entry;
GtkEditable *editable;
int position;
gboolean result;
entry = NAUTILUS_ENTRY (widget);
editable = GTK_EDITABLE (widget);
if (!editable->editable) {
return FALSE;
}
switch (event->keyval) {
case GDK_Tab:
/* The location bar entry wants TAB to work kind of
* like it does in the shell for command completion,
* so if we get a tab and there's a selection, we
* should position the insertion point at the end of
* the selection.
*/
if (entry->details->special_tab_handling && editable->has_selection) {
position = strlen (gtk_entry_get_text (GTK_ENTRY (editable)));
gtk_entry_select_region (GTK_ENTRY (editable), position, position);
return TRUE;
}
break;
case GDK_KP_Enter:
/* Work around bug in GtkEntry where keypad Enter key
* inserts a character rather than activating like the
* other Enter key.
*/
gtk_widget_activate (widget);
return TRUE;
default:
break;
}
if (!entry->details->use_emacs_shortcuts) {
/* Filter out the emacs-style keyboard shortcuts in
* GtkEntry for alt and control keys. They have
* numerous conflicts with menu keyboard shortcuts.
*/
if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK) {
return FALSE;
}
}
obscure_cursor (entry);
result = EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, key_press_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static gboolean
nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event)
{
int result;
guint old_start_pos, old_end_pos;
GdkCursor *cursor;
NautilusEntry *entry;
/* Reset cursor to I-Beam */
entry = NAUTILUS_ENTRY (widget);
if (entry->details->cursor_obscured) {
cursor = gdk_cursor_new (GDK_XTERM);
gdk_window_set_cursor (GTK_ENTRY (entry)->text_area, cursor);
gdk_cursor_destroy (cursor);
entry->details->cursor_obscured = FALSE;
}
old_start_pos = GTK_EDITABLE (widget)->selection_start_pos;
old_end_pos = GTK_EDITABLE (widget)->selection_end_pos;
result = EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, motion_notify_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
/**
* nautilus_entry_select_all
*
* Select all text, leaving the text cursor position at the end.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
static gboolean
select_all_at_idle (gpointer callback_data)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (callback_data);
if (!GTK_OBJECT_DESTROYED (entry)) {
nautilus_entry_select_all (entry);
}
gtk_object_unref (GTK_OBJECT (entry));
return FALSE;
}
/**
* nautilus_entry_select_all_at_idle
*
* Select all text at the next idle, not immediately.
* This is useful when reacting to a key press, because
* changing the selection and the text cursor position doesn't
* work in a key_press signal handler.
*
* @entry: A NautilusEntry
**/
void
nautilus_entry_select_all_at_idle (NautilusEntry *entry)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
/* If the text cursor position changes in this routine
* then gtk_entry_key_press will unselect (and we want
* to move the text cursor position to the end).
*/
gtk_object_ref (GTK_OBJECT (entry));
gtk_idle_add (select_all_at_idle, entry);
}
/**
* nautilus_entry_set_text
*
* This function wraps gtk_entry_set_text. It sets undo_registered
* to TRUE and preserves the old value for a later restore. This is
* done so the programmatic changes to the entry do not register
* with the undo manager.
*
* @entry: A NautilusEntry
* @test: The text to set
**/
void
nautilus_entry_set_text (NautilusEntry *entry, const gchar *text)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
entry->details->user_edit = FALSE;
gtk_entry_set_text (GTK_ENTRY (entry), text);
entry->details->user_edit = TRUE;
gtk_signal_emit (GTK_OBJECT (entry), signals[SELECTION_CHANGED]);
}
static void
nautilus_entry_set_selection (GtkEditable *editable,
int start_pos,
int end_pos)
{
EEL_CALL_PARENT (GTK_EDITABLE_CLASS, set_selection,
(editable, start_pos, end_pos));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
static gboolean
nautilus_entry_button_press (GtkWidget *widget,
GdkEventButton *event)
{
gboolean result;
result = EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, button_press_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static gboolean
nautilus_entry_button_release (GtkWidget *widget,
GdkEventButton *event)
{
gboolean result;
result = EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, button_release_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static void
nautilus_entry_insert_text (GtkEditable *editable, const gchar *text,
int length, int *position)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY(editable);
/* Fire off user changed signals */
if (entry->details->user_edit) {
gtk_signal_emit (GTK_OBJECT (editable), signals[USER_CHANGED]);
}
EEL_CALL_PARENT (GTK_EDITABLE_CLASS, insert_text,
(editable, text, length, position));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
static void
nautilus_entry_delete_text (GtkEditable *editable, int start_pos, int end_pos)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (editable);
/* Fire off user changed signals */
if (entry->details->user_edit) {
gtk_signal_emit (GTK_OBJECT (editable), signals[USER_CHANGED]);
}
EEL_CALL_PARENT (GTK_EDITABLE_CLASS, delete_text,
(editable, start_pos, end_pos));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
/* Overridden to work around GTK bug. The selection_clear_event is queued
* when the selection changes. Changing the selection to NULL and then
* back to the original selection owner still sends the event, so the
* selection owner then gets the selection ripped away from it. We ran into
* this with type-completion behavior in NautilusLocationBar (see bug 5313).
* There's a FIXME comment that seems to be about this same issue in
* gtk+/gtkselection.c, gtk_selection_clear.
*/
static gboolean
nautilus_entry_selection_clear (GtkWidget *widget,
GdkEventSelection *event)
{
g_return_val_if_fail (NAUTILUS_IS_ENTRY (widget), FALSE);
if (gdk_selection_owner_get (event->selection) == widget->window) {
return FALSE;
}
return EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, selection_clear_event, (widget, event));
}
static void
nautilus_entry_initialize_class (NautilusEntryClass *class)
{
GtkWidgetClass *widget_class;
GtkObjectClass *object_class;
GtkEditableClass *editable_class;
widget_class = GTK_WIDGET_CLASS (class);
object_class = GTK_OBJECT_CLASS (class);
editable_class = GTK_EDITABLE_CLASS (class);
widget_class->button_press_event = nautilus_entry_button_press;
widget_class->button_release_event = nautilus_entry_button_release;
widget_class->key_press_event = nautilus_entry_key_press;
widget_class->motion_notify_event = nautilus_entry_motion_notify;
widget_class->selection_clear_event = nautilus_entry_selection_clear;
object_class->destroy = nautilus_entry_destroy;
editable_class->insert_text = nautilus_entry_insert_text;
editable_class->delete_text = nautilus_entry_delete_text;
editable_class->set_selection = nautilus_entry_set_selection;
/* Set up signals */
signals[USER_CHANGED] = gtk_signal_new
("user_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
user_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
signals[SELECTION_CHANGED] = gtk_signal_new
("selection_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
void
nautilus_entry_set_special_tab_handling (NautilusEntry *entry,
gboolean special_tab_handling)
{
g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
entry->details->special_tab_handling = special_tab_handling;
}

View file

@ -1,72 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusEntry: one-line text editing widget. This consists of bug fixes
* and other improvements to GtkEntry, and all the changes could be rolled
* into GtkEntry some day.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: John Sullivan <sullivan@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef NAUTILUS_ENTRY_H
#define NAUTILUS_ENTRY_H
#include <libgnome/gnome-defs.h>
#include <gtk/gtkentry.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_ENTRY \
(nautilus_entry_get_type ())
#define NAUTILUS_ENTRY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ENTRY, NautilusEntry))
#define NAUTILUS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ENTRY, NautilusEntryClass))
#define NAUTILUS_IS_ENTRY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ENTRY))
#define NAUTILUS_IS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ENTRY))
typedef struct NautilusEntryDetails NautilusEntryDetails;
typedef struct {
GtkEntry parent;
NautilusEntryDetails *details;
} NautilusEntry;
typedef struct {
GtkEntryClass parent_class;
void (*user_changed) (NautilusEntry *entry);
void (*selection_changed) (NautilusEntry *entry);
} NautilusEntryClass;
GtkType nautilus_entry_get_type (void);
GtkWidget *nautilus_entry_new (void);
GtkWidget *nautilus_entry_new_with_max_length (guint16 max);
void nautilus_entry_set_text (NautilusEntry *entry,
const char *text);
void nautilus_entry_select_all (NautilusEntry *entry);
void nautilus_entry_select_all_at_idle (NautilusEntry *entry);
void nautilus_entry_set_special_tab_handling (NautilusEntry *entry,
gboolean special_tab_handling);
END_GNOME_DECLS
#endif /* NAUTILUS_ENTRY_H */

View file

@ -1,44 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-file-attributes.h: #defines and other file-attribute-related info
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_FILE_ATTRIBUTES_H
#define NAUTILUS_FILE_ATTRIBUTES_H
/* Names for NautilusFile attributes. These are used when registering
* interest in changes to the attributes or when waiting for them.
*/
#define NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI "activation URI"
#define NAUTILUS_FILE_ATTRIBUTE_CAPABILITIES "capabilities"
#define NAUTILUS_FILE_ATTRIBUTE_CUSTOM_ICON "custom icon"
#define NAUTILUS_FILE_ATTRIBUTE_DEEP_COUNTS "deep counts"
#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT "directory item count"
#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES "directory item MIME types"
#define NAUTILUS_FILE_ATTRIBUTE_FILE_TYPE "file type"
#define NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY "is directory"
#define NAUTILUS_FILE_ATTRIBUTE_METADATA "metadata"
#define NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE "MIME type"
#define NAUTILUS_FILE_ATTRIBUTE_TOP_LEFT_TEXT "top left text"
#endif /* NAUTILUS_FILE_ATTRIBUTES_H */

View file

@ -1,543 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Pavel Cisler <pavel@eazel.com>
*/
#include <config.h>
#include "nautilus-file-changes-queue.h"
#include "nautilus-directory-notify.h"
#include <eel/eel-glib-extensions.h>
#ifdef G_THREADS_ENABLED
#define MUTEX_LOCK(a) if ((a) != NULL) g_mutex_lock (a)
#define MUTEX_UNLOCK(a) if ((a) != NULL) g_mutex_unlock (a)
#else
#define MUTEX_LOCK(a)
#define MUTEX_UNLOCK(a)
#endif
typedef enum {
CHANGE_FILE_INITIAL,
CHANGE_FILE_ADDED,
CHANGE_FILE_CHANGED,
CHANGE_FILE_REMOVED,
CHANGE_FILE_MOVED,
CHANGE_METADATA_COPIED,
CHANGE_METADATA_MOVED,
CHANGE_METADATA_REMOVED,
CHANGE_POSITION_SET,
CHANGE_POSITION_REMOVE
} NautilusFileChangeKind;
typedef struct {
NautilusFileChangeKind kind;
char *from_uri;
char *to_uri;
GdkPoint point;
} NautilusFileChange;
typedef struct {
GList *head;
GList *tail;
#ifdef G_THREADS_ENABLED
GMutex *mutex;
#endif
} NautilusFileChangesQueue;
static NautilusFileChangesQueue *
nautilus_file_changes_queue_new (void)
{
NautilusFileChangesQueue *result;
result = g_new0 (NautilusFileChangesQueue, 1);
#ifdef G_THREADS_ENABLED
result->mutex = g_mutex_new ();
#endif
return result;
}
static NautilusFileChangesQueue *
nautilus_file_changes_queue_get (void)
{
static NautilusFileChangesQueue *file_changes_queue;
if (file_changes_queue == NULL) {
file_changes_queue = nautilus_file_changes_queue_new ();
}
return file_changes_queue;
}
#if 0 /* no public free call yet */
static void
nautilus_file_change_free (NautilusFileChange *change)
{
g_free (change->from_uri);
g_free (change->to_uri);
}
void
nautilus_file_changes_queue_free (NautilusFileChangesQueue *queue)
{
GList *p;
if (queue == NULL) {
return;
}
#ifdef G_THREADS_ENABLED
/* if lock on a defunct mutex were defined (returning a failure)
* we would lock here
*/
#endif
for (p = queue->head; p != NULL; p = p->next) {
nautilus_file_change_free (p->data);
}
g_list_free (queue->head);
#ifdef G_THREADS_ENABLED
g_mutex_free (queue->mutex);
#endif
g_free (queue);
}
#endif /* no public free call yet */
static void
nautilus_file_changes_queue_add_common (NautilusFileChangesQueue *queue,
NautilusFileChange *new_item)
{
/* enqueue the new queue item while locking down the list */
MUTEX_LOCK (queue->mutex);
queue->head = g_list_prepend (queue->head, new_item);
if (queue->tail == NULL)
queue->tail = queue->head;
MUTEX_UNLOCK (queue->mutex);
}
void
nautilus_file_changes_queue_file_added (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get();
new_item = g_new0 (NautilusFileChange, 1);
new_item->kind = CHANGE_FILE_ADDED;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_file_changed (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get();
new_item = g_new0 (NautilusFileChange, 1);
new_item->kind = CHANGE_FILE_CHANGED;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_file_removed (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get();
new_item = g_new0 (NautilusFileChange, 1);
new_item->kind = CHANGE_FILE_REMOVED;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_file_moved (const char *from, const char *to)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_FILE_MOVED;
new_item->from_uri = g_strdup (from);
new_item->to_uri = g_strdup (to);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_metadata_copy (const char *from_uri,
const char *to_uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_METADATA_COPIED;
new_item->from_uri = g_strdup (from_uri);
new_item->to_uri = g_strdup (to_uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_metadata_move (const char *from_uri,
const char *to_uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_METADATA_MOVED;
new_item->from_uri = g_strdup (from_uri);
new_item->to_uri = g_strdup (to_uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_metadata_remove (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_METADATA_REMOVED;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_position_set (const char *uri,
GdkPoint point)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_POSITION_SET;
new_item->from_uri = g_strdup (uri);
new_item->point = point;
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_position_remove (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_POSITION_REMOVE;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
static NautilusFileChange *
nautilus_file_changes_queue_get_change (NautilusFileChangesQueue *queue)
{
GList *new_tail;
NautilusFileChange *result;
g_assert (queue != NULL);
/* dequeue the tail item while locking down the list */
MUTEX_LOCK (queue->mutex);
if (queue->tail == NULL) {
result = NULL;
} else {
new_tail = queue->tail->prev;
result = queue->tail->data;
queue->head = g_list_remove_link (queue->head,
queue->tail);
g_list_free_1 (queue->tail);
queue->tail = new_tail;
}
MUTEX_UNLOCK (queue->mutex);
return result;
}
enum {
CONSUME_CHANGES_MAX_CHUNK = 20
};
static void
pairs_list_free (GList *pairs)
{
GList *p;
URIPair *pair;
/* deep delete the list of pairs */
for (p = pairs; p != NULL; p = p->next) {
/* delete the strings in each pair */
pair = p->data;
g_free (pair->from_uri);
g_free (pair->to_uri);
}
/* delete the list and the now empty pair structs */
eel_g_list_free_deep (pairs);
}
static void
position_set_list_free (GList *list)
{
GList *p;
NautilusFileChangesQueuePosition *item;
for (p = list; p != NULL; p = p->next) {
item = p->data;
g_free (item->uri);
}
/* delete the list and the now empty structs */
eel_g_list_free_deep (list);
}
/* go through changes in the change queue, send ones with the same kind
* in a list to the different nautilus_directory_notify calls
*/
void
nautilus_file_changes_consume_changes (gboolean consume_all)
{
NautilusFileChange *change;
GList *additions, *changes, *deletions, *moves;
GList *metadata_copy_requests, *metadata_move_requests, *metadata_remove_requests;
GList *position_set_requests;
URIPair *pair;
NautilusFileChangesQueuePosition *position_set;
guint chunk_count;
NautilusFileChangesQueue *queue;
gboolean flush_needed;
additions = NULL;
changes = NULL;
deletions = NULL;
moves = NULL;
metadata_copy_requests = NULL;
metadata_move_requests = NULL;
metadata_remove_requests = NULL;
position_set_requests = NULL;
queue = nautilus_file_changes_queue_get();
/* Consume changes from the queue, stuffing them into one of three lists,
* keep doing it while the changes are of the same kind, then send them off.
* This is to ensure that the changes get sent off in the same order that they
* arrived.
*/
for (chunk_count = 0; ; chunk_count++) {
change = nautilus_file_changes_queue_get_change (queue);
/* figure out if we need to flush the pending changes that we collected sofar */
if (change == NULL) {
flush_needed = TRUE;
/* no changes left, flush everything */
} else {
flush_needed = additions != NULL
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= changes != NULL
&& change->kind != CHANGE_FILE_CHANGED;
flush_needed |= moves != NULL
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= deletions != NULL
&& change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED;
flush_needed |= metadata_copy_requests != NULL
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= metadata_move_requests != NULL
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= metadata_remove_requests != NULL
&& change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED;
flush_needed |= position_set_requests != NULL
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_METADATA_MOVED;
flush_needed |= !consume_all && chunk_count >= CONSUME_CHANGES_MAX_CHUNK;
/* we have reached the chunk maximum */
}
if (flush_needed) {
/* Send changes we collected off.
* At one time we may only have one of the lists
* contain changes.
*/
if (deletions != NULL) {
nautilus_directory_notify_files_removed (deletions);
eel_g_list_free_deep (deletions);
deletions = NULL;
}
if (moves != NULL) {
nautilus_directory_notify_files_moved (moves);
pairs_list_free (moves);
moves = NULL;
}
if (additions != NULL) {
nautilus_directory_notify_files_added (additions);
eel_g_list_free_deep (additions);
additions = NULL;
}
if (changes != NULL) {
nautilus_directory_notify_files_changed (changes);
eel_g_list_free_deep (changes);
changes = NULL;
}
if (metadata_copy_requests != NULL) {
nautilus_directory_schedule_metadata_copy (metadata_copy_requests);
pairs_list_free (metadata_copy_requests);
metadata_copy_requests = NULL;
}
if (metadata_move_requests != NULL) {
nautilus_directory_schedule_metadata_move (metadata_move_requests);
pairs_list_free (metadata_move_requests);
metadata_move_requests = NULL;
}
if (metadata_remove_requests != NULL) {
nautilus_directory_schedule_metadata_remove (metadata_remove_requests);
eel_g_list_free_deep (metadata_remove_requests);
metadata_remove_requests = NULL;
}
if (position_set_requests != NULL) {
nautilus_directory_schedule_position_set (position_set_requests);
position_set_list_free (position_set_requests);
position_set_requests = NULL;
}
}
if (change == NULL) {
/* we are done */
return;
}
/* add the new change to the list */
switch (change->kind) {
case CHANGE_FILE_ADDED:
additions = g_list_append (additions, change->from_uri);
break;
case CHANGE_FILE_CHANGED:
changes = g_list_append (changes, change->from_uri);
break;
case CHANGE_FILE_REMOVED:
deletions = g_list_append (deletions, change->from_uri);
break;
case CHANGE_FILE_MOVED:
pair = g_new (URIPair, 1);
pair->from_uri = change->from_uri;
pair->to_uri = change->to_uri;
moves = g_list_append (moves, pair);
break;
case CHANGE_METADATA_COPIED:
pair = g_new (URIPair, 1);
pair->from_uri = change->from_uri;
pair->to_uri = change->to_uri;
metadata_copy_requests = g_list_append (metadata_copy_requests, pair);
break;
case CHANGE_METADATA_MOVED:
pair = g_new (URIPair, 1);
pair->from_uri = change->from_uri;
pair->to_uri = change->to_uri;
metadata_move_requests = g_list_append (metadata_move_requests, pair);
break;
case CHANGE_METADATA_REMOVED:
metadata_remove_requests = g_list_append (metadata_remove_requests,
change->from_uri);
break;
case CHANGE_POSITION_SET:
position_set = g_new (NautilusFileChangesQueuePosition, 1);
position_set->uri = change->from_uri;
position_set->set = TRUE;
position_set->point = change->point;
position_set_requests = g_list_append (position_set_requests,
position_set);
break;
case CHANGE_POSITION_REMOVE:
position_set = g_new (NautilusFileChangesQueuePosition, 1);
position_set->uri = change->from_uri;
position_set->set = FALSE;
position_set_requests = g_list_append (position_set_requests,
position_set);
break;
default:
g_assert_not_reached ();
break;
}
change->from_uri = NULL;
change->to_uri = NULL;
}
}

View file

@ -1,44 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Pavel Cisler <pavel@eazel.com>
*/
#ifndef NAUTILUS_FILE_CHANGES_QUEUE_H
#define NAUTILUS_FILE_CHANGES_QUEUE_H
#include <gdk/gdktypes.h>
void nautilus_file_changes_queue_file_added (const char *uri);
void nautilus_file_changes_queue_file_changed (const char *uri);
void nautilus_file_changes_queue_file_removed (const char *uri);
void nautilus_file_changes_queue_file_moved (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_copy (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_move (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_remove (const char *uri);
void nautilus_file_changes_queue_schedule_position_set (const char *uri,
GdkPoint point);
void nautilus_file_changes_queue_schedule_position_remove (const char *uri);
void nautilus_file_changes_consume_changes (gboolean consume_all);
#endif /* NAUTILUS_FILE_CHANGES_QUEUE_H */

View file

@ -1,109 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-drag.c - Drag & drop handling code that operated on
NautilusFile objects.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Pavel Cisler <pavel@eazel.com>,
*/
#include <config.h>
#include "nautilus-file-dnd.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-string.h>
gboolean
nautilus_drag_can_accept_item (NautilusFile *drop_target_item,
const char *item_uri)
{
if (nautilus_file_matches_uri (drop_target_item, item_uri)) {
/* can't accept itself */
return FALSE;
}
if (nautilus_file_is_directory (drop_target_item)) {
/* target is a directory, accept anything */
return TRUE;
}
/* All Nautilus links are assumed to be links to directories.
* Therefore, they all can accept drags, like all other
* directories to. As with other directories, there can be
* errors when the actual copy is attempted due to
* permissions.
*/
if (nautilus_file_is_nautilus_link (drop_target_item)) {
return TRUE;
}
return FALSE;
}
gboolean
nautilus_drag_can_accept_items (NautilusFile *drop_target_item,
const GList *items)
{
int max;
if (drop_target_item == NULL)
return FALSE;
g_assert (NAUTILUS_IS_FILE (drop_target_item));
/* Iterate through selection checking if item will get accepted by the
* drop target. If more than 100 items selected, return an over-optimisic
* result
*/
for (max = 100; items != NULL && max >= 0; items = items->next, max--) {
if (!nautilus_drag_can_accept_item (drop_target_item,
((EelDragSelectionItem *)items->data)->uri)) {
return FALSE;
}
}
return TRUE;
}
void
nautilus_drag_file_receive_dropped_keyword (NautilusFile *file, char *keyword)
{
GList *keywords, *word;
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (keyword != NULL);
/* special case the erase emblem */
if (strcmp (keyword, NAUTILUS_FILE_DND_ERASE_KEYWORD) == 0) {
keywords = NULL;
} else {
keywords = nautilus_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
if (word == NULL) {
keywords = g_list_append (keywords, g_strdup (keyword));
} else {
keywords = g_list_remove_link (keywords, word);
g_free (word->data);
g_list_free_1 (word);
}
}
nautilus_file_set_keywords (file, keywords);
eel_g_list_free_deep (keywords);
}

View file

@ -1,41 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-drag.h - Drag & drop handling code that operated on
NautilusFile objects.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Pavel Cisler <pavel@eazel.com>,
*/
#ifndef NAUTILUS_FILE_DND_H
#define NAUTILUS_FILE_DND_H
#include <eel/eel-dnd.h>
#include <libnautilus-extensions/nautilus-file.h>
#define NAUTILUS_FILE_DND_ERASE_KEYWORD "erase"
gboolean nautilus_drag_can_accept_item (NautilusFile *drop_target_item,
const char *item_uri);
gboolean nautilus_drag_can_accept_items (NautilusFile *drop_target_item,
const GList *items);
void nautilus_drag_file_receive_dropped_keyword (NautilusFile *file,
char *keyword);
#endif /* NAUTILUS_FILE_DND_H */

View file

@ -1,446 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* dfos-xfer-progress-dialog.c - Progress dialog for transfer operations in the
GNOME Desktop File Operation Service.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000, 2001 Eazel Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors:
Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
*/
#include <config.h>
#include "nautilus-file-operations-progress.h"
#include <eel/eel-ellipsizing-label.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkprogressbar.h>
#include <gtk/gtktable.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-stock.h>
#include <libgnomevfs/gnome-vfs-utils.h>
/* The width of the progress bar determines the minimum width of the
* window. It will be wider only if the font is really huge and the
* fixed labels don't fit in the window otherwise.
*/
#define PROGRESS_BAR_WIDTH 350
#define OUTER_BORDER 5
#define HORIZONTAL_SPACING 3
#define MINIMUM_TIME_UP 1000
static void nautilus_file_operations_progress_initialize_class (NautilusFileOperationsProgressClass *klass);
static void nautilus_file_operations_progress_initialize (NautilusFileOperationsProgress *dialog);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusFileOperationsProgress,
nautilus_file_operations_progress,
GNOME_TYPE_DIALOG);
struct NautilusFileOperationsProgressDetails {
GtkWidget *progress_title_label;
GtkWidget *progress_count_label;
GtkWidget *operation_name_label;
GtkWidget *item_name;
GtkWidget *from_label;
GtkWidget *from_path_label;
GtkWidget *to_label;
GtkWidget *to_path_label;
GtkWidget *progress_bar;
const char *from_prefix;
const char *to_prefix;
gulong bytes_copied;
gulong files_total;
gulong bytes_total;
/* system time (microseconds) when dialog was mapped */
gint64 start_time;
guint delayed_close_timeout_id;
};
/* Private functions. */
static void
nautilus_file_operations_progress_update (NautilusFileOperationsProgress *progress)
{
if (progress->details->bytes_total == 0) {
/* We haven't set up the file count yet, do not update
* the progress bar until we do.
*/
return;
}
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
progress->details->bytes_copied,
0.0,
progress->details->bytes_total);
}
static void
set_text_unescaped_trimmed (EelEllipsizingLabel *label, const char *text)
{
char *unescaped_text;
if (text == NULL || text[0] == '\0') {
eel_ellipsizing_label_set_text (label, "");
return;
}
unescaped_text = gnome_vfs_unescape_string_for_display (text);
eel_ellipsizing_label_set_text (label, unescaped_text);
g_free (unescaped_text);
}
/* This is just to make sure the dialog is not closed without explicit
* intervention.
*/
static gboolean
close_callback (GnomeDialog *dialog)
{
return FALSE;
}
/* GtkObject methods. */
static void
nautilus_file_operations_progress_destroy (GtkObject *object)
{
NautilusFileOperationsProgress *progress;
progress = NAUTILUS_FILE_OPERATIONS_PROGRESS (object);
if (progress->details->delayed_close_timeout_id != 0) {
g_source_remove (progress->details->delayed_close_timeout_id);
}
g_free (progress->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
/* Initialization. */
static void
create_titled_label (GtkTable *table, int row, GtkWidget **title_widget, GtkWidget **label_text_widget)
{
*title_widget = gtk_label_new ("");
eel_gtk_label_make_bold (GTK_LABEL (*title_widget));
gtk_misc_set_alignment (GTK_MISC (*title_widget), 1, 0);
gtk_table_attach (table, *title_widget,
0, 1,
row, row + 1,
GTK_FILL, 0,
0, 0);
gtk_widget_show (*title_widget);
*label_text_widget = eel_ellipsizing_label_new ("");
gtk_table_attach (table, *label_text_widget,
1, 2,
row, row + 1,
GTK_FILL | GTK_EXPAND, 0,
0, 0);
gtk_widget_show (*label_text_widget);
gtk_misc_set_alignment (GTK_MISC (*label_text_widget), 0, 0);
}
static void
map_callback (GtkWidget *widget)
{
NautilusFileOperationsProgress *progress;
progress = NAUTILUS_FILE_OPERATIONS_PROGRESS (widget);
EEL_CALL_PARENT (GTK_WIDGET_CLASS, map, (widget));
progress->details->start_time = eel_get_system_time ();
}
static gboolean
delete_event_callback (GtkWidget *widget,
GdkEventAny *event)
{
/* Do nothing -- we shouldn't be getting a close event because
* the dialog should not have a close box.
*/
return TRUE;
}
static void
nautilus_file_operations_progress_initialize (NautilusFileOperationsProgress *progress)
{
GtkBox *vbox;
GtkWidget *hbox;
GtkTable *titled_label_table;
progress->details = g_new0 (NautilusFileOperationsProgressDetails, 1);
vbox = GTK_BOX (GNOME_DIALOG (progress)->vbox);
/* This is evil but makes the dialog look less cramped. */
gtk_container_set_border_width (GTK_CONTAINER (vbox), OUTER_BORDER);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (vbox, hbox, TRUE, TRUE, HORIZONTAL_SPACING);
gtk_widget_show (hbox);
/* label- */
/* Files remaining to be copied: */
progress->details->progress_title_label = gtk_label_new ("");
gtk_label_set_justify (GTK_LABEL (progress->details->progress_title_label), GTK_JUSTIFY_LEFT);
gtk_box_pack_start (GTK_BOX (hbox), progress->details->progress_title_label, FALSE, FALSE, 0);
gtk_widget_show (progress->details->progress_title_label);
eel_gtk_label_make_bold (GTK_LABEL (progress->details->progress_title_label));
/* label -- */
/* 24 of 30 */
progress->details->progress_count_label = gtk_label_new ("");
gtk_label_set_justify (GTK_LABEL (progress->details->progress_count_label), GTK_JUSTIFY_RIGHT);
gtk_box_pack_end (GTK_BOX (hbox), progress->details->progress_count_label, FALSE, FALSE, 0);
gtk_widget_show (progress->details->progress_count_label);
eel_gtk_label_make_bold (GTK_LABEL (progress->details->progress_count_label));
/* progress bar */
progress->details->progress_bar = gtk_progress_bar_new ();
gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (progress->details->progress_bar),
GTK_PROGRESS_CONTINUOUS);
gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (progress->details->progress_bar),
GTK_PROGRESS_LEFT_TO_RIGHT);
gtk_widget_set_usize (progress->details->progress_bar, PROGRESS_BAR_WIDTH, -1);
gtk_box_pack_start (vbox, progress->details->progress_bar, FALSE, TRUE, 0);
gtk_widget_show (progress->details->progress_bar);
titled_label_table = GTK_TABLE (gtk_table_new (3, 2, FALSE));
gtk_table_set_row_spacings (titled_label_table, 4);
gtk_table_set_col_spacings (titled_label_table, 4);
gtk_widget_show (GTK_WIDGET (titled_label_table));
create_titled_label (titled_label_table, 0,
&progress->details->operation_name_label,
&progress->details->item_name);
create_titled_label (titled_label_table, 1,
&progress->details->from_label,
&progress->details->from_path_label);
create_titled_label (titled_label_table, 2,
&progress->details->to_label,
&progress->details->to_path_label);
gtk_box_pack_start (vbox, GTK_WIDGET (titled_label_table), FALSE, FALSE, 0);
}
static void
nautilus_file_operations_progress_initialize_class (NautilusFileOperationsProgressClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GnomeDialogClass *dialog_class;
object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
dialog_class = GNOME_DIALOG_CLASS (klass);
object_class->destroy = nautilus_file_operations_progress_destroy;
/* The progress dialog should not have a title and a close box.
* Some broken window manager themes still show the window title.
* Make clicking the close box do nothing in that case to prevent
* a crash.
*/
widget_class->delete_event = delete_event_callback;
widget_class->map = map_callback;
dialog_class->close = close_callback;
}
NautilusFileOperationsProgress *
nautilus_file_operations_progress_new (const char *title,
const char *operation_string,
const char *from_prefix,
const char *to_prefix,
gulong total_files,
gulong total_bytes)
{
GtkWidget *widget;
NautilusFileOperationsProgress *progress;
widget = gtk_widget_new (nautilus_file_operations_progress_get_type (), NULL);
progress = NAUTILUS_FILE_OPERATIONS_PROGRESS (widget);
nautilus_file_operations_progress_set_operation_string (progress, operation_string);
nautilus_file_operations_progress_set_total (progress, total_files, total_bytes);
gtk_window_set_title (GTK_WINDOW (widget), title);
gtk_window_set_wmclass (GTK_WINDOW (widget), "file_progress", "Nautilus");
gnome_dialog_append_button (GNOME_DIALOG (widget),
GNOME_STOCK_BUTTON_CANCEL);
progress->details->from_prefix = from_prefix;
progress->details->to_prefix = to_prefix;
return progress;
}
void
nautilus_file_operations_progress_set_total (NautilusFileOperationsProgress *progress,
gulong files_total,
gulong bytes_total)
{
g_return_if_fail (NAUTILUS_IS_FILE_OPERATIONS_PROGRESS (progress));
progress->details->files_total = files_total;
progress->details->bytes_total = bytes_total;
nautilus_file_operations_progress_update (progress);
}
void
nautilus_file_operations_progress_set_operation_string (NautilusFileOperationsProgress *progress,
const char *operation_string)
{
g_return_if_fail (NAUTILUS_IS_FILE_OPERATIONS_PROGRESS (progress));
gtk_label_set_text (GTK_LABEL (progress->details->progress_title_label),
operation_string);
}
void
nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *progress,
const char *progress_verb,
const char *item_name,
const char *from_path,
const char *to_path,
const char *from_prefix,
const char *to_prefix,
gulong file_index,
gulong size)
{
char *progress_count;
g_return_if_fail (NAUTILUS_IS_FILE_OPERATIONS_PROGRESS (progress));
g_return_if_fail (GTK_WIDGET_REALIZED (progress));
progress->details->from_prefix = from_prefix;
progress->details->to_prefix = to_prefix;
if (progress->details->bytes_total > 0) {
/* we haven't set up the file count yet, do not update the progress
* count until we do
*/
gtk_label_set_text (GTK_LABEL (progress->details->operation_name_label),
progress_verb);
set_text_unescaped_trimmed
(EEL_ELLIPSIZING_LABEL (progress->details->item_name),
item_name);
progress_count = g_strdup_printf (_("%ld of %ld"),
file_index,
progress->details->files_total);
gtk_label_set_text (GTK_LABEL (progress->details->progress_count_label), progress_count);
g_free (progress_count);
gtk_label_set_text (GTK_LABEL (progress->details->from_label), from_prefix);
set_text_unescaped_trimmed
(EEL_ELLIPSIZING_LABEL (progress->details->from_path_label), from_path);
if (progress->details->to_prefix != NULL && progress->details->to_path_label != NULL) {
gtk_label_set_text (GTK_LABEL (progress->details->to_label), to_prefix);
set_text_unescaped_trimmed
(EEL_ELLIPSIZING_LABEL (progress->details->to_path_label), to_path);
}
}
nautilus_file_operations_progress_update (progress);
}
void
nautilus_file_operations_progress_clear (NautilusFileOperationsProgress *progress)
{
gtk_label_set_text (GTK_LABEL (progress->details->from_label), "");
gtk_label_set_text (GTK_LABEL (progress->details->from_path_label), "");
gtk_label_set_text (GTK_LABEL (progress->details->to_label), "");
gtk_label_set_text (GTK_LABEL (progress->details->to_path_label), "");
progress->details->files_total = 0;
progress->details->bytes_total = 0;
nautilus_file_operations_progress_update (progress);
}
void
nautilus_file_operations_progress_update_sizes (NautilusFileOperationsProgress *progress,
gulong bytes_done_in_file,
gulong bytes_done)
{
g_return_if_fail (NAUTILUS_IS_FILE_OPERATIONS_PROGRESS (progress));
progress->details->bytes_copied = bytes_done;
nautilus_file_operations_progress_update (progress);
}
static gboolean
delayed_close_callback (gpointer callback_data)
{
NautilusFileOperationsProgress *progress;
progress = NAUTILUS_FILE_OPERATIONS_PROGRESS (callback_data);
progress->details->delayed_close_timeout_id = 0;
gtk_object_destroy (GTK_OBJECT (progress));
return FALSE;
}
void
nautilus_file_operations_progress_done (NautilusFileOperationsProgress *progress)
{
guint time_up;
if (!GTK_WIDGET_MAPPED (progress)) {
gtk_object_destroy (GTK_OBJECT (progress));
return;
}
g_assert (progress->details->start_time != 0);
/* compute time up in milliseconds */
time_up = (eel_get_system_time () - progress->details->start_time) / 1000;
if (time_up >= MINIMUM_TIME_UP) {
gtk_object_destroy (GTK_OBJECT (progress));
return;
}
/* No cancel button once the operation is done. */
gnome_dialog_set_sensitive (GNOME_DIALOG (progress), 0, FALSE);
progress->details->delayed_close_timeout_id = gtk_timeout_add
(MINIMUM_TIME_UP - time_up,
delayed_close_callback,
progress);
}

View file

@ -1,81 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-operations-progress.h - Progress dialog for transfer
operations in the GNOME Desktop File Operation Service.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000, 2001 Eazel Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author:
Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
*/
#ifndef NAUTILUS_FILE_OPERATIONS_PROGRESS_H
#define NAUTILUS_FILE_OPERATIONS_PROGRESS_H
#include <libgnomeui/gnome-dialog.h>
typedef struct NautilusFileOperationsProgressDetails NautilusFileOperationsProgressDetails;
typedef struct {
GnomeDialog dialog;
NautilusFileOperationsProgressDetails *details;
} NautilusFileOperationsProgress;
typedef struct {
GnomeDialogClass parent_class;
} NautilusFileOperationsProgressClass;
#define NAUTILUS_FILE_OPERATIONS_PROGRESS(obj) \
GTK_CHECK_CAST (obj, nautilus_file_operations_progress_get_type (), NautilusFileOperationsProgress)
#define NAUTILUS_FILE_OPERATIONS_PROGRESS_CLASS(klass) \
GTK_CHECK_CLASS_CAST (klass, nautilus_file_operations_progress_get_type (), NautilusFileOperationsProgressClass)
#define NAUTILUS_IS_FILE_OPERATIONS_PROGRESS(obj) \
GTK_CHECK_TYPE (obj, nautilus_file_operations_progress_get_type ())
guint nautilus_file_operations_progress_get_type (void);
NautilusFileOperationsProgress *nautilus_file_operations_progress_new (const char *title,
const char *operation_string,
const char *from_prefix,
const char *to_prefix,
gulong files_total,
gulong bytes_total);
void nautilus_file_operations_progress_done (NautilusFileOperationsProgress *dialog);
void nautilus_file_operations_progress_set_progress_title (NautilusFileOperationsProgress *dialog,
const char *progress_title);
void nautilus_file_operations_progress_set_total (NautilusFileOperationsProgress *dialog,
gulong files_total,
gulong bytes_total);
void nautilus_file_operations_progress_set_operation_string (NautilusFileOperationsProgress *dialog,
const char *operation_string);
void nautilus_file_operations_progress_clear (NautilusFileOperationsProgress *dialog);
void nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *dialog,
const char *progress_verb,
const char *item_name,
const char *from_path,
const char *to_path,
const char *from_prefix,
const char *to_prefix,
gulong file_index,
gulong size);
void nautilus_file_operations_progress_update_sizes (NautilusFileOperationsProgress *dialog,
gulong bytes_done_in_file,
gulong bytes_done);
#endif /* NAUTILUS_FILE_OPERATIONS_PROGRESS_H */

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-operations: execute file operations.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ettore Perazzoli <ettore@gnu.org>,
Pavel Cisler <pavel@eazel.com>
*/
#ifndef NAUTILUS_FILE_OPERATIONS_H
#define NAUTILUS_FILE_OPERATIONS_H
#include <gtk/gtkwidget.h>
#include <libgnomevfs/gnome-vfs-types.h>
typedef void (* NautilusCopyCallback) (GHashTable *debuting_uris,
gpointer callback_data);
typedef void (* NautilusNewFolderCallback) (const char *new_folder_uri,
gpointer callback_data);
/* FIXME: int copy_action should be an enum */
void nautilus_file_operations_copy_move (const GList *item_uris,
GArray *target_item_points,
const char *target_dir_uri,
GdkDragAction copy_action,
GtkWidget *parent_view,
NautilusCopyCallback done_callback,
gpointer done_callback_data);
void nautilus_file_operations_empty_trash (GtkWidget *parent_view);
void nautilus_file_operations_new_folder (GtkWidget *parent_view,
const char *parent_dir_uri,
NautilusNewFolderCallback done_callback,
gpointer done_callback_data);
void nautilus_file_operations_delete (const GList *item_uris,
GtkWidget *parent_view);
#endif /* NAUTILUS_FILE_OPERATIONS_H */

View file

@ -1,149 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory.c: Nautilus directory model.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#include "nautilus-directory.h"
#include "nautilus-file.h"
#include "nautilus-monitor.h"
#include <eel/eel-glib-extensions.h>
#define NAUTILUS_FILE_TOP_LEFT_TEXT_MAXIMUM_CHARACTERS_PER_LINE 80
#define NAUTILUS_FILE_TOP_LEFT_TEXT_MAXIMUM_LINES 24
#define NAUTILUS_FILE_TOP_LEFT_TEXT_MAXIMUM_BYTES 10000
/* These are in the typical sort order. Known things come first, then
* things where we can't know, finally things where we don't yet know.
*/
typedef enum {
KNOWN,
UNKNOWABLE,
UNKNOWN
} Knowledge;
typedef struct {
int automatic_emblems_as_integer;
char emblem_keywords[1];
} NautilusFileSortByEmblemCache;
struct NautilusFileDetails
{
NautilusDirectory *directory;
char *relative_uri;
GnomeVFSFileInfo *info;
GnomeVFSResult get_info_error;
NautilusMonitor *monitor;
guint directory_count;
guint deep_directory_count;
guint deep_file_count;
guint deep_unreadable_count;
GnomeVFSFileSize deep_size;
GList *mime_list; /* If this is a directory, the list of MIME types in it. */
char *top_left_text;
char *activation_uri;
/* The following is for file operations in progress. Since
* there are normally only a few of these, we can move them to
* a separate hash table or something if required to keep the
* file objects small.
*/
GList *operations_in_progress;
/* We use this to cache automatic emblems and emblem keywords
to speed up compare_by_emblems. */
NautilusFileSortByEmblemCache *compare_by_emblem_cache;
/* boolean fields: bitfield to save space, since there can be
many NautilusFile objects. */
eel_boolean_bit unconfirmed : 1;
eel_boolean_bit is_gone : 1;
/* Set by the NautilusDirectory while it's loading the file
* list so the file knows not to do redundant I/O.
*/
eel_boolean_bit loading_directory : 1;
/* got_info known from info field being non-NULL */
eel_boolean_bit get_info_failed : 1;
eel_boolean_bit file_info_is_up_to_date : 1;
eel_boolean_bit got_directory_count : 1;
eel_boolean_bit directory_count_failed : 1;
eel_boolean_bit directory_count_is_up_to_date : 1;
NautilusRequestStatus deep_counts_status : 2;
/* no deep_counts_are_up_to_date field; since we expose
intermediate values for this attribute, we do actually
forget it rather than invalidating. */
eel_boolean_bit got_mime_list : 1;
eel_boolean_bit mime_list_failed : 1;
eel_boolean_bit mime_list_is_up_to_date : 1;
eel_boolean_bit got_top_left_text : 1;
eel_boolean_bit top_left_text_is_up_to_date : 1;
eel_boolean_bit got_activation_uri : 1;
eel_boolean_bit activation_uri_is_up_to_date : 1;
};
NautilusFile *nautilus_file_new_from_info (NautilusDirectory *directory,
GnomeVFSFileInfo *info);
NautilusFile *nautilus_file_get_existing (const char *uri);
void nautilus_file_emit_changed (NautilusFile *file);
void nautilus_file_mark_gone (NautilusFile *file);
gboolean nautilus_file_info_missing (NautilusFile *file,
GnomeVFSFileInfoFields needed_mask);
char * nautilus_extract_top_left_text (const char *text,
int length);
void nautilus_file_set_directory (NautilusFile *file,
NautilusDirectory *directory);
gboolean nautilus_file_get_date (NautilusFile *file,
NautilusDateType date_type,
time_t *date);
void nautilus_file_updated_deep_count_in_progress (NautilusFile *file);
/* Compare file's state with a fresh file info struct, return FALSE if
* no change, update file and return TRUE if the file info contains
* new state. */
gboolean nautilus_file_update_info (NautilusFile *file,
GnomeVFSFileInfo *info);
gboolean nautilus_file_update_name (NautilusFile *file,
const char *name);
/* Return true if the top lefts of files in this directory should be
* fetched, according to the preference settings.
*/
gboolean nautilus_file_should_get_top_left_text (NautilusFile *file);
/* Mark specified attributes for this file out of date without canceling current
* I/O or kicking off new I/O.
*/
void nautilus_file_invalidate_attributes_internal (NautilusFile *file,
GList *file_attributes);
GList * nautilus_file_get_all_attributes (void);
gboolean nautilus_file_is_self_owned (NautilusFile *file);

View file

@ -1,322 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-utilities.c - implementation of file manipulation routines.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
*/
#include <config.h>
#include "nautilus-file-utilities.h"
#include "nautilus-global-preferences.h"
#include "nautilus-lib-self-check-functions.h"
#include "nautilus-link-set.h"
#include "nautilus-metadata.h"
#include "nautilus-metafile.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-string.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#define NAUTILUS_USER_DIRECTORY_NAME ".nautilus"
#define DEFAULT_NAUTILUS_DIRECTORY_MODE (0755)
#define DESKTOP_DIRECTORY_NAME ".gnome-desktop"
#define DEFAULT_DESKTOP_DIRECTORY_MODE (0755)
#define NAUTILUS_USER_MAIN_DIRECTORY_NAME "Nautilus"
gboolean
nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri)
{
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
return name_or_relative_uri[0] == '.';
}
gboolean
nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri)
{
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
return eel_str_has_suffix (name_or_relative_uri, "~");
}
gboolean
nautilus_file_name_matches_metafile_pattern (const char *name_or_relative_uri)
{
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
return eel_str_has_suffix (name_or_relative_uri, NAUTILUS_METAFILE_NAME_SUFFIX);
}
/**
* nautilus_make_path:
*
* Make a path name from a base path and name. The base path
* can end with or without a separator character.
*
* Return value: the combined path name.
**/
char *
nautilus_make_path (const char *path, const char* name)
{
gboolean insert_separator;
int path_length;
char *result;
path_length = strlen (path);
insert_separator = path_length > 0 &&
name[0] != '\0' &&
path[path_length - 1] != G_DIR_SEPARATOR;
if (insert_separator) {
result = g_strconcat (path, G_DIR_SEPARATOR_S, name, NULL);
} else {
result = g_strconcat (path, name, NULL);
}
return result;
}
/**
* nautilus_get_user_directory:
*
* Get the path for the directory containing nautilus settings.
*
* Return value: the directory path.
**/
char *
nautilus_get_user_directory (void)
{
char *user_directory = NULL;
user_directory = nautilus_make_path (g_get_home_dir (),
NAUTILUS_USER_DIRECTORY_NAME);
if (!g_file_exists (user_directory)) {
mkdir (user_directory, DEFAULT_NAUTILUS_DIRECTORY_MODE);
/* FIXME bugzilla.eazel.com 1286:
* How should we handle the case where this mkdir fails?
* Note that nautilus_application_startup will refuse to launch if this
* directory doesn't get created, so that case is OK. But the directory
* could be deleted after Nautilus was launched, and perhaps
* there is some bad side-effect of not handling that case.
*/
}
return user_directory;
}
/**
* nautilus_get_desktop_directory:
*
* Get the path for the directory containing files on the desktop.
*
* Return value: the directory path.
**/
char *
nautilus_get_desktop_directory (void)
{
char *desktop_directory;
if (nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR)) {
desktop_directory = g_strdup (g_get_home_dir());
} else {
desktop_directory = nautilus_make_path (g_get_home_dir (), DESKTOP_DIRECTORY_NAME);
}
if (!g_file_exists (desktop_directory)) {
mkdir (desktop_directory, DEFAULT_DESKTOP_DIRECTORY_MODE);
/* FIXME bugzilla.eazel.com 1286:
* How should we handle the case where this mkdir fails?
* Note that nautilus_application_startup will refuse to launch if this
* directory doesn't get created, so that case is OK. But the directory
* could be deleted after Nautilus was launched, and perhaps
* there is some bad side-effect of not handling that case.
*/
}
return desktop_directory;
}
/**
* nautilus_user_main_directory_exists:
*
* returns true if the user directory exists. This must be called
* before nautilus_get_user_main_directory, which creates it if necessary
*
**/
gboolean
nautilus_user_main_directory_exists(void)
{
gboolean directory_exists;
char *main_directory;
main_directory = g_strdup_printf ("%s/%s",
g_get_home_dir(),
NAUTILUS_USER_MAIN_DIRECTORY_NAME);
directory_exists = g_file_exists(main_directory);
g_free(main_directory);
return directory_exists;
}
/**
* nautilus_get_user_main_directory:
*
* Get the path for the user's main Nautilus directory.
* Usually ~/Nautilus
*
* Return value: the directory path.
**/
char *
nautilus_get_user_main_directory (void)
{
char *user_main_directory = NULL;
GnomeVFSResult result;
char *destination_directory_uri_text;
GnomeVFSURI *destination_directory_uri;
GnomeVFSURI *destination_uri;
user_main_directory = g_strdup_printf ("%s/%s",
g_get_home_dir(),
NAUTILUS_USER_MAIN_DIRECTORY_NAME);
if (!g_file_exists (user_main_directory)) {
destination_directory_uri_text = gnome_vfs_get_uri_from_local_path (g_get_home_dir());
destination_directory_uri = gnome_vfs_uri_new (destination_directory_uri_text);
g_free (destination_directory_uri_text);
destination_uri = gnome_vfs_uri_append_file_name (destination_directory_uri,
NAUTILUS_USER_MAIN_DIRECTORY_NAME);
gnome_vfs_uri_unref (destination_directory_uri);
result = gnome_vfs_make_directory_for_uri (destination_uri,
GNOME_VFS_PERM_USER_ALL
| GNOME_VFS_PERM_GROUP_ALL
| GNOME_VFS_PERM_OTHER_READ);
/* FIXME bugzilla.eazel.com 1286:
* How should we handle error codes returned from gnome_vfs_xfer_uri?
* Note that nautilus_application_startup will refuse to launch if this
* directory doesn't get created, so that case is OK. But the directory
* could be deleted after Nautilus was launched, and perhaps
* there is some bad side-effect of not handling that case.
*/
gnome_vfs_uri_unref (destination_uri);
/* If this fails to create the directory, nautilus_application_startup will
* notice and refuse to launch.
*/
/* install the default link sets */
nautilus_link_set_install (user_main_directory, "apps");
nautilus_link_set_install (user_main_directory, "home");
}
return user_main_directory;
}
/**
* nautilus_get_pixmap_directory
*
* Get the path for the directory containing Nautilus pixmaps.
*
* Return value: the directory path.
**/
char *
nautilus_get_pixmap_directory (void)
{
return g_strdup (DATADIR "/pixmaps/nautilus");
}
/* FIXME bugzilla.eazel.com 2423:
* Callers just use this and dereference so we core dump if
* pixmaps are missing. That is lame.
*/
char *
nautilus_pixmap_file (const char *partial_path)
{
char *path;
/* Look for a non-GPL Eazel logo version. */
path = nautilus_make_path (DATADIR "/pixmaps/nautilus/eazel-logos", partial_path);
if (g_file_exists (path)) {
return path;
}
g_free (path);
/* Look for a GPL version. */
path = nautilus_make_path (DATADIR "/pixmaps/nautilus", partial_path);
if (g_file_exists (path)) {
return path;
}
g_free (path);
return NULL;
}
char *
nautilus_unique_temporary_file_name (void)
{
const char *prefix = "/tmp/nautilus-temp-file";
char *file_name;
static guint count = 1;
file_name = g_strdup_printf ("%sXXXXXX", prefix);
if (mktemp (file_name) != file_name) {
g_free (file_name);
file_name = g_strdup_printf ("%s-%d-%d", prefix, count++, getpid ());
}
return file_name;
}
char *
nautilus_get_build_time_stamp (void)
{
#ifdef EAZEL_BUILD_TIMESTAMP
return g_strdup (EAZEL_BUILD_TIMESTAMP);
#else
return NULL;
#endif
}
char *
nautilus_get_build_message (void)
{
#ifdef NAUTILUS_BUILD_MESSAGE
return g_strdup (NAUTILUS_BUILD_MESSAGE);
#else
return NULL;
#endif
}
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
void
nautilus_self_check_file_utilities (void)
{
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */

View file

@ -1,81 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-utilities.h - interface for file manipulation routines.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_FILE_UTILITIES_H
#define NAUTILUS_FILE_UTILITIES_H
#include <libgnomevfs/gnome-vfs-types.h>
/* Recognizing special file names. */
gboolean nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_metafile_pattern (const char *name_or_relative_uri);
/* FIXME bugzilla.eazel.com 2424:
* This is the same as gnome-libs g_concat_dir_and_file except
* for handling path == NULL.
*/
char * nautilus_make_path (const char *path,
const char *name);
/* These functions all return something something that needs to be
* freed with g_free, is not NULL, and is guaranteed to exist.
*/
char * nautilus_get_user_directory (void);
char * nautilus_get_user_main_directory (void);
char * nautilus_get_desktop_directory (void);
char * nautilus_get_pixmap_directory (void);
/* See if the user_main_directory exists. This should be called before
* nautilus_get_user_main_directory, which creates the directory.
*/
gboolean nautilus_user_main_directory_exists (void);
/* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
* Otherwise similar to gnome_pixmap_file in that it checks to see if the file
* exists and returns NULL if it doesn't.
*/
/* FIXME bugzilla.eazel.com 2425:
* We might not need this once we get on gnome-libs 2.0 which handles
* gnome_pixmap_file better, using GNOME_PATH.
*/
char * nautilus_pixmap_file (const char *partial_path);
/* Returns the build time stamp the Nautilus binary.
* This is useful to be able to tell builds apart.
* A return value of NULL means unknown time stamp.
*/
char * nautilus_get_build_time_stamp (void);
/* Returns the "build message", which provides some information on build
* context. May return NULL.
*/
char * nautilus_get_build_message (void);
/* Return an allocated file name that is guranteed to be unique. */
char * nautilus_unique_temporary_file_name (void);
char * nautilus_find_file_in_gnome_path (char *file);
GList * nautilus_find_all_files_in_gnome_path (char *file);
#endif /* NAUTILUS_FILE_UTILITIES_H */

File diff suppressed because it is too large Load diff

View file

@ -1,361 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-file.h: Nautilus file model.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_FILE_H
#define NAUTILUS_FILE_H
#include <gtk/gtkobject.h>
#include <libgnomevfs/gnome-vfs-types.h>
/* NautilusFile is an object used to represent a single element of a
* NautilusDirectory. It's lightweight and relies on NautilusDirectory
* to do most of the work.
*/
/* NautilusFile is defined both here and in nautilus-directory.h. */
#ifndef NAUTILUS_FILE_DEFINED
#define NAUTILUS_FILE_DEFINED
typedef struct NautilusFile NautilusFile;
#endif
#define NAUTILUS_TYPE_FILE \
(nautilus_file_get_type ())
#define NAUTILUS_FILE(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_FILE, NautilusFile))
#define NAUTILUS_FILE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_FILE, NautilusFileClass))
#define NAUTILUS_IS_FILE(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_FILE))
#define NAUTILUS_IS_FILE_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_FILE))
typedef enum {
NAUTILUS_FILE_SORT_NONE,
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DIRECTORY,
NAUTILUS_FILE_SORT_BY_SIZE,
NAUTILUS_FILE_SORT_BY_TYPE,
NAUTILUS_FILE_SORT_BY_MTIME,
NAUTILUS_FILE_SORT_BY_EMBLEMS
} NautilusFileSortType;
typedef enum {
NAUTILUS_REQUEST_NOT_STARTED,
NAUTILUS_REQUEST_IN_PROGRESS,
NAUTILUS_REQUEST_DONE
} NautilusRequestStatus;
/* Emblems sometimes displayed for NautilusFiles. Do not localize. */
#define NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK "symbolic-link"
#define NAUTILUS_FILE_EMBLEM_NAME_CANT_READ "noread"
#define NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE "nowrite"
#define NAUTILUS_FILE_EMBLEM_NAME_TRASH "trash"
typedef void (*NautilusFileCallback) (NautilusFile *file,
gpointer callback_data);
typedef void (*NautilusFileOperationCallback) (NautilusFile *file,
GnomeVFSResult result,
gpointer callback_data);
typedef int (*NautilusWidthMeasureCallback) (const char *string,
void *context);
typedef char * (*NautilusTruncateCallback) (const char *string,
int width,
void *context);
/* GtkObject requirements. */
GtkType nautilus_file_get_type (void);
/* Getting at a single file. */
NautilusFile * nautilus_file_get (const char *uri);
/* Covers for gtk_object_ref and gtk_object_unref that provide two conveniences:
* 1) You don't have to cast to GtkObject *, so using these is type safe.
* 2) You are allowed to call these with NULL,
*/
NautilusFile * nautilus_file_ref (NautilusFile *file);
void nautilus_file_unref (NautilusFile *file);
/* Monitor the file. */
void nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
GList *attributes);
void nautilus_file_monitor_remove (NautilusFile *file,
gconstpointer client);
/* Waiting for data that's read asynchronously.
* This interface currently works only for metadata, but could be expanded
* to other attributes as well.
*/
void nautilus_file_call_when_ready (NautilusFile *file,
GList *attributes,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_cancel_call_when_ready (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
gboolean nautilus_file_check_if_ready (NautilusFile *file,
GList *attributes);
void nautilus_file_invalidate_attributes (NautilusFile *file,
GList *attributes);
void nautilus_file_invalidate_all_attributes (NautilusFile *file);
/* Basic attributes for file objects. */
gboolean nautilus_file_contains_text (NautilusFile *file);
char * nautilus_file_get_name (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_uri_scheme (NautilusFile *file);
char * nautilus_file_get_parent_uri (NautilusFile *file);
char * nautilus_file_get_parent_uri_for_display (NautilusFile *file);
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
char * nautilus_file_get_mime_type (NautilusFile *file);
gboolean nautilus_file_is_mime_type (NautilusFile *file,
const char *mime_type);
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
char * nautilus_file_get_symbolic_link_target_path (NautilusFile *file);
gboolean nautilus_file_is_broken_symbolic_link (NautilusFile *file);
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
gboolean nautilus_file_is_gmc_url (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautilus_file_is_in_trash (NautilusFile *file);
gboolean nautilus_file_is_in_desktop (NautilusFile *file);
GnomeVFSResult nautilus_file_get_file_info_result (NautilusFile *file);
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
void nautilus_file_recompute_deep_counts (NautilusFile *file);
NautilusRequestStatus nautilus_file_get_deep_counts (NautilusFile *file,
guint *directory_count,
guint *file_count,
guint *unreadable_directory_count,
GnomeVFSFileSize *total_size);
gboolean nautilus_file_should_show_directory_item_count (NautilusFile *file);
GList * nautilus_file_get_keywords (NautilusFile *file);
void nautilus_file_set_keywords (NautilusFile *file,
GList *keywords);
GList * nautilus_file_get_emblem_names (NautilusFile *file);
char * nautilus_file_get_top_left_text (NautilusFile *file);
gboolean nautilus_file_get_directory_item_mime_types (NautilusFile *file,
GList **mime_list);
/* Permissions. */
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_get_owner (NautilusFile *file);
gboolean nautilus_file_can_set_owner (NautilusFile *file);
gboolean nautilus_file_can_get_group (NautilusFile *file);
gboolean nautilus_file_can_set_group (NautilusFile *file);
char * nautilus_file_get_owner_name (NautilusFile *file);
char * nautilus_file_get_group_name (NautilusFile *file);
GList * nautilus_get_user_names (void);
GList * nautilus_get_group_names (void);
GList * nautilus_file_get_settable_group_names (NautilusFile *file);
/* "Capabilities". */
gboolean nautilus_file_can_read (NautilusFile *file);
gboolean nautilus_file_can_write (NautilusFile *file);
gboolean nautilus_file_can_execute (NautilusFile *file);
gboolean nautilus_file_can_rename (NautilusFile *file);
/* Basic operations for file objects. */
void nautilus_file_set_owner (NautilusFile *file,
const char *user_name_or_id,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_set_group (NautilusFile *file,
const char *group_name_or_id,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions permissions,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_rename (NautilusFile *file,
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_cancel (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
/* Return true if this file has already been deleted.
* This object will be unref'd after sending the files_removed signal,
* but it could hang around longer if someone ref'd it.
*/
gboolean nautilus_file_is_gone (NautilusFile *file);
/* Return true if this file is not confirmed to have ever really
* existed. This is true when the NautilusFile object has been created, but no I/O
* has yet confirmed the existence of a file by that name.
*/
gboolean nautilus_file_is_not_yet_confirmed (NautilusFile *file);
/* Simple getting and setting top-level metadata. */
char * nautilus_file_get_metadata (NautilusFile *file,
const char *key,
const char *default_metadata);
GList * nautilus_file_get_metadata_list (NautilusFile *file,
const char *list_key,
const char *list_subkey);
void nautilus_file_set_metadata (NautilusFile *file,
const char *key,
const char *default_metadata,
const char *metadata);
void nautilus_file_set_metadata_list (NautilusFile *file,
const char *list_key,
const char *list_subkey,
GList *list);
/* Covers for common data types. */
gboolean nautilus_file_get_boolean_metadata (NautilusFile *file,
const char *key,
gboolean default_metadata);
void nautilus_file_set_boolean_metadata (NautilusFile *file,
const char *key,
gboolean default_metadata,
gboolean metadata);
int nautilus_file_get_integer_metadata (NautilusFile *file,
const char *key,
int default_metadata);
void nautilus_file_set_integer_metadata (NautilusFile *file,
const char *key,
int default_metadata,
int metadata);
/* Attributes for file objects as user-displayable strings. */
char * nautilus_file_get_string_attribute (NautilusFile *file,
const char *attribute_name);
char * nautilus_file_get_string_attribute_with_default (NautilusFile *file,
const char *attribute_name);
char * nautilus_file_fit_modified_date_as_string (NautilusFile *file,
int width,
NautilusWidthMeasureCallback measure_callback,
NautilusTruncateCallback truncate_callback,
void *measure_truncate_context);
/* Matching with another URI. */
gboolean nautilus_file_matches_uri (NautilusFile *file,
const char *uri);
/* Is the file local? */
gboolean nautilus_file_is_local (NautilusFile *file);
/* Comparing two file objects for sorting */
int nautilus_file_compare_for_sort (NautilusFile *file_1,
NautilusFile *file_2,
NautilusFileSortType sort_type,
gboolean directories_first,
gboolean reversed);
int nautilus_file_compare_name (NautilusFile *file_1,
const char *pattern);
/* filtering functions for use by various directory views */
gboolean nautilus_file_is_hidden_file (NautilusFile *file);
gboolean nautilus_file_is_backup_file (NautilusFile *file);
gboolean nautilus_file_is_metafile (NautilusFile *file);
gboolean nautilus_file_should_show (NautilusFile *file,
gboolean show_hidden,
gboolean show_backup);
GList *nautilus_file_list_filter_hidden_and_backup (GList *files,
gboolean show_hidden,
gboolean show_backup);
/* Get the URI that's used when activating the file.
* Getting this can require reading the contents of the file.
*/
char * nautilus_file_get_activation_uri (NautilusFile *file);
/* Convenience functions for dealing with a list of NautilusFile objects that each have a ref.
* These are just convenient names for functions that work on lists of GtkObject *.
*/
GList * nautilus_file_list_ref (GList *file_list);
void nautilus_file_list_unref (GList *file_list);
void nautilus_file_list_free (GList *file_list);
GList * nautilus_file_list_copy (GList *file_list);
GList * nautilus_file_list_sort_by_name (GList *file_list);
/* Debugging */
void nautilus_file_dump (NautilusFile *file);
typedef struct NautilusFileDetails NautilusFileDetails;
struct NautilusFile {
GtkObject parent_slot;
NautilusFileDetails *details;
};
/* This is actually a "protected" type, but it must be here so we can
* compile the get_date function pointer declaration below.
*/
typedef enum {
NAUTILUS_DATE_TYPE_MODIFIED,
NAUTILUS_DATE_TYPE_CHANGED,
NAUTILUS_DATE_TYPE_ACCESSED,
NAUTILUS_DATE_TYPE_PERMISSIONS_CHANGED
} NautilusDateType;
typedef struct {
GtkObjectClass parent_slot;
/* Called when the file notices any change. */
void (* changed) (NautilusFile *file);
/* Called periodically while directory deep count is being computed. */
void (* updated_deep_count_in_progress) (NautilusFile *file);
/* Virtual functions (mainly used for trash directory). */
void (* monitor_add) (NautilusFile *file,
gconstpointer client,
GList *attributes);
void (* monitor_remove) (NautilusFile *file,
gconstpointer client);
void (* call_when_ready) (NautilusFile *file,
GList *attributes,
NautilusFileCallback callback,
gpointer callback_data);
void (* cancel_call_when_ready) (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
gboolean (* check_if_ready) (NautilusFile *file,
GList *attributes);
GnomeVFSFileType (* get_file_type) (NautilusFile *file);
gboolean (* get_item_count) (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
NautilusRequestStatus (* get_deep_counts) (NautilusFile *file,
guint *directory_count,
guint *file_count,
guint *unreadable_directory_count,
GnomeVFSFileSize *total_size);
gboolean (* get_date) (NautilusFile *file,
NautilusDateType type,
time_t *date);
char * (* get_where_string) (NautilusFile *file);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */

View file

@ -1,292 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-font-factory.c: Class for obtaining fonts.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#include <config.h>
#include "nautilus-font-factory.h"
#include "nautilus-global-preferences.h"
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <pthread.h>
#include <unistd.h>
#include <libgnome/gnome-i18n.h>
#define NAUTILUS_TYPE_FONT_FACTORY \
(nautilus_font_factory_get_type ())
#define NAUTILUS_FONT_FACTORY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_FONT_FACTORY, NautilusFontFactory))
#define NAUTILUS_FONT_FACTORY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_FONT_FACTORY, NautilusFontFactoryClass))
#define NAUTILUS_IS_FONT_FACTORY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_FONT_FACTORY))
#define NAUTILUS_IS_FONT_FACTORY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_FONT_FACTORY))
/* The font factory */
typedef struct {
GtkObject object;
GHashTable *fonts;
} NautilusFontFactory;
typedef struct {
GtkObjectClass parent_class;
} NautilusFontFactoryClass;
/* FontHashNode */
typedef struct {
char *name;
GdkFont *font;
} FontHashNode;
static NautilusFontFactory *global_font_factory = NULL;
static GtkType nautilus_font_factory_get_type (void);
static void nautilus_font_factory_initialize_class (NautilusFontFactoryClass *class);
static void nautilus_font_factory_initialize (NautilusFontFactory *factory);
static void destroy (GtkObject *object);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusFontFactory,
nautilus_font_factory,
GTK_TYPE_OBJECT)
static void
unref_global_font_factory (void)
{
gtk_object_unref (GTK_OBJECT (global_font_factory));
}
/* Return a pointer to the single global font factory. */
static NautilusFontFactory *
nautilus_get_current_font_factory (void)
{
if (global_font_factory == NULL) {
global_font_factory = NAUTILUS_FONT_FACTORY (gtk_object_new (nautilus_font_factory_get_type (), NULL));
gtk_object_ref (GTK_OBJECT (global_font_factory));
gtk_object_sink (GTK_OBJECT (global_font_factory));
g_atexit (unref_global_font_factory);
}
return global_font_factory;
}
GtkObject *
nautilus_font_factory_get (void)
{
return GTK_OBJECT (nautilus_get_current_font_factory ());
}
static void
nautilus_font_factory_initialize (NautilusFontFactory *factory)
{
factory->fonts = g_hash_table_new (g_str_hash, g_str_equal);
}
static void
nautilus_font_factory_initialize_class (NautilusFontFactoryClass *class)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (class);
object_class->destroy = destroy;
}
static FontHashNode *
font_hash_node_alloc (const char *name)
{
FontHashNode *node;
g_assert (name != NULL);
node = g_new0 (FontHashNode, 1);
node->name = g_strdup (name);
return node;
}
static void
font_hash_node_free (FontHashNode *node)
{
g_assert (node != NULL);
g_free (node->name);
gdk_font_unref (node->font);
g_free (node);
}
static void
free_one_hash_node (gpointer key, gpointer value, gpointer callback_data)
{
FontHashNode *node;
g_assert (key != NULL);
g_assert (value != NULL);
g_assert (callback_data == NULL);
node = value;
g_assert (node->name == key);
font_hash_node_free (node);
}
static void
destroy (GtkObject *object)
{
NautilusFontFactory *factory;
factory = NAUTILUS_FONT_FACTORY (object);
g_hash_table_foreach (factory->fonts, free_one_hash_node, NULL);
g_hash_table_destroy (factory->fonts);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static FontHashNode *
font_hash_node_lookup (const char *name)
{
NautilusFontFactory *factory;
g_assert (name != NULL);
factory = nautilus_get_current_font_factory ();
return (FontHashNode *) g_hash_table_lookup (factory->fonts, name);
}
static FontHashNode *
font_hash_node_lookup_with_insertion (const char *name)
{
NautilusFontFactory *factory;
FontHashNode *node;
GdkFont *font;
g_assert (name != NULL);
factory = nautilus_get_current_font_factory ();
node = font_hash_node_lookup (name);
if (node == NULL) {
font = gdk_fontset_load (name);
if (font != NULL) {
node = font_hash_node_alloc (name);
node->font = font;
g_hash_table_insert (factory->fonts, node->name, node);
}
}
return node;
}
/* Public functions */
GdkFont *
nautilus_font_factory_get_font_by_family (const char *family,
guint size_in_pixels)
{
NautilusFontFactory *factory;
GdkFont *font;
FontHashNode *node;
char *font_name;
char **fontset;
char **iter;
g_return_val_if_fail (family != NULL, NULL);
g_return_val_if_fail (size_in_pixels > 0, NULL);
/* FIXME bugzilla.eazel.com 7907:
* The "GTK System Font" string is hard coded in many places.
*/
if (eel_str_is_equal (family, "GTK System Font")) {
return eel_gtk_get_system_font ();
}
fontset = g_strsplit (family, ",", 5);
iter = fontset;
factory = nautilus_get_current_font_factory ();
while (*iter) {
/* FIXME bugzilla.eazel.com 7347:
* Its a hack that we check for "-" prefixes in font names.
* We do this in order not to break transalted font families.
*/
if (!eel_str_has_prefix (*iter, "-")) {
font_name = eel_gdk_font_xlfd_string_new ("*",
*iter,
"medium",
"r",
"normal",
"*",
size_in_pixels);
} else {
font_name = g_strdup (*iter);
}
g_free (*iter);
*iter = font_name;
iter++;
}
font_name = g_strjoinv (",", fontset);
g_strfreev (fontset);
node = font_hash_node_lookup_with_insertion (font_name);
if (node != NULL) {
g_assert (node->font != NULL);
font = node->font;
gdk_font_ref (font);
} else {
font = eel_gdk_font_get_fixed ();
}
g_free (font_name);
return font;
}
GdkFont *
nautilus_font_factory_get_font_from_preferences (guint size_in_pixels)
{
static gboolean icon_view_font_auto_value_registered;
static const char *icon_view_font_auto_value;
/* Can't initialize this in initialize_class, because no font factory
* instance may yet exist when this is called.
*/
if (!icon_view_font_auto_value_registered) {
nautilus_preferences_add_auto_string (NAUTILUS_PREFERENCES_ICON_VIEW_FONT,
&icon_view_font_auto_value);
icon_view_font_auto_value_registered = TRUE;
}
/* FIXME: We hardwire icon view font here, but some callers probably
* expect default font instead.
*/
return nautilus_font_factory_get_font_by_family (icon_view_font_auto_value, size_in_pixels);
}

View file

@ -1,43 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-font-factory.h: Class for obtaining fonts.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_FONT_FACTORY_H
#define NAUTILUS_FONT_FACTORY_H
#include <gdk/gdk.h>
#include <gtk/gtkobject.h>
/* A There's a single NautilusFontFactory object. */
GtkObject *nautilus_font_factory_get (void);
/* Get a font by familiy. */
GdkFont * nautilus_font_factory_get_font_by_family (const char *family,
guint size_in_pixels);
/* Get a font according to the family set in preferences. */
GdkFont * nautilus_font_factory_get_font_from_preferences (guint size_in_pixels);
#endif /* NAUTILUS_FONT_FACTORY_H */

View file

@ -1,515 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-gconf-extensions.c - Stuff to make GConf easier to use in Nautilus.
Copyright (C) 2000, 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#include <config.h>
#include "nautilus-gconf-extensions.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <gconf/gconf-client.h>
#include <gconf/gconf.h>
#include <libgnome/gnome-i18n.h>
static GConfClient *global_gconf_client = NULL;
static void
global_client_free (void)
{
if (global_gconf_client == NULL) {
return;
}
gtk_object_unref (GTK_OBJECT (global_gconf_client));
global_gconf_client = NULL;
}
/* Public */
GConfClient *
nautilus_gconf_client_get_global (void)
{
/* Initialize gconf if needed */
if (!gconf_is_initialized ()) {
char *argv[] = { "nautilus-preferences", NULL };
GError *error = NULL;
if (!gconf_init (1, argv, &error)) {
if (nautilus_gconf_handle_error (&error)) {
return NULL;
}
}
}
if (global_gconf_client == NULL) {
global_gconf_client = gconf_client_get_default ();
g_atexit (global_client_free);
}
return global_gconf_client;
}
gboolean
nautilus_gconf_handle_error (GError **error)
{
char *message;
static gboolean shown_dialog = FALSE;
g_return_val_if_fail (error != NULL, FALSE);
if (*error != NULL) {
g_warning (_("GConf error:\n %s"), (*error)->message);
if (! shown_dialog) {
shown_dialog = TRUE;
message = g_strdup_printf (_("GConf error:\n %s\n"
"All further errors shown "
"only on terminal"),
(*error)->message);
eel_show_error_dialog (message, _("GConf Error"), NULL);
g_free (message);
}
g_error_free (*error);
*error = NULL;
return TRUE;
}
return FALSE;
}
void
nautilus_gconf_set_boolean (const char *key,
gboolean boolean_value)
{
GConfClient *client;
GError *error = NULL;
g_return_if_fail (key != NULL);
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
gconf_client_set_bool (client, key, boolean_value, &error);
nautilus_gconf_handle_error (&error);
}
gboolean
nautilus_gconf_get_boolean (const char *key)
{
gboolean result;
GConfClient *client;
GError *error = NULL;
g_return_val_if_fail (key != NULL, FALSE);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, FALSE);
result = gconf_client_get_bool (client, key, &error);
if (nautilus_gconf_handle_error (&error)) {
result = FALSE;
}
return result;
}
void
nautilus_gconf_set_integer (const char *key,
int int_value)
{
GConfClient *client;
GError *error = NULL;
g_return_if_fail (key != NULL);
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
gconf_client_set_int (client, key, int_value, &error);
nautilus_gconf_handle_error (&error);
}
int
nautilus_gconf_get_integer (const char *key)
{
int result;
GConfClient *client;
GError *error = NULL;
g_return_val_if_fail (key != NULL, 0);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, 0);
result = gconf_client_get_int (client, key, &error);
if (nautilus_gconf_handle_error (&error)) {
result = 0;
}
return result;
}
void
nautilus_gconf_set_string (const char *key,
const char *string_value)
{
GConfClient *client;
GError *error = NULL;
g_return_if_fail (key != NULL);
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
gconf_client_set_string (client, key, string_value, &error);
nautilus_gconf_handle_error (&error);
}
char *
nautilus_gconf_get_string (const char *key)
{
char *result;
GConfClient *client;
GError *error = NULL;
g_return_val_if_fail (key != NULL, NULL);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, NULL);
result = gconf_client_get_string (client, key, &error);
if (nautilus_gconf_handle_error (&error)) {
result = g_strdup ("");
}
return result;
}
void
nautilus_gconf_set_string_list (const char *key,
const GSList *slist)
{
GConfClient *client;
GError *error;
g_return_if_fail (key != NULL);
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
error = NULL;
gconf_client_set_list (client, key, GCONF_VALUE_STRING,
/* Need cast cause of GConf api bug */
(GSList *) slist,
&error);
nautilus_gconf_handle_error (&error);
}
GSList *
nautilus_gconf_get_string_list (const char *key)
{
GSList *slist;
GConfClient *client;
GError *error;
g_return_val_if_fail (key != NULL, NULL);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, NULL);
error = NULL;
slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error);
if (nautilus_gconf_handle_error (&error)) {
slist = NULL;
}
return slist;
}
gboolean
nautilus_gconf_is_default (const char *key)
{
gboolean result;
GConfValue *value;
GError *error = NULL;
g_return_val_if_fail (key != NULL, FALSE);
value = gconf_client_get_without_default (nautilus_gconf_client_get_global (), key, &error);
if (nautilus_gconf_handle_error (&error)) {
if (value != NULL) {
gconf_value_free (value);
}
return FALSE;
}
result = (value == NULL);
if (value != NULL) {
gconf_value_free (value);
}
return result;
}
gboolean
nautilus_gconf_monitor_add (const char *directory)
{
GError *error = NULL;
GConfClient *client;
g_return_val_if_fail (directory != NULL, FALSE);
client = gconf_client_get_default ();
g_return_val_if_fail (client != NULL, FALSE);
gconf_client_add_dir (client,
directory,
GCONF_CLIENT_PRELOAD_NONE,
&error);
if (nautilus_gconf_handle_error (&error)) {
return FALSE;
}
return TRUE;
}
gboolean
nautilus_gconf_monitor_remove (const char *directory)
{
GError *error = NULL;
GConfClient *client;
if (directory == NULL) {
return FALSE;
}
client = gconf_client_get_default ();
g_return_val_if_fail (client != NULL, FALSE);
gconf_client_remove_dir (client,
directory,
&error);
if (nautilus_gconf_handle_error (&error)) {
return FALSE;
}
return TRUE;
}
void
nautilus_gconf_suggest_sync (void)
{
GConfClient *client;
GError *error = NULL;
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
gconf_client_suggest_sync (client, &error);
nautilus_gconf_handle_error (&error);
}
GConfValue*
nautilus_gconf_get_value (const char *key)
{
GConfValue *value = NULL;
GConfClient *client;
GError *error = NULL;
g_return_val_if_fail (key != NULL, NULL);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, NULL);
value = gconf_client_get (client, key, &error);
if (nautilus_gconf_handle_error (&error)) {
if (value != NULL) {
gconf_value_free (value);
value = NULL;
}
}
return value;
}
static gboolean
simple_value_is_equal (const GConfValue *a,
const GConfValue *b)
{
g_return_val_if_fail (a != NULL, FALSE);
g_return_val_if_fail (b != NULL, FALSE);
switch (a->type) {
case GCONF_VALUE_STRING:
return eel_str_is_equal (a->d.string_data, b->d.string_data);
break;
case GCONF_VALUE_INT:
return a->d.int_data == b->d.int_data;
break;
case GCONF_VALUE_FLOAT:
return a->d.float_data == b->d.float_data;
break;
case GCONF_VALUE_BOOL:
return a->d.bool_data == b->d.bool_data;
break;
default:
g_assert_not_reached ();
}
return FALSE;
}
gboolean
nautilus_gconf_value_is_equal (const GConfValue *a,
const GConfValue *b)
{
GSList *node_a;
GSList *node_b;
if (a == NULL && b == NULL) {
return TRUE;
}
if (a == NULL || b == NULL) {
return FALSE;
}
if (a->type != b->type) {
return FALSE;
}
switch (a->type) {
case GCONF_VALUE_STRING:
case GCONF_VALUE_INT:
case GCONF_VALUE_FLOAT:
case GCONF_VALUE_BOOL:
return simple_value_is_equal (a, b);
break;
case GCONF_VALUE_LIST:
if (a->d.list_data.type != b->d.list_data.type) {
return FALSE;
}
if (a->d.list_data.list == NULL && b->d.list_data.list == NULL) {
return TRUE;
}
if (a->d.list_data.list != NULL || b->d.list_data.list != NULL) {
return FALSE;
}
if (g_slist_length (a->d.list_data.list) != g_slist_length (b->d.list_data.list)) {
return FALSE;
}
for (node_a = a->d.list_data.list,node_b = b->d.list_data.list;
node_a != NULL && node_b != NULL;
node_a = node_a->next, node_b = node_b->next) {
g_assert (node_a->data != NULL);
g_assert (node_b->data != NULL);
if (!simple_value_is_equal (node_a->data, node_b->data)) {
return FALSE;
}
}
return TRUE;
default:
/* FIXME: pair ? */
g_assert (0);
}
g_assert_not_reached ();
return FALSE;
}
void
nautilus_gconf_value_free (GConfValue *value)
{
if (value == NULL) {
return;
}
gconf_value_free (value);
}
guint
nautilus_gconf_notification_add (const char *key,
GConfClientNotifyFunc notification_callback,
gpointer callback_data)
{
guint notification_id;
GConfClient *client;
GError *error = NULL;
g_return_val_if_fail (key != NULL, NAUTILUS_GCONF_UNDEFINED_CONNECTION);
g_return_val_if_fail (notification_callback != NULL, NAUTILUS_GCONF_UNDEFINED_CONNECTION);
client = nautilus_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, NAUTILUS_GCONF_UNDEFINED_CONNECTION);
notification_id = gconf_client_notify_add (client,
key,
notification_callback,
callback_data,
NULL,
&error);
if (nautilus_gconf_handle_error (&error)) {
if (notification_id != NAUTILUS_GCONF_UNDEFINED_CONNECTION) {
gconf_client_notify_remove (client, notification_id);
notification_id = NAUTILUS_GCONF_UNDEFINED_CONNECTION;
}
}
return notification_id;
}
void
nautilus_gconf_notification_remove (guint notification_id)
{
GConfClient *client;
if (notification_id == NAUTILUS_GCONF_UNDEFINED_CONNECTION) {
return;
}
client = nautilus_gconf_client_get_global ();
g_return_if_fail (client != NULL);
gconf_client_notify_remove (client, notification_id);
}

View file

@ -1,65 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-gconf-extensions.h - Stuff to make GConf easier to use in Nautilus.
Copyright (C) 2000, 2001 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_GCONF_EXTENSIONS_H
#define NAUTILUS_GCONF_EXTENSIONS_H
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
#include <libgnome/gnome-defs.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_GCONF_UNDEFINED_CONNECTION 0
GConfClient *nautilus_gconf_client_get_global (void);
gboolean nautilus_gconf_handle_error (GError **error);
void nautilus_gconf_set_boolean (const char *key,
gboolean boolean_value);
gboolean nautilus_gconf_get_boolean (const char *key);
int nautilus_gconf_get_integer (const char *key);
void nautilus_gconf_set_integer (const char *key,
int int_value);
char * nautilus_gconf_get_string (const char *key);
void nautilus_gconf_set_string (const char *key,
const char *string_value);
GSList * nautilus_gconf_get_string_list (const char *key);
void nautilus_gconf_set_string_list (const char *key,
const GSList *string_list_value);
gboolean nautilus_gconf_is_default (const char *key);
gboolean nautilus_gconf_monitor_add (const char *directory);
gboolean nautilus_gconf_monitor_remove (const char *directory);
void nautilus_gconf_suggest_sync (void);
GConfValue* nautilus_gconf_get_value (const char *key);
gboolean nautilus_gconf_value_is_equal (const GConfValue *a,
const GConfValue *b);
void nautilus_gconf_value_free (GConfValue *value);
guint nautilus_gconf_notification_add (const char *key,
GConfClientNotifyFunc notification_callback,
gpointer callback_data);
void nautilus_gconf_notification_remove (guint notification_id);
END_GNOME_DECLS
#endif /* NAUTILUS_GCONF_EXTENSIONS_H */

View file

@ -1,87 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-generous-bin.c: Subclass of GtkVBox that clips off
items that don't fit, except the last one.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>,
*/
#include <config.h>
#include "nautilus-generous-bin.h"
#include <eel/eel-gtk-macros.h>
static void nautilus_generous_bin_initialize_class (NautilusGenerousBinClass *class);
static void nautilus_generous_bin_initialize (NautilusGenerousBin *box);
static void nautilus_generous_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void nautilus_generous_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusGenerousBin, nautilus_generous_bin, GTK_TYPE_BIN)
static void
nautilus_generous_bin_initialize_class (NautilusGenerousBinClass *klass)
{
GTK_WIDGET_CLASS (klass)->size_request = nautilus_generous_bin_size_request;
GTK_WIDGET_CLASS (klass)->size_allocate = nautilus_generous_bin_size_allocate;
}
static void
nautilus_generous_bin_initialize (NautilusGenerousBin *bin)
{
}
static void
nautilus_generous_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkBin *bin;
GtkRequisition child_requisition;
bin = GTK_BIN (widget);
requisition->width = 0;
requisition->height = 0;
if (bin->child != NULL && GTK_WIDGET_VISIBLE (bin->child)) {
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
static void
nautilus_generous_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkBin *bin;
GtkAllocation child_allocation;
bin = GTK_BIN (widget);
widget->allocation = *allocation;
if (bin->child != NULL && GTK_WIDGET_VISIBLE (bin->child)) {
child_allocation = *allocation;
gtk_widget_size_allocate (bin->child, &child_allocation);
}
}

View file

@ -1,50 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-generous-bin.h: Subclass of GtkBin that gives all of its
allocation to its child.
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_GENEROUS_BIN_H
#define NAUTILUS_GENEROUS_BIN_H
#include <gtk/gtkbin.h>
#define NAUTILUS_TYPE_GENEROUS_BIN (nautilus_generous_bin_get_type ())
#define NAUTILUS_GENEROUS_BIN(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_GENEROUS_BIN, NautilusGenerousBin))
#define NAUTILUS_GENEROUS_BIN_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_GENEROUS_BIN, NautilusGenerousBinClass))
#define NAUTILUS_IS_GENEROUS_BIN(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_GENEROUS_BIN))
#define NAUTILUS_IS_GENEROUS_BIN_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_GENEROUS_BIN))
typedef struct NautilusGenerousBin NautilusGenerousBin;
typedef struct NautilusGenerousBinClass NautilusGenerousBinClass;
struct NautilusGenerousBin {
GtkBin parent_slot;
};
struct NautilusGenerousBinClass {
GtkBinClass parent_slot;
};
GtkType nautilus_generous_bin_get_type (void);
#endif /* NAUTILUS_GENEROUS_BIN_H */

File diff suppressed because it is too large Load diff

View file

@ -1,204 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-global-prefs.h - Nautilus main preferences api.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program 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 program 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 program; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_PREFS_GLOBAL_H
#define NAUTILUS_PREFS_GLOBAL_H
#include <libnautilus-extensions/nautilus-preferences.h>
BEGIN_GNOME_DECLS
/* Which theme is active */
#define NAUTILUS_PREFERENCES_THEME "preferences/theme"
/* How wide the sidebar is (or how wide it will be when expanded) */
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "preferences/sidebar_width"
/* Text fields */
#define NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS "preferences/use_emacs_shortcuts"
/* Window options */
#define NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW "preferences/window_always_new"
/* Trash options */
#define NAUTILUS_PREFERENCES_CONFIRM_TRASH "preferences/confirm_trash"
#define NAUTILUS_PREFERENCES_ENABLE_DELETE "preferences/enable_delete"
/* Desktop options */
#define NAUTILUS_PREFERENCES_SHOW_DESKTOP "preferences/show_desktop"
#define NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR "preferences/desktop_is_home_dir"
/* Display */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "preferences/show_hidden_files"
#define NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES "preferences/show_backup_files"
#define NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS "preferences/show_special_flags"
/* Sidebar panels */
#define NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES "sidebar-panels/tree/show_only_directories"
/* Navigation */
#define NAUTILUS_PREFERENCES_HOME_URI "preferences/home_uri"
#define NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS "preferences/hide_built_in_bookmarks"
/* Proxy */
#define NAUTILUS_PREFERENCES_HTTP_USE_PROXY "/system/gnome-vfs/use-http-proxy"
#define NAUTILUS_PREFERENCES_HTTP_PROXY_HOST "/system/gnome-vfs/http-proxy-host"
#define NAUTILUS_PREFERENCES_HTTP_PROXY_PORT "/system/gnome-vfs/http-proxy-port"
/* HTTP Proxy Authentication */
#define NAUTILUS_PREFERENCES_HTTP_PROXY_USE_AUTH "/system/gnome-vfs/use-http-proxy-authorization"
#define NAUTILUS_PREFERENCES_HTTP_PROXY_AUTH_USERNAME "/system/gnome-vfs/http-proxy-authorization-user"
#define NAUTILUS_PREFERENCES_HTTP_USE_AUTH_PASSWORD "/system/gnome-vfs/http-proxy-authorization-password"
/* adding/removing from property browser */
#define NAUTILUS_PREFERENCES_CAN_ADD_CONTENT "preferences/can_add_content"
/* Content fonts */
#define NAUTILUS_PREFERENCES_DEFAULT_FONT "preferences/default_font"
#define NAUTILUS_PREFERENCES_DEFAULT_SMOOTH_FONT "preferences/default_smooth_font"
#define NAUTILUS_PREFERENCES_DEFAULT_FONT_SIZE "preferences/default_font_size"
/* Single/Double click preference */
#define NAUTILUS_PREFERENCES_CLICK_POLICY "preferences/click_policy"
/* Activating executable text files */
#define NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION "preferences/executable_text_activation"
/* Smooth graphics mode (smoother but slower) */
#define NAUTILUS_PREFERENCES_SMOOTH_GRAPHICS_MODE "preferences/smooth_graphics_mode"
/* Which views should be displayed for new windows */
#define NAUTILUS_PREFERENCES_START_WITH_TOOLBAR "preferences/start_with_toolbar"
#define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR "preferences/start_with_location_bar"
#define NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR "preferences/start_with_status_bar"
#define NAUTILUS_PREFERENCES_START_WITH_SIDEBAR "preferences/start_with_sidebar"
/* Sorting order */
#define NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST "preferences/sort_directories_first"
/* The default folder viewer - one of the two enums below */
#define NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER "preferences/default_folder_viewer"
enum
{
NAUTILUS_DEFAULT_FOLDER_VIEWER_ICON_VIEW,
NAUTILUS_DEFAULT_FOLDER_VIEWER_LIST_VIEW,
NAUTILUS_DEFAULT_FOLDER_VIEWER_OTHER
};
/* These IIDs are used by the preferences code and in nautilus-application.c */
#define NAUTILUS_ICON_VIEW_IID "OAFIID:nautilus_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058"
#define NAUTILUS_LIST_VIEW_IID "OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c"
/* Icon View */
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER "icon-view/default_sort_in_reverse_order"
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER "icon-view/default_sort_order"
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT "icon-view/default_use_tighter_layout"
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL "icon-view/default_zoom_level"
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE "icon-view/default_zoom_level_font_size"
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT "icon-view/default_use_manual_layout"
#define NAUTILUS_PREFERENCES_ICON_VIEW_FONT "icon-view/font"
#define NAUTILUS_PREFERENCES_ICON_VIEW_SMOOTH_FONT "icon-view/smooth_font"
/* The icon view uses 2 variables to store the sort order and
* whether to use manual layout. However, the UI for these
* preferences presensts them as single option menu. So we
* use the following preference as a proxy for the other two.
* In nautilus-global-preferences.c we install callbacks for
* the proxy preference and update the other 2 when it changes
*/
#define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT "icon-view/default_sort_order_or_manual_layout"
/* Which text attributes appear beneath icon names */
#define NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS "icon-view/captions"
/* List View */
#define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER "list-view/default_sort_in_reverse_order"
#define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER "list-view/default_sort_order"
#define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL "list-view/default_zoom_level"
#define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE "list-view/default_zoom_level_font_size"
#define NAUTILUS_PREFERENCES_LIST_VIEW_FONT "list-view/font"
/* News panel */
#define NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS "news/max_items"
#define NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL "news/update_interval"
/* File Indexing */
#define NAUTILUS_PREFERENCES_SEARCH_BAR_TYPE "preferences/search_bar_type"
/* searching */
#define NAUTILUS_PREFERENCES_SEARCH_WEB_URI "preferences/search_web_uri"
enum
{
NAUTILUS_CLICK_POLICY_SINGLE,
NAUTILUS_CLICK_POLICY_DOUBLE
};
enum
{
NAUTILUS_EXECUTABLE_TEXT_LAUNCH,
NAUTILUS_EXECUTABLE_TEXT_DISPLAY,
NAUTILUS_EXECUTABLE_TEXT_ASK
};
typedef enum
{
NAUTILUS_SPEED_TRADEOFF_ALWAYS,
NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY,
NAUTILUS_SPEED_TRADEOFF_NEVER
} NautilusSpeedTradeoffValue;
#define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS "preferences/show_icon_text"
#define NAUTILUS_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS "preferences/show_directory_item_counts"
#define NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS "preferences/show_image_thumbnails"
#define NAUTILUS_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT "preferences/thumbnail_limit"
#define NAUTILUS_PREFERENCES_USE_PUBLIC_METADATA "preferences/use_public_metadata"
#define NAUTILUS_PREFERENCES_PREVIEW_SOUND "preferences/preview_sound"
typedef enum
{
NAUTILUS_COMPLEX_SEARCH_BAR,
NAUTILUS_SIMPLE_SEARCH_BAR
} NautilusSearchBarMode;
/* Gnome session management */
#define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session"
void nautilus_global_preferences_initialize (void);
/* Sidebar */
struct EelScalableFont *nautilus_global_preferences_get_icon_view_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_bold_font (void);
void nautilus_global_preferences_set_default_folder_viewer (const char *iid);
END_GNOME_DECLS
#endif /* NAUTILUS_PREFS_GLOBAL_H */

View file

@ -1,447 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-horizontal-splitter.c - A horizontal splitter with a semi gradient look
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#include <config.h>
#include "nautilus-horizontal-splitter.h"
#include <eel/eel-gtk-macros.h>
#include <stdlib.h>
struct NautilusHorizontalSplitterDetails {
gboolean down;
double down_position;
guint32 down_time;
int saved_size;
};
/* Bar width currently hardcoded to 7 */
#define BAR_WIDTH 7
#define CLOSED_THRESHOLD 4
#define NOMINAL_SIZE 148
#define SPLITTER_CLICK_SLOP 1
#define SPLITTER_CLICK_TIMEOUT 400
/* NautilusHorizontalSplitterClass methods */
static void nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class);
static void nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter);
static gboolean nautilus_horizontal_splitter_button_press (GtkWidget *widget,
GdkEventButton *event);
static gboolean nautilus_horizontal_splitter_button_release (GtkWidget *widget,
GdkEventButton *event);
static gboolean nautilus_horizontal_splitter_motion (GtkWidget *widget,
GdkEventMotion *event);
/* GtkObjectClass methods */
static void nautilus_horizontal_splitter_destroy (GtkObject *object);
/* GtkWidgetClass methods */
static void nautilus_horizontal_splitter_draw (GtkWidget *widget,
GdkRectangle *area);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusHorizontalSplitter,
nautilus_horizontal_splitter,
E_TYPE_HPANED)
/* GtkObjectClass methods */
static void
nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
object_class = GTK_OBJECT_CLASS (horizontal_splitter_class);
widget_class = GTK_WIDGET_CLASS (horizontal_splitter_class);
/* GtkObjectClass */
object_class->destroy = nautilus_horizontal_splitter_destroy;
/* GtkWidgetClass */
widget_class->draw = nautilus_horizontal_splitter_draw;
widget_class->button_press_event = nautilus_horizontal_splitter_button_press;
widget_class->button_release_event = nautilus_horizontal_splitter_button_release;
widget_class->motion_notify_event = nautilus_horizontal_splitter_motion;
}
static void
nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter)
{
horizontal_splitter->details = g_new0 (NautilusHorizontalSplitterDetails, 1);
e_paned_set_handle_size (E_PANED (horizontal_splitter), BAR_WIDTH);
}
/* GtkObjectClass methods */
static void
nautilus_horizontal_splitter_destroy (GtkObject *object)
{
NautilusHorizontalSplitter *horizontal_splitter;
horizontal_splitter = NAUTILUS_HORIZONTAL_SPLITTER (object);
g_free (horizontal_splitter->details);
/* Chain */
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
draw_resize_bar (GtkWidget *widget,
GdkWindow *window,
const GdkRectangle *area)
{
GtkStyle *style;
GdkGC *gcs[BAR_WIDTH];
guint i;
g_assert (widget != NULL);
g_assert (window != NULL);
g_assert (area != NULL);
g_assert (area->width == BAR_WIDTH);
style = widget->style;
g_assert (style != NULL);
gcs[0] = style->fg_gc[GTK_STATE_NORMAL];
gcs[1] = style->fg_gc[GTK_STATE_SELECTED];
gcs[2] = style->light_gc[GTK_STATE_ACTIVE];
gcs[3] = style->bg_gc[GTK_STATE_NORMAL];
gcs[4] = style->mid_gc[GTK_STATE_ACTIVE];
gcs[5] = style->dark_gc[GTK_STATE_NORMAL];
gcs[6] = style->fg_gc[GTK_STATE_NORMAL];
for (i = 0; i < BAR_WIDTH; i++)
{
gdk_draw_line (window,
gcs[i],
area->x + i,
area->y,
area->x + i,
area->y + area->height - 1);
}
}
/* Number of ridges in the thumb currently hardcoded to 8 */
#define NUM_RIDGES 8
/* These control the layout of the ridges */
#define RIDGE_HEIGHT 2
#define RIDGE_EDGE_OFFSET 2
#define BETWEEN_RIDGE_OFFSET 1
static void
draw_resize_bar_thumb (GtkWidget *widget,
GdkWindow *window,
const GdkRectangle *area)
{
EPaned *paned;
GtkStyle *style;
GdkGC *light_gc;
GdkGC *dark_gc;
guint total_thumb_height;
g_assert (widget != NULL);
g_assert (window != NULL);
g_assert (area != NULL);
g_assert (area->width == BAR_WIDTH);
style = widget->style;
g_assert (style != NULL);
paned = E_PANED (widget);
light_gc = style->light_gc[GTK_STATE_ACTIVE];
dark_gc = style->dark_gc[GTK_STATE_NORMAL];
total_thumb_height = (NUM_RIDGES * RIDGE_HEIGHT) + ((NUM_RIDGES - 1) * BETWEEN_RIDGE_OFFSET);
/* Make sure the thumb aint bigger than the handle */
if (total_thumb_height > paned->handle_height)
{
total_thumb_height = paned->handle_height;
}
/* Draw the thumb only if we have enough space for at least one ridge */
if (total_thumb_height > RIDGE_HEIGHT)
{
gint y = paned->handle_ypos + (paned->handle_height - total_thumb_height) / 2;
guint i;
for (i = 0; i < NUM_RIDGES; i++)
{
gint x1 = area->x + RIDGE_EDGE_OFFSET;
gint x2 = area->x + BAR_WIDTH - RIDGE_EDGE_OFFSET;
gdk_draw_line (window,
dark_gc,
x1,
y,
x2,
y);
y += BETWEEN_RIDGE_OFFSET;
gdk_draw_line (window,
light_gc,
x1,
y,
x2,
y);
y += RIDGE_HEIGHT;
}
}
}
/* GtkWidgetClass methods */
static void
nautilus_horizontal_splitter_draw (GtkWidget *widget,
GdkRectangle *area)
{
EPaned *paned;
GdkRectangle handle_area, child_area;
guint16 border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (E_IS_PANED (widget));
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) {
paned = E_PANED (widget);
border_width = GTK_CONTAINER (paned)->border_width;
gdk_window_clear_area (widget->window,
area->x, area->y, area->width,
area->height);
if (e_paned_handle_shown(paned)) {
handle_area.x = paned->handle_xpos;
handle_area.y = paned->handle_ypos;
handle_area.width = paned->handle_size;
handle_area.height = paned->handle_height;
if (gdk_rectangle_intersect (&handle_area, area, &child_area)) {
child_area.x -= paned->handle_xpos;
child_area.y -= paned->handle_ypos;
/* Simply things by always drawing the full width of the bar. */
child_area.x = 0;
child_area.width = BAR_WIDTH;
draw_resize_bar (widget, paned->handle, &child_area);
draw_resize_bar_thumb (widget, paned->handle, &child_area);
}
}
/* Redraw the children
*/
if (paned->child1 && gtk_widget_intersect (paned->child1, area, &child_area)) {
gtk_widget_draw (paned->child1, &child_area);
}
if (paned->child2 && gtk_widget_intersect (paned->child2, area, &child_area)) {
gtk_widget_draw (paned->child2, &child_area);
}
}
}
void
nautilus_horizontal_splitter_expand (NautilusHorizontalSplitter *splitter)
{
int position;
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
position = e_paned_get_position (E_PANED (splitter));
if (position >= CLOSED_THRESHOLD) {
return;
}
position = splitter->details->saved_size;
if (position < CLOSED_THRESHOLD) {
position = NOMINAL_SIZE;
}
e_paned_set_position (E_PANED (splitter), position);
}
void
nautilus_horizontal_splitter_collapse (NautilusHorizontalSplitter *splitter)
{
int position;
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
position = e_paned_get_position (E_PANED (splitter));
if (position < CLOSED_THRESHOLD) {
return;
}
splitter->details->saved_size = position;
e_paned_set_position (E_PANED (splitter), 0);
}
/* routine to toggle the open/closed state of the splitter */
void
nautilus_horizontal_splitter_toggle_position (NautilusHorizontalSplitter *splitter)
{
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
if (e_paned_get_position (E_PANED (splitter)) >= CLOSED_THRESHOLD) {
nautilus_horizontal_splitter_collapse (splitter);
} else {
nautilus_horizontal_splitter_expand (splitter);
}
}
/* NautilusHorizontalSplitter public methods */
GtkWidget *
nautilus_horizontal_splitter_new (void)
{
return gtk_widget_new (nautilus_horizontal_splitter_get_type (), NULL);
}
/* handle mouse downs by remembering the position and the time */
static gboolean
nautilus_horizontal_splitter_button_press (GtkWidget *widget, GdkEventButton *event)
{
NautilusHorizontalSplitter *splitter;
splitter = NAUTILUS_HORIZONTAL_SPLITTER (widget);
if (event->window != E_PANED (widget)->handle) {
splitter->details->down = FALSE;
} else {
splitter->details->down = TRUE;
splitter->details->down_position = event->x;
splitter->details->down_time = event->time;
}
return EEL_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, button_press_event, (widget, event));
}
static void
splitter_xor_line (EPaned *paned)
{
GtkWidget *widget;
GdkGCValues values;
guint16 xpos, half_width;
gint8 dash_list[2];
widget = GTK_WIDGET(paned);
if (!paned->xor_gc) {
values.function = GDK_INVERT;
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
paned->xor_gc = gdk_gc_new_with_values (widget->window, &values,
GDK_GC_FUNCTION | GDK_GC_SUBWINDOW);
}
gdk_gc_set_line_attributes (paned->xor_gc, 1, GDK_LINE_ON_OFF_DASH,
GDK_CAP_NOT_LAST, GDK_JOIN_BEVEL);
/* Make line appear as every other pixel dash */
dash_list[0] = 1;
dash_list[1] = 1;
gdk_gc_set_dashes (paned->xor_gc, 1, dash_list, 2);
xpos = paned->child1_size + GTK_CONTAINER (paned)->border_width + paned->handle_size / 2;
half_width = paned->handle_size / 2;
gdk_draw_line (widget->window, paned->xor_gc, xpos - half_width, 0, xpos - half_width,
widget->allocation.height - 1);
gdk_draw_line (widget->window, paned->xor_gc, xpos + half_width, 0, xpos + half_width,
widget->allocation.height - 1);
}
/* handle mouse ups by seeing if it was a tap and toggling the open state accordingly */
static gboolean
nautilus_horizontal_splitter_button_release (GtkWidget *widget, GdkEventButton *event)
{
NautilusHorizontalSplitter *splitter;
int delta, delta_time;
EPaned *paned;
splitter = NAUTILUS_HORIZONTAL_SPLITTER (widget);
if (event->window == E_PANED (widget)->handle
&& splitter->details->down) {
delta = abs (event->x - splitter->details->down_position);
delta_time = abs (splitter->details->down_time - event->time);
if (delta < SPLITTER_CLICK_SLOP && delta_time < SPLITTER_CLICK_TIMEOUT) {
nautilus_horizontal_splitter_toggle_position (splitter);
}
}
splitter->details->down = FALSE;
paned = E_PANED (widget);
if (paned->in_drag && (event->button == 1)) {
splitter_xor_line (paned);
paned->in_drag = FALSE;
paned->position_set = TRUE;
gdk_pointer_ungrab (event->time);
gtk_widget_queue_resize (GTK_WIDGET (paned));
return TRUE;
}
return FALSE;
}
static gboolean
nautilus_horizontal_splitter_motion (GtkWidget *widget, GdkEventMotion *event)
{
EPaned *paned;
gint x;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (E_IS_PANED (widget), FALSE);
paned = E_PANED (widget);
if (event->is_hint || event->window != widget->window) {
gtk_widget_get_pointer(widget, &x, NULL);
} else {
x = event->x;
}
if (paned->in_drag) {
gint size = x - GTK_CONTAINER (paned)->border_width - paned->handle_size / 2;
splitter_xor_line (paned);
paned->child1_size = CLAMP (e_paned_quantized_size (paned, size), paned->min_position, paned->max_position);
splitter_xor_line (paned);
}
return TRUE;
}

View file

@ -1,60 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-horizontal-splitter.h - A horizontal splitter with a semi gradient look
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_HORIZONTAL_SPLITTER_H
#define NAUTILUS_HORIZONTAL_SPLITTER_H
#include <libgnome/gnome-defs.h>
#include <widgets/e-paned/e-hpaned.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_HORIZONTAL_SPLITTER (nautilus_horizontal_splitter_get_type ())
#define NAUTILUS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitter))
#define NAUTILUS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitterClass))
#define NAUTILUS_IS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER))
#define NAUTILUS_IS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER))
typedef struct NautilusHorizontalSplitterDetails NautilusHorizontalSplitterDetails;
typedef struct {
EHPaned parent_slot;
NautilusHorizontalSplitterDetails *details;
} NautilusHorizontalSplitter;
typedef struct {
EHPanedClass parent_slot;
} NautilusHorizontalSplitterClass;
/* NautilusHorizontalSplitter public methods */
GtkType nautilus_horizontal_splitter_get_type (void);
GtkWidget *nautilus_horizontal_splitter_new (void);
void nautilus_horizontal_splitter_collapse (NautilusHorizontalSplitter *splitter);
void nautilus_horizontal_splitter_expand (NautilusHorizontalSplitter *splitter);
void nautilus_horizontal_splitter_toggle_position (NautilusHorizontalSplitter *splitter);
END_GNOME_DECLS
#endif /* NAUTILUS_HORIZONTAL_SPLITTER_H */

File diff suppressed because it is too large Load diff

View file

@ -1,98 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* Nautilus - Icon canvas item class for icon container.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: Andy Hertzfeld <andy@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef NAUTILUS_ICON_CANVAS_ITEM_H
#define NAUTILUS_ICON_CANVAS_ITEM_H
#include <libgnome/gnome-defs.h>
#include <libgnomeui/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_ICON_CANVAS_ITEM \
(nautilus_icon_canvas_item_get_type ())
#define NAUTILUS_ICON_CANVAS_ITEM(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ICON_CANVAS_ITEM, NautilusIconCanvasItem))
#define NAUTILUS_ICON_CANVAS_ITEM_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ICON_CANVAS_ITEM, NautilusIconCanvasItemClass))
#define NAUTILUS_IS_ICON_CANVAS_ITEM(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ICON_CANVAS_ITEM))
#define NAUTILUS_IS_ICON_CANVAS_ITEM_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ICON_CANVAS_ITEM))
typedef struct NautilusIconCanvasItem NautilusIconCanvasItem;
typedef struct NautilusIconCanvasItemClass NautilusIconCanvasItemClass;
typedef struct NautilusIconCanvasItemDetails NautilusIconCanvasItemDetails;
struct NautilusIconCanvasItem {
GnomeCanvasItem item;
NautilusIconCanvasItemDetails *details;
gpointer user_data;
};
struct NautilusIconCanvasItemClass {
GnomeCanvasItemClass parent_class;
void (* bounds_changed) (NautilusIconCanvasItem *item,
const ArtDRect *old_world_bounds);
};
/* GtkObject */
GtkType nautilus_icon_canvas_item_get_type (void);
/* attributes */
void nautilus_icon_canvas_item_set_image (NautilusIconCanvasItem *item,
GdkPixbuf *image);
GdkPixbuf * nautilus_icon_canvas_item_get_image (NautilusIconCanvasItem *item);
void nautilus_icon_canvas_item_set_emblems (NautilusIconCanvasItem *item,
GList *emblem_pixbufs);
void nautilus_icon_canvas_item_set_show_stretch_handles (NautilusIconCanvasItem *item,
gboolean show_stretch_handles);
void nautilus_icon_canvas_item_set_attach_points (NautilusIconCanvasItem *item,
NautilusEmblemAttachPoints *attach_points);
double nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item);
const char *nautilus_icon_canvas_item_get_editable_text (NautilusIconCanvasItem *icon_item);
void nautilus_icon_canvas_item_set_renaming (NautilusIconCanvasItem *icon_item,
gboolean state);
/* geometry and hit testing */
gboolean nautilus_icon_canvas_item_hit_test_rectangle (NautilusIconCanvasItem *item,
ArtIRect canvas_rect);
gboolean nautilus_icon_canvas_item_hit_test_stretch_handles (NautilusIconCanvasItem *item,
ArtPoint world_point);
void nautilus_icon_canvas_item_invalidate_label_size (NautilusIconCanvasItem *item);
ArtDRect nautilus_icon_canvas_item_get_icon_rectangle (const NautilusIconCanvasItem *item);
void nautilus_icon_canvas_item_update_bounds (NautilusIconCanvasItem *item);
void nautilus_icon_canvas_item_set_smooth_font (NautilusIconCanvasItem *item,
EelScalableFont *font);
void nautilus_icon_canvas_item_set_smooth_font_size (NautilusIconCanvasItem *item,
int font_size);
END_GNOME_DECLS
#endif /* NAUTILUS_ICON_CANVAS_ITEM_H */

File diff suppressed because it is too large Load diff

View file

@ -1,232 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-icon-container.h - Icon container widget.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ettore Perazzoli <ettore@gnu.org>, Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_ICON_CONTAINER_H
#define NAUTILUS_ICON_CONTAINER_H
#include <libgnomeui/gnome-canvas.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
#define NAUTILUS_ICON_CONTAINER(obj) \
GTK_CHECK_CAST (obj, nautilus_icon_container_get_type (), NautilusIconContainer)
#define NAUTILUS_ICON_CONTAINER_CLASS(k) \
GTK_CHECK_CLASS_CAST (k, nautilus_icon_container_get_type (), NautilusIconContainerClass)
#define NAUTILUS_IS_ICON_CONTAINER(obj) \
GTK_CHECK_TYPE (obj, nautilus_icon_container_get_type ())
#define NAUTILUS_ICON_CONTAINER_ICON_DATA(pointer) \
((NautilusIconData *) (pointer))
typedef struct NautilusIconData NautilusIconData;
typedef void (* NautilusIconCallback) (NautilusIconData *icon_data,
gpointer callback_data);
typedef struct {
int x;
int y;
double scale_x;
double scale_y;
} NautilusIconPosition;
typedef enum {
NAUTILUS_ICON_LAYOUT_L_R_T_B,
NAUTILUS_ICON_LAYOUT_T_B_L_R,
NAUTILUS_ICON_LAYOUT_T_B_R_L
} NautilusIconLayoutMode;
typedef struct NautilusIconContainerDetails NautilusIconContainerDetails;
typedef struct {
GnomeCanvas canvas;
NautilusIconContainerDetails *details;
} NautilusIconContainer;
typedef struct {
GnomeCanvasClass parent_slot;
/* Operations on the container. */
int (* button_press) (NautilusIconContainer *container,
GdkEventButton *event);
void (* context_click_background) (NautilusIconContainer *container,
GdkEventButton *event);
void (* middle_click) (NautilusIconContainer *container,
GdkEventButton *event);
/* Operations on icons. */
void (* activate) (NautilusIconContainer *container,
NautilusIconData *data);
void (* context_click_selection) (NautilusIconContainer *container,
GdkEventButton *event);
void (* move_copy_items) (NautilusIconContainer *container,
GList *item_uris,
GdkPoint *relative_item_points,
const char *target_uri,
int copy_action,
int x,
int y);
void (* handle_uri_list) (NautilusIconContainer *container,
GList *item_uris,
int x,
int y);
/* Queries on the container for subclass/client.
* These must be implemented. The default "do nothing" is not good enough.
*/
char * (* get_container_uri) (NautilusIconContainer *container);
/* Queries on icons for subclass/client.
* These must be implemented. The default "do nothing" is not good enough.
*/
gboolean (* can_accept_item) (NautilusIconContainer *container,
NautilusIconData *target,
const char *item_uri);
gboolean (* get_stored_icon_position) (NautilusIconContainer *container,
NautilusIconData *data,
NautilusIconPosition *position);
NautilusScalableIcon *
(* get_icon_images) (NautilusIconContainer *container,
NautilusIconData *data,
const char *modifier,
GList **emblem_icons);
void (* get_icon_text) (NautilusIconContainer *container,
NautilusIconData *data,
char **editable_text,
char **additional_text);
char * (* get_icon_uri) (NautilusIconContainer *container,
NautilusIconData *data);
char * (* get_icon_drop_target_uri) (NautilusIconContainer *container,
NautilusIconData *data);
int (* compare_icons) (NautilusIconContainer *container,
NautilusIconData *icon_a,
NautilusIconData *icon_b);
int (* compare_icons_by_name) (NautilusIconContainer *container,
NautilusIconData *icon_a,
NautilusIconData *icon_b);
/* Notifications for the whole container. */
void (* band_select_started) (NautilusIconContainer *container);
void (* band_select_ended) (NautilusIconContainer *container);
void (* selection_changed) (NautilusIconContainer *container);
void (* layout_changed) (NautilusIconContainer *container);
/* Notifications for icons. */
void (* icon_position_changed) (NautilusIconContainer *container,
NautilusIconData *data,
const NautilusIconPosition *position);
void (* icon_text_changed) (NautilusIconContainer *container,
NautilusIconData *data,
const char *text);
void (* renaming_icon) (NautilusIconContainer *container,
GtkWidget *renaming_widget);
void (* icon_stretch_started) (NautilusIconContainer *container,
NautilusIconData *data);
void (* icon_stretch_ended) (NautilusIconContainer *container,
NautilusIconData *data);
int (* preview) (NautilusIconContainer *container,
NautilusIconData *data,
gboolean start_flag);
} NautilusIconContainerClass;
/* GtkObject */
guint nautilus_icon_container_get_type (void);
GtkWidget * nautilus_icon_container_new (void);
/* adding, removing, and managing icons */
void nautilus_icon_container_clear (NautilusIconContainer *view);
gboolean nautilus_icon_container_add (NautilusIconContainer *view,
NautilusIconData *data);
gboolean nautilus_icon_container_remove (NautilusIconContainer *view,
NautilusIconData *data);
void nautilus_icon_container_for_each (NautilusIconContainer *view,
NautilusIconCallback callback,
gpointer callback_data);
void nautilus_icon_container_request_update (NautilusIconContainer *view,
NautilusIconData *data);
void nautilus_icon_container_request_update_all (NautilusIconContainer *container);
void nautilus_icon_container_reveal (NautilusIconContainer *container,
NautilusIconData *data);
gboolean nautilus_icon_container_is_empty (NautilusIconContainer *container);
/* control the layout */
gboolean nautilus_icon_container_is_auto_layout (NautilusIconContainer *container);
void nautilus_icon_container_set_auto_layout (NautilusIconContainer *container,
gboolean auto_layout);
gboolean nautilus_icon_container_is_tighter_layout (NautilusIconContainer *container);
void nautilus_icon_container_set_tighter_layout (NautilusIconContainer *container,
gboolean tighter_layout);
void nautilus_icon_container_set_layout_mode (NautilusIconContainer *container,
NautilusIconLayoutMode mode);
void nautilus_icon_container_sort (NautilusIconContainer *container);
void nautilus_icon_container_freeze_icon_positions (NautilusIconContainer *container);
/* operations on all icons */
void nautilus_icon_container_unselect_all (NautilusIconContainer *view);
void nautilus_icon_container_select_all (NautilusIconContainer *view);
/* operations on the selection */
GList * nautilus_icon_container_get_selection (NautilusIconContainer *view);
void nautilus_icon_container_set_selection (NautilusIconContainer *view,
GList *selection);
GArray * nautilus_icon_container_get_selected_icon_locations (NautilusIconContainer *view);
gboolean nautilus_icon_container_has_stretch_handles (NautilusIconContainer *container);
gboolean nautilus_icon_container_is_stretched (NautilusIconContainer *container);
void nautilus_icon_container_show_stretch_handles (NautilusIconContainer *container);
void nautilus_icon_container_unstretch (NautilusIconContainer *container);
void nautilus_icon_container_start_renaming_selected_item (NautilusIconContainer *container);
/* options */
NautilusZoomLevel nautilus_icon_container_get_zoom_level (NautilusIconContainer *view);
void nautilus_icon_container_set_zoom_level (NautilusIconContainer *view,
int new_zoom_level);
void nautilus_icon_container_set_single_click_mode (NautilusIconContainer *container,
gboolean single_click_mode);
void nautilus_icon_container_enable_linger_selection (NautilusIconContainer *view,
gboolean enable);
gboolean nautilus_icon_container_get_anti_aliased_mode (NautilusIconContainer *view);
void nautilus_icon_container_set_anti_aliased_mode (NautilusIconContainer *view,
gboolean anti_aliased_mode);
void nautilus_icon_container_set_label_font_for_zoom_level (NautilusIconContainer *container,
int zoom_level,
GdkFont *font);
void nautilus_icon_container_set_smooth_label_font (NautilusIconContainer *container,
EelScalableFont *font);
gboolean nautilus_icon_container_get_is_fixed_size (NautilusIconContainer *container);
void nautilus_icon_container_set_is_fixed_size (NautilusIconContainer *container,
gboolean is_fixed_size);
void nautilus_icon_container_reset_scroll_region (NautilusIconContainer *container);
void nautilus_icon_container_set_font_size_table (NautilusIconContainer *container,
const int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1]);
void nautilus_icon_container_set_margins (NautilusIconContainer *container,
int left_margin,
int right_margin,
int top_margin,
int bottom_margin);
#endif /* NAUTILUS_ICON_CONTAINER_H */

File diff suppressed because it is too large Load diff

View file

@ -1,53 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-icon-dnd.h - Drag & drop handling for the icon container widget.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ettore Perazzoli <ettore@gnu.org>,
Darin Adler <darin@eazel.com>,
Andy Hertzfeld <andy@eazel.com>
*/
#ifndef NAUTILUS_ICON_DND_H
#define NAUTILUS_ICON_DND_H
#include "nautilus-icon-container.h"
#include <eel/eel-dnd.h>
/* DnD-related information. */
typedef struct {
/* inherited drag info context */
EelDragInfo drag_info;
/* Shadow for the icons being dragged. */
GnomeCanvasItem *shadow;
} NautilusIconDndInfo;
void nautilus_icon_dnd_init (NautilusIconContainer *container,
GdkBitmap *stipple);
void nautilus_icon_dnd_fini (NautilusIconContainer *container);
void nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
GdkDragAction actions,
gint button,
GdkEventMotion *event);
void nautilus_icon_dnd_end_drag (NautilusIconContainer *container);
#endif /* NAUTILUS_ICON_DND_H */

View file

@ -1,39 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-icon-factory-private.h: Private interface for use within
the icon factory code.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Darin Adler <darin@eazel.com>
*/
#ifndef NAUTILUS_ICON_FACTORY_PRIVATE_H
#define NAUTILUS_ICON_FACTORY_PRIVATE_H
#include "nautilus-icon-factory.h"
/* For now, images are used themselves as thumbnails when they are
* below this threshold size. Later we might have to have a more
* complex rule about when to use an image for itself.
*/
#define SELF_THUMBNAIL_SIZE_THRESHOLD 16384
void nautilus_icon_factory_remove_by_uri (const char *uri);
#endif /* NAUTILUS_ICON_FACTORY_PRIVATE_H */

File diff suppressed because it is too large Load diff

View file

@ -1,183 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-icon-factory.h: Class for obtaining icons for files and other objects.
Copyright (C) 1999, 2000 Red Hat Inc.
Copyright (C) 1999, 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_ICON_FACTORY_H
#define NAUTILUS_ICON_FACTORY_H
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <eel/eel-string-list.h>
#include <gtk/gtkobject.h>
/* NautilusIconFactory is a class that knows how to hand out icons to be
* used for representing files and some other objects. It was designed
* specifically to be useful for the Nautilus file browser, but could be
* used by any program that wants to display the standard icon for a
* file.
*
* The most common usage is to get a NautilusIconFactory object with
* nautilus_get_current_icon_factory, then ask for an icon for a specific
* file with nautilus_icon_factory_get_icon_for_file. The caller can ask
* for any size icon, but normally will use one of the defined
* NAUTILUS_ICON_SIZE macros.
*/
/* Names for Nautilus's different zoom levels, from tiniest items to largest items */
typedef enum {
NAUTILUS_ZOOM_LEVEL_SMALLEST,
NAUTILUS_ZOOM_LEVEL_SMALLER,
NAUTILUS_ZOOM_LEVEL_SMALL,
NAUTILUS_ZOOM_LEVEL_STANDARD,
NAUTILUS_ZOOM_LEVEL_LARGE,
NAUTILUS_ZOOM_LEVEL_LARGER,
NAUTILUS_ZOOM_LEVEL_LARGEST
} NautilusZoomLevel;
/* Nominal icon sizes for each Nautilus zoom level.
* This scheme assumes that icons are designed to
* fit in a square space, though each image needn't
* be square. Since individual icons can be stretched,
* each icon is not constrained to this nominal size.
*/
#define NAUTILUS_ICON_SIZE_SMALLEST 12
#define NAUTILUS_ICON_SIZE_SMALLER 24
#define NAUTILUS_ICON_SIZE_SMALL 36
#define NAUTILUS_ICON_SIZE_STANDARD 48
#define NAUTILUS_ICON_SIZE_LARGE 72
#define NAUTILUS_ICON_SIZE_LARGER 96
#define NAUTILUS_ICON_SIZE_LARGEST 192
/* Icon size to use for menus. NAUTILUS_ICON_SIZE_SMALLEST
* is a little too small and NAUTILUS_ICON_SIZE_SMALLER is
* a little too big.
*/
#define NAUTILUS_ICON_SIZE_FOR_MENUS 20
typedef struct NautilusScalableIcon NautilusScalableIcon;
/* here's a structure to hold the emblem attach points */
#define MAX_ATTACH_POINTS 8
typedef struct {
int num_points;
GdkPoint points[MAX_ATTACH_POINTS];
} NautilusEmblemAttachPoints;
/* Instead of a class declaration here, I will just document
* the signals.
*
* "icons_changed", no parameters
*/
/* There's a single NautilusIconFactory object.
* The only thing you need it for is to connect to its signals.
*/
GtkObject * nautilus_icon_factory_get (void);
/* Relationship between zoom levels and icons sizes. */
guint nautilus_get_icon_size_for_zoom_level (NautilusZoomLevel zoom_level);
/* Choose the appropriate icon, but don't render it yet. */
NautilusScalableIcon *nautilus_icon_factory_get_icon_for_file (NautilusFile *file,
const char *modifier);
gboolean nautilus_icon_factory_is_icon_ready_for_file (NautilusFile *file);
GList * nautilus_icon_factory_get_required_file_attributes (void);
GList * nautilus_icon_factory_get_emblem_icons_for_file (NautilusFile *file,
EelStringList *exclude);
NautilusScalableIcon *nautilus_icon_factory_get_emblem_icon_by_name (const char *emblem_name);
/* Render an icon to a particular size.
* Ownership of a ref. count in this pixbuf comes with the deal.
* This allows scaling in both dimensions. All other calls assume
* that X and Y scaling are the same. Optionally, we also pass
* back an array of emblem attach points, if the pointer is non-null
* If the wants_default boolean is set, return a default icon instead
* of NULL if we can't find anything
*/
GdkPixbuf * nautilus_icon_factory_get_pixbuf_for_icon (NautilusScalableIcon *scalable_icon,
guint nominal_size_in_pixels_x,
guint nominal_size_in_pixels_y,
guint maximum_size_in_pixels_x,
guint maximum_size_in_pixels_y,
gboolean optimized_for_anti_aliasing,
NautilusEmblemAttachPoints *attach_points,
gboolean wants_default);
/* Convenience functions for the common case where you want to choose
* and render the icon into a pixbuf all at once.
*/
GdkPixbuf * nautilus_icon_factory_get_pixbuf_for_file (NautilusFile *file,
const char *modifer,
guint size_in_pixels,
gboolean optimized_for_anti_aliasing);
/* Convenience functions for legacy interfaces that require a pixmap and
* bitmap. Maybe we can get rid of these one day.
*/
void nautilus_icon_factory_get_pixmap_and_mask_for_file (NautilusFile *file,
const char *modifer,
guint size_in_pixels,
GdkPixmap **pixmap,
GdkBitmap **mask);
/* Convenience routine for getting a pixbuf from an icon name
*/
GdkPixbuf * nautilus_icon_factory_get_pixbuf_from_name (const char *icon_name,
const char *modifer,
guint size_in_pixels,
gboolean optimized_for_anti_aliasing);
/* Manage a scalable icon.
* Since the factory always passes out references to the same scalable
* icon, you can compare two scalable icons to see if they are the same
* with ==.
*/
void nautilus_scalable_icon_ref (NautilusScalableIcon *scalable_icon);
void nautilus_scalable_icon_unref (NautilusScalableIcon *scalable_icon);
/* A scalable icon can be decomposed into text and reconstituted later
* using nautilus_scalable_icon_new_from_text_pieces. This is the way
* to store scalable icons in metadata or other files.
*/
void nautilus_scalable_icon_get_text_pieces (NautilusScalableIcon *scalable_icon,
char **uri_return,
char **mime_type_return,
char **name_return,
char **modifier_return,
char **embedded_text_return);
/* Get a scalable icon using the earlier results of
* nautilus_scalable_icon_get_text_pieces.
*/
NautilusScalableIcon *nautilus_scalable_icon_new_from_text_pieces (const char *uri,
const char *mime_type,
const char *name,
const char *modifier,
const char *embedded_text);
/* Convenience function for freeing a list of scalable icons.
* Unrefs all the icons before freeing the list.
*/
void nautilus_scalable_icon_list_free (GList *scalable_icon_list);
#endif /* NAUTILUS_ICON_FACTORY_H */

View file

@ -1,257 +0,0 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-icon-container-private.h
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Ettore Perazzoli <ettore@gnu.org>
*/
#ifndef NAUTILUS_ICON_CONTAINER_PRIVATE_H
#define NAUTILUS_ICON_CONTAINER_PRIVATE_H
#include "nautilus-entry.h"
#include <eel/eel-glib-extensions.h>
#include "nautilus-icon-container.h"
#include "nautilus-icon-dnd.h"
#include "nautilus-icon-factory.h"
#include "nautilus-icon-canvas-item.h"
#include "nautilus-icon-text-item.h"
/* An Icon. */
typedef struct {
/* Object represented by this icon. */
NautilusIconData *data;
/* Canvas item for the icon. */
NautilusIconCanvasItem *item;
/* X/Y coordinates. */
double x, y;
/* Scale factor (stretches icon). */
double scale_x, scale_y;
/* Whether this item is selected. */
eel_boolean_bit is_selected : 1;
/* Whether this item was selected before rubberbanding. */
eel_boolean_bit was_selected_before_rubberband : 1;
} NautilusIcon;
/* Private NautilusIconContainer members. */
typedef struct {
gboolean active;
double start_x, start_y;
GnomeCanvasItem *selection_rectangle;
guint timer_id;
guint prev_x, prev_y;
ArtDRect prev_rect;
} NautilusIconRubberbandInfo;
typedef enum {
DRAG_STATE_INITIAL,
DRAG_STATE_MOVE_OR_COPY,
DRAG_STATE_MOVE_COPY_OR_MENU,
DRAG_STATE_STRETCH
} DragState;
typedef struct {
/* Pointer position in canvas coordinates. */
int pointer_x, pointer_y;
/* Icon top, left, and size in canvas coordinates. */
int icon_x, icon_y;
guint icon_size;
} StretchState;
typedef enum {
AXIS_NONE,
AXIS_HORIZONTAL,
AXIS_VERTICAL
} Axis;
typedef struct {
char *type_select_pattern;
guint64 last_typeselect_time;
} TypeSelectState;
struct NautilusIconContainerDetails {
/* List of icons. */
GList *icons;
GList *new_icons;
/* Current icon for keyboard navigation. */
NautilusIcon *keyboard_focus;
/* Current icon with stretch handles, so we have only one. */
NautilusIcon *stretch_icon;
double stretch_initial_x, stretch_initial_y;
guint stretch_initial_size;
/* Last highlighted drop target. */
NautilusIcon *drop_target;
/* Rubberbanding status. */
NautilusIconRubberbandInfo rubberband_info;
/* Timeout used to make a selected icon fully visible after a short
* period of time. (The timeout is needed to make sure
* double-clicking still works.)
*/
guint keyboard_icon_reveal_timer_id;
NautilusIcon *keyboard_icon_to_reveal;
/* If a request is made to reveal an unpositioned icon we remember
* it and reveal it once it gets positioned (in relayout).
*/
NautilusIcon *pending_icon_to_reveal;
/* If a request is made to rename an unpositioned icon we remember
* it and start renaming it once it gets positioned (in relayout).
*/
NautilusIcon *pending_icon_to_rename;
/* Remembered information about the start of the current event. */
guint32 button_down_time;
/* Drag state. Valid only if drag_button is non-zero. */
guint drag_button;
NautilusIcon *drag_icon;
int drag_x, drag_y;
DragState drag_state;
gboolean drag_started;
StretchState stretch_start;
int context_menu_timeout_id;
/* Renaming Details */
gboolean renaming;
NautilusIconTextItem *rename_widget; /* Editable text item */
char *original_text; /* Copy of editable text for later compare */
/* typeahead selection state */
TypeSelectState *type_select_state;
/* Idle ID. */
guint idle_id;
/* Idle handler for stretch code */
guint stretch_idle_id;
/* Timeout for selection in browser mode. */
guint linger_selection_mode_timer_id;
/* Icon to be selected at timeout in browser mode. */
NautilusIcon *linger_selection_mode_icon;
/* DnD info. */
NautilusIconDndInfo *dnd_info;
/* zoom level */
int zoom_level;
/* fonts used to draw labels in regular mode */
GdkFont *label_font[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
/* font used to draw labels in smooth mode */
EelScalableFont *smooth_label_font;
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
/* pixbuf and color for label highlighting */
GdkPixbuf *highlight_frame;
guint32 highlight_color;
/* color for text labels */
guint32 label_color;
guint32 label_info_color;
/* State used so arrow keys don't wander if icons aren't lined up.
* Keeps track of last axis arrow key was used on.
*/
Axis arrow_key_axis;
int arrow_key_start;
/* Mode settings. */
gboolean single_click_mode;
gboolean auto_layout;
gboolean tighter_layout;
/* Layout mode */
NautilusIconLayoutMode layout_mode;
/* Set to TRUE after first allocation has been done */
gboolean has_been_allocated;
/* Is the container fixed or resizable */
gboolean is_fixed_size;
/* Ignore the visible area the next time the scroll region is recomputed */
gboolean reset_scroll_region_trigger;
/* The position we are scaling to on stretch */
int window_x;
int window_y;
/* margins to follow, used for the desktop panel avoidance */
int left_margin;
int right_margin;
int top_margin;
int bottom_margin;
};
/* Private functions shared by mutiple files. */
NautilusIcon *nautilus_icon_container_get_icon_by_uri (NautilusIconContainer *container,
const char *uri);
void nautilus_icon_container_move_icon (NautilusIconContainer *container,
NautilusIcon *icon,
int x,
int y,
double scale_x,
double scale_y,
gboolean raise,
gboolean update_position);
void nautilus_icon_container_select_list_unselect_others (NautilusIconContainer *container,
GList *icons);
char * nautilus_icon_container_get_icon_uri (NautilusIconContainer *container,
NautilusIcon *icon);
char * nautilus_icon_container_get_icon_drop_target_uri (NautilusIconContainer *container,
NautilusIcon *icon);
void nautilus_icon_container_update_icon (NautilusIconContainer *container,
NautilusIcon *icon);
void nautilus_icon_container_flush_typeselect_state (NautilusIconContainer *container);
gboolean nautilus_icon_container_has_stored_icon_positions (NautilusIconContainer *container);
gboolean nautilus_icon_container_emit_preview_signal (NautilusIconContainer *view,
NautilusIcon *icon,
gboolean start_flag);
gboolean nautilus_icon_container_scroll (NautilusIconContainer *container,
int delta_x,
int delta_y);
void nautilus_icon_container_update_scroll_region (NautilusIconContainer *container);
/* label color for items */
guint32 nautilus_icon_container_get_label_color (NautilusIconContainer *container,
gboolean first_line);
#endif /* NAUTILUS_ICON_CONTAINER_PRIVATE_H */

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more