package GridFiller::Types; use strict; use warnings; use namespace::autoclean; use MooseX::Types -declare => [qw( GridT GridStatusT CharT LetterCellT TextResultT WordListT FontDescrT FontOptT )]; use MooseX::Types::Moose qw(Str ArrayRef Int); use MooseX::Types::Structured qw(Tuple); subtype CharT, as Str, where { length($_) == 1 }; subtype LetterCellT, as Tuple[Int,CharT]; subtype GridT, as ArrayRef[ArrayRef[Str]]; subtype GridStatusT, as ArrayRef[ArrayRef[Int]]; subtype WordListT, as ArrayRef[Str]; subtype TextResultT, as ArrayRef[ArrayRef[LetterCellT]]; class_type FontDescrT, { class => 'Pango::FontDescription' }; coerce FontDescrT, from Str, via { require Pango; Pango::FontDescription->from_string($_); }; class_type FontOptT, { class => 'Cairo::FontOptions' }; 1; __END__ =head1 AUTHOR Gianni Ceccarelli =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2012 by Gianni Ceccarelli. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. =cut