summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-undo-manager.h
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-06-07 02:47:10 +0000
committerDarin Adler <darin@src.gnome.org>2000-06-07 02:47:10 +0000
commit62ae037752dc780c7def921c36df45dc2cfb66f0 (patch)
treec4e2c923f38b282120f3ab717c1787e403adf7f5 /libnautilus-private/nautilus-undo-manager.h
parentaac364ac6b2ab7205a694b13d95d2d21f4e8335d (diff)
downloadnautilus-62ae037752dc780c7def921c36df45dc2cfb66f0.tar.gz
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.
Diffstat (limited to 'libnautilus-private/nautilus-undo-manager.h')
-rw-r--r--libnautilus-private/nautilus-undo-manager.h74
1 files changed, 31 insertions, 43 deletions
diff --git a/libnautilus-private/nautilus-undo-manager.h b/libnautilus-private/nautilus-undo-manager.h
index 668733d1b..0e5deccb9 100644
--- a/libnautilus-private/nautilus-undo-manager.h
+++ b/libnautilus-private/nautilus-undo-manager.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* NautilusUndoManager - Manages undo and redo transactions.
+ * This is the public interface used by the application.
*
* Copyright (C) 2000 Eazel, Inc.
*
@@ -25,10 +26,7 @@
#ifndef NAUTILUS_UNDO_MANAGER_H
#define NAUTILUS_UNDO_MANAGER_H
-#include <bonobo/bonobo-control.h>
-
-#include "nautilus-undo-transaction.h"
-#include "nautilus-undo.h"
+#include <bonobo/bonobo-ui-handler.h>
#define NAUTILUS_TYPE_UNDO_MANAGER \
(nautilus_undo_manager_get_type ())
@@ -41,46 +39,36 @@
#define NAUTILUS_IS_UNDO_MANAGER_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_UNDO_MANAGER))
-typedef struct NautilusUndoManagerClass NautilusUndoManagerClass;
typedef struct NautilusUndoManagerDetails NautilusUndoManagerDetails;
-struct NautilusUndoManager {
+typedef struct {
BonoboObject parent;
NautilusUndoManagerDetails *details;
-};
-
-struct NautilusUndoManagerClass {
- BonoboObjectClass parent_class;
- void (* undo_transaction_occurred) (GtkObject *object, gpointer data);
- gpointer servant_init_func, servant_destroy_func, vepv;
-};
-
-
-/* GtkObject */
-GtkType nautilus_undo_manager_get_type (void);
-NautilusUndoManager *nautilus_undo_manager_new (void);
-
-/* Prototypes */
-gboolean nautilus_undo_manager_can_undo (NautilusUndoManager *manager);
-gboolean nautilus_undo_manager_can_redo (NautilusUndoManager *manager);
-void nautilus_undo_manager_enable_redo (NautilusUndoManager *manager,
- gboolean value);
-void nautilus_undo_manager_set_queue_depth (NautilusUndoManager *manager,
- gint depth);
-
-void nautilus_attach_undo_manager (GtkObject *object,
- Nautilus_Undo_Manager manager);
-void nautilus_share_undo_manager (GtkObject *destination_object,
- GtkObject *source_object);
-void nautilus_undo_set_up_bonobo_control (BonoboControl *control);
-Nautilus_Undo_Manager nautilus_get_undo_manager (GtkObject *start_object);
-
-void nautilus_undo_manager_stash_global_undo (Nautilus_Undo_Manager undo_manager);
-Nautilus_Undo_Manager nautilus_undo_manager_get_global_undo (void);
-
-
-Nautilus_Undo_Transaction nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager);
-
-
-
-#endif
+} NautilusUndoManager;
+
+typedef struct {
+ BonoboObjectClass parent_slot;
+ void (* changed) (GtkObject *object, gpointer data);
+} NautilusUndoManagerClass;
+
+GtkType nautilus_undo_manager_get_type (void);
+NautilusUndoManager *nautilus_undo_manager_new (void);
+
+/* Undo operations. */
+void nautilus_undo_manager_undo (NautilusUndoManager *undo_manager);
+
+/* Connect the manager to a particular menu item. */
+void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *manager,
+ BonoboUIHandler *handler,
+ const char *path,
+ const char *no_undo_menu_item_label,
+ const char *no_undo_menu_item_hint);
+
+/* Attach the undo manager to a Gtk object so that object and the widgets inside it can participate in undo. */
+void nautilus_undo_manager_attach (NautilusUndoManager *manager,
+ GtkObject *object);
+/* Attach the undo manager to a Bonobo object so another component can find it. */
+void nautilus_undo_manager_add_interface (NautilusUndoManager *manager,
+ BonoboObject *object);
+
+#endif /* NAUTILUS_UNDO_MANAGER_H */