NAME

Curses::Toolkit::Theme - base class for widgets themes

VERSION

version 0.200

DESCRIPTION

Base class for widgets themes

CONSTRUCTOR

None, this is an abstract class

set_property

$theme->set_property('Toolkit::Curses::Widget::Class', 'property name', 'value');
$widget->set_property('Toolkit::Curses::Widget::Class', { name1 => 'value1', ... });

Sets a single property or a whole group of property

Properties are arbitrary caracteristics of widgets. For themes, they are grouped by Widgets class name. The property will be set for all widgets from this class using the theme. To set a property, you need to specify the class name of the widget you want to theme , then the property name, then the value name. However you can specify the class name, and a hash representing multiple names / values

Returns the widget.

get_property

my $value = $widget->get_property('Toolkit::Curses::Widget::Class', 'property name');
my $hash = $widget->get_property('Toolkit::Curses::Widget::Class');

Return the theme property or the hash of properties of a widget.

get_widget

my $widget = $theme_instance->get_widget();

Returns the widget of this theme instance, or undef

get_window

my $widget = $theme_instance->get_window();

Returns the window of this theme instance, or void

get_root_window

my $widget = $theme_instance->get_root_window();

Returns the root window of this theme instance, or void

get_shape

my $widget = $theme_instance->get_shape();

Returns the shape of the root window of this theme instance, or void

is_in_shape

my $coordinates = $theme_instance->is_in_shape( $coordinate );
my $coordinates = $theme_instance->is_in_shape( x1 => 1, y1 => 1, x2 => 25, y2 => 10 );
my $coordinates = $theme_instance->is_in_shape( x1 => 1, y1 => 1, width => 4, height => 1 );

Returns true / false if the given coordinates are in the current shape. Or returns void if there is no root window.

restrict_to_shape

my $coordinates = $theme_instance->restrict_to_shape( $coordinate );
my $coordinates = $theme_instance->restrict_to_shape( x1 => 1, y1 => 1, x2 => 25, y2 => 10 );
my $coordinates = $theme_instance->restrict_to_shape( x1 => 1, y1 => 1, width => 4, height => 1 );

Given a coordinates, returns it restricted to the shape of the root window, or void if there is no root window. Useful to draw text / line and make sure thay are in the shape

curses

my $curses_object = $theme_instance->curses($attr);

Returns the Curses object. $attr is an optional HASHREF that can contain these keys:

bold : set bold on / off
reverse : set reverse on / off
focused : draw in focused mode
clicked : draw in clicked mode

AUTHOR

Damien "dams" Krotkine

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Damien "dams" Krotkine.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.