… | |
… | |
52 | ///////////////////////////////////////////////////////////////////////////// |
52 | ///////////////////////////////////////////////////////////////////////////// |
53 | |
53 | |
54 | typedef char * octet_string; |
54 | typedef char * octet_string; |
55 | typedef char * utf8_string; |
55 | typedef char * utf8_string; |
56 | |
56 | |
|
|
57 | typedef int render_repeat_mode; |
|
|
58 | |
57 | typedef GdkPixbuf * urxvt__pixbuf; |
59 | typedef GdkPixbuf * urxvt__pixbuf; |
58 | typedef rxvt_img * urxvt__img; |
60 | typedef rxvt_img * urxvt__img; |
59 | |
61 | |
60 | ///////////////////////////////////////////////////////////////////////////// |
62 | ///////////////////////////////////////////////////////////////////////////// |
61 | |
63 | |
… | |
… | |
389 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); |
391 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); |
390 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0); |
392 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0); |
391 | } |
393 | } |
392 | } |
394 | } |
393 | |
395 | |
|
|
396 | void |
|
|
397 | rxvt_perl_interp::usage (int type) |
|
|
398 | { |
|
|
399 | localise_env set_environ (perl_environ); |
|
|
400 | |
|
|
401 | ENTER; |
|
|
402 | SAVETMPS; |
|
|
403 | |
|
|
404 | dSP; |
|
|
405 | XPUSHs (sv_2mortal (newSViv (type))); |
|
|
406 | PUTBACK; |
|
|
407 | call_pv ("urxvt::usage", G_VOID | G_DISCARD | G_EVAL); |
|
|
408 | |
|
|
409 | FREETMPS; |
|
|
410 | LEAVE; |
|
|
411 | } |
|
|
412 | |
|
|
413 | uint8_t |
|
|
414 | rxvt_perl_interp::resource (rxvt_term *term, const char *name, bool arg, bool longopt, bool flag, const char *value) |
|
|
415 | { |
|
|
416 | localise_env set_environ (perl_environ); |
|
|
417 | |
|
|
418 | ENTER; |
|
|
419 | SAVETMPS; |
|
|
420 | |
|
|
421 | dSP; |
|
|
422 | EXTEND (SP, 6); |
|
|
423 | PUSHs (sv_2mortal (newSVterm (term))); |
|
|
424 | PUSHs (sv_2mortal (newSVpv (name, 0))); |
|
|
425 | PUSHs (arg ? &PL_sv_yes : &PL_sv_no); |
|
|
426 | PUSHs (longopt ? &PL_sv_yes : &PL_sv_no); |
|
|
427 | PUSHs (flag ? &PL_sv_yes : &PL_sv_no); |
|
|
428 | PUSHs (value ? sv_2mortal (newSVpv (value, 0)) : &PL_sv_undef); |
|
|
429 | PUTBACK; |
|
|
430 | call_pv ("urxvt::resource", G_SCALAR | G_EVAL); |
|
|
431 | |
|
|
432 | uint8_t ret = POPi; |
|
|
433 | |
|
|
434 | FREETMPS; |
|
|
435 | LEAVE; |
|
|
436 | |
|
|
437 | return ret; |
|
|
438 | } |
|
|
439 | |
394 | static void |
440 | static void |
395 | ungrab (rxvt_term *THIS) |
441 | ungrab (rxvt_term *THIS) |
396 | { |
442 | { |
397 | if (THIS->perl.grabtime) |
443 | if (THIS->perl.grabtime) |
398 | { |
444 | { |
… | |
… | |
429 | } |
475 | } |
430 | } |
476 | } |
431 | |
477 | |
432 | bool event_consumed; |
478 | bool event_consumed; |
433 | |
479 | |
434 | if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always |
|
|
435 | || term->perl.should_invoke [htype]) |
480 | if (term->perl.should_invoke [htype]) |
436 | { |
481 | { |
437 | dSP; |
482 | dSP; |
438 | va_list ap; |
483 | va_list ap; |
439 | |
484 | |
440 | va_start (ap, htype); |
485 | va_start (ap, htype); |
… | |
… | |
650 | ENTER; |
695 | ENTER; |
651 | SAVETMPS; |
696 | SAVETMPS; |
652 | |
697 | |
653 | dSP; |
698 | dSP; |
654 | XPUSHs (sv_2mortal (newSVpvn (data, len))); |
699 | XPUSHs (sv_2mortal (newSVpvn (data, len))); |
|
|
700 | PUTBACK; |
655 | call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL); |
701 | call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL); |
656 | |
702 | |
657 | if (SvTRUE (ERRSV)) |
703 | if (SvTRUE (ERRSV)) |
658 | rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); |
704 | rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); |
659 | |
705 | |
… | |
… | |
800 | const_iv (XIMSecondary), |
846 | const_iv (XIMSecondary), |
801 | const_iv (XIMTertiary), |
847 | const_iv (XIMTertiary), |
802 | const_iv (XIMVisibleToForward), |
848 | const_iv (XIMVisibleToForward), |
803 | const_iv (XIMVisibleToBackword), |
849 | const_iv (XIMVisibleToBackword), |
804 | const_iv (XIMVisibleToCenter), |
850 | const_iv (XIMVisibleToCenter), |
805 | #if HAVE_XRENDER |
851 | #if XRENDER |
806 | const_iv (PictStandardARGB32), |
852 | const_iv (PictStandardARGB32), |
807 | const_iv (PictStandardRGB24), |
853 | const_iv (PictStandardRGB24), |
808 | const_iv (PictStandardA8), |
854 | const_iv (PictStandardA8), |
809 | const_iv (PictStandardA4), |
855 | const_iv (PictStandardA4), |
810 | const_iv (PictStandardA1), |
856 | const_iv (PictStandardA1), |
… | |
… | |
845 | rxvt_fatal ("%s", msg); |
891 | rxvt_fatal ("%s", msg); |
846 | |
892 | |
847 | void |
893 | void |
848 | _exit (int status) |
894 | _exit (int status) |
849 | |
895 | |
|
|
896 | void |
|
|
897 | catch_fatal (SV *block) |
|
|
898 | PROTOTYPE: & |
|
|
899 | CODE: |
|
|
900 | try |
|
|
901 | { |
|
|
902 | PUSHMARK (SP); |
|
|
903 | PUTBACK; |
|
|
904 | call_sv (block, G_VOID | G_DISCARD); |
|
|
905 | SPAGAIN; |
|
|
906 | } |
|
|
907 | catch (const rxvt_failure_exception &e) |
|
|
908 | { |
|
|
909 | croak ("rxvt_fatal exception caught, trying to continue."); |
|
|
910 | } |
|
|
911 | |
850 | NV |
912 | NV |
851 | NOW () |
913 | NOW () |
852 | CODE: |
914 | CODE: |
853 | RETVAL = ev::now (); |
915 | RETVAL = ev::now (); |
854 | OUTPUT: |
916 | OUTPUT: |
… | |
… | |
978 | rxvt_term::destroy () |
1040 | rxvt_term::destroy () |
979 | |
1041 | |
980 | void |
1042 | void |
981 | rxvt_term::set_should_invoke (int htype, int inc) |
1043 | rxvt_term::set_should_invoke (int htype, int inc) |
982 | CODE: |
1044 | CODE: |
983 | THIS->perl.should_invoke [htype] += inc; |
1045 | uint8_t &count = THIS->perl.should_invoke [htype]; |
|
|
1046 | uint8_t prev = count; |
|
|
1047 | count += inc; |
|
|
1048 | if (!prev != !count) |
|
|
1049 | { |
|
|
1050 | // hook status changed, react |
|
|
1051 | switch (htype) |
|
|
1052 | { |
|
|
1053 | case HOOK_POSITION_CHANGE: |
|
|
1054 | if (count) |
|
|
1055 | THIS->get_window_origin (THIS->parent_x, THIS->parent_y); |
|
|
1056 | } |
|
|
1057 | } |
984 | |
1058 | |
985 | int |
1059 | int |
986 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1060 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
987 | CODE: |
1061 | CODE: |
988 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1062 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
… | |
… | |
1245 | CODE: |
1319 | CODE: |
1246 | RETVAL = THIS->parent; |
1320 | RETVAL = THIS->parent; |
1247 | OUTPUT: |
1321 | OUTPUT: |
1248 | RETVAL |
1322 | RETVAL |
1249 | |
1323 | |
1250 | Window |
1324 | int |
1251 | rxvt_term::vt () |
1325 | rxvt_term::parent_x () |
1252 | CODE: |
1326 | CODE: |
1253 | RETVAL = THIS->vt; |
1327 | RETVAL = THIS->parent_x; |
|
|
1328 | OUTPUT: |
|
|
1329 | RETVAL |
|
|
1330 | |
|
|
1331 | int |
|
|
1332 | rxvt_term::parent_y () |
|
|
1333 | CODE: |
|
|
1334 | RETVAL = THIS->parent_y; |
1254 | OUTPUT: |
1335 | OUTPUT: |
1255 | RETVAL |
1336 | RETVAL |
1256 | |
1337 | |
1257 | void |
1338 | void |
1258 | rxvt_term::vt_emask_add (U32 emask) |
1339 | rxvt_term::vt_emask_add (U32 emask) |
… | |
… | |
1934 | } |
2015 | } |
1935 | |
2016 | |
1936 | ############################################################################# |
2017 | ############################################################################# |
1937 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
2018 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
1938 | |
2019 | |
|
|
2020 | # TODO: ugly |
|
|
2021 | void |
|
|
2022 | rxvt_term::get_geometry () |
|
|
2023 | PPCODE: |
|
|
2024 | EXTEND (SP, 4); |
|
|
2025 | PUSHs (sv_2mortal (newSViv (THIS->parent_x))); |
|
|
2026 | PUSHs (sv_2mortal (newSViv (THIS->parent_y))); |
|
|
2027 | PUSHs (sv_2mortal (newSViv (THIS->szHint.width))); |
|
|
2028 | PUSHs (sv_2mortal (newSViv (THIS->szHint.height))); |
|
|
2029 | |
1939 | #if HAVE_IMG |
2030 | #if HAVE_IMG |
1940 | |
2031 | |
1941 | rxvt_img * |
2032 | rxvt_img * |
1942 | rxvt_term::new_img (SV *format, int width, int height) |
2033 | rxvt_term::new_img (SV *format, int width, int height) |
1943 | CODE: |
2034 | CODE: |
1944 | XRenderPictFormat *f = SvOK (format) |
2035 | XRenderPictFormat *f = SvOK (format) |
1945 | ? XRenderFindVisualFormat (THIS->dpy, THIS->visual) |
|
|
1946 | : XRenderFindStandardFormat (THIS->dpy, SvIV (format)); |
2036 | ? XRenderFindStandardFormat (THIS->dpy, SvIV (format)) |
|
|
2037 | : XRenderFindVisualFormat (THIS->dpy, THIS->visual); |
1947 | RETVAL = new rxvt_img (THIS, f, width, height); |
2038 | RETVAL = new rxvt_img (THIS, f, width, height); |
1948 | OUTPUT: |
2039 | OUTPUT: |
1949 | RETVAL |
2040 | RETVAL |
1950 | |
2041 | |
1951 | #if ENABLE_TRANSPARENCY |
2042 | #if ENABLE_TRANSPARENCY |
… | |
… | |
2081 | void |
2172 | void |
2082 | rxvt_img::DESTROY () |
2173 | rxvt_img::DESTROY () |
2083 | CODE: |
2174 | CODE: |
2084 | delete THIS; |
2175 | delete THIS; |
2085 | |
2176 | |
2086 | void |
2177 | rxvt_img * |
2087 | rxvt_img::blur (int rh, int rv) |
2178 | rxvt_img::blur (int rh, int rv) |
2088 | |
2179 | |
2089 | void |
2180 | void |
2090 | rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) |
2181 | rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) |
2091 | |
2182 | |
… | |
… | |
2097 | |
2188 | |
2098 | rxvt_img * |
2189 | rxvt_img * |
2099 | rxvt_img::clone () |
2190 | rxvt_img::clone () |
2100 | |
2191 | |
2101 | rxvt_img * |
2192 | rxvt_img * |
2102 | rxvt_img::scale (int new_width, int new_height) |
2193 | rxvt_img::sub_rect (int x, int y, int width, int height, render_repeat_mode repeat = RepeatNormal) |
2103 | |
2194 | |
2104 | rxvt_img * |
2195 | rxvt_img * |
2105 | rxvt_img::transform (int new_width, int new_height, int repeat, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33) |
2196 | rxvt_img::transform (int new_width, int new_height, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33, render_repeat_mode repeat = RepeatNormal) |
2106 | INIT: |
2197 | INIT: |
2107 | double matrix[9] = { |
2198 | double matrix[9] = { |
2108 | p11, p12, p13, |
2199 | p11, p12, p13, |
2109 | p21, p22, p23, |
2200 | p21, p22, p23, |
2110 | p31, p32, p33 |
2201 | p31, p32, p33 |
2111 | }; |
2202 | }; |
2112 | C_ARGS: new_width, new_height, repeat, matrix |
2203 | C_ARGS: new_width, new_height, matrix, repeat |
|
|
2204 | |
|
|
2205 | rxvt_img * |
|
|
2206 | rxvt_img::scale (int new_width, int new_height) |
|
|
2207 | |
|
|
2208 | rxvt_img * |
|
|
2209 | rxvt_img::rotate (int new_width, int new_height, int x, int y, NV phi, render_repeat_mode repeat = RepeatNormal) |
2113 | |
2210 | |
2114 | #endif |
2211 | #endif |
2115 | |
2212 | |