summaryrefslogtreecommitdiff
path: root/libnautilus/nautilus-undoable.h
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-05-19 21:38:54 +0000
committerDarin Adler <darin@src.gnome.org>2000-05-19 21:38:54 +0000
commitf3df1c2b67710f0c8af8cfd7e6c60ba9e103abba (patch)
treeb5e74c4cb0863b58e86e54b06d2c70c32cf379e1 /libnautilus/nautilus-undoable.h
parentbc167f1a374edfbc8cbf7bd8ea57fdcd9689db27 (diff)
downloadnautilus-f3df1c2b67710f0c8af8cfd7e6c60ba9e103abba.tar.gz
File name changes.
* components/services/trilobite/sample/command-line/.cvsignore: * components/services/trilobite/sample/service/.cvsignore: File name changes. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_file_monitor_add), (nautilus_self_check_directory): * libnautilus-extensions/nautilus-directory.h: * src/file-manager/fm-directory-view.c: (finish_loading_uri): Added reload interface. * libnautilus/nautilus-undoable.c: (nautilus_undo_register), (undo_atom_destroy), (undo_atom_destroy_notify_cover), (undo_atom_destroy_g_func_cover), (save_callback), (restore_callback), (nautilus_undo_register_full), (nautilus_undo_unregister), (nautilus_undo): * libnautilus/nautilus-undoable.h: Implemented new simplified Undo API. * libnautilus-extensions/nautilus-entry.c: (nautilus_entry_initialize), (nautilus_entry_destroy), (nautilus_entry_key_press), (nautilus_entry_changed), (register_edit_undo), (update_undo_text), (restore_from_undo_snapshot_callback), (nautilus_entry_enable_undo): * libnautilus-extensions/nautilus-icon-container.c: (hide_rename_widget): * libnautilus-extensions/nautilus-icon-text-item.c: (iti_event), (register_rename_undo), (restore_from_undo_snapshot_callback): * src/nautilus-bookmarks-window.c: (on_window_delete_event): * src/nautilus-location-bar.c: (destroy): Use new simplified Undo API. * libnautilus/nautilus-undo-manager.h: Remove UNDO_MANAGER_NAME, which is no longer used. * src/file-manager/fm-icon-view.c: (icon_position_changed_callback): Fixed a bad g_free that was cause seg faults when you resized an icon.
Diffstat (limited to 'libnautilus/nautilus-undoable.h')
-rw-r--r--libnautilus/nautilus-undoable.h62
1 files changed, 54 insertions, 8 deletions
diff --git a/libnautilus/nautilus-undoable.h b/libnautilus/nautilus-undoable.h
index 9d56b5190..628b7f117 100644
--- a/libnautilus/nautilus-undoable.h
+++ b/libnautilus/nautilus-undoable.h
@@ -40,9 +40,10 @@
#define NAUTILUS_IS_UNDOABLE_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_UNDOABLE))
+typedef struct NautilusUndoable NautilusUndoable;
typedef struct NautilusUndoableClass NautilusUndoableClass;
+
typedef struct NautilusUndoManager NautilusUndoManager;
-typedef struct NautilusUndoable NautilusUndoable;
typedef struct NautilusUndoTransaction NautilusUndoTransaction;
struct NautilusUndoable {
@@ -55,16 +56,61 @@ struct NautilusUndoable {
struct NautilusUndoableClass {
GtkObjectClass parent_class;
- void (* save_undo_snapshot) (GtkObject *object, gpointer data);
- void (* restore_from_undo_snapshot) (GtkObject *object, gpointer data);
+ void (* save_undo_snapshot) (GtkObject *object,
+ gpointer data);
+ void (* restore_from_undo_snapshot) (GtkObject *object,
+ gpointer data);
+
+ void (* obsoleted) (NautilusUndoable *object,
+ gpointer user_data);
};
/* GtkObject */
-GtkType nautilus_undoable_get_type (void);
+GtkType nautilus_undoable_get_type (void);
+GtkObject *nautilus_undoable_new (void);
+
+/* Basic operations. */
+void nautilus_undoable_save_undo_snapshot (NautilusUndoTransaction *transaction,
+ GtkObject *target,
+ GtkSignalFunc save_function,
+ GtkSignalFunc restore_function);
+void nautilus_undoable_restore_from_undo_snapshot (NautilusUndoable *undoable);
-GtkObject *nautilus_undoable_new (void);
-void nautilus_undoable_save_undo_snapshot (NautilusUndoTransaction *transaction, GtkObject *target,
- GtkSignalFunc save_func, GtkSignalFunc restore_func);
-void nautilus_undoable_restore_from_undo_snapshot (NautilusUndoable *undoable);
+/* A change that makes this atom no longer apply. */
+void nautilus_undoable_mark_obsolete (NautilusUndoable *undoable);
+
+typedef void (* NautilusUndoCallback) (GtkObject *target, gpointer callback_data);
+
+/* Recipe for undo of a bit of work on an object. */
+typedef struct {
+ GtkObject *target;
+ NautilusUndoCallback callback;
+ gpointer callback_data;
+ GDestroyNotify callback_data_destroy_notify;
+} NautilusUndoAtom;
+
+/* Registering something that can be undone. */
+void nautilus_undo_register (GtkObject *target,
+ NautilusUndoCallback callback,
+ gpointer callback_data,
+ GDestroyNotify callback_data_destroy_notify,
+ const char *operation_name,
+ const char *undo_menu_item_name,
+ const char *undo_menu_item_description,
+ const char *redo_menu_item_name,
+ const char *redo_menu_item_description);
+void nautilus_undo_register_full (GList *atoms,
+ GtkObject *undo_manager_search_start_object,
+ const char *operation_name,
+ const char *undo_menu_item_name,
+ const char *undo_menu_item_description,
+ const char *redo_menu_item_name,
+ const char *redo_menu_item_description);
+void nautilus_undo_unregister (GtkObject *target);
+
+/* Performing an undo explicitly. Only for use by objects "out in the field".
+ * The menu bar itself uses a richer API in the undo manager.
+ */
+void nautilus_undo (GtkObject *undo_manager_search_start_object);
#endif