19 Feb 2021 00:34:37 UTC
- Distribution: GooCanvas2-CairoTypes
- Module version: 0.001
- Source (raw)
- Browse (raw)
- How to Contribute
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Activity24 month
- Download (13.21KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionASOKOLOV Алексей Евгеньевич Соколовand 1 contributors
- Alexey Sokolov
GooCanvas2::CairoTypes - Bridge between GooCanvas2 and Cairo types
use GooCanvas2; use GooCanvas2::CairoTypes; my $pattern = Cairo::SolidPattern->create_rgba(0, 0, 0, 0); my $rect = GooCanvas2::CanvasRect->new( ..., 'fill-pattern' => $pattern, # fails without CairoTypes, just works with ); # Sometimes (but not always, no idea why) this fails: $rect->get('fill-pattern')->set_filter('linear); # Here's the solution: GooCanvas2::CairoTypes::cairoize_pattern($rect->get('fill-pattern')) ->set_filter('linear);
There is an issue in the interaction between GooCanvas, GObject Introspection, Cairo, and their Perl bindings, which causes some functionality to be unusable from Perl side. This is better described here, and there was an attempt to fix it upstream. Until it's fixed, this can serve as a workaround for it.
Currently this module only "fixes"
Cairo::Pattern/GooCanvas2::CairoPatterninterop. For certain calls it just works if this module was included; for some other calls you need to explicitly convert the type.
If you have any idea how to fix those cases to not require such call, or need to bridge more types, pull requests are welcome!
Alexey Sokolov, <email@example.com>
Copyright (C) 2021 by Google
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.3 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install GooCanvas2::CairoTypes, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install GooCanvas2::CairoTypes
For more information on module installation, please visit the detailed CPAN module installation guide.