version 1.11, 2016/05/11 20:56:58 |
version 1.12, 2016/10/03 22:52:11 |
|
|
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
int alerts_fired; |
static int alerts_fired; |
|
|
void alerts_timer(int, short, void *); |
static void alerts_timer(int, short, void *); |
int alerts_enabled(struct window *, int); |
static int alerts_enabled(struct window *, int); |
void alerts_callback(int, short, void *); |
static void alerts_callback(int, short, void *); |
void alerts_reset(struct window *); |
static void alerts_reset(struct window *); |
|
|
void alerts_run_hook(struct session *, struct winlink *, int); |
static void alerts_run_hook(struct session *, struct winlink *, int); |
int alerts_check_all(struct session *, struct winlink *); |
static int alerts_check_all(struct session *, struct winlink *); |
int alerts_check_bell(struct session *, struct winlink *); |
static int alerts_check_bell(struct session *, struct winlink *); |
int alerts_check_activity(struct session *, struct winlink *); |
static int alerts_check_activity(struct session *, struct winlink *); |
int alerts_check_silence(struct session *, struct winlink *); |
static int alerts_check_silence(struct session *, struct winlink *); |
void alerts_ring_bell(struct session *); |
static void alerts_ring_bell(struct session *); |
|
|
void |
static void |
alerts_timer(__unused int fd, __unused short events, void *arg) |
alerts_timer(__unused int fd, __unused short events, void *arg) |
{ |
{ |
struct window *w = arg; |
struct window *w = arg; |
|
|
alerts_queue(w, WINDOW_SILENCE); |
alerts_queue(w, WINDOW_SILENCE); |
} |
} |
|
|
void |
static void |
alerts_callback(__unused int fd, __unused short events, __unused void *arg) |
alerts_callback(__unused int fd, __unused short events, __unused void *arg) |
{ |
{ |
struct window *w; |
struct window *w; |
|
|
alerts_fired = 0; |
alerts_fired = 0; |
} |
} |
|
|
void |
static void |
alerts_run_hook(struct session *s, struct winlink *wl, int flags) |
alerts_run_hook(struct session *s, struct winlink *wl, int flags) |
{ |
{ |
struct cmd_find_state fs; |
struct cmd_find_state fs; |
|
|
hooks_run(s->hooks, NULL, &fs, "alert-activity"); |
hooks_run(s->hooks, NULL, &fs, "alert-activity"); |
} |
} |
|
|
int |
static int |
alerts_check_all(struct session *s, struct winlink *wl) |
alerts_check_all(struct session *s, struct winlink *wl) |
{ |
{ |
int alerts; |
int alerts; |
|
|
alerts_check_all(s, wl); |
alerts_check_all(s, wl); |
} |
} |
|
|
int |
static int |
alerts_enabled(struct window *w, int flags) |
alerts_enabled(struct window *w, int flags) |
{ |
{ |
if (flags & WINDOW_BELL) |
if (flags & WINDOW_BELL) |
|
|
alerts_reset(w); |
alerts_reset(w); |
} |
} |
|
|
void |
static void |
alerts_reset(struct window *w) |
alerts_reset(struct window *w) |
{ |
{ |
struct timeval tv; |
struct timeval tv; |
|
|
} |
} |
} |
} |
|
|
int |
static int |
alerts_check_bell(struct session *s, struct winlink *wl) |
alerts_check_bell(struct session *s, struct winlink *wl) |
{ |
{ |
struct client *c; |
struct client *c; |
|
|
return (WINDOW_BELL); |
return (WINDOW_BELL); |
} |
} |
|
|
int |
static int |
alerts_check_activity(struct session *s, struct winlink *wl) |
alerts_check_activity(struct session *s, struct winlink *wl) |
{ |
{ |
struct client *c; |
struct client *c; |
|
|
return (WINDOW_ACTIVITY); |
return (WINDOW_ACTIVITY); |
} |
} |
|
|
int |
static int |
alerts_check_silence(struct session *s, struct winlink *wl) |
alerts_check_silence(struct session *s, struct winlink *wl) |
{ |
{ |
struct client *c; |
struct client *c; |
|
|
return (WINDOW_SILENCE); |
return (WINDOW_SILENCE); |
} |
} |
|
|
void |
static void |
alerts_ring_bell(struct session *s) |
alerts_ring_bell(struct session *s) |
{ |
{ |
struct client *c; |
struct client *c; |