… | |
… | |
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) rxvt_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_STRING, |
18 | DT_STR, |
|
|
19 | DT_STR_LEN, |
|
|
20 | DT_WCS_LEN, |
|
|
21 | DT_XEVENT, |
19 | }; |
22 | }; |
20 | |
23 | |
21 | enum hook_type { |
24 | enum hook_type { |
22 | HOOK_INIT = 0, // special, hardcoded |
25 | # define def(sym) HOOK_ ## sym, |
23 | HOOK_DESTROY = 1, // values in urxvt.pm |
26 | # include "hookinc.h" |
24 | HOOK_RESET, |
27 | # undef def |
25 | HOOK_START, |
28 | HOOK_NUM, |
|
|
29 | }; |
26 | |
30 | |
27 | HOOK_SEL_BEGIN, |
31 | struct rxvt_perl_term |
28 | HOOK_SEL_EXTEND, |
32 | { |
29 | HOOK_SEL_MAKE, |
33 | void *self; |
30 | HOOK_SEL_GRAB, |
34 | unsigned long grabtime; |
31 | |
|
|
32 | HOOK_FOCUS_IN, |
|
|
33 | HOOK_FOCUS_OUT, |
|
|
34 | |
|
|
35 | HOOK_VIEW_CHANGE, |
|
|
36 | HOOK_SCROLL_BACK, |
|
|
37 | HOOK_TTY_ACTIVITY, |
|
|
38 | |
|
|
39 | HOOK_REFRESH_BEGIN, |
|
|
40 | HOOK_REFRESH_END, |
|
|
41 | |
|
|
42 | HOOK_KEYBOARD_COMMAND, |
|
|
43 | |
|
|
44 | HOOK_NUM, |
|
|
45 | }; |
35 | }; |
46 | |
36 | |
47 | struct rxvt_perl_interp |
37 | struct rxvt_perl_interp |
48 | { |
38 | { |
|
|
39 | char **perl_environ; |
|
|
40 | |
49 | rxvt_perl_interp (); |
41 | rxvt_perl_interp (); |
50 | ~rxvt_perl_interp (); |
42 | ~rxvt_perl_interp (); |
51 | |
43 | |
52 | bool should_invoke[HOOK_NUM]; |
44 | bool should_invoke[HOOK_NUM]; |
53 | |
45 | |
54 | void init (); |
46 | void init (); |
55 | bool invoke (rxvt_term *term, hook_type htype, ...); |
47 | bool invoke (rxvt_term *term, hook_type htype, ...); |
|
|
48 | void line_update (rxvt_term *term); |
56 | }; |
49 | }; |
57 | |
50 | |
58 | extern struct rxvt_perl_interp rxvt_perl; |
51 | extern struct rxvt_perl_interp rxvt_perl; |
59 | |
52 | |
60 | #else |
53 | #else |
|
|
54 | # define SHOULD_INVOKE(htype) false |
61 | # define PERL_INVOKE(args) false |
55 | # define HOOK_INVOKE(args) false |
62 | #endif |
56 | #endif |
63 | |
57 | |
64 | #endif |
58 | #endif |
65 | |
59 | |