2005-09-14 [paul] 1.9.14cvs26
[claws.git] / src / undo.h
index 096fd7d3a6efe28857b7693ebcedd010ecdd1a69..dd00ca15f9dd1d87d750a9e6b9e41a5b7354c968 100644 (file)
@@ -23,7 +23,7 @@
 #define __UNDO_H__
 
 #include <glib.h>
-#include <gtk/gtkwidget.h>
+#include <gtk/gtktextview.h>
 #include <gtk/gtkitemfactory.h>
 
 typedef enum 
@@ -31,7 +31,7 @@ typedef enum
        UNDO_ACTION_INSERT,
        UNDO_ACTION_DELETE,
        UNDO_ACTION_REPLACE_INSERT,
-       UNDO_ACTION_REPLACE_DELETE,
+       UNDO_ACTION_REPLACE_DELETE
 } UndoAction;
 
 typedef enum 
@@ -39,35 +39,42 @@ typedef enum
        UNDO_STATE_TRUE,
        UNDO_STATE_FALSE,
        UNDO_STATE_UNCHANGED,
-       UNDO_STATE_REFRESH,
+       UNDO_STATE_REFRESH
 } UndoState;
 
 typedef struct _UndoMain UndoMain;
 
-typedef void (*UndoChangeState)        (UndoMain       *undostruct,
-                                gint            undo_state,
-                                gint            redo_state,
-                                GtkWidget      *changewidget);
+typedef void (*UndoChangeStateFunc)    (UndoMain       *undostruct,
+                                        gint            undo_state,
+                                        gint            redo_state,
+                                        gpointer        data);
 
 struct _UndoMain 
 {
-       GtkWidget *text;
-       GtkWidget *changewidget;
+       GtkTextView *textview;
+
        GList *undo;
        GList *redo;
-       UndoChangeState change_func;
+
+       UndoChangeStateFunc change_state_func;
+       gpointer change_state_data;
+
        gboolean undo_state : 1;
        gboolean redo_state : 1;
+
        gint paste;
 };
 
-UndoMain *undo_init            (GtkWidget      *text);
-void undo_destroy              (UndoMain       *undostruct);
-void undo_set_undo_change_funct        (UndoMain       *undostruct,
-                                UndoChangeState func,
-                                GtkWidget      *changewidget);
+UndoMain *undo_init            (GtkWidget              *text);
+void undo_destroy              (UndoMain               *undostruct);
+
+void undo_set_change_state_func        (UndoMain               *undostruct,
+                                UndoChangeStateFunc     func,
+                                gpointer                data);
 
-void undo_undo                 (UndoMain       *undostruct); 
-void undo_redo                 (UndoMain       *undostruct); 
+void undo_undo                 (UndoMain               *undostruct); 
+void undo_redo                 (UndoMain               *undostruct); 
+void undo_block                        (UndoMain               *undostruct);
+void undo_unblock              (UndoMain               *undostruct);
 
 #endif /* __UNDO_H__ */