… | |
… | |
23 | #define line_t perl_line_t |
23 | #define line_t perl_line_t |
24 | #include <EXTERN.h> |
24 | #include <EXTERN.h> |
25 | #include <perl.h> |
25 | #include <perl.h> |
26 | #include <XSUB.h> |
26 | #include <XSUB.h> |
27 | #undef line_t |
27 | #undef line_t |
|
|
28 | #undef bool // perl defines it's own bool type, except with g++... what a trap |
28 | |
29 | |
29 | #include "../config.h" |
30 | #include "../config.h" |
30 | |
31 | |
31 | #include <cstddef> |
32 | #include <stddef.h> |
32 | #include <cstdarg> |
33 | #include <stdarg.h> |
33 | |
34 | |
34 | #include "unistd.h" |
35 | #include "unistd.h" |
35 | |
36 | |
36 | #include "ev_cpp.h" |
37 | #include "ev_cpp.h" |
37 | #include "rxvt.h" |
38 | #include "rxvt.h" |
… | |
… | |
45 | |
46 | |
46 | #undef LINENO |
47 | #undef LINENO |
47 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #undef ROW |
49 | #undef ROW |
49 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | #define ROW(n) THIS->row_buf [LINENO (n)] |
|
|
51 | |
|
|
52 | ///////////////////////////////////////////////////////////////////////////// |
|
|
53 | |
|
|
54 | typedef char * octet_string; |
|
|
55 | typedef char * utf8_string; |
|
|
56 | |
|
|
57 | typedef int render_repeat_mode; |
|
|
58 | |
|
|
59 | typedef GdkPixbuf * urxvt__pixbuf; |
|
|
60 | typedef rxvt_img * urxvt__img; |
|
|
61 | |
|
|
62 | ///////////////////////////////////////////////////////////////////////////// |
|
|
63 | |
|
|
64 | static void |
|
|
65 | parse_color (rxvt_screen *s, rxvt_color &c, SV *sv) |
|
|
66 | { |
|
|
67 | //TODO: support component stuff |
|
|
68 | c.set (s, SvPVbyte_nolen (sv)); |
|
|
69 | } |
50 | |
70 | |
51 | ///////////////////////////////////////////////////////////////////////////// |
71 | ///////////////////////////////////////////////////////////////////////////// |
52 | |
72 | |
53 | static wchar_t * |
73 | static wchar_t * |
54 | sv2wcs (SV *sv) |
74 | sv2wcs (SV *sv) |
… | |
… | |
371 | 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); |
372 | 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); |
373 | } |
393 | } |
374 | } |
394 | } |
375 | |
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 | |
376 | static void |
440 | static void |
377 | ungrab (rxvt_term *THIS) |
441 | ungrab (rxvt_term *THIS) |
378 | { |
442 | { |
379 | if (THIS->perl.grabtime) |
443 | if (THIS->perl.grabtime) |
380 | { |
444 | { |
… | |
… | |
411 | } |
475 | } |
412 | } |
476 | } |
413 | |
477 | |
414 | bool event_consumed; |
478 | bool event_consumed; |
415 | |
479 | |
416 | if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always |
|
|
417 | || term->perl.should_invoke [htype]) |
480 | if (term->perl.should_invoke [htype]) |
418 | { |
481 | { |
419 | dSP; |
482 | dSP; |
420 | va_list ap; |
483 | va_list ap; |
421 | |
484 | |
422 | va_start (ap, htype); |
485 | va_start (ap, htype); |
… | |
… | |
632 | ENTER; |
695 | ENTER; |
633 | SAVETMPS; |
696 | SAVETMPS; |
634 | |
697 | |
635 | dSP; |
698 | dSP; |
636 | XPUSHs (sv_2mortal (newSVpvn (data, len))); |
699 | XPUSHs (sv_2mortal (newSVpvn (data, len))); |
|
|
700 | PUTBACK; |
637 | 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); |
638 | |
702 | |
639 | if (SvTRUE (ERRSV)) |
703 | if (SvTRUE (ERRSV)) |
640 | rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); |
704 | rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); |
641 | |
705 | |
… | |
… | |
782 | const_iv (XIMSecondary), |
846 | const_iv (XIMSecondary), |
783 | const_iv (XIMTertiary), |
847 | const_iv (XIMTertiary), |
784 | const_iv (XIMVisibleToForward), |
848 | const_iv (XIMVisibleToForward), |
785 | const_iv (XIMVisibleToBackword), |
849 | const_iv (XIMVisibleToBackword), |
786 | const_iv (XIMVisibleToCenter), |
850 | const_iv (XIMVisibleToCenter), |
|
|
851 | #if XRENDER |
|
|
852 | const_iv (PictStandardARGB32), |
|
|
853 | const_iv (PictStandardRGB24), |
|
|
854 | const_iv (PictStandardA8), |
|
|
855 | const_iv (PictStandardA4), |
|
|
856 | const_iv (PictStandardA1), |
|
|
857 | const_iv (RepeatNone), |
|
|
858 | const_iv (RepeatNormal), |
|
|
859 | const_iv (RepeatPad), |
|
|
860 | const_iv (RepeatReflect), |
|
|
861 | #endif |
787 | # if 0 |
862 | # if 0 |
788 | const_iv (XIMForwardChar), |
863 | const_iv (XIMForwardChar), |
789 | const_iv (XIMBackwardChar), |
864 | const_iv (XIMBackwardChar), |
790 | const_iv (XIMForwardWord), |
865 | const_iv (XIMForwardWord), |
791 | const_iv (XIMBackwardWord), |
866 | const_iv (XIMBackwardWord), |
… | |
… | |
816 | rxvt_fatal ("%s", msg); |
891 | rxvt_fatal ("%s", msg); |
817 | |
892 | |
818 | void |
893 | void |
819 | _exit (int status) |
894 | _exit (int status) |
820 | |
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 | |
821 | NV |
912 | NV |
822 | NOW () |
913 | NOW () |
823 | CODE: |
914 | CODE: |
824 | RETVAL = ev::now (); |
915 | RETVAL = ev::now (); |
825 | OUTPUT: |
916 | OUTPUT: |
… | |
… | |
920 | CODE: |
1011 | CODE: |
921 | { |
1012 | { |
922 | rxvt_term *term = new rxvt_term; |
1013 | rxvt_term *term = new rxvt_term; |
923 | |
1014 | |
924 | stringvec *argv = new stringvec; |
1015 | stringvec *argv = new stringvec; |
925 | stringvec *envv = new stringvec; |
|
|
926 | |
|
|
927 | for (int i = 0; i <= AvFILL (arg); i++) |
1016 | for (int i = 0; i <= AvFILL (arg); i++) |
928 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
1017 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
929 | |
1018 | |
|
|
1019 | stringvec *envv = new stringvec; |
930 | for (int i = AvFILL (env) + 1; i--; ) |
1020 | for (int i = AvFILL (env) + 1; i--; ) |
931 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
1021 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
932 | |
1022 | |
933 | envv->push_back (0); |
|
|
934 | |
|
|
935 | try |
1023 | try |
936 | { |
1024 | { |
937 | term->init (argv, envv); |
1025 | term->init (argv, envv); |
938 | } |
1026 | } |
939 | catch (const class rxvt_failure_exception &e) |
1027 | catch (const class rxvt_failure_exception &e) |
… | |
… | |
952 | rxvt_term::destroy () |
1040 | rxvt_term::destroy () |
953 | |
1041 | |
954 | void |
1042 | void |
955 | rxvt_term::set_should_invoke (int htype, int inc) |
1043 | rxvt_term::set_should_invoke (int htype, int inc) |
956 | CODE: |
1044 | CODE: |
957 | 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 | } |
958 | |
1058 | |
959 | int |
1059 | int |
960 | 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) |
961 | CODE: |
1061 | CODE: |
962 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1062 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
… | |
… | |
1099 | rxvt_pop_locale (); |
1199 | rxvt_pop_locale (); |
1100 | |
1200 | |
1101 | RETVAL = wcs2sv (wstr); |
1201 | RETVAL = wcs2sv (wstr); |
1102 | free (wstr); |
1202 | free (wstr); |
1103 | } |
1203 | } |
1104 | OUTPUT: |
|
|
1105 | RETVAL |
|
|
1106 | |
|
|
1107 | char * |
|
|
1108 | rxvt_term::locale () |
|
|
1109 | CODE: |
|
|
1110 | RETVAL = THIS->locale; |
|
|
1111 | OUTPUT: |
1204 | OUTPUT: |
1112 | RETVAL |
1205 | RETVAL |
1113 | |
1206 | |
1114 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1207 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1115 | |
1208 | |
… | |
… | |
1226 | CODE: |
1319 | CODE: |
1227 | RETVAL = THIS->parent; |
1320 | RETVAL = THIS->parent; |
1228 | OUTPUT: |
1321 | OUTPUT: |
1229 | RETVAL |
1322 | RETVAL |
1230 | |
1323 | |
1231 | Window |
1324 | int |
1232 | rxvt_term::vt () |
1325 | rxvt_term::parent_x () |
1233 | CODE: |
1326 | CODE: |
1234 | 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; |
1235 | OUTPUT: |
1335 | OUTPUT: |
1236 | RETVAL |
1336 | RETVAL |
1237 | |
1337 | |
1238 | void |
1338 | void |
1239 | rxvt_term::vt_emask_add (U32 emask) |
1339 | rxvt_term::vt_emask_add (U32 emask) |
… | |
… | |
1553 | |
1653 | |
1554 | if (set >= 0) |
1654 | if (set >= 0) |
1555 | { |
1655 | { |
1556 | THIS->set_option (optval, set); |
1656 | THIS->set_option (optval, set); |
1557 | |
1657 | |
1558 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1658 | if (THIS->init_done) // avoid doing this before START |
1559 | switch (optval) |
1659 | switch (optval) |
1560 | { |
1660 | { |
1561 | case Opt_skipBuiltinGlyphs: |
1661 | case Opt_skipBuiltinGlyphs: |
1562 | THIS->set_fonts (); |
1662 | THIS->set_fonts (); |
1563 | THIS->scr_remap_chars (); |
1663 | THIS->scr_remap_chars (); |
1564 | THIS->scr_touch (true); |
1664 | THIS->scr_touch (true); |
1565 | THIS->want_refresh = 1; |
1665 | THIS->want_refresh = 1; |
1566 | THIS->refresh_check (); |
1666 | THIS->refresh_check (); |
1567 | break; |
1667 | break; |
|
|
1668 | #ifdef CURSOR_BLINK |
|
|
1669 | case Opt_cursorBlink: |
|
|
1670 | THIS->cursor_blink_reset (); |
|
|
1671 | break; |
|
|
1672 | #endif |
1568 | |
1673 | |
1569 | case Opt_cursorUnderline: |
1674 | case Opt_cursorUnderline: |
1570 | THIS->want_refresh = 1; |
1675 | THIS->want_refresh = 1; |
1571 | THIS->refresh_check (); |
1676 | THIS->refresh_check (); |
1572 | break; |
1677 | break; |
… | |
… | |
1710 | |
1815 | |
1711 | void |
1816 | void |
1712 | rxvt_term::scr_bell () |
1817 | rxvt_term::scr_bell () |
1713 | |
1818 | |
1714 | void |
1819 | void |
|
|
1820 | rxvt_term::scr_recolour (bool refresh = true); |
|
|
1821 | |
|
|
1822 | void |
1715 | rxvt_term::scr_change_screen (int screen) |
1823 | rxvt_term::scr_change_screen (int screen) |
1716 | |
1824 | |
1717 | void |
1825 | void |
1718 | rxvt_term::scr_add_lines (SV *string) |
1826 | rxvt_term::scr_add_lines (SV *string) |
1719 | CODE: |
1827 | CODE: |
… | |
… | |
1832 | type, format, PropModeReplace, |
1940 | type, format, PropModeReplace, |
1833 | (unsigned char *)data_, len / elemsize); |
1941 | (unsigned char *)data_, len / elemsize); |
1834 | } |
1942 | } |
1835 | |
1943 | |
1836 | Atom |
1944 | Atom |
1837 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1945 | XInternAtom (rxvt_term *term, octet_string atom_name, int only_if_exists = FALSE) |
1838 | C_ARGS: term->dpy, atom_name, only_if_exists |
1946 | C_ARGS: term->dpy, atom_name, only_if_exists |
1839 | |
1947 | |
1840 | char * |
1948 | char * |
1841 | XGetAtomName (rxvt_term *term, Atom atom) |
1949 | XGetAtomName (rxvt_term *term, Atom atom) |
1842 | C_ARGS: term->dpy, atom |
1950 | C_ARGS: term->dpy, atom |
1843 | CLEANUP: |
1951 | CLEANUP: |
1844 | XFree (RETVAL); |
1952 | XFree (RETVAL); |
1845 | |
1953 | |
1846 | void |
1954 | void |
1847 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1955 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1848 | C_ARGS: term->dpy, window, property |
1956 | C_ARGS: term->dpy, window, property |
1849 | |
1957 | |
1850 | Window |
1958 | Window |
1851 | rxvt_term::DefaultRootWindow () |
1959 | rxvt_term::DefaultRootWindow () |
1852 | CODE: |
1960 | CODE: |
1853 | RETVAL = THIS->display->root; |
1961 | RETVAL = THIS->display->root; |
… | |
… | |
1905 | PUSHs (newSVuv (child)); |
2013 | PUSHs (newSVuv (child)); |
1906 | } |
2014 | } |
1907 | } |
2015 | } |
1908 | |
2016 | |
1909 | ############################################################################# |
2017 | ############################################################################# |
|
|
2018 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
|
|
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 | |
|
|
2030 | #if HAVE_IMG |
|
|
2031 | |
|
|
2032 | rxvt_img * |
|
|
2033 | rxvt_term::new_img (SV *format, int width, int height) |
|
|
2034 | CODE: |
|
|
2035 | XRenderPictFormat *f = SvOK (format) |
|
|
2036 | ? XRenderFindStandardFormat (THIS->dpy, SvIV (format)) |
|
|
2037 | : XRenderFindVisualFormat (THIS->dpy, THIS->visual); |
|
|
2038 | RETVAL = new rxvt_img (THIS, f, width, height); |
|
|
2039 | OUTPUT: |
|
|
2040 | RETVAL |
|
|
2041 | |
|
|
2042 | #if ENABLE_TRANSPARENCY |
|
|
2043 | |
|
|
2044 | #if 0 |
|
|
2045 | |
|
|
2046 | rxvt_img * |
|
|
2047 | rxvt_term::new_img_from_root () |
|
|
2048 | CODE: |
|
|
2049 | RETVAL = rxvt_img::new_from_root (THIS); |
|
|
2050 | OUTPUT: |
|
|
2051 | RETVAL |
|
|
2052 | |
|
|
2053 | #endif |
|
|
2054 | |
|
|
2055 | #endif |
|
|
2056 | |
|
|
2057 | #if HAVE_PIXBUF |
|
|
2058 | |
|
|
2059 | rxvt_img * |
|
|
2060 | rxvt_term::new_img_from_file (octet_string filename) |
|
|
2061 | CODE: |
|
|
2062 | try |
|
|
2063 | { |
|
|
2064 | RETVAL = rxvt_img::new_from_file (THIS, filename); |
|
|
2065 | } |
|
|
2066 | catch (const class rxvt_failure_exception &e) |
|
|
2067 | { |
|
|
2068 | croak ("new_img_from_file failed"); |
|
|
2069 | } |
|
|
2070 | OUTPUT: |
|
|
2071 | RETVAL |
|
|
2072 | |
|
|
2073 | #endif |
|
|
2074 | |
|
|
2075 | #if HAVE_BG_PIXMAP |
|
|
2076 | |
|
|
2077 | void |
|
|
2078 | rxvt_term::set_background (rxvt_img *img) |
|
|
2079 | CODE: |
|
|
2080 | THIS->bg_destroy (); |
|
|
2081 | THIS->bg_pixmap = None; |
|
|
2082 | THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH; |
|
|
2083 | |
|
|
2084 | if (img) // TODO: cannot be false |
|
|
2085 | { |
|
|
2086 | img->unshare (); |
|
|
2087 | THIS->bg_pixmap = img->steal (); |
|
|
2088 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; |
|
|
2089 | THIS->bg_valid_since = ev::now (); // TODO: extra bloat |
|
|
2090 | } |
|
|
2091 | |
|
|
2092 | #endif |
|
|
2093 | |
|
|
2094 | #endif |
|
|
2095 | |
|
|
2096 | ############################################################################# |
1910 | # urxvt::overlay |
2097 | # urxvt::overlay |
1911 | ############################################################################# |
2098 | ############################################################################# |
1912 | |
2099 | |
1913 | MODULE = urxvt PACKAGE = urxvt::overlay |
2100 | MODULE = urxvt PACKAGE = urxvt::overlay |
1914 | |
2101 | |
… | |
… | |
1924 | void |
2111 | void |
1925 | overlay::DESTROY () |
2112 | overlay::DESTROY () |
1926 | |
2113 | |
1927 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
2114 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1928 | |
2115 | |
|
|
2116 | MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_ |
|
|
2117 | |
|
|
2118 | #if HAVE_PIXBUF |
|
|
2119 | |
|
|
2120 | urxvt::pixbuf gdk_pixbuf_new_from_file (SV *klass, octet_string filename) |
|
|
2121 | C_ARGS: filename, 0 |
|
|
2122 | |
|
|
2123 | void |
|
|
2124 | DESTROY (urxvt::pixbuf self) |
|
|
2125 | CODE: |
|
|
2126 | gdk_pixbuf_unref (self); |
|
|
2127 | |
|
|
2128 | #endif |
|
|
2129 | |
|
|
2130 | MODULE = urxvt PACKAGE = urxvt::img |
|
|
2131 | |
|
|
2132 | #if HAVE_IMG |
|
|
2133 | |
|
|
2134 | # rxvt_img *new (rxvt_screen *screen, XRenderPictFormat *format, int width, int height) |
|
|
2135 | # rxvt_img *rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
|
|
2136 | |
|
|
2137 | int |
|
|
2138 | rxvt_img::w () |
|
|
2139 | CODE: |
|
|
2140 | RETVAL = THIS->w; |
|
|
2141 | OUTPUT: |
|
|
2142 | RETVAL |
|
|
2143 | |
|
|
2144 | int |
|
|
2145 | rxvt_img::h () |
|
|
2146 | CODE: |
|
|
2147 | RETVAL = THIS->h; |
|
|
2148 | OUTPUT: |
|
|
2149 | RETVAL |
|
|
2150 | |
|
|
2151 | bool |
|
|
2152 | rxvt_img::shared () |
|
|
2153 | CODE: |
|
|
2154 | RETVAL = THIS->shared; |
|
|
2155 | OUTPUT: |
|
|
2156 | RETVAL |
|
|
2157 | |
|
|
2158 | Pixmap |
|
|
2159 | rxvt_img::pm () |
|
|
2160 | CODE: |
|
|
2161 | RETVAL = THIS->pm; |
|
|
2162 | OUTPUT: |
|
|
2163 | RETVAL |
|
|
2164 | |
|
|
2165 | void |
|
|
2166 | rxvt_img::fill (SV *c) |
|
|
2167 | INIT: |
|
|
2168 | rxvt_color rc; |
|
|
2169 | parse_color (THIS->s, rc, c); |
|
|
2170 | C_ARGS: rc |
|
|
2171 | |
|
|
2172 | void |
|
|
2173 | rxvt_img::DESTROY () |
|
|
2174 | CODE: |
|
|
2175 | delete THIS; |
|
|
2176 | |
|
|
2177 | rxvt_img * |
|
|
2178 | rxvt_img::blur (int rh, int rv) |
|
|
2179 | |
|
|
2180 | void |
|
|
2181 | rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) |
|
|
2182 | |
|
|
2183 | void |
|
|
2184 | rxvt_img::contrast (NV r, NV g, NV b, NV a = 1.) |
|
|
2185 | |
|
|
2186 | void |
|
|
2187 | rxvt_img::unshare () |
|
|
2188 | |
|
|
2189 | rxvt_img * |
|
|
2190 | rxvt_img::clone () |
|
|
2191 | |
|
|
2192 | rxvt_img * |
|
|
2193 | rxvt_img::sub_rect (int x, int y, int width, int height, render_repeat_mode repeat = RepeatNormal) |
|
|
2194 | |
|
|
2195 | rxvt_img * |
|
|
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) |
|
|
2197 | INIT: |
|
|
2198 | double matrix[9] = { |
|
|
2199 | p11, p12, p13, |
|
|
2200 | p21, p22, p23, |
|
|
2201 | p31, p32, p33 |
|
|
2202 | }; |
|
|
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) |
|
|
2210 | |
|
|
2211 | #endif |
|
|
2212 | |