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