X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fundostack.C;h=1bb781022695ec1ba5059c834c236902924a7696;hb=6fae7dd0f56872d524c1a6cf749a15574783f9e8;hp=9216c2e17ad1a2734b6d5bd6cb89f52a32a5d86e;hpb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/undostack.C b/cinelerra-5.1/cinelerra/undostack.C index 9216c2e1..1bb78102 100644 --- a/cinelerra-5.1/cinelerra/undostack.C +++ b/cinelerra-5.1/cinelerra/undostack.C @@ -35,6 +35,23 @@ UndoStack::~UndoStack() { } +UndoStackItem *UndoStack::get_current_undo() +{ + UndoStackItem *item = current; + if( item && (number_of(item) % 2) ) item = item->previous; + if( item && !(number_of(item) % 2) ) item = item->previous; + return item; +} + +UndoStackItem *UndoStack::get_current_redo() +{ + UndoStackItem *item = current ? current : first; + if( item && (number_of(item) % 2) ) item = item->next; + if( item && !(number_of(item) % 2) ) item = item->next; + return item; +} + + UndoStackItem* UndoStack::push() { // current is only 0 if before first undo @@ -76,11 +93,6 @@ UndoStackItem* UndoStack::push() return current; } -void UndoStack::pull() -{ - if(current) current = PREVIOUS; -} - UndoStackItem* UndoStack::pull_next() { // use first entry if none @@ -506,7 +518,7 @@ void UndoStackItem::set_data(char *data) new_size, &this->data_size, 0); -//printf("UndoStackItem::set_data 2 " _LD "\n", timer.get_difference()); +//printf("UndoStackItem::set_data 2 %jd\n", timer.get_difference()); // Testing // FILE *test1 = fopen("/tmp/undo1", "w");