aboutsummaryrefslogtreecommitdiffstats
path: root/src/delayed.h
blob: aa85c4b9d08502669c831a0236bb1130ce1b865b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef E_DELAYED_H
#define E_DELAYED_H

#include "e.h"

typedef struct _E_Delayed_Action E_Delayed_Action;

struct _E_Delayed_Action {
	OBS_PROPERTIES;

	double delay;
	void (*delay_func)(int val, void *obj);
};

#define E_DELAYED_ACT_INIT(_e_da, _e_act, _e_delay, _e_act_cb) \
{ \
    OBS_INIT(_e_da, _e_act, e_delayed_action_start, e_delayed_action_free); \
    _e_da->delay = _e_delay; \
    _e_da->delay_func = _e_act_cb; \
}

void e_delayed_action_start(void *obs, void *obj);
void e_delayed_action_cancel(void *obs);
void e_delayed_action_free(void *obs);

#endif