1 /* Copyright (c) 2006-2015 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
18 #include "tig/types.h"
21 WATCH_EVENT_SWITCH_VIEW
,
22 WATCH_EVENT_AFTER_COMMAND
,
29 WATCH_INDEX_STAGED_YES
= 1 << 0,
30 WATCH_INDEX_STAGED_NO
= 1 << 1,
31 WATCH_INDEX_UNSTAGED_YES
= 1 << 2,
32 WATCH_INDEX_UNSTAGED_NO
= 1 << 3,
37 WATCH_INDEX_STAGED
= WATCH_INDEX_STAGED_YES
| WATCH_INDEX_STAGED_NO
,
38 WATCH_INDEX_UNSTAGED
= WATCH_INDEX_UNSTAGED_YES
| WATCH_INDEX_UNSTAGED_NO
,
39 WATCH_INDEX
= WATCH_INDEX_STAGED
| WATCH_INDEX_UNSTAGED
,
44 enum watch_trigger triggers
;
45 enum watch_trigger changed
;
46 enum watch_trigger state
;
49 void watch_register(struct watch
*watch
, enum watch_trigger triggers
);
50 void watch_unregister(struct watch
*watch
);
51 bool watch_dirty(struct watch
*watch
);
52 enum watch_trigger
watch_update(enum watch_event event
);
53 enum watch_trigger
watch_update_single(struct watch
*watch
, enum watch_event event
);
54 void watch_apply(struct watch
*source
, enum watch_trigger changed
);
55 int watch_periodic(int interval
);
58 /* vim: set ts=8 sw=8 noexpandtab: */