NAME
Renard::Curie::Helper - Collection of helper utilities for Gtk3 and Glib
VERSION
version 0.001_01
CLASS METHODS
gval
classmethod gval( $glib_typename, $value )
Given a Glib type name, wraps a Perl value in an object that can be passed to other Glib-based functions.
$glib_typename
The name of a type under the
Glib::
namespace. For example, passing in"int"
gives a wrapper to thegint
C type which is known asGlib::Int
in Perl.$value
The value to put inside the wrapper.
See Glib::Object::Introspection::GValueWrapper in Glib::Object::Introspection for more information.
genum
classmethod genum( $package, $sv )
Returns an enumeration value of type $package
which contains the matching enum value given in $sv
as a string.
$package
The package name of a Glib enumeration.
$sv
A string representation of the enumeration value.
For example, for GtkPackType enum, we set $package
to 'Gtk3::PackType'
and $sv
to 'GTK_PACK_START'
. This can be passed on to other Glib::Object::Introspection methods.
callback
classmethod callback( $invocant, $callback_name, @args )
A helper function to redirect to other callback functions. Given an $invocant
and the name of the callback function, $callback_name
, which is defined in the package of $invocant
, calls that function with arguments ( @args, $invocant )
.
For example, if we are trying to call the callback function Target::Package::on_event_cb
and $target
is a blessed reference of type Target::Package
, then by using
Renard::Curie::Helper->callback( $target, on_event_cb => @rest_of_args );
effectively calls
Target::Package::on_event_cb( @rest_of_args, $target );
AUTHOR
Project Renard
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Project Renard.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.