Changes window position and dimension on the screen by positioning
it horizontally ($abscissa) and vertically ($ordinate) adding the given
offsets ($x_offset, $y_offset).

Use these constants to specify the window attachment parameters $abscissa
and $ordinate.

COORDINATE_CENTER
COORDINATE_MAXIMUM
COORDINATE_MINIMUM

$aosd->set_renderer($renderer, $user_data)

Apply your renderer to the OSD window. This is a subroutine resp. a closure
with this signature:

sub renderer {
my ($cr, $user_data) = @_;
...
}

$cr is the Cairo context managed by libaosd you can draw with. Anytime
the surface needs to be (re)drawn the renderer is called. You can force
calling it using the $aosd->render method (or even better
$aosd->update - see below).

$aosd->set_mouse_event_cb($callback, $user_data)

libaosd catches mouse clicks on the window. You can handle these events
by attaching a callback, which has the following signature:

sub mouse_event {
my ($event, $user_data) = @_;
...
}

$event is a hash reference with the following keys (all integers)
corresponding to libaosd's AosdMouseEvent structure:

x
y
x_root
y_root
send_event
button
int

$aosd->set_hide_upon_mouse_event($boolean)

Set this to a true value if the OSD window should automatically
hide on mouse click.

Object inspectors

($name, $class) = $aosd->get_name

Returns XClassHint name and class of the window.

($trans) = $aosd->get_transparency;

Returns the current transparency mode of the window. Valid
modes are:

TRANSPARENCY_COMPOSITE
TRANSPARENCY_FAKE
TRANSPARENCY_NONE

($x, $y, $width, $height) = $aosd->get_geometry;

Returns position and dimensions of the window.

($width, $height) = $aosd->get_screen_size;

Returns the dimensions of the X screen.

($shown) = $aosd->get_is_shown;

Returns a boolean whether the window is currently visible or not.

Object manipulators

$aosd->render

This actually renders the window. Note that the X mainloop need to
run at least one time ($aosd->loop_once) to take rendering effect.
You can use the $aosd->update convenience method for render + loop_once.

$aosd->show

Shows the OSD window (and renders it, if not rendered yet).

$aosd->hide

Hides the OSD window.

Mainloop processing

libaosd can take control of the mainloop, but note that your program
blocks when libaosd's mainloop is running. For simple programs
libaosd's maninloop is Ok, but for more complex situations,
e.g. drawing an animation, you should use Glib's mainloop instead
(or any event loop you like, e.g. Event or EV).

Animations are always controlled through timeouts, so with Glib's
mainloop this will look this way:

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.