EFL - Perl bindings for the Enlightenment Foundation Libraries
version 0.501
Import all EFL functions from EFL::*:
use EFL qw(:all);
Or only a subset:
use EFL qw(:evas :elementary);
Perl bindings for the Enlightenment Foundation Libraries (EFL) Elementary library. The API was deliberatly kept as close to 1-to-1 mapping of the Elementary API as possible. Function parameters types and position are the same as you would in C (deviations are documented), Evas_Object pointers are just scalars, #defines are Perl constants, etc.
For example, the C way:
elm_win_screen_position_get(Evas_Object *obj, int *x, int *y);
This will be translated into the Perlish-C way as:
elm_win_screen_position_get($obj, \$x, \$y);
As opposed to the Perl way:
my ($x, $y) = elm_win_screen_position_get($obj);
This was intentional as the desired goal will to aid in porting to pure-C. But with the power of Perl and CPAN, it will be easier for rapid development and prototyping.
With regards to passing data between Perl and C, the API is not set in stone and may change in future releases.
Due to the complexity of EFL and XS, it is very easy to segfault. For instance,
elm_win_add(undef, "main", ELM_WIN_BASIC); ...
Without a leading elm_init(); causes a segfault. You've been warned. Although if you compiled Elementary, Evas, etc with symbols (-g in gcc), you can easily see where the segfault occured with gdb -c core `which perl`.
elm_init();
-g
gdb -c core `which perl`
Perl 5.10.0+ (I haven't tried 5.8.x yet)
Linux (untested on non-Linux platforms)
gcc
pkg-config can find the evas.pc and elementary.pm files (if not set PKG_CONFIG_PATH)
pkg-config
PKG_CONFIG_PATH
evas and elmentary compiled successfully
linkable with -levas and -lelementary
Currently only the following are supported.
evas
elementary
Currently only the following are partially supported. With more support coming in the future.
ecore
eina
What I consider very low priority/no priority. Although I am fully open to patches.
non-Linux/Windows compatiability
Perl threads
Nothing by default. You can either import the entire API with :all, or only a subset with the tag name being the EFL group, e.g. :elementary.
:elementary
Check the EFL API documentation for how to correctly call functions.
To see what functions can be export run misc/supported.pl -api <efl-subset> and misc/supported.pl -tags <efl-subset> for the Exporter tags available.
misc/supported.pl -api <efl-subset
misc/supported.pl -tags <efl-subset
Some thanks for helping me out.
Everyone that worked on EFL. The API makes sense and was easy to Perl-ize.
Audio::XMMSClient for showing me some XS tricks.
Dist::Zilla and Pod::Weaver for making it easier to manage releases/POD.
You can find documentation for this module with the perldoc command.
perldoc EFL
You can also look for information at:
RT: CPAN's request tracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=EFL
AnnoCPAN: Annotated CPAN documentation: http://annocpan.org/dist/EFL
CPAN Ratings: http://cpanratings.perl.org/d/EFL
Search CPAN: http://search.cpan.org/dist/EFL
Main Enlightenment page: http://www.enlightenment.org
EFL API: http://docs.enlightenment.org
EFL Git Web Repository: http://git.npjh.com/?p=libefl-perl.git;a=summary
Adam Flott <adam@npjh.com>
This software is Copyright (c) 2010 by Adam Flott.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
To install EFL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EFL
CPAN shell
perl -MCPAN -e shell install EFL
For more information on module installation, please visit the detailed CPAN module installation guide.