X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fevent-log.h;h=9fcd01e1c7a2b9c45e4d688a3dcd99e9bd237e70;hb=7b51296159813ffbc382e4decef735f222ee23f8;hp=16ecfd5558c4d77b66627d6ed92ea624e546c033;hpb=e173aaf34472892de413d42ef20b7fd00aafd45b;p=inkscape.git diff --git a/src/event-log.h b/src/event-log.h index 16ecfd555..9fcd01e1c 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -16,7 +16,7 @@ * Author: * Gustav Broberg * - * Copyright (c) 2006 Authors + * Copyright (c) 2006, 2007 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -44,8 +44,8 @@ public: typedef Gtk::TreeModel::iterator iterator; typedef Gtk::TreeModel::const_iterator const_iterator; - EventLog(); - ~EventLog(); + EventLog(SPDocument* document); + virtual ~EventLog(); /** * Event datatype @@ -53,13 +53,14 @@ public: struct EventModelColumns : public Gtk::TreeModelColumnRecord { + Gtk::TreeModelColumn event; Gtk::TreeModelColumn type; Gtk::TreeModelColumn description; Gtk::TreeModelColumn child_count; EventModelColumns() { - add(type); add(description); add(child_count); + add(event); add(type); add(description); add(child_count); } }; @@ -71,6 +72,8 @@ public: void notifyUndoEvent(Event *log); void notifyRedoEvent(Event *log); void notifyUndoCommitEvent(Event *log); + void notifyClearUndoEvent(); + void notifyClearRedoEvent(); /** * Accessor functions @@ -84,8 +87,7 @@ public: void setCurrEvent(iterator event) { _curr_event = event; } void setCurrEventParent(iterator event) { _curr_event_parent = event; } void blockNotifications(bool status=true) { _notifications_blocked = status; } - - void setDocument(SPDocument *document); + void rememberFileSave() { _last_saved = _curr_event; } /* * Callback types for TreeView changes. @@ -117,10 +119,6 @@ private: const EventModelColumns _columns; - /** - * Helper functions for initialization - */ - Glib::RefPtr _event_list_store; Glib::RefPtr _event_list_selection; Gtk::TreeView *_event_list_view; @@ -129,14 +127,25 @@ private: iterator _last_event; //< end position in _event_list_store iterator _curr_event_parent; //< parent to current event, if any + iterator _last_saved; //< position where last document save occurred + bool _notifications_blocked; //< if notifications should be handled // Map of connections used to temporary block/unblock callbacks in a TreeView CallbackMap *_callback_connections; + /** + * Helper functions + */ + const_iterator _getUndoEvent() const; //< returns the current undoable event or NULL if none const_iterator _getRedoEvent() const; //< returns the current redoable event or NULL if none + void _clearUndo(); //< erase all previously commited events + void _clearRedo(); //< erase all previously undone events + + void checkForVirginity(); //< marks the document as untouched if undo/redo reaches a previously saved state + // noncopyable, nonassignable EventLog(EventLog const &other); EventLog& operator=(EventLog const &other);