summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-undo.h
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-01 22:24:23 -0300
committerPerberos <[email protected]>2011-12-01 22:24:23 -0300
commit0e004c696b0e68b2cff37a4c3315b022a35eaf43 (patch)
tree43261e815529cb9518ed7be37af13b846af8b26b /libcaja-private/caja-undo.h
downloadcaja-0e004c696b0e68b2cff37a4c3315b022a35eaf43.tar.bz2
caja-0e004c696b0e68b2cff37a4c3315b022a35eaf43.tar.xz
moving from https://github.com/perberos/mate-desktop-environment
Diffstat (limited to 'libcaja-private/caja-undo.h')
-rw-r--r--libcaja-private/caja-undo.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/libcaja-private/caja-undo.h b/libcaja-private/caja-undo.h
new file mode 100644
index 00000000..09adefc0
--- /dev/null
+++ b/libcaja-private/caja-undo.h
@@ -0,0 +1,77 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/* caja-undo.h - public interface for objects that implement
+ * undoable actions -- works across components
+ *
+ * Copyright (C) 2000 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.
+ *
+ * Author: Darin Adler <[email protected]>
+ */
+
+#ifndef CAJA_UNDO_H
+#define CAJA_UNDO_H
+
+#include <glib-object.h>
+
+typedef struct _CajaUndoTransaction CajaUndoTransaction;
+
+
+/* The basic undoable operation. */
+typedef void (* CajaUndoCallback) (GObject *target, gpointer callback_data);
+
+/* Recipe for undo of a bit of work on an object.
+ * Create these atoms when you want to register more
+ * than one as a single undoable operation.
+ */
+typedef struct
+{
+ GObject *target;
+ CajaUndoCallback callback;
+ gpointer callback_data;
+ GDestroyNotify callback_data_destroy_notify;
+} CajaUndoAtom;
+
+/* Registering something that can be undone. */
+void caja_undo_register (GObject *target,
+ CajaUndoCallback callback,
+ gpointer callback_data,
+ GDestroyNotify callback_data_destroy_notify,
+ const char *operation_name,
+ const char *undo_menu_item_label,
+ const char *undo_menu_item_hint,
+ const char *redo_menu_item_label,
+ const char *redo_menu_item_hint);
+void caja_undo_register_full (GList *atoms,
+ GObject *undo_manager_search_start_object,
+ const char *operation_name,
+ const char *undo_menu_item_label,
+ const char *undo_menu_item_hint,
+ const char *redo_menu_item_label,
+ const char *redo_menu_item_hint);
+void caja_undo_unregister (GObject *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 caja_undo (GObject *undo_manager_search_start_object);
+
+/* Connecting an undo manager. */
+void caja_undo_share_undo_manager (GObject *destination_object,
+ GObject *source_object);
+
+#endif /* CAJA_UNDO_H */