summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorroot <root>2020-06-30 07:31:24 +0000
committerroot <root>2020-06-30 07:31:24 +0000
commit74dcd66efcfd778a0b3f70c187316367483c02e2 (patch)
tree6356be7af6da08f012119bf30fec63ae737c209c /src
parentfba793aded0ed13c0f177bfa5f18b0ab2639ba05 (diff)
do not call perl_destruct
Diffstat (limited to 'src')
-rw-r--r--src/rxvtperl.h2
-rw-r--r--src/rxvtperl.xs30
2 files changed, 22 insertions, 10 deletions
diff --git a/src/rxvtperl.h b/src/rxvtperl.h
index 0e50e8f..d559009 100644
--- a/src/rxvtperl.h
+++ b/src/rxvtperl.h
@@ -51,7 +51,9 @@ struct rxvt_perl_interp
{
char **perl_environ;
+ #if 0 // see rxvtperl.xs
~rxvt_perl_interp ();
+ #endif
void init ();
void init (rxvt_term *term);
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
index 963a445..c22a1d3 100644
--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -84,15 +84,15 @@ parse_rgba (SV *sv, rxvt_screen *s = 0)
c.a = rgba::MAX_CC;
- c.r = c.g = c.b = float_to_component (SvIV (*av_fetch (av, 0, 0)));
+ c.r = c.g = c.b = float_to_component (SvNV (*av_fetch (av, 0, 0)));
if (len >= 3)
{
- c.g = float_to_component (SvIV (*av_fetch (av, 1, 0)));
- c.b = float_to_component (SvIV (*av_fetch (av, 2, 0)));
+ c.g = float_to_component (SvNV (*av_fetch (av, 1, 0)));
+ c.b = float_to_component (SvNV (*av_fetch (av, 2, 0)));
if (len >= 4)
- c.a = float_to_component (SvIV (*av_fetch (av, 3, 0)));
+ c.a = float_to_component (SvNV (*av_fetch (av, 3, 0)));
}
}
else if (s)
@@ -372,6 +372,9 @@ struct rxvt_perl_interp rxvt_perl;
static PerlInterpreter *perl;
+#if 0 /* we are not a library anymore, so doing this is just not worth it */
+/*THINK/TODO: this has the side effect of, of course, not calling destructors. */
+/* but therse are not guaranteed anyway... */
rxvt_perl_interp::~rxvt_perl_interp ()
{
if (perl)
@@ -381,6 +384,7 @@ rxvt_perl_interp::~rxvt_perl_interp ()
PERL_SYS_TERM ();
}
}
+#endif
void
rxvt_perl_interp::init ()
@@ -393,7 +397,7 @@ rxvt_perl_interp::init ()
perl_environ = rxvt_environ;
localise_env set_environ (perl_environ);
- char *args[] = {
+ const char *args[] = {
"",
"-e"
"BEGIN {"
@@ -405,7 +409,7 @@ rxvt_perl_interp::init ()
0
};
int argc = ecb_array_length (args) - 1;
- char **argv = args;
+ char **argv = (char **)args;
PERL_SYS_INIT3 (&argc, &argv, &environ);
perl = perl_alloc ();
@@ -1834,7 +1838,7 @@ rxvt_term::_resource (octet_string name, int index, SV *newval = 0)
else
{
--rs;
- name = "";
+ name = (octet_string)"";
}
if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES))
@@ -2314,13 +2318,20 @@ rxvt_term::new_img_from_file (octet_string filename)
#endif
void
+rxvt_term::clr_background ()
+ CODE:
+ delete THIS->bg_img;
+ THIS->bg_img = 0;
+ THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH;
+
+void
rxvt_term::set_background (rxvt_img *img, bool border = false)
CODE:
delete THIS->bg_img;
THIS->bg_img = 0;
- THIS->bg_flags = 0;
+ THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH;
- if (img) // TODO: cannot be false
+ //if (img) // TODO: cannot be false, maybe allow and get rid of clr_background?
{
img = img->clone (); // own the img
@@ -2338,7 +2349,6 @@ rxvt_term::set_background (rxvt_img *img, bool border = false)
->replace (img);
THIS->bg_img = img;
- THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH;
if (!border)
THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT;