sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR);
}
+SV *
+new (...)
+ CODE:
+{
+ stringvec *argv = new stringvec;
+ bool success;
+
+ for (int i = 0; i < items ;i++)
+ argv->push_back (strdup (SvPVbyte_nolen (ST (i))));
+
+ rxvt_term *term = new rxvt_term;
+
+ term->argv = argv;
+
+ try
+ {
+ if (!term->init (argv->size (), argv->begin ()))
+ term = 0;
+ }
+ catch (const class rxvt_failure_exception &e)
+ {
+ term->destroy ();
+ croak ("exception caught while initializing new terminal instance");
+ }
+
+ RETVAL = term && term->self ? newSVterm (term) : &PL_sv_undef;
+}
+ OUTPUT:
+ RETVAL
+
void
set_should_invoke (int htype, int value)
CODE:
MODULE = urxvt PACKAGE = urxvt::term
+void
+rxvt_term::destroy ()
+
int
rxvt_term::strwidth (SV *str)
CODE:
C_ARGS:
str, len
+void
+rxvt_term::cmd_parse (SV *octets)
+ CODE:
+{
+ STRLEN len;
+ char *str = SvPVbyte (octets, len);
+
+ char *old_cmdbuf_ptr = THIS->cmdbuf_ptr;
+ char *old_cmdbuf_endp = THIS->cmdbuf_endp;
+
+ THIS->cmdbuf_ptr = str;
+ THIS->cmdbuf_endp = str + len;
+
+ THIS->cmd_parse ();
+
+ THIS->cmdbuf_ptr = old_cmdbuf_ptr;
+ THIS->cmdbuf_endp = old_cmdbuf_endp;
+}
+
SV *
rxvt_term::overlay (int x, int y, int w, int h, int rstyle = OVERLAY_RSTYLE, int border = 2)
CODE:
=item on_init $term
Called after a new terminal object has been initialized, but before
-windows are created or the command gets run.
+windows are created or the command gets run. Most methods are unsafe to
+call or deliver senseless data, as terminal size and other characteristics
+have not yet been determined. You can safely query and change resources,
+though.
=item on_reset $term
=over 4
+=item $term = new urxvt [arg...]
+
+Creates a new terminal, very similar as if you had started it with
+C<system $binfile, arg...>. Croaks (and probably outputs an error message)
+if the new instance couldn't be created. Returns C<undef> if the new
+instance didn't initialise perl, and the terminal object otherwise. The
+C<init> and C<start> hooks will be called during the call.
+
=item urxvt::fatal $errormessage
Fatally aborts execution with the given error message. Avoid at all
=over 4
+=item $term->destroy
+
+Destroy the terminal object (close the window, free resources etc.).
+
=item $value = $term->resource ($name[, $newval])
Returns the current resource value associated with a given name and
confused by changes in cursor position or scrolling. Its useful inside a
C<on_add_lines> hook, though.
+=item $term->cmd_parse ($octets)
+
+Similar to C<scr_add_lines>, but the argument must be in the
+locale-specific encoding of the terminal and can contain command sequences
+(escape codes) that will be interpreted.
+
=item $term->tt_write ($octets)
Write the octets given in C<$data> to the tty (i.e. as program input). To