</p>
<h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2>
<dl>
+<dt><strong><a name="item__24urxvt_3a_3alibdir">$urxvt::LIBDIR</a></strong><br />
+</dt>
+<dd>
+The rxvt-unicode library directory, where, among other things, the perl
+modules and scripts are stored.
+</dd>
+<p></p>
+<dt><strong><a name="item__24urxvt_3a_3aresclass_2c__24urxvt_3a_3aresclass">$urxvt::RESCLASS, $urxvt::RESCLASS</a></strong><br />
+</dt>
+<dd>
+The resource class and name rxvt-unicode uses to look up X resources.
+</dd>
+<p></p>
+<dt><strong><a name="item__24urxvt_3a_3arxvtname">$urxvt::RXVTNAME</a></strong><br />
+</dt>
+<dd>
+The basename of the installed binaries, usually <code>urxvt</code>.
+</dd>
+<p></p>
<dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br />
</dt>
<dd>
The current terminal. This variable stores the current <code>urxvt::term</code>
object, whenever a callback/hook is executing.
</dd>
-<p></p></dl>
+<p></p>
+<dt></dt>
+</dl>
<p>
</p>
<h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2>
Return the foreground/background colour index, respectively.
</dd>
<p></p>
-<dt><strong><a name="item_set_fgcolor">$rend = urxvt::SET_FGCOLOR ($rend, $new_colour)</a></strong><br />
+<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_fgcolor__24rend_2c__24n">$rend = urxvt::SET_FGCOLOR $rend, $new_colour</a></strong><br />
</dt>
-<dt><strong><a name="item_set_bgcolor">$rend = urxvt::SET_BGCOLOR ($rend, $new_colour)</a></strong><br />
+<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_bgcolor__24rend_2c__24n">$rend = urxvt::SET_BGCOLOR $rend, $new_colour</a></strong><br />
</dt>
<dd>
Replace the foreground/background colour in the rendition mask with the
specified one.
</dd>
<p></p>
-<dt><strong><a name="item_get_custom">$value = urxvt::GET_CUSTOM ($rend)</a></strong><br />
+<dt><strong><a name="item__24value__3d_urxvt_3a_3aget_custom__24rend">$value = urxvt::GET_CUSTOM $rend</a></strong><br />
</dt>
<dd>
Return the ``custom'' value: Every rendition has 5 bits for use by
zero.
</dd>
<p></p>
-<dt><strong><a name="item_set_custom">$rend = urxvt::SET_CUSTOM ($rend, $new_value)</a></strong><br />
+<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_custom__24rend_2c__24ne">$rend = urxvt::SET_CUSTOM $rend, $new_value</a></strong><br />
</dt>
<dd>
Change the custom value.
<h2><a name="the_urxvt__anyevent_class">The <code>urxvt::anyevent</code> Class</a></h2>
<p>The sole purpose of this class is to deliver an interface to the
<code>AnyEvent</code> module - any module using it will work inside urxvt without
-further work. The only exception is that you cannot wait on condition
-variables, but non-blocking condvar use is ok. What this means is that you
-cannot use blocking APIs, but the non-blocking variant should work.</p>
+further programming. The only exception is that you cannot wait on
+condition variables, but non-blocking condvar use is ok. What this means
+is that you cannot use blocking APIs, but the non-blocking variant should
+work.</p>
<p>
</p>
<h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2>
<dt><strong><a name="item_destroy">$term->destroy</a></strong><br />
</dt>
<dd>
-Destroy the terminal object (close the window, free resources etc.).
+Destroy the terminal object (close the window, free resources
+etc.). Please note that rxvt will not exit as long as any event
+watchers (timers, io watchers) are still active.
</dd>
<p></p>
<dt><strong><a name="item_option">$isset = $term->option ($optval[, $set])</a></strong><br />
<p>
</p>
<h2><a name="the_urxvt__popup_class">The <code>urxvt::popup</code> Class</a></h2>
+<dl>
+<dt><strong><a name="item_add_title">$popup->add_title ($title)</a></strong><br />
+</dt>
+<dd>
+Adds a non-clickable title to the popup.
+</dd>
+<p></p>
+<dt><strong><a name="item_add_separator">$popup->add_separator ([$sepchr])</a></strong><br />
+</dt>
+<dd>
+Creates a separator, optionally using the character given as <code>$sepchr</code>.
+</dd>
+<p></p>
+<dt><strong><a name="item_add_button">$popup->add_button ($text, $cb)</a></strong><br />
+</dt>
+<dd>
+Adds a clickable button to the popup. <code>$cb</code> is called whenever it is
+selected.
+</dd>
+<p></p>
+<dt><strong><a name="item_add_toggle">$popup->add_toggle ($text, $cb, $initial_value)</a></strong><br />
+</dt>
+<dd>
+Adds a toggle/checkbox item to the popup. Teh callback gets called
+whenever it gets toggled, with a boolean indicating its value as its first
+argument.
+</dd>
+<p></p>
+<dt><strong>$popup->show</strong><br />
+</dt>
+<dd>
+Displays the popup (which is initially hidden).
+</dd>
+<p></p></dl>
<p>
</p>
<h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2>
.ie n .Sh "Variables in the ""urxvt"" Package"
.el .Sh "Variables in the \f(CWurxvt\fP Package"
.IX Subsection "Variables in the urxvt Package"
+.IP "$urxvt::LIBDIR" 4
+.IX Item "$urxvt::LIBDIR"
+The rxvt-unicode library directory, where, among other things, the perl
+modules and scripts are stored.
+.ie n .IP "$urxvt::RESCLASS, $urxvt::RESCLASS" 4
+.el .IP "$urxvt::RESCLASS, \f(CW$urxvt::RESCLASS\fR" 4
+.IX Item "$urxvt::RESCLASS, $urxvt::RESCLASS"
+The resource class and name rxvt-unicode uses to look up X resources.
+.IP "$urxvt::RXVTNAME" 4
+.IX Item "$urxvt::RXVTNAME"
+The basename of the installed binaries, usually \f(CW\*(C`urxvt\*(C'\fR.
.IP "$urxvt::TERM" 4
.IX Item "$urxvt::TERM"
The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR
object, whenever a callback/hook is executing.
+.IP "*" 4
.ie n .Sh "Functions in the ""urxvt"" Package"
.el .Sh "Functions in the \f(CWurxvt\fP Package"
.IX Subsection "Functions in the urxvt Package"
+.PD 0
.IP "$term = new urxvt [arg...]" 4
.IX Item "$term = new urxvt [arg...]"
+.PD
Creates a new terminal, very similar as if you had started it with
\&\f(CW\*(C`system $binfile, arg...\*(C'\fR. Croaks (and probably outputs an error message)
if the new instance couldn't be created. Returns \f(CW\*(C`undef\*(C'\fR if the new
.IX Item "$background = urxvt::GET_BASEBG $rend"
.PD
Return the foreground/background colour index, respectively.
-.ie n .IP "$rend = urxvt::SET_FGCOLOR ($rend, $new_colour)" 4
-.el .IP "$rend = urxvt::SET_FGCOLOR ($rend, \f(CW$new_colour\fR)" 4
-.IX Item "$rend = urxvt::SET_FGCOLOR ($rend, $new_colour)"
+.ie n .IP "$rend = urxvt::SET_FGCOLOR $rend\fR, \f(CW$new_colour" 4
+.el .IP "$rend = urxvt::SET_FGCOLOR \f(CW$rend\fR, \f(CW$new_colour\fR" 4
+.IX Item "$rend = urxvt::SET_FGCOLOR $rend, $new_colour"
.PD 0
-.ie n .IP "$rend = urxvt::SET_BGCOLOR ($rend, $new_colour)" 4
-.el .IP "$rend = urxvt::SET_BGCOLOR ($rend, \f(CW$new_colour\fR)" 4
-.IX Item "$rend = urxvt::SET_BGCOLOR ($rend, $new_colour)"
+.ie n .IP "$rend = urxvt::SET_BGCOLOR $rend\fR, \f(CW$new_colour" 4
+.el .IP "$rend = urxvt::SET_BGCOLOR \f(CW$rend\fR, \f(CW$new_colour\fR" 4
+.IX Item "$rend = urxvt::SET_BGCOLOR $rend, $new_colour"
.PD
Replace the foreground/background colour in the rendition mask with the
specified one.
-.IP "$value = urxvt::GET_CUSTOM ($rend)" 4
-.IX Item "$value = urxvt::GET_CUSTOM ($rend)"
+.ie n .IP "$value = urxvt::GET_CUSTOM $rend" 4
+.el .IP "$value = urxvt::GET_CUSTOM \f(CW$rend\fR" 4
+.IX Item "$value = urxvt::GET_CUSTOM $rend"
Return the \*(L"custom\*(R" value: Every rendition has 5 bits for use by
extensions. They can be set and changed as you like and are initially
zero.
-.ie n .IP "$rend = urxvt::SET_CUSTOM ($rend, $new_value)" 4
-.el .IP "$rend = urxvt::SET_CUSTOM ($rend, \f(CW$new_value\fR)" 4
-.IX Item "$rend = urxvt::SET_CUSTOM ($rend, $new_value)"
+.ie n .IP "$rend = urxvt::SET_CUSTOM $rend\fR, \f(CW$new_value" 4
+.el .IP "$rend = urxvt::SET_CUSTOM \f(CW$rend\fR, \f(CW$new_value\fR" 4
+.IX Item "$rend = urxvt::SET_CUSTOM $rend, $new_value"
Change the custom value.
.ie n .Sh "The ""urxvt::anyevent"" Class"
.el .Sh "The \f(CWurxvt::anyevent\fP Class"
.IX Subsection "The urxvt::anyevent Class"
The sole purpose of this class is to deliver an interface to the
\&\f(CW\*(C`AnyEvent\*(C'\fR module \- any module using it will work inside urxvt without
-further work. The only exception is that you cannot wait on condition
-variables, but non-blocking condvar use is ok. What this means is that you
-cannot use blocking APIs, but the non-blocking variant should work.
+further programming. The only exception is that you cannot wait on
+condition variables, but non-blocking condvar use is ok. What this means
+is that you cannot use blocking APIs, but the non-blocking variant should
+work.
.ie n .Sh "The ""urxvt::term"" Class"
.el .Sh "The \f(CWurxvt::term\fP Class"
.IX Subsection "The urxvt::term Class"
.IP "$term\->destroy" 4
.IX Item "$term->destroy"
-Destroy the terminal object (close the window, free resources etc.).
+Destroy the terminal object (close the window, free resources
+etc.). Please note that @@RXVT_NAME@@ will not exit as long as any event
+watchers (timers, io watchers) are still active.
.ie n .IP "$isset = $term\fR\->option ($optval[, \f(CW$set])" 4
.el .IP "$isset = \f(CW$term\fR\->option ($optval[, \f(CW$set\fR])" 4
.IX Item "$isset = $term->option ($optval[, $set])"
.ie n .Sh "The ""urxvt::popup"" Class"
.el .Sh "The \f(CWurxvt::popup\fP Class"
.IX Subsection "The urxvt::popup Class"
+.IP "$popup\->add_title ($title)" 4
+.IX Item "$popup->add_title ($title)"
+Adds a non-clickable title to the popup.
+.IP "$popup\->add_separator ([$sepchr])" 4
+.IX Item "$popup->add_separator ([$sepchr])"
+Creates a separator, optionally using the character given as \f(CW$sepchr\fR.
+.ie n .IP "$popup\->add_button ($text, $cb)" 4
+.el .IP "$popup\->add_button ($text, \f(CW$cb\fR)" 4
+.IX Item "$popup->add_button ($text, $cb)"
+Adds a clickable button to the popup. \f(CW$cb\fR is called whenever it is
+selected.
+.ie n .IP "$popup\->add_toggle ($text, $cb\fR, \f(CW$initial_value)" 4
+.el .IP "$popup\->add_toggle ($text, \f(CW$cb\fR, \f(CW$initial_value\fR)" 4
+.IX Item "$popup->add_toggle ($text, $cb, $initial_value)"
+Adds a toggle/checkbox item to the popup. Teh callback gets called
+whenever it gets toggled, with a boolean indicating its value as its first
+argument.
+.IP "$popup\->show" 4
+.IX Item "$popup->show"
+Displays the popup (which is initially hidden).
.ie n .Sh "The ""urxvt::timer"" Class"
.el .Sh "The \f(CWurxvt::timer\fP Class"
.IX Subsection "The urxvt::timer Class"
-.RS 4
This class implements timer watchers/events. Time is represented as a
fractional number of seconds since the epoch. Example:
.Sp
\& sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
\& });
.Ve
+.RS 4
.IP "$timer = new urxvt::timer" 4
.IX Item "$timer = new urxvt::timer"
Create a new timer object in started state. It is scheduled to fire
subwindow.
Variables in the "urxvt" Package
+ $urxvt::LIBDIR
+ The rxvt-unicode library directory, where, among other things, the
+ perl modules and scripts are stored.
+
+ $urxvt::RESCLASS, $urxvt::RESCLASS
+ The resource class and name rxvt-unicode uses to look up X
+ resources.
+
+ $urxvt::RXVTNAME
+ The basename of the installed binaries, usually "urxvt".
+
$urxvt::TERM
The current terminal. This variable stores the current "urxvt::term"
object, whenever a callback/hook is executing.
+ *
+
Functions in the "urxvt" Package
$term = new urxvt [arg...]
Creates a new terminal, very similar as if you had started it with
$background = urxvt::GET_BASEBG $rend
Return the foreground/background colour index, respectively.
- $rend = urxvt::SET_FGCOLOR ($rend, $new_colour)
- $rend = urxvt::SET_BGCOLOR ($rend, $new_colour)
+ $rend = urxvt::SET_FGCOLOR $rend, $new_colour
+ $rend = urxvt::SET_BGCOLOR $rend, $new_colour
Replace the foreground/background colour in the rendition mask with
the specified one.
- $value = urxvt::GET_CUSTOM ($rend)
+ $value = urxvt::GET_CUSTOM $rend
Return the "custom" value: Every rendition has 5 bits for use by
extensions. They can be set and changed as you like and are
initially zero.
- $rend = urxvt::SET_CUSTOM ($rend, $new_value)
+ $rend = urxvt::SET_CUSTOM $rend, $new_value
Change the custom value.
The "urxvt::anyevent" Class
The sole purpose of this class is to deliver an interface to the
"AnyEvent" module - any module using it will work inside urxvt without
- further work. The only exception is that you cannot wait on condition
- variables, but non-blocking condvar use is ok. What this means is that
- you cannot use blocking APIs, but the non-blocking variant should work.
+ further programming. The only exception is that you cannot wait on
+ condition variables, but non-blocking condvar use is ok. What this means
+ is that you cannot use blocking APIs, but the non-blocking variant
+ should work.
The "urxvt::term" Class
$term->destroy
Destroy the terminal object (close the window, free resources etc.).
+ Please note that rxvt will not exit as long as any event watchers
+ (timers, io watchers) are still active.
$isset = $term->option ($optval[, $set])
Returns true if the option specified by $optval is enabled, and
case as the session.
The "urxvt::popup" Class
+ $popup->add_title ($title)
+ Adds a non-clickable title to the popup.
+
+ $popup->add_separator ([$sepchr])
+ Creates a separator, optionally using the character given as
+ $sepchr.
+
+ $popup->add_button ($text, $cb)
+ Adds a clickable button to the popup. $cb is called whenever it is
+ selected.
+
+ $popup->add_toggle ($text, $cb, $initial_value)
+ Adds a toggle/checkbox item to the popup. Teh callback gets called
+ whenever it gets toggled, with a boolean indicating its value as its
+ first argument.
+
+ $popup->show
+ Displays the popup (which is initially hidden).
+
The "urxvt::timer" Class
This class implements timer watchers/events. Time is represented as
a fractional number of seconds since the epoch. Example:
push @{ $self->{item} }, $item;
}
+=item $popup->add_title ($title)
+
+Adds a non-clickable title to the popup.
+
+=cut
+
+sub add_title {
+ my ($self, $title) = @_;
+
+ $self->add_item ({
+ rend => { normal => "\x1b[38;5;11;44m", hover => "\x1b[38;5;11;44m", active => "\x1b[38;5;11;44m" },
+ text => $title,
+ activate => sub { },
+ });
+}
+
+=item $popup->add_separator ([$sepchr])
+
+Creates a separator, optionally using the character given as C<$sepchr>.
+
+=cut
+
sub add_separator {
my ($self, $sep) = @_;
});
}
-sub add_title {
- my ($self, $title) = @_;
+=item $popup->add_button ($text, $cb)
- $self->add_item ({
- rend => { normal => "\x1b[38;5;11;44m", hover => "\x1b[38;5;11;44m", active => "\x1b[38;5;11;44m" },
- text => $title,
- activate => sub { },
- });
-}
+Adds a clickable button to the popup. C<$cb> is called whenever it is
+selected.
+
+=cut
sub add_button {
my ($self, $text, $cb) = @_;
$self->add_item ({ type => "button", text => $text, activate => $cb});
}
+=item $popup->add_toggle ($text, $cb, $initial_value)
+
+Adds a toggle/checkbox item to the popup. Teh callback gets called
+whenever it gets toggled, with a boolean indicating its value as its first
+argument.
+
+=cut
+
sub add_toggle {
my ($self, $text, $cb, $value) = @_;
text => " $text",
value => $value,
render => sub { ($_[0]{value} ? "* " : " ") . $text },
- activate => sub { $cb->($_[0]{value} = !$_[0]{value}); },
+ activate => sub { $cb->($_[1]{value} = !$_[1]{value}); },
};
$self->add_item ($item);
}
+=item $popup->show
+
+Displays the popup (which is initially hidden).
+
+=cut
+
sub show {
my ($self) = @_;