… | |
… | |
4 | |
4 | |
5 | #ifndef RXVTPERL_H_ |
5 | #ifndef RXVTPERL_H_ |
6 | #define RXVTPERL_H_ |
6 | #define RXVTPERL_H_ |
7 | |
7 | |
8 | #if ENABLE_PERL |
8 | #if ENABLE_PERL |
|
|
9 | # define SHOULD_INVOKE(htype) perl.should_invoke [htype] |
|
|
10 | # define HOOK_INVOKE(args) rxvt_perl.invoke args |
9 | |
11 | |
10 | #include "rxvt.h" |
12 | #include "rxvt.h" |
11 | |
|
|
12 | #define PERL_INVOKE(args) rxvt_perl.invoke args |
|
|
13 | |
13 | |
14 | enum data_type { |
14 | enum data_type { |
15 | DT_END, |
15 | DT_END, |
16 | DT_INT, |
16 | DT_INT, |
17 | DT_LONG, |
17 | DT_LONG, |
|
|
18 | DT_STR, |
|
|
19 | DT_STR_LEN, |
|
|
20 | DT_WCS_LEN, |
|
|
21 | DT_XEVENT, |
18 | }; |
22 | }; |
19 | |
23 | |
20 | enum hook_type { |
24 | enum hook_type { |
21 | HOOK_LOAD, |
25 | # define def(sym) HOOK_ ## sym, |
|
|
26 | # include "hookinc.h" |
|
|
27 | # undef def |
|
|
28 | HOOK_NUM, |
|
|
29 | }; |
22 | |
30 | |
23 | HOOK_INIT, |
31 | struct rxvt_perl_term |
24 | HOOK_RESET, |
32 | { |
25 | HOOK_START, |
33 | void *self; |
26 | HOOK_DESTROY, |
34 | unsigned long grabtime; |
27 | |
35 | uint8_t should_invoke[HOOK_NUM]; |
28 | HOOK_SEL_BEGIN, |
|
|
29 | HOOK_SEL_EXTEND, |
|
|
30 | HOOK_SEL_MAKE, |
|
|
31 | HOOK_SEL_GRAB, |
|
|
32 | |
|
|
33 | HOOK_FOCUS_IN, |
|
|
34 | HOOK_FOCUS_OUT, |
|
|
35 | |
|
|
36 | HOOK_VIEW_CHANGE, |
|
|
37 | HOOK_SCROLL_BACK, |
|
|
38 | HOOK_TTY_ACTIVITY, |
|
|
39 | |
|
|
40 | HOOK_REFRESH_BEGIN, |
|
|
41 | HOOK_REFRESH_END, |
|
|
42 | |
|
|
43 | HOOK_NUM, |
|
|
44 | }; |
36 | }; |
45 | |
37 | |
46 | struct rxvt_perl_interp |
38 | struct rxvt_perl_interp |
47 | { |
39 | { |
48 | rxvt_perl_interp (); |
40 | char **perl_environ; |
|
|
41 | |
49 | ~rxvt_perl_interp (); |
42 | ~rxvt_perl_interp (); |
50 | |
|
|
51 | bool should_invoke[HOOK_NUM]; |
|
|
52 | |
43 | |
53 | void init (); |
44 | void init (); |
54 | bool invoke (rxvt_term *term, hook_type htype, ...); |
45 | bool invoke (rxvt_term *term, hook_type htype, ...); |
|
|
46 | void line_update (rxvt_term *term); |
55 | }; |
47 | }; |
56 | |
48 | |
57 | extern struct rxvt_perl_interp rxvt_perl; |
49 | extern struct rxvt_perl_interp rxvt_perl; |
58 | |
50 | |
59 | #else |
51 | #else |
|
|
52 | # define SHOULD_INVOKE(htype) false |
60 | # define PERL_INVOKE(args) false |
53 | # define HOOK_INVOKE(args) false |
61 | #endif |
54 | #endif |
62 | |
55 | |
63 | #endif |
56 | #endif |
64 | |
57 | |