diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-27 08:52:42 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-30 14:34:36 +0200 |
commit | 6907ae73e76d11c201ff237663af79b3bbfc5385 (patch) | |
tree | 3863be2f3c8b31f7a0c138debc3e5927f9b06acd /src/calcurse.h | |
parent | b230e2949ef888010c133e4b6f7690f2e1ed2c09 (diff) | |
download | calcurse-6907ae73e76d11c201ff237663af79b3bbfc5385.zip |
Revise cut/pasting
Instead of calling type-specific duplication handlers and inserting
clones of the original items when pasting, save the generic day item and
remove the actual item from the linked list, so that it can be inserted
anywhere else later.
The cut/paste buffer is moved to the interaction unit, item-specific cut
operations are changed to remove the item from the linked list only
instead of copying and freeing it. An item is only freed if another item
is cut before the current cut/paste buffer is pasted. All paste
operations are changed and reinsert the actual item instead of creating
a clone.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r-- | src/calcurse.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/calcurse.h b/src/calcurse.h index 0dd7d01..4cdfe35 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -609,7 +609,7 @@ void apoint_scroll_pad_up(int); struct notify_app *apoint_check_next(struct notify_app *, long); void apoint_switch_notify(struct apoint *); void apoint_update_panel(int); -void apoint_paste_item(void); +void apoint_paste_item(struct apoint *, long); /* args.c */ int parse_args(int, char **); @@ -672,8 +672,8 @@ void day_write_stdout(long, const char *, const char *, const char *, void day_popup_item(struct day_item *); int day_check_if_item(struct date); unsigned day_chk_busy_slices(struct date, int, int *); -int day_cut_item(long, int); -int day_paste_item(long, int); +struct day_item *day_cut_item(long, int); +int day_paste_item(struct day_item *, long); struct day_item *day_get_item(int); int day_item_nb(long, int, int); void day_edit_note(struct day_item *, const char *); @@ -695,7 +695,7 @@ unsigned event_inday(struct event *, long *); void event_write(struct event *, FILE *); struct event *event_scan(FILE *, struct tm, int, char *); void event_delete(struct event *, enum eraseflg); -void event_paste_item(void); +void event_paste_item(struct event *, long); /* help.c */ void help_wins_init(struct scrollwin *, int, int, int, int); @@ -716,6 +716,7 @@ void interact_day_item_delete(unsigned *, unsigned *); void interact_day_item_edit(void); void interact_day_item_pipe(void); void interact_day_item_repeat(void); +void interact_day_item_cut_free(); int interact_day_item_cut(unsigned *, unsigned *); void interact_day_item_paste(unsigned *, unsigned *, int); void interact_todo_add(void); @@ -879,8 +880,8 @@ void recur_apoint_erase(struct recur_apoint *, long, unsigned, enum eraseflg); void recur_exc_scan(llist_t *, FILE *); struct notify_app *recur_apoint_check_next(struct notify_app *, long, long); void recur_apoint_switch_notify(struct recur_apoint *); -void recur_event_paste_item(void); -void recur_apoint_paste_item(void); +void recur_event_paste_item(struct recur_event *, long); +void recur_apoint_paste_item(struct recur_apoint *, long); /* sigs.c */ void sigs_init(void); |