787 lines
21 KiB
HTML
787 lines
21 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Glib::Object::Introspection</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Glib::Object::Introspection</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-08<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Glib::Object::Introspection - Dynamically create Perl language bindings
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Glib::Object::Introspection;
|
|
Glib::Object::Introspection->setup(
|
|
basename => 'Gtk',
|
|
version => '3.0',
|
|
package => 'Gtk3');
|
|
# now GtkWindow, to mention just one example, is available as
|
|
# Gtk3::Window, and you can call gtk_window_new as Gtk3::Window->new
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>ABSTRACT</H2>
|
|
|
|
|
|
|
|
Glib::Object::Introspection uses the gobject-introspection and libffi projects
|
|
to dynamically create Perl bindings for a wide variety of libraries. Examples
|
|
include gtk+, webkit, libsoup and many more.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION FOR LIBRARY USERS</H2>
|
|
|
|
|
|
|
|
To allow Glib::Object::Introspection to create bindings for a library, the
|
|
library must have installed a typelib file, for example
|
|
<TT>"$prefix/lib/girepository-1.0/Gtk-3.0.typelib"</TT>. In your code you then simply
|
|
call <TT>"Glib::Object::Introspection->setup"</TT> with the following key-value
|
|
pairs to set everything up:
|
|
<DL COMPACT>
|
|
<DT id="1">basename => $basename<DD>
|
|
|
|
|
|
|
|
|
|
The basename of the library that should be wrapped. If your typelib is called
|
|
<TT>"Gtk-3.0.typelib"</TT>, then the basename is 'Gtk'.
|
|
<DT id="2">version => $version<DD>
|
|
|
|
|
|
|
|
|
|
The particular version of the library that should be wrapped, in string form.
|
|
For <TT>"Gtk-3.0.typelib"</TT>, it is '3.0'.
|
|
<DT id="3">package => $package<DD>
|
|
|
|
|
|
|
|
|
|
The name of the Perl package where every class and method of the library should
|
|
be rooted. If a library with basename 'Gtk' contains an class 'GtkWindow',
|
|
and you pick as the package 'Gtk3', then that class will be available as
|
|
'Gtk3::Window'.
|
|
</DL>
|
|
<P>
|
|
|
|
The Perl wrappers created by <TT>"Glib::Object::Introspection"</TT> follow the
|
|
conventions of the Glib module and old hand-written bindings like Gtk2.
|
|
You can use the included tool <TT>"perli11ndoc"</TT> to view the documentation of all
|
|
installed libraries organized and displayed in accordance with these
|
|
conventions. The guiding principles underlying the conventions are described
|
|
in the following.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Namespaces and Objects</H3>
|
|
|
|
|
|
|
|
The namespaces of the C libraries are mapped to Perl packages according to the
|
|
<TT>"package"</TT> option specified, for example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
gtk_ => Gtk3
|
|
gdk_ => Gtk3::Gdk
|
|
gdk_pixbuf_ => Gtk3::Gdk::Pixbuf
|
|
pango_ => Pango
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Classes, interfaces and boxed and fundamental types get their own namespaces,
|
|
in a way, as the concept of the GType is completely replaced in the Perl
|
|
bindings by the Perl package name.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
GtkButton => Gtk3::Button
|
|
GdkPixbuf => Gtk3::Gdk::Pixbuf
|
|
GtkScrolledWindow => Gtk3::ScrolledWindow
|
|
PangoFontDescription => Pango::FontDescription
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
With this package mapping and Perl's built-in method lookup, the bindings can
|
|
do object casting for you. This gives us a rather comfortably object-oriented
|
|
syntax, using normal Perl object semantics:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
in C:
|
|
GtkWidget * b;
|
|
b = gtk_check_button_new_with_mnemonic ("_Something");
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b), TRUE);
|
|
gtk_widget_show (b);
|
|
|
|
in Perl:
|
|
my $b = Gtk3::CheckButton->new_with_mnemonic ('_Something');
|
|
$b->set_active (1);
|
|
$b->show;
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
You see from this that cast macros are not necessary and that you don't need to
|
|
type namespace prefixes quite so often, so your code is a lot shorter.
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Flags and Enums</H3>
|
|
|
|
|
|
|
|
Flags and enum values are handled as strings, because it's much more readable
|
|
than numbers, and because it's automagical thanks to the GType system. Values
|
|
are referred to by their nicknames; basically, strip the common prefix,
|
|
lower-case it, and optionally convert '_' to '-':
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
GTK_WINDOW_TOPLEVEL => 'toplevel'
|
|
GTK_BUTTONS_OK_CANCEL => 'ok-cancel' (or 'ok_cancel')
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Flags are a special case. You can't (sensibly) bitwise-or these
|
|
string-constants, so you provide a reference to an array of them instead.
|
|
Anonymous arrays are useful here, and an empty anonymous array is a simple
|
|
way to say 'no flags'.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
FOO_BAR_BAZ | FOO_BAR_QUU | FOO_BAR_QUUX => [qw/baz quu qux/]
|
|
0 => []
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
In some cases you need to see if a bit is set in a bitfield; methods
|
|
returning flags therefore return an overloaded object. See Glib for
|
|
more details on which operations are allowed on these flag objects, but
|
|
here is a quick example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
in C:
|
|
/* event->state is a bitfield */
|
|
if (event->state & GDK_CONTROL_MASK) g_printerr ("control was down\n");
|
|
|
|
in Perl:
|
|
# $event->state is a special object
|
|
warn "control was down\n" if $event->state & "control-mask";
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
But this also works:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
warn "control was down\n" if $event->state * "control-mask";
|
|
warn "control was down\n" if $event->state >= "control-mask";
|
|
warn "control and shift were down\n"
|
|
if $event->state >= ["control-mask", "shift-mask"];
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Memory Handling</H3>
|
|
|
|
|
|
|
|
The functions for ref'ing and unref'ing objects and free'ing boxed structures
|
|
are not even mapped to Perl, because it's all handled automagically by the
|
|
bindings. Objects will be kept alive so long as you have a Perl scalar
|
|
pointing to it or the object is referenced in another way, e.g. from a
|
|
container.
|
|
<P>
|
|
|
|
The only thing you have to be careful about is the lifespan of non
|
|
reference counted structures, which means most things derived from
|
|
<TT>"Glib::Boxed"</TT>. If it comes from a signal callback it might be good
|
|
only until you return, or if it's the insides of another object then
|
|
it might be good only while that object lives. If in doubt you can
|
|
<TT>"copy"</TT>. Structs from <TT>"copy"</TT> or <TT>"new"</TT> are yours and live as long as
|
|
referred to from Perl.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Callbacks</H3>
|
|
|
|
|
|
|
|
Use normal Perl callback/closure tricks with callbacks. The most common use
|
|
you'll have for callbacks is with the Glib <TT>"signal_connect"</TT> method:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
$widget->signal_connect (event => \&event_handler, $user_data);
|
|
$button->signal_connect (clicked => sub { warn "hi!\n" });
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
<TT>$user_data</TT> is optional, and with Perl closures you don't often need it
|
|
(see ``Persistent variables with closures'' in perlsub).
|
|
<P>
|
|
|
|
The userdata is held in a scalar, initialized from what you give in
|
|
<TT>"signal_connect"</TT> etc. It's passed to the callback in usual Perl
|
|
``call by reference'' style which means the callback can modify its last
|
|
argument, ie. <TT>$_</TT>[-1], to modify the held userdata. This is a little
|
|
subtle, but you can use it for some ``state'' associated with the
|
|
connection.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
$widget->signal_connect (activate => \&my_func, 1);
|
|
sub my_func {
|
|
print "activation count: $_[-1]\n";
|
|
$_[-1] ++;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Because the held userdata is a new scalar there's no change to the
|
|
variable (etc.) you originally passed to <TT>"signal_connect"</TT>.
|
|
<P>
|
|
|
|
If you have a parent object in the userdata (or closure) you have to be careful
|
|
about circular references preventing parent and child being destroyed. See
|
|
``Two-Phased Garbage Collection'' in perlobj about this generally. Toplevel
|
|
widgets like <TT>"Gtk3::Window"</TT> always need an explicit <TT>"$widget->destroy"</TT> so
|
|
their <TT>"destroy"</TT> signal is a good place to break circular references. But for
|
|
other widgets it's usually friendliest to avoid circularities in the first
|
|
place, either by using weak references in the userdata, or possibly locating a
|
|
parent dynamically with <TT>"$widget->get_ancestor"</TT>.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Exception handling</H3>
|
|
|
|
|
|
|
|
Anything that uses GError in C will <TT>"croak"</TT> on failure, setting $@ to a
|
|
magical exception object, which is overloaded to print as the
|
|
returned error message. The ideology here is that GError is to be used
|
|
for runtime exceptions, and <TT>"croak"</TT> is how you do that in Perl. You can
|
|
catch a croak very easily by wrapping the function in an eval:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
eval {
|
|
my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file ($filename);
|
|
$image->set_from_pixbuf ($pixbuf);
|
|
};
|
|
if ($@) {
|
|
print "$@\n"; # prints the possibly-localized error message
|
|
if (Glib::Error::matches ($@, 'Gtk3::Gdk::Pixbuf::Error',
|
|
'unknown-format')) {
|
|
change_format_and_try_again ();
|
|
} elsif (Glib::Error::matches ($@, 'Glib::File::Error', 'noent')) {
|
|
change_source_dir_and_try_again ();
|
|
} else {
|
|
# don't know how to handle this
|
|
die $@;
|
|
}
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
This has the added advantage of letting you bunch things together as you would
|
|
with a try/throw/catch block in C<FONT SIZE="-2">++</FONT> --- you get cleaner code. By using
|
|
Glib::Error exception objects, you don't have to rely on string matching
|
|
on a possibly localized error message; you can match errors by explicit and
|
|
predictable conditions. See Glib::Error for more information.
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Output arguments, lists, hashes</H3>
|
|
|
|
|
|
|
|
In C you can only return one value from a function, and it is a common practice
|
|
to modify pointers passed in to simulate returning multiple values. In Perl,
|
|
you can return lists; any functions which modify arguments are changed to
|
|
return them instead.
|
|
<P>
|
|
|
|
Arguments and return values that have the types GList or GSList or which are C
|
|
arrays of values will be converted to and from references to normal Perl
|
|
arrays. The same holds for GHashTable and references to normal Perl hashes.
|
|
<A NAME="lbAL"> </A>
|
|
<H3>Object class functions</H3>
|
|
|
|
|
|
|
|
Object class functions like <TT>"Gtk3::WidgetClass::find_style_propery"</TT> can be
|
|
called either with a package name or with an instance of the package. For
|
|
example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
Gtk3::WidgetClass::find_style_property ('Gtk3::Button', 'image-spacing')
|
|
|
|
my $button = Gtk3::Button->new;
|
|
Gtk3::WidgetClass::find_style_property ($button, 'image-spacing')
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAM"> </A>
|
|
<H3>Overriding virtual functions</H3>
|
|
|
|
|
|
|
|
When subclassing a gtk+ class or when implementing a gtk+ interface with
|
|
Glib::Object::Subclass, you can override any virtual functions that the
|
|
class has by simply defining sub routines with names obtained by capitalizing
|
|
the original names of the virtual functions. So, for example, if you implement
|
|
a custom subclass of <TT>"Gtk3::CellRenderer"</TT> and want to override its virtual
|
|
function <TT>"render"</TT>, you provide a sub routine with the name <TT>"RENDER"</TT> in your
|
|
package.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
sub RENDER {
|
|
my ($cell, $cr, $widget, $background_area, $cell_area, $flags) = @_;
|
|
# do something
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAN"> </A>
|
|
<H2>DESCRIPTION FOR LIBRARY BINDING AUTHORS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAO"> </A>
|
|
<H3>Glib::Object::Introspection->setup</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<TT>"Glib::Object::Introspection->setup"</TT> takes a few optional arguments that
|
|
augment the generated <FONT SIZE="-1">API:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="4">search_path => $search_path<DD>
|
|
|
|
|
|
|
|
|
|
A path that should be used when looking for typelibs. If you use typelibs from
|
|
system directories, or if your environment contains a properly set
|
|
<TT>"GI_TYPELIB_PATH"</TT> variable, then this should not be necessary.
|
|
<DT id="5">name_corrections => { auto_name => new_name, ... }<DD>
|
|
|
|
|
|
A hash ref that is used to rename functions and methods. Use this if you don't
|
|
like the automatically generated mapping for a function or method. For
|
|
example, if <TT>"g_file_hash"</TT> is automatically represented as
|
|
<TT>"Glib::IO::file_hash"</TT> but you want <TT>"Glib::IO::File::hash"</TT> then pass
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
name_corrections => {
|
|
'Glib::IO::file_hash' => 'Glib::IO::File::hash'
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="6">class_static_methods => [ function1, ... ]<DD>
|
|
|
|
|
|
An array ref of function names that you want to be treated as class-static
|
|
methods. That is, if you want be able to call
|
|
<TT>"Gtk3::Window::list_toplevels"</TT> as <TT>"Gtk3::Window->list_toplevels"</TT>, then
|
|
pass
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
class_static_methods => [
|
|
'Gtk3::Window::list_toplevels'
|
|
]
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The function names refer to those after name corrections.
|
|
<DT id="7">flatten_array_ref_return_for => [ function1, ... ]<DD>
|
|
|
|
|
|
An array ref of function names that return an array ref that you want to be
|
|
flattened so that they return plain lists. For example
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
flatten_array_ref_return_for => [
|
|
'Gtk3::Window::list_toplevels'
|
|
]
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The function names refer to those after name corrections. Functions occurring
|
|
in <TT>"flatten_array_ref_return_for"</TT> may also occur in <TT>"class_static_methods"</TT>.
|
|
<DT id="8">handle_sentinel_boolean_for => [ function1, ... ]<DD>
|
|
|
|
|
|
An array ref of function names that return multiple values, the first of which
|
|
is to be interpreted as indicating whether the rest of the returned values are
|
|
valid. This frequently occurs with functions that have out arguments; the
|
|
boolean then indicates whether the out arguments have been written. With
|
|
<TT>"handle_sentinel_boolean_for"</TT>, the first return value is taken to be the
|
|
sentinel boolean. If it is true, the rest of the original return values will
|
|
be returned, and otherwise an empty list will be returned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
handle_sentinel_boolean_for => [
|
|
'Gtk3::TreeSelection::get_selected'
|
|
]
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The function names refer to those after name corrections. Functions occurring
|
|
in <TT>"handle_sentinel_boolean_for"</TT> may also occur in <TT>"class_static_methods"</TT>.
|
|
<DT id="9">use_generic_signal_marshaller_for => [ [package1, signal1, [arg_converter1]], ... ]<DD>
|
|
|
|
|
|
Use an introspection-based generic signal marshaller for the signal <TT>"signal1"</TT>
|
|
of type <TT>"package1"</TT>. If given, use the code reference <TT>"arg_converter1"</TT> to
|
|
convert the arguments that are passed to the signal handler. In contrast to
|
|
Glib's normal signal marshaller, the generic signal marshaller supports,
|
|
among other things, pointer arrays and out arguments.
|
|
<DT id="10">reblessers => { package => \&reblesser, ... }<DD>
|
|
|
|
|
|
Tells G:O:I to invoke <I>reblesser</I> whenever a Perl object is created for an
|
|
object of type <I>package</I>. Currently, this only applies to boxed unions. The
|
|
reblesser gets passed the pre-created Perl object and needs to return the
|
|
modified Perl object. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
sub Gtk3::Gdk::Event::_rebless {
|
|
my ($event) = @_;
|
|
return bless $event, lookup_real_package_for ($event);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAP"> </A>
|
|
<H3>Glib::Object::Introspection->invoke</H3>
|
|
|
|
|
|
|
|
|
|
|
|
To invoke specific functions manually, you can use the low-level <TT>"Glib::Object::Introspection->invoke"</TT>.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
Glib::Object::Introspection->invoke(
|
|
$basename, $namespace, $function, @args)
|
|
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="11">•<DD>
|
|
<TT>$basename</TT> is the basename of a library, like 'Gtk'.
|
|
<DT id="12">•<DD>
|
|
<TT>$namespace</TT> refers to a namespace inside that library, like 'Window'. Use
|
|
undef here if you want to call a library-global function.
|
|
<DT id="13">•<DD>
|
|
<TT>$function</TT> is the name of the function you want to invoke. It can also
|
|
refer to the name of a constant.
|
|
<DT id="14">•<DD>
|
|
<TT>@args</TT> are the arguments that should be passed to the function. For a
|
|
method, this should include the invocant. For a constructor, this should
|
|
include the package name.
|
|
</DL>
|
|
<P>
|
|
|
|
<TT>"Glib::Object::Introspection->invoke"</TT> returns whatever the function being
|
|
invoked returns.
|
|
<A NAME="lbAQ"> </A>
|
|
<H3>Overrides</H3>
|
|
|
|
|
|
|
|
To override the behavior of a specific function or method, create an
|
|
appropriately named sub in the correct package and have it call <TT>"Glib::Object::Introspection->invoke"</TT>. Say you want to override
|
|
<TT>"Gtk3::Window::list_toplevels"</TT>, then do this:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
sub Gtk3::Window::list_toplevels {
|
|
# ...do something...
|
|
my $ref = Glib::Object::Introspection->invoke (
|
|
'Gtk', 'Window', 'list_toplevels',
|
|
@_);
|
|
# ...do something...
|
|
return wantarray ? @$ref : $ref->[$#$ref];
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
The sub's name and package must be those after name corrections.
|
|
<A NAME="lbAR"> </A>
|
|
<H3>Converting a Perl variable to a GValue</H3>
|
|
|
|
|
|
|
|
If you need to marshal into a GValue, then Glib::Object::Introspection cannot
|
|
do this automatically because the type information is missing. If you do have
|
|
this information in your module, however, you can use
|
|
Glib::Object::Introspection::GValueWrapper to do the conversion. In the
|
|
wrapper for a function that expects a GValue, do this:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
...
|
|
my $type = ...; # somehow get the package name that
|
|
# corresponds to the correct GType
|
|
my $wrapper =
|
|
Glib::Object::Introspection::GValueWrapper->new ($type, $value);
|
|
# now use Glib::Object::Introspection->invoke and
|
|
# substitute $wrapper where you'd use $value
|
|
...
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
If you need to call a function that expects an already set-up GValue and
|
|
modifies it, use <TT>"get_value"</TT> on the wrapper afterwards to obtain the value.
|
|
For example:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
my $wrapper =
|
|
Glib::Object::Introspection::GValueWrapper->new ('Glib::Boolean', 0);
|
|
$box->child_get_property ($label, 'expand', $gvalue);
|
|
my $value = $gvalue->get_value
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAS"> </A>
|
|
<H3>Handling raw enumerations and flags</H3>
|
|
|
|
|
|
|
|
If you need to handle raw enumerations/flags or extendable enumerations for
|
|
which more than the pre-defined values might be valid, then use <TT>"Glib::Object::Introspection->convert_enum_to_sv"</TT>, <TT>"Glib::Object::Introspection->convert_sv_to_enum"</TT>, <TT>"Glib::Object::Introspection->convert_flags_to_sv"</TT> and <TT>"Glib::Object::Introspection->convert_sv_to_flags"</TT>. They will raise an
|
|
exception on unknown values; catching it then allows you to implement fallback
|
|
behavior.
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
Glib::Object::Introspection->convert_enum_to_sv (package, enum_value)
|
|
Glib::Object::Introspection->convert_sv_to_enum (package, sv)
|
|
|
|
Glib::Object::Introspection->convert_flags_to_sv (package, flags_value)
|
|
Glib::Object::Introspection->convert_sv_to_flags (package, sv)
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAT"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="15">perl-Glib: Glib<DD>
|
|
|
|
|
|
|
|
<DT id="16">gobject-introspection: <<A HREF="http://live.gnome.org/GObjectIntrospection">http://live.gnome.org/GObjectIntrospection</A>><DD>
|
|
|
|
|
|
<DT id="17">libffi: <<A HREF="http://sourceware.org/libffi/">http://sourceware.org/libffi/</A>><DD>
|
|
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAU"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="18">Emmanuele Bassi <ebassi at linux intel com><DD>
|
|
|
|
|
|
|
|
<DT id="19">muppet <scott asofyet org><DD>
|
|
|
|
|
|
<DT id="20">Torsten Schönfeld <kaffeetisch at gmx de><DD>
|
|
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAV"> </A>
|
|
<H2>LICENSE</H2>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under
|
|
the terms of the Lesser General Public License (<FONT SIZE="-1">LGPL</FONT>). For more information,
|
|
see <A HREF="http://www.fsf.org/licenses/lgpl.txt">http://www.fsf.org/licenses/lgpl.txt</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="21"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="22"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="23"><A HREF="#lbAD">ABSTRACT</A><DD>
|
|
<DT id="24"><A HREF="#lbAE">DESCRIPTION FOR LIBRARY USERS</A><DD>
|
|
<DL>
|
|
<DT id="25"><A HREF="#lbAF">Namespaces and Objects</A><DD>
|
|
<DT id="26"><A HREF="#lbAG">Flags and Enums</A><DD>
|
|
<DT id="27"><A HREF="#lbAH">Memory Handling</A><DD>
|
|
<DT id="28"><A HREF="#lbAI">Callbacks</A><DD>
|
|
<DT id="29"><A HREF="#lbAJ">Exception handling</A><DD>
|
|
<DT id="30"><A HREF="#lbAK">Output arguments, lists, hashes</A><DD>
|
|
<DT id="31"><A HREF="#lbAL">Object class functions</A><DD>
|
|
<DT id="32"><A HREF="#lbAM">Overriding virtual functions</A><DD>
|
|
</DL>
|
|
<DT id="33"><A HREF="#lbAN">DESCRIPTION FOR LIBRARY BINDING AUTHORS</A><DD>
|
|
<DL>
|
|
<DT id="34"><A HREF="#lbAO">Glib::Object::Introspection->setup</A><DD>
|
|
<DT id="35"><A HREF="#lbAP">Glib::Object::Introspection->invoke</A><DD>
|
|
<DT id="36"><A HREF="#lbAQ">Overrides</A><DD>
|
|
<DT id="37"><A HREF="#lbAR">Converting a Perl variable to a GValue</A><DD>
|
|
<DT id="38"><A HREF="#lbAS">Handling raw enumerations and flags</A><DD>
|
|
</DL>
|
|
<DT id="39"><A HREF="#lbAT">SEE ALSO</A><DD>
|
|
<DT id="40"><A HREF="#lbAU">AUTHORS</A><DD>
|
|
<DT id="41"><A HREF="#lbAV">LICENSE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:45 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|