GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 62ae0377 authored by Darin Adler's avatar Darin Adler

The main change here is revamping the undo manager.

	To get a complete check-out you might have to delete
	the file named libnautilus/nautilus-undo.h that used
	to be a generated file and is now checked-in.

	* components/help/help-method.c: (vfs_module_transform):
	Removed a bogus extraneous FIXME.

	* libnautilus-extensions/Makefile.am:
	Moved the undo manager into libnautilus-extensions
	since it's not needed by Nautilus components.

	* libnautilus-extensions/nautilus-entry.c:
	* libnautilus-extensions/nautilus-icon-text-item.c:
	* libnautilus/nautilus-view.c:
	* src/nautilus-application.c:
	* src/nautilus-bookmarks-window.c: (create_bookmarks_window):
	* src/nautilus-view-frame.c:
	* src/nautilus-window-private.h:
	* src/nautilus-window.c:
	Updated includes and a few small function name changes.

	* libnautilus-extensions/nautilus-gtk-extensions.h:
	* libnautilus-extensions/nautilus-gtk-extensions.c:
	(alive_disconnecter),
	(nautilus_gtk_signal_connect_full_while_alive):
	Added a new function that combines the features of
	gtk_signal_connect_full with gtk_signal_connect_while_alive.

	* libnautilus/nautilus-undo-context.h: [removed]
	* libnautilus/nautilus-undo-context.c: [removed]
	* libnautilus-extensions/nautilus-undo-context.h:
	* libnautilus-extensions/nautilus-undo-context.c:
	(impl_Nautilus_Undo_Context__destroy),
	(impl_Nautilus_Undo_Context__create),
	(impl_Nautilus_Undo_Context__get_undo_manager),
	(nautilus_undo_context_new), (destroy),
	(nautilus_undo_context_initialize_class):
	Rewrote this class to simplify it (after moving it here).

	* libnautilus/nautilus-undo-manager.h: [removed]
	* libnautilus/nautilus-undo-manager.c: [removed]
	* libnautilus/nautilus-undo-manager-private.h: [removed]
	* libnautilus-extensions/nautilus-undo-manager.h:
	* libnautilus-extensions/nautilus-undo-manager.c:
	(impl_Nautilus_Undo_Manager__destroy),
	(impl_Nautilus_Undo_Manager__create),
	(impl_Nautilus_Undo_Manager__append),
	(impl_Nautilus_Undo_Manager__forget),
	(nautilus_undo_manager_initialize),
	(nautilus_undo_manager_initialize_class),
	(nautilus_undo_manager_undo),
	(nautilus_undo_manager_add_transaction),
	(nautilus_undo_manager_forget_transaction),
	(nautilus_undo_manager_set_queue_depth),
	(nautilus_undo_manager_attach),
	(nautilus_undo_manager_add_interface), (update_undo_menu_item),
	(undo_menu_handler_connection_free),
	(undo_menu_handler_connection_free_cover),
	(nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item):
	Rewrote this class to simplify it. Got rid of many old
	interfaces and added some new ones.

	* libnautilus/.cvsignore:
	* libnautilus/Makefile.am:
	Renamed the old nautilus-undo.idl to
	nautilus-distributed-undo.idl.  The IDL is only about the internal
	part of the undo framework.  Clients use calls that are in
	nautilus-undo.h. The part that's public needs the prettier name.

	* libnautilus/nautilus-undo.idl: [removed]
	* libnautilus/nautilus-distributed-undo.idl:
	Updated the names of menu-item-related things to better match the
	standard terminology.

	* libnautilus/nautilus-undo-private.h:
	Added this new header for things needed by the undo manager that
	are in libnautilus. Maybe we can eliminate this later.

	* libnautilus/nautilus-undo-transaction.h:
	* libnautilus/nautilus-undo-transaction.c:
	(impl_Nautilus_Undo_Transaction__destroy),
	(impl_Nautilus_Undo_Transaction__create),
	(impl_Nautilus_Undo_Transaction__get_undo_menu_item),
	(impl_Nautilus_Undo_Transaction__get_redo_menu_item),
	(impl_Nautilus_Undo_Transaction__get_operation_name),
	(impl_Nautilus_Undo_Transaction__undo),
	(nautilus_undo_transaction_new),
	(nautilus_undo_transaction_initialize),
	(remove_transaction_from_object),
	(nautilus_undo_transaction_destroy),
	(nautilus_undo_transaction_initialize_class),
	(nautilus_undo_transaction_add_atom),
	(nautilus_undo_transaction_undo),
	(nautilus_undo_transaction_add_to_undo_manager), (remove_atoms),
	(remove_atoms_cover),
	(nautilus_undo_transaction_unregister_object), (undo_atom_free),
	(undo_atom_undo_and_free), (undo_atom_free_cover),
	(undo_atom_undo_and_free_cover), (undo_atom_list_free),
	(undo_atom_list_undo_and_free):
	Rewrote and simplified this class and got rid of all uses of
	NautilusUndoable.

	* libnautilus/nautilus-undoable.h: [removed]
	* libnautilus/nautilus-undoable.c: [removed]
	* libnautilus/nautilus-undo.h:
	* libnautilus/nautilus-undo.c: (nautilus_undo_register),
	(nautilus_undo_register_full), (nautilus_undo_unregister),
	(nautilus_undo), (nautilus_undo_get_undo_manager),
	(undo_manager_ref), (undo_manager_unref),
	(undo_manager_unref_cover), (nautilus_undo_attach_undo_manager),
	(nautilus_undo_share_undo_manager), (set_up_bonobo_control),
	(nautilus_undo_set_up_bonobo_control):
	Added this new file with the public interface of the undo code and
	most of the basic implementation. Most of this was previously in
	nautilus-undoable.c.

	* nautilus-widgets/nautilus-preferences.c:
	(preferences_hash_node_free), (preferences_hash_node_add_callback),
	(preferences_hash_node_remove_callback),
	(preferences_hash_node_check_changes_func),
	(preferences_callback_node_alloc),
	(preferences_callback_node_free),
	(preferences_callback_node_free_func),
	(preferences_callback_node_invoke_func),
	(preferences_gconf_callback):
	Fixed a repeated spelling error in this file.

	* src/nautilus-application.c: (nautilus_app_init):
	* src/nautilus-view-frame.c: (nautilus_view_frame_load_client):
	* src/nautilus-window-menus.c: (edit_menu_undo_callback),
	(nautilus_window_initialize_menus):
	* src/nautilus-window.c: (nautilus_window_constructed):
	Changed to use public parts of the undo API instead of the old
	stuff that used private secret stuff. Many places use nice new
	convenient calls that do a lot of the work for you.
parent aac364ac
2000-06-06 Darin Adler <darin@eazel.com>
The main change here is revamping the undo manager.
To get a complete check-out you might have to delete
the file named libnautilus/nautilus-undo.h that used
to be a generated file and is now checked-in.
* components/help/help-method.c: (vfs_module_transform):
Removed a bogus extraneous FIXME.
* libnautilus-extensions/Makefile.am:
Moved the undo manager into libnautilus-extensions
since it's not needed by Nautilus components.
* libnautilus-extensions/nautilus-entry.c:
* libnautilus-extensions/nautilus-icon-text-item.c:
* libnautilus/nautilus-view.c:
* src/nautilus-application.c:
* src/nautilus-bookmarks-window.c: (create_bookmarks_window):
* src/nautilus-view-frame.c:
* src/nautilus-window-private.h:
* src/nautilus-window.c:
Updated includes and a few small function name changes.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(alive_disconnecter),
(nautilus_gtk_signal_connect_full_while_alive):
Added a new function that combines the features of
gtk_signal_connect_full with gtk_signal_connect_while_alive.
* libnautilus/nautilus-undo-context.h: [removed]
* libnautilus/nautilus-undo-context.c: [removed]
* libnautilus-extensions/nautilus-undo-context.h:
* libnautilus-extensions/nautilus-undo-context.c:
(impl_Nautilus_Undo_Context__destroy),
(impl_Nautilus_Undo_Context__create),
(impl_Nautilus_Undo_Context__get_undo_manager),
(nautilus_undo_context_new), (destroy),
(nautilus_undo_context_initialize_class):
Rewrote this class to simplify it (after moving it here).
* libnautilus/nautilus-undo-manager.h: [removed]
* libnautilus/nautilus-undo-manager.c: [removed]
* libnautilus/nautilus-undo-manager-private.h: [removed]
* libnautilus-extensions/nautilus-undo-manager.h:
* libnautilus-extensions/nautilus-undo-manager.c:
(impl_Nautilus_Undo_Manager__destroy),
(impl_Nautilus_Undo_Manager__create),
(impl_Nautilus_Undo_Manager__append),
(impl_Nautilus_Undo_Manager__forget),
(nautilus_undo_manager_initialize),
(nautilus_undo_manager_initialize_class),
(nautilus_undo_manager_undo),
(nautilus_undo_manager_add_transaction),
(nautilus_undo_manager_forget_transaction),
(nautilus_undo_manager_set_queue_depth),
(nautilus_undo_manager_attach),
(nautilus_undo_manager_add_interface), (update_undo_menu_item),
(undo_menu_handler_connection_free),
(undo_menu_handler_connection_free_cover),
(nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item):
Rewrote this class to simplify it. Got rid of many old
interfaces and added some new ones.
* libnautilus/.cvsignore:
* libnautilus/Makefile.am:
Renamed the old nautilus-undo.idl to
nautilus-distributed-undo.idl. The IDL is only about the internal
part of the undo framework. Clients use calls that are in
nautilus-undo.h. The part that's public needs the prettier name.
* libnautilus/nautilus-undo.idl: [removed]
* libnautilus/nautilus-distributed-undo.idl:
Updated the names of menu-item-related things to better match the
standard terminology.
* libnautilus/nautilus-undo-private.h:
Added this new header for things needed by the undo manager that
are in libnautilus. Maybe we can eliminate this later.
* libnautilus/nautilus-undo-transaction.h:
* libnautilus/nautilus-undo-transaction.c:
(impl_Nautilus_Undo_Transaction__destroy),
(impl_Nautilus_Undo_Transaction__create),
(impl_Nautilus_Undo_Transaction__get_undo_menu_item),
(impl_Nautilus_Undo_Transaction__get_redo_menu_item),
(impl_Nautilus_Undo_Transaction__get_operation_name),
(impl_Nautilus_Undo_Transaction__undo),
(nautilus_undo_transaction_new),
(nautilus_undo_transaction_initialize),
(remove_transaction_from_object),
(nautilus_undo_transaction_destroy),
(nautilus_undo_transaction_initialize_class),
(nautilus_undo_transaction_add_atom),
(nautilus_undo_transaction_undo),
(nautilus_undo_transaction_add_to_undo_manager), (remove_atoms),
(remove_atoms_cover),
(nautilus_undo_transaction_unregister_object), (undo_atom_free),
(undo_atom_undo_and_free), (undo_atom_free_cover),
(undo_atom_undo_and_free_cover), (undo_atom_list_free),
(undo_atom_list_undo_and_free):
Rewrote and simplified this class and got rid of all uses of
NautilusUndoable.
* libnautilus/nautilus-undoable.h: [removed]
* libnautilus/nautilus-undoable.c: [removed]
* libnautilus/nautilus-undo.h:
* libnautilus/nautilus-undo.c: (nautilus_undo_register),
(nautilus_undo_register_full), (nautilus_undo_unregister),
(nautilus_undo), (nautilus_undo_get_undo_manager),
(undo_manager_ref), (undo_manager_unref),
(undo_manager_unref_cover), (nautilus_undo_attach_undo_manager),
(nautilus_undo_share_undo_manager), (set_up_bonobo_control),
(nautilus_undo_set_up_bonobo_control):
Added this new file with the public interface of the undo code and
most of the basic implementation. Most of this was previously in
nautilus-undoable.c.
* nautilus-widgets/nautilus-preferences.c:
(preferences_hash_node_free), (preferences_hash_node_add_callback),
(preferences_hash_node_remove_callback),
(preferences_hash_node_check_changes_func),
(preferences_callback_node_alloc),
(preferences_callback_node_free),
(preferences_callback_node_free_func),
(preferences_callback_node_invoke_func),
(preferences_gconf_callback):
Fixed a repeated spelling error in this file.
* src/nautilus-application.c: (nautilus_app_init):
* src/nautilus-view-frame.c: (nautilus_view_frame_load_client):
* src/nautilus-window-menus.c: (edit_menu_undo_callback),
(nautilus_window_initialize_menus):
* src/nautilus-window.c: (nautilus_window_constructed):
Changed to use public parts of the undo API instead of the old
stuff that used private secret stuff. Many places use nice new
convenient calls that do a lot of the work for you.
2000-06-06 Pavel Cisler <pavel@eazel.com> 2000-06-06 Pavel Cisler <pavel@eazel.com>
* libnautilus-extensions/nautilus-icon-factory.c: * libnautilus-extensions/nautilus-icon-factory.c:
......
...@@ -291,7 +291,7 @@ vfs_module_transform (const char *method_name, const char *args) ...@@ -291,7 +291,7 @@ vfs_module_transform (const char *method_name, const char *args)
{ {
init_help_module (); init_help_module ();
#ifdef ALI_DEBUG #ifdef ALI_DEBUG
g_print ("Loading libvfs-help.so...\n"); /* FIXME: Remove me */ g_print ("Loading libvfs-help.so...\n");
#endif #endif
return &transform; return &transform;
} }
...@@ -72,6 +72,7 @@ libnautilus_extensionsinclude_HEADERS= \ ...@@ -72,6 +72,7 @@ libnautilus_extensionsinclude_HEADERS= \
nautilus-self-checks.h \ nautilus-self-checks.h \
nautilus-string-list.h \ nautilus-string-list.h \
nautilus-string.h \ nautilus-string.h \
nautilus-undo-manager.h \
nautilus-view-identifier.h \ nautilus-view-identifier.h \
nautilus-xml-extensions.h \ nautilus-xml-extensions.h \
$(NULL) $(NULL)
...@@ -82,6 +83,7 @@ libnautilus_extensions_la_SOURCES = \ ...@@ -82,6 +83,7 @@ libnautilus_extensions_la_SOURCES = \
nautilus-directory-private.h \ nautilus-directory-private.h \
nautilus-directory-metafile.h \ nautilus-directory-metafile.h \
nautilus-lib-self-check-functions.h \ nautilus-lib-self-check-functions.h \
nautilus-undo-context.h \
bonobo-stream-vfs.c \ bonobo-stream-vfs.c \
nautilus-background-canvas-group.c \ nautilus-background-canvas-group.c \
nautilus-background.c \ nautilus-background.c \
...@@ -127,6 +129,8 @@ libnautilus_extensions_la_SOURCES = \ ...@@ -127,6 +129,8 @@ libnautilus_extensions_la_SOURCES = \
nautilus-self-checks.c \ nautilus-self-checks.c \
nautilus-string-list.c \ nautilus-string-list.c \
nautilus-string.c \ nautilus-string.c \
nautilus-undo-context.c \
nautilus-undo-manager.c \
nautilus-view-identifier.c \ nautilus-view-identifier.c \
nautilus-xml-extensions.c \ nautilus-xml-extensions.c \
$(NULL) $(NULL)
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
#include <libgnome/gnome-defs.h> #include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
#include <libnautilus/nautilus-undo-manager.h>
#include <libnautilus/nautilus-undoable.h>
#include <libnautilus/nautilus-undo.h> #include <libnautilus/nautilus-undo.h>
#include <orb/orbit.h> #include <orb/orbit.h>
......
...@@ -663,3 +663,84 @@ nautilus_gtk_widget_set_font_by_name (GtkWidget *widget, const char *font_name) ...@@ -663,3 +663,84 @@ nautilus_gtk_widget_set_font_by_name (GtkWidget *widget, const char *font_name)
nautilus_gtk_widget_set_font (widget, font); nautilus_gtk_widget_set_font (widget, font);
gdk_font_unref (font); gdk_font_unref (font);
} }
/* This stuff is stolen from Gtk. */
typedef struct DisconnectInfo {
GtkObject *object1;
guint disconnect_handler1;
guint signal_handler;
GtkObject *object2;
guint disconnect_handler2;
} DisconnectInfo;
static guint
alive_disconnecter (GtkObject *object, DisconnectInfo *info)
{
g_assert (info != NULL);
g_assert (GTK_IS_OBJECT (info->object1));
g_assert (info->disconnect_handler1 != 0);
g_assert (info->signal_handler != 0);
g_assert (GTK_IS_OBJECT (info->object2));
g_assert (info->disconnect_handler2 != 0);
g_assert (object == info->object1 || object == info->object2);
gtk_signal_disconnect (info->object1, info->disconnect_handler1);
gtk_signal_disconnect (info->object1, info->signal_handler);
gtk_signal_disconnect (info->object2, info->disconnect_handler2);
g_free (info);
return 0;
}
/**
* nautilus_gtk_signal_connect_full_while_alive
*
* Like gtk_signal_connect_while_alive, but works with full parameters.
**/
void
nautilus_gtk_signal_connect_full_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy_func,
gboolean object_signal,
gboolean after,
GtkObject *alive_object)
{
DisconnectInfo *info;
g_return_if_fail (GTK_IS_OBJECT (object));
g_return_if_fail (name != NULL);
g_return_if_fail (func != NULL);
g_return_if_fail (object_signal == FALSE || object_signal == TRUE);
g_return_if_fail (after == FALSE || after == TRUE);
g_return_if_fail (GTK_IS_OBJECT (alive_object));
info = g_new (DisconnectInfo, 1);
info->object1 = object;
info->object2 = alive_object;
info->signal_handler =
gtk_signal_connect_full (object,
name,
func,
marshal,
data,
destroy_func,
object_signal,
after);
info->disconnect_handler1 =
gtk_signal_connect (object,
"destroy",
GTK_SIGNAL_FUNC (alive_disconnecter),
info);
info->disconnect_handler2 =
gtk_signal_connect (alive_object,
"destroy",
GTK_SIGNAL_FUNC (alive_disconnecter),
info);
}
...@@ -34,56 +34,64 @@ ...@@ -34,56 +34,64 @@
#define NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT 2 #define NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT 2
/* GtkCList */ /* GtkCList */
int nautilus_gtk_clist_get_first_selected_row (GtkCList *list); int nautilus_gtk_clist_get_first_selected_row (GtkCList *list);
int nautilus_gtk_clist_get_last_selected_row (GtkCList *list); int nautilus_gtk_clist_get_last_selected_row (GtkCList *list);
/* signals */ /* signals */
guint nautilus_gtk_signal_connect_free_data (GtkObject *object, guint nautilus_gtk_signal_connect_free_data (GtkObject *object,
const gchar *name, const gchar *name,
GtkSignalFunc func, GtkSignalFunc func,
gpointer data); gpointer data);
guint nautilus_gtk_signal_connect_free_data_custom (GtkObject *object, guint nautilus_gtk_signal_connect_free_data_custom (GtkObject *object,
const gchar *name, const gchar *name,
GtkSignalFunc func, GtkSignalFunc func,
gpointer data, gpointer data,
GtkDestroyNotify destroy_func); GtkDestroyNotify destroy_func);
void nautilus_gtk_signal_connect_full_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy_func,
gboolean object_signal,
gboolean after,
GtkObject *alive_object);
/* list of GtkObject */ /* list of GtkObject */
GList * nautilus_gtk_object_list_ref (GList *list); GList * nautilus_gtk_object_list_ref (GList *list);
void nautilus_gtk_object_list_unref (GList *list); void nautilus_gtk_object_list_unref (GList *list);
void nautilus_gtk_object_list_free (GList *list); void nautilus_gtk_object_list_free (GList *list);
GList * nautilus_gtk_object_list_copy (GList *list); GList * nautilus_gtk_object_list_copy (GList *list);
/* GtkWidget */ /* GtkWidget */
gboolean nautilus_point_in_allocation (const GtkAllocation *allocation, gboolean nautilus_point_in_allocation (const GtkAllocation *allocation,
int x, int x,
int y); int y);
void nautilus_gtk_widget_set_font (GtkWidget *widget, void nautilus_gtk_widget_set_font (GtkWidget *widget,
GdkFont *font); GdkFont *font);
void nautilus_gtk_widget_set_font_by_name (GtkWidget *widget, void nautilus_gtk_widget_set_font_by_name (GtkWidget *widget,
const char *font_name); const char *font_name);
gboolean nautilus_point_in_widget (GtkWidget *widget, gboolean nautilus_point_in_widget (GtkWidget *widget,
int x, int x,
int y); int y);
/* GtkWindow */ /* GtkWindow */
void nautilus_gtk_window_present (GtkWindow *window); void nautilus_gtk_window_present (GtkWindow *window);
/* selection data */ /* selection data */
GtkSelectionData *nautilus_gtk_selection_data_copy_deep (const GtkSelectionData *selection_data); GtkSelectionData *nautilus_gtk_selection_data_copy_deep (const GtkSelectionData *selection_data);
void nautilus_gtk_selection_data_free_deep (GtkSelectionData *selection_data); void nautilus_gtk_selection_data_free_deep (GtkSelectionData *selection_data);
/* GtkMenu */ /* GtkMenu */
void nautilus_pop_up_context_menu (GtkMenu *menu, void nautilus_pop_up_context_menu (GtkMenu *menu,
gint16 offset_x, gint16 offset_x,
gint16 offset_y); gint16 offset_y);
/* GtkStyle */ /* GtkStyle */
void nautilus_gtk_style_set_font (GtkStyle *style, void nautilus_gtk_style_set_font (GtkStyle *style,
GdkFont *font); GdkFont *font);
void nautilus_gtk_style_set_font_by_name (GtkStyle *style, void nautilus_gtk_style_set_font_by_name (GtkStyle *style,
const char *font_name); const char *font_name);
/* marshals */ /* marshals */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "nautilus-icon-text-item.h" #include "nautilus-icon-text-item.h"
#include "nautilus-entry.h" #include "nautilus-entry.h"
#include <libnautilus/nautilus-undoable.h> #include <libnautilus/nautilus-undo.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
......
...@@ -93,13 +93,13 @@ static void preferences_hash_node_check_changes_func ( ...@@ -93,13 +93,13 @@ static void preferences_hash_node_check_changes_func (
/* PreferencesCallbackNode functions */ /* PreferencesCallbackNode functions */
static PreferencesCallbackNode *preferneces_callback_node_alloc (NautilusPreferencesCallback callback_proc, static PreferencesCallbackNode *preferences_callback_node_alloc (NautilusPreferencesCallback callback_proc,
gpointer callback_data, gpointer callback_data,
const PreferencesHashNode *hash_node); const PreferencesHashNode *hash_node);
static void preferneces_callback_node_free (PreferencesCallbackNode *node); static void preferences_callback_node_free (PreferencesCallbackNode *node);
static void preferneces_callback_node_free_func (gpointer data, static void preferences_callback_node_free_func (gpointer data,
gpointer callback_data); gpointer callback_data);
static void preferneces_callback_node_invoke_func (gpointer data, static void preferences_callback_node_invoke_func (gpointer data,
gpointer callback_data); gpointer callback_data);
static void preferences_hash_node_add_callback (PreferencesHashNode *node, static void preferences_hash_node_add_callback (PreferencesHashNode *node,
NautilusPreferencesCallback callback_proc, NautilusPreferencesCallback callback_proc,
...@@ -177,7 +177,7 @@ preferences_hash_node_free (PreferencesHashNode *node) ...@@ -177,7 +177,7 @@ preferences_hash_node_free (PreferencesHashNode *node)
} }
nautilus_g_list_free_deep_custom (node->callback_list, nautilus_g_list_free_deep_custom (node->callback_list,
preferneces_callback_node_free_func, preferences_callback_node_free_func,
NULL); NULL);
node->callback_list = NULL; node->callback_list = NULL;
...@@ -201,21 +201,21 @@ preferences_hash_node_add_callback (PreferencesHashNode *node, ...@@ -201,21 +201,21 @@ preferences_hash_node_add_callback (PreferencesHashNode *node,
NautilusPreferencesCallback callback_proc, NautilusPreferencesCallback callback_proc,
gpointer callback_data) gpointer callback_data)
{ {
PreferencesCallbackNode *preferneces_callback_node; PreferencesCallbackNode *preferences_callback_node;
guint i; guint i;
g_assert (node != NULL); g_assert (node != NULL);
g_assert (callback_proc != NULL); g_assert (callback_proc != NULL);
preferneces_callback_node = preferneces_callback_node_alloc (callback_proc, preferences_callback_node = preferences_callback_node_alloc (callback_proc,
callback_data, callback_data,
node); node);
g_assert (preferneces_callback_node != NULL); g_assert (preferences_callback_node != NULL);
node->callback_list = g_list_append (node->callback_list, node->callback_list = g_list_append (node->callback_list,
(gpointer) preferneces_callback_node); (gpointer) preferences_callback_node);
/* /*
* We install only one gconf notification for each preference node. * We install only one gconf notification for each preference node.
...@@ -279,7 +279,7 @@ preferences_hash_node_remove_callback (PreferencesHashNode *node, ...@@ -279,7 +279,7 @@ preferences_hash_node_remove_callback (PreferencesHashNode *node,
node->callback_list = g_list_remove (node->callback_list, node->callback_list = g_list_remove (node->callback_list,
(gpointer) callback_info); (gpointer) callback_info);
preferneces_callback_node_free (callback_info); preferences_callback_node_free (callback_info);
} }
} }
...@@ -345,14 +345,14 @@ preferences_hash_node_check_changes_func (gpointer key, ...@@ -345,14 +345,14 @@ preferences_hash_node_check_changes_func (gpointer key,
/* Invoke callbacks for this node */ /* Invoke callbacks for this node */
if (node->callback_list) { if (node->callback_list) {
g_list_foreach (node->callback_list, g_list_foreach (node->callback_list,
preferneces_callback_node_invoke_func, preferences_callback_node_invoke_func,
(gpointer) NULL); (gpointer) NULL);
} }
} }
} }
/** /**
* preferneces_callback_node_alloc * preferences_callback_node_alloc
* *
* Allocate a callback info struct from the given values. PreferencesCallbackNode * Allocate a callback info struct from the given values. PreferencesCallbackNode
* structures are used as nodes for the callbac_list member of pref hash table * structures are used as nodes for the callbac_list member of pref hash table
...@@ -364,7 +364,7 @@ preferences_hash_node_check_changes_func (gpointer key, ...@@ -364,7 +364,7 @@ preferences_hash_node_check_changes_func (gpointer key,
* Return value: A newly allocated node. * Return value: A newly allocated node.
**/ **/
static PreferencesCallbackNode * static PreferencesCallbackNode *
preferneces_callback_node_alloc (NautilusPreferencesCallback callback_proc, preferences_callback_node_alloc (NautilusPreferencesCallback callback_proc,
gpointer callback_data, gpointer callback_data,
const PreferencesHashNode *hash_node) const PreferencesHashNode *hash_node)
{ {
...@@ -382,13 +382,13 @@ preferneces_callback_node_alloc (NautilusPreferencesCallback callback_proc, ...@@ -382,13 +382,13 @@ preferneces_callback_node_alloc (NautilusPreferencesCallback callback_proc,
} }
/** /**
* preferneces_callback_node_free * preferences_callback_node_free
* *
* Free a callback info struct. * Free a callback info struct.
* @preferneces_callback_node: The struct to free. * @preferences_callback_node: The struct to free.
**/ **/
static void static void
preferneces_callback_node_free (PreferencesCallbackNode *callback_node) preferences_callback_node_free (PreferencesCallbackNode *callback_node)
{ {
g_assert (callback_node != NULL); g_assert (callback_node != NULL);
...@@ -399,7 +399,7 @@ preferneces_callback_node_free (PreferencesCallbackNode *callback_node) ...@@ -399,7 +399,7 @@ preferneces_callback_node_free (PreferencesCallbackNode *callback_node)
} }
/** /**
* preferneces_callback_node_free_func * preferences_callback_node_free_func
* *
* A function that frees a callback info struct. It is meant to be fed to * A function that frees a callback info struct. It is meant to be fed to
* g_list_foreach () * g_list_foreach ()
...@@ -407,16 +407,16 @@ preferneces_callback_node_free (PreferencesCallbackNode *callback_node) ...@@ -407,16 +407,16 @@ preferneces_callback_node_free (PreferencesCallbackNode *callback_node)
* @callback_data: The callback_data privately maintained by the GList. * @callback_data: The callback_data privately maintained by the GList.
**/ **/
static void static void
preferneces_callback_node_free_func (gpointer data, preferences_callback_node_free_func (gpointer data,
gpointer callback_data) gpointer callback_data)
{ {
g_assert (data != NULL); g_assert (data != NULL);
preferneces_callback_node_free ((PreferencesCallbackNode *) data); preferences_callback_node_free ((PreferencesCallbackNode *) data);
} }
/** /**
* preferneces_callback_node_invoke_func * preferences_callback_node_invoke_func
* *
* A function that invokes a callback from the given struct. It is meant to be fed to * A function that invokes a callback from the given struct. It is meant to be fed to
* g_list_foreach () * g_list_foreach ()
...@@ -424,7 +424,7 @@ preferneces_callback_node_free_func (gpointer data, ...@@ -424,7 +424,7 @@ preferneces_callback_node_free_func (gpointer data,
* @callback_data: The callback_data privately maintained by the GList. * @callback_data: The callback_data privately maintained by the GList.
**/ **/
static void static void
preferneces_callback_node_invoke_func (gpointer data, preferences_callback_node_invoke_func (gpointer data,
gpointer callback_data) gpointer callback_data)
{ {
PreferencesCallbackNode *callback_node; PreferencesCallbackNode *callback_node;
...@@ -562,7 +562,7 @@ preferences_gconf_callback (GConfClient *client, ...@@ -562,7 +562,7 @@ preferences_gconf_callback (GConfClient *client,
/* Invoke callbacks for this node */ /* Invoke callbacks for this node */
if (node->callback_list) { if (node->callback_list) {
g_list_foreach (node->callback_list, g_list_foreach (node->callback_list,
preferneces_callback_node_invoke_func, preferences_callback_node_invoke_func,
(gpointer) NULL); (gpointer) NULL);
} }
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusUndoContext /* NautilusUndoContext - Used internally by undo machinery.
* Not public.
* *
* Copyright (C) 2000 Eazel, Inc. * Copyright (C) 2000 Eazel, Inc.
* *
...@@ -23,16 +24,11 @@ ...@@ -23,16 +24,11 @@
*/ */
#include <config.h> #include <config.h>
#include "nautilus-undo-context.h"
#include "nautilus-gtk-macros.h"
#include <gtk/gtksignal.h> #include <gtk/gtksignal.h>
#include <gtk/gtkmain.h>
#include <bonobo/bonobo-main.h>