gnome-perl-introspection r4 - in Glib-Object-Introspection/trunk: . t xs
- From: tsch svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-perl-introspection r4 - in Glib-Object-Introspection/trunk: . t xs
- Date: Fri, 14 Mar 2008 13:28:58 +0000 (GMT)
Author: tsch
Date: Fri Mar 14 13:28:57 2008
New Revision: 4
URL: http://svn.gnome.org/viewvc/gnome-perl-introspection?rev=4&view=rev
Log:
Initial import into GNOME SVN.
Added:
Glib-Object-Introspection/trunk/Introspection.pm
Glib-Object-Introspection/trunk/LICENSE
Glib-Object-Introspection/trunk/MANIFEST
Glib-Object-Introspection/trunk/MANIFEST.SKIP
Glib-Object-Introspection/trunk/Makefile.PL
Glib-Object-Introspection/trunk/copyright.pod
Glib-Object-Introspection/trunk/gobject-introspection-perl-private.h
Glib-Object-Introspection/trunk/gobject-introspection-perl.h
Glib-Object-Introspection/trunk/gobject-introspection.typemap
Glib-Object-Introspection/trunk/maps
Glib-Object-Introspection/trunk/t/
Glib-Object-Introspection/trunk/t/Idl.t
Glib-Object-Introspection/trunk/t/IdlArgInfo.t
Glib-Object-Introspection/trunk/t/IdlBaseInfo.t
Glib-Object-Introspection/trunk/t/IdlCallableInfo.t
Glib-Object-Introspection/trunk/t/IdlConstantInfo.t
Glib-Object-Introspection/trunk/t/IdlEnumInfo.t
Glib-Object-Introspection/trunk/t/IdlErrorDomainInfo.t
Glib-Object-Introspection/trunk/t/IdlFieldInfo.t
Glib-Object-Introspection/trunk/t/IdlFunctionInfo.t
Glib-Object-Introspection/trunk/t/IdlInterfaceInfo.t
Glib-Object-Introspection/trunk/t/IdlObjectInfo.t
Glib-Object-Introspection/trunk/t/IdlPropertyInfo.t
Glib-Object-Introspection/trunk/t/IdlRegisteredTypeInfo.t
Glib-Object-Introspection/trunk/t/IdlRepository.t
Glib-Object-Introspection/trunk/t/IdlSignalInfo.t
Glib-Object-Introspection/trunk/t/IdlStructInfo.t
Glib-Object-Introspection/trunk/t/IdlTypeInfo.t
Glib-Object-Introspection/trunk/t/IdlVFuncInfo.t
Glib-Object-Introspection/trunk/t/IdlValueInfo.t
Glib-Object-Introspection/trunk/t/create-repository.inc
Glib-Object-Introspection/trunk/t/test.idl
Glib-Object-Introspection/trunk/t/test.raw (contents, props changed)
Glib-Object-Introspection/trunk/xs/
Glib-Object-Introspection/trunk/xs/Idl.xs
Glib-Object-Introspection/trunk/xs/IdlArgInfo.xs
Glib-Object-Introspection/trunk/xs/IdlBaseInfo.xs
Glib-Object-Introspection/trunk/xs/IdlBoxedInfo.xs
Glib-Object-Introspection/trunk/xs/IdlCallableInfo.xs
Glib-Object-Introspection/trunk/xs/IdlConstantInfo.xs
Glib-Object-Introspection/trunk/xs/IdlEnumInfo.xs
Glib-Object-Introspection/trunk/xs/IdlErrorDomainInfo.xs
Glib-Object-Introspection/trunk/xs/IdlFieldInfo.xs
Glib-Object-Introspection/trunk/xs/IdlFunctionInfo.xs
Glib-Object-Introspection/trunk/xs/IdlInterfaceInfo.xs
Glib-Object-Introspection/trunk/xs/IdlMetadata.xs
Glib-Object-Introspection/trunk/xs/IdlObjectInfo.xs
Glib-Object-Introspection/trunk/xs/IdlPropertyInfo.xs
Glib-Object-Introspection/trunk/xs/IdlRegisteredTypeInfo.xs
Glib-Object-Introspection/trunk/xs/IdlRepository.xs
Glib-Object-Introspection/trunk/xs/IdlSignalInfo.xs
Glib-Object-Introspection/trunk/xs/IdlStructInfo.xs
Glib-Object-Introspection/trunk/xs/IdlTypeInfo.xs
Glib-Object-Introspection/trunk/xs/IdlVFuncInfo.xs
Glib-Object-Introspection/trunk/xs/IdlValueInfo.xs
Added: Glib-Object-Introspection/trunk/Introspection.pm
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/Introspection.pm Fri Mar 14 13:28:57 2008
@@ -0,0 +1,139 @@
+package Glib::Object::Introspection;
+
+# $Id: Introspection.pm,v 1.3 2005/08/26 18:47:42 torsten Exp $
+
+use 5.008;
+use strict;
+use warnings;
+
+use Carp qw(croak);
+use Glib;
+
+require DynaLoader;
+
+our @ISA = qw(DynaLoader);
+our $VERSION = '0.01';
+
+sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
+
+Glib::Object::Introspection -> bootstrap($VERSION);
+
+# --------------------------------------------------------------------------- #
+
+our $AUTOLOAD;
+our $REPOSITORY;
+our $BASENAME;
+our $PACKAGE;
+
+sub setup {
+ my ($self, $library, $wrapper_library, $basename, $package) = @_;
+
+ $BASENAME = $basename;
+ $PACKAGE = $package;
+ $REPOSITORY = Glib::Object::Introspection::Repository -> get_default();
+
+ # Load the library
+ {
+ my $so = DynaLoader::dl_findfile($library);
+ croak "Couldn't locate $library in the linker path" unless defined $so;
+
+ my $lib = DynaLoader::dl_load_file($so, 0x01);
+ croak "Couldn't load $so" unless defined $lib;
+ }
+
+ # Load the wrapper library
+ {
+ my $so = DynaLoader::dl_findfile($wrapper_library);
+ croak "Couldn't locate $wrapper_library in the linker path" unless defined $so;
+
+ my $lib = DynaLoader::dl_load_file($so, 0x01);
+ croak "Couldn't load $so" unless defined $lib;
+ }
+
+ $REPOSITORY -> register_types($basename => $package);
+}
+
+sub AUTOLOAD {
+ (my $symbol = $AUTOLOAD) =~ s/${PACKAGE}:://;
+
+ # namespace::method
+ if ($symbol =~ m/(.+)::(.+)/) {
+ my ($namespace, $method) = ($1, $2);
+
+ my $object = $REPOSITORY -> find_by_name($BASENAME, $namespace);
+ my $type = $object -> get_type();
+
+ if ($type eq "object" || $type eq "boxed") {
+ my $info;
+
+ if ($info = $object -> find_method($method)) {
+ return $info -> get_flags() & "is-constructor"
+ ? $info -> invoke(@_[1..$#_])
+ : $info -> invoke(@_);
+ }
+
+ elsif (($info) = grep { $_ -> get_name() eq $method }
+ $object -> get_fields()) {
+ if (@_ != 1 && @_ != 2) {
+ croak "Invalid invocation of a field accessor";
+ }
+
+ return defined $_[1]
+ ? $object -> access_field($info, $_[0], $_[1])
+ : $object -> access_field($info, $_[0]);
+ }
+
+ else {
+ croak "Dispatch error: ${PACKAGE}::$symbol doesn't exist";
+ }
+ } else {
+ croak "Unhandled type: $type";
+ }
+ }
+
+ # function
+ else {
+ my $info = $REPOSITORY -> find_by_name($BASENAME, $symbol);
+ if ($info) {
+ return defined $_[0] && $_[0] eq $PACKAGE
+ ? $info -> invoke(@_[1..$#_])
+ : $info -> invoke(@_);
+ }
+ }
+
+ croak "Invalid invocation: Cannot handle $AUTOLOAD";
+}
+
+1;
+
+# --------------------------------------------------------------------------- #
+
+__END__
+
+=head1 NAME
+
+Glib::Object::Introspection - Perl bindings for GLib's introspection library
+
+=head1 SYNOPSIS
+
+ # ...
+
+=head1 ABSTRACT
+
+Automatically generate Perl bindings from vendor-supplied IDL files!
+
+=head1 AUTHORS
+
+=over
+
+=item Torsten Schoenfeld, E<lt>kaffeetisch at gmx dot deE<gt>
+
+=item muppet, E<lt>scott at asofyet dot orgE<gt>
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2005 by the gtk2-perl team
+
+=cut
Added: Glib-Object-Introspection/trunk/LICENSE
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/LICENSE Fri Mar 14 13:28:57 2008
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Added: Glib-Object-Introspection/trunk/MANIFEST
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/MANIFEST Fri Mar 14 13:28:57 2008
@@ -0,0 +1,51 @@
+Introspection.pm
+LICENSE
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+copyright.pod
+gobject-introspection-perl-private.h
+gobject-introspection-perl.h
+gobject-introspection.typemap
+maps
+t/Idl.t
+t/IdlArgInfo.t
+t/IdlBaseInfo.t
+t/IdlCallableInfo.t
+t/IdlConstantInfo.t
+t/IdlEnumInfo.t
+t/IdlErrorDomainInfo.t
+t/IdlFieldInfo.t
+t/IdlFunctionInfo.t
+t/IdlInterfaceInfo.t
+t/IdlObjectInfo.t
+t/IdlPropertyInfo.t
+t/IdlRegisteredTypeInfo.t
+t/IdlRepository.t
+t/IdlSignalInfo.t
+t/IdlStructInfo.t
+t/IdlTypeInfo.t
+t/IdlVFuncInfo.t
+t/IdlValueInfo.t
+t/test.idl
+t/test.raw
+xs/Idl.xs
+xs/IdlArgInfo.xs
+xs/IdlBaseInfo.xs
+xs/IdlBoxedInfo.xs
+xs/IdlCallableInfo.xs
+xs/IdlConstantInfo.xs
+xs/IdlEnumInfo.xs
+xs/IdlErrorDomainInfo.xs
+xs/IdlFieldInfo.xs
+xs/IdlFunctionInfo.xs
+xs/IdlInterfaceInfo.xs
+xs/IdlObjectInfo.xs
+xs/IdlPropertyInfo.xs
+xs/IdlRegisteredTypeInfo.xs
+xs/IdlRepository.xs
+xs/IdlSignalInfo.xs
+xs/IdlStructInfo.xs
+xs/IdlTypeInfo.xs
+xs/IdlVFuncInfo.xs
+xs/IdlValueInfo.xs
Added: Glib-Object-Introspection/trunk/MANIFEST.SKIP
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/MANIFEST.SKIP Fri Mar 14 13:28:57 2008
@@ -0,0 +1,11 @@
+.cvsignore
+blib
+build
+CVS
+Introspection.bs
+pm_to_blib
+Makefile$
+\.c$
+\.o$
+.svn
+\.bak$
Added: Glib-Object-Introspection/trunk/Makefile.PL
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/Makefile.PL Fri Mar 14 13:28:57 2008
@@ -0,0 +1,111 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use ExtUtils::MakeMaker;
+use Cwd qw(cwd);
+
+# $Id: Makefile.PL,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+our %build_reqs = (
+ 'perl-ExtUtils-Depends' => '0.205',
+ 'perl-ExtUtils-PkgConfig' => '1.07',
+ 'perl-Glib' => '1.090',
+);
+
+our %pre_reqs = (
+ 'ExtUtils::Depends' => $build_reqs{'perl-ExtUtils-Depends'},
+ 'ExtUtils::PkgConfig' => $build_reqs{'perl-ExtUtils-PkgConfig'},
+ 'Glib' => $build_reqs{'perl-Glib'},
+);
+
+unless (eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';"
+ . "use ExtUtils::PkgConfig '$build_reqs{'perl-ExtUtils-PkgConfig'}';"
+ . "use Glib '$build_reqs{'perl-Glib'}';"
+ . "use Glib::MakeHelper;"
+ . "use Glib::CodeGen;"
+ . "1") {
+ warn "$ \n";
+ WriteMakefile(
+ PREREQ_FATAL => 1,
+ PREREQ_PM => \%pre_reqs,
+ );
+ exit 1; # not reached
+}
+
+# --------------------------------------------------------------------------- #
+
+mkdir 'build', 0777;
+
+my %i11n_pkgcfg = ExtUtils::PkgConfig->find("gobject-introspection");
+my %ffi_pkgcfg = ExtUtils::PkgConfig->find("libffi");
+
+my $includedir = ExtUtils::PkgConfig->variable("gobject-introspection",
+ "includedir");
+my $header = $includedir . "/glib-2.0/gobject-introspection/girepository.h";
+
+system(q(glib-mkenums --fhead "#ifndef __GIDLPERL_GTYPES_H__\n" ) .
+ q(--fhead "#define __GIDLPERL_GTYPES_H__ 1\n\n" ) .
+ q(--fhead "#include <glib-object.h>\n\n" ) .
+ q(--fhead "G_BEGIN_DECLS\n\n" ) .
+ q(--eprod "#define GIDLPERL_TYPE_ ENUMSHORT@ gidlperl_ enum_name@_get_type()\n" ) .
+ q(--eprod "GType gidlperl_ enum_name@_get_type (void);\n" ) .
+ q(--ftail "G_END_DECLS\n\n" ) .
+ q(--ftail "#endif /* __GIDLPERL_GTYPES_H__ */\n" ) .
+ "$header > build/gobject-introspection-perl-types.h");
+
+system(q(glib-mkenums --fhead "#include \"girepository.h\"\n" ) .
+ q(--vhead "static const G Type@Value _gidlperl_ enum_name@_values[] = {" ) .
+ q(--vprod " { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," ) .
+ q(--vtail " { 0, NULL, NULL }\n};\n\n" ) .
+ q(--vtail "GType\ngidlperl_ enum_name@_get_type (void)\n{\n" ) .
+ q(--vtail " static GType type = 0;\n\n" ) .
+ q(--vtail " if (!type)\n" ) .
+ q(--vtail " type = g_ type@_register_static (\"@EnumName \", _gidlperl_ enum_name@_values);\n\n" ) .
+ q(--vtail " return type;\n}\n\n" ) .
+ "$header > build/gobject-introspection-perl-types.c");
+
+# --------------------------------------------------------------------------- #
+
+our @xs_files = <xs/*.xs>;
+our %pod_files = (
+ 'Introspection.pm' => '$(INST_MAN3DIR)/Glib::Object::Introspection.$(MAN3EXT)',
+ Glib::MakeHelper->do_pod_files (@xs_files),
+);
+
+Glib::CodeGen->parse_maps ('gobject-introspection-perl');
+Glib::CodeGen->write_boot (ignore => qr/^Glib::Object::Introspection$/);
+
+my $idl = ExtUtils::Depends->new('Glib::Object::Introspection', 'Glib');
+$idl->set_inc($i11n_pkgcfg{cflags} . ' ' . $ffi_pkgcfg{cflags} . ' -Ibuild');
+$idl->set_libs($i11n_pkgcfg{libs} . ' ' . $ffi_pkgcfg{libs});
+$idl->add_c(qw(build/gobject-introspection-perl-types.c));
+$idl->add_xs(@xs_files);
+$idl->add_pm('Introspection.pm' => '$(INST_LIBDIR)/Introspection.pm');
+$idl->add_typemaps(map { cwd() . "/$_" }
+ qw(gobject-introspection.typemap
+ build/gobject-introspection-perl.typemap));
+$idl->install(qw(gobject-introspection-perl.h
+ gobject-introspection.typemap
+ build/gobject-introspection-perl.typemap
+ build/gobject-introspection-perl-types.h));
+$idl->save_config('build/IFiles.pm');
+
+# --------------------------------------------------------------------------- #
+
+WriteMakefile(
+ NAME => 'Glib::Object::Introspection',
+ VERSION_FROM => 'Introspection.pm',
+ ABSTRACT_FROM => 'Introspection.pm',
+ PREREQ_PM => \%pre_reqs,
+ XSPROTOARG => '-noprototypes',
+ MAN3PODS => \%pod_files,
+ $idl->get_makefile_vars,
+);
+
+sub MY::postamble {
+ return Glib::MakeHelper->postamble_clean ()
+ . Glib::MakeHelper->postamble_docs_full (
+ DEPENDS => $idl,
+ COPYRIGHT_FROM => 'copyright.pod');
+}
Added: Glib-Object-Introspection/trunk/copyright.pod
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/copyright.pod Fri Mar 14 13:28:57 2008
@@ -0,0 +1,4 @@
+Copyright (C) 2005 by the gtk2-perl team.
+
+This software is licensed under the LGPL. See L<Glib::Object::Introspection>
+for a full notice.
Added: Glib-Object-Introspection/trunk/gobject-introspection-perl-private.h
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/gobject-introspection-perl-private.h Fri Mar 14 13:28:57 2008
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: gobject-introspection-perl.h,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#ifndef _GOBJECT_INTROSPECTION_PERL_PRIVATE_H_
+#define _GOBJECT_INTROSPECTION_PERL_PRIVATE_H_
+
+#include "gobject-introspection-perl.h"
+
+void * gperl_i11n_sv_to_pointer (GITypeInfo* info, SV *sv);
+SV * gperl_i11n_pointer_to_sv (GITypeInfo* info, void* pointer, gboolean own);
+
+GType gperl_i11n_get_gtype (GIRegisteredTypeInfo *info);
+
+#endif /* _GOBJECT_INTROSPECTION_PERL_PRIVATE_H_ */
Added: Glib-Object-Introspection/trunk/gobject-introspection-perl.h
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/gobject-introspection-perl.h Fri Mar 14 13:28:57 2008
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: gobject-introspection-perl.h,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#ifndef _GOBJECT_INTROSPECTION_PERL_H_
+#define _GOBJECT_INTROSPECTION_PERL_H_
+
+#include <gperl.h>
+
+#include <girepository.h>
+
+#include "gobject-introspection-perl-types.h"
+#include "gobject-introspection-perl-autogen.h"
+
+SV * newSVGIBaseInfo (GIBaseInfo *info);
+GIBaseInfo * SvGIBaseInfo (SV *info);
+
+SV * newSVGIFunctionInfo (GIFunctionInfo *info);
+GIFunctionInfo * SvGIFunctionInfo (SV *info);
+
+SV * newSVGIStructInfo (GIStructInfo *info);
+GIStructInfo * SvGIStructInfo (SV *info);
+
+SV * newSVGIFieldInfo (GIFieldInfo *info);
+GIFieldInfo * SvGIFieldInfo (SV *info);
+
+SV * newSVGITypeInfo (GITypeInfo *info);
+GITypeInfo * SvGITypeInfo (SV *info);
+
+SV * newSVGIErrorDomainInfo (GIErrorDomainInfo *info);
+GIErrorDomainInfo * SvGIErrorDomainInfo (SV *info);
+
+SV * newSVGIInterfaceInfo (GIInterfaceInfo *info);
+GIInterfaceInfo * SvGIInterfaceInfo (SV *info);
+
+SV * newSVGIPropertyInfo (GIPropertyInfo *info);
+GIPropertyInfo * SvGIPropertyInfo (SV *info);
+
+SV * newSVGISignalInfo (GISignalInfo *info);
+GISignalInfo * SvGISignalInfo (SV *info);
+
+SV * newSVGIVFuncInfo (GIVFuncInfo *info);
+GIVFuncInfo * SvGIVFuncInfo (SV *info);
+
+SV * newSVGIConstantInfo (GIConstantInfo *info);
+GIConstantInfo * SvGIConstantInfo (SV *info);
+
+SV * newSVGICallableInfo (GICallableInfo *info);
+GICallableInfo * SvGICallableInfo (SV *info);
+
+SV * newSVGIArgInfo (GIArgInfo *info);
+GIArgInfo * SvGIArgInfo (SV *info);
+
+SV * newSVGIRegisteredTypeInfo (GIRegisteredTypeInfo *info);
+GIRegisteredTypeInfo * SvGIRegisteredTypeInfo (SV *info);
+
+SV * newSVGIValueInfo (GIValueInfo *info);
+GIValueInfo * SvGIValueInfo (SV *info);
+
+SV * newSVGIEnumInfo (GIEnumInfo *info);
+GIEnumInfo * SvGIEnumInfo (SV *info);
+
+SV * newSVGIObjectInfo (GIObjectInfo *info);
+GIObjectInfo * SvGIObjectInfo (SV *info);
+
+SV * newSVGMetadata (GMetadata *metadata);
+GMetadata * SvGMetadata (SV *metadata);
+
+#endif /* _GOBJECT_INTROSPECTION_PERL_H_ */
Added: Glib-Object-Introspection/trunk/gobject-introspection.typemap
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/gobject-introspection.typemap Fri Mar 14 13:28:57 2008
@@ -0,0 +1,21 @@
+TYPEMAP
+
+GIArgInfo * T_GPERL_GENERIC_WRAPPER
+GIBaseInfo * T_GPERL_GENERIC_WRAPPER
+GICallableInfo * T_GPERL_GENERIC_WRAPPER
+GIConstantInfo * T_GPERL_GENERIC_WRAPPER
+GIEnumInfo * T_GPERL_GENERIC_WRAPPER
+GIErrorDomainInfo * T_GPERL_GENERIC_WRAPPER
+GIFieldInfo * T_GPERL_GENERIC_WRAPPER
+GIFunctionInfo * T_GPERL_GENERIC_WRAPPER
+GIInterfaceInfo * T_GPERL_GENERIC_WRAPPER
+GIObjectInfo * T_GPERL_GENERIC_WRAPPER
+GIPropertyInfo * T_GPERL_GENERIC_WRAPPER
+GIRegisteredTypeInfo * T_GPERL_GENERIC_WRAPPER
+GISignalInfo * T_GPERL_GENERIC_WRAPPER
+GIStructInfo * T_GPERL_GENERIC_WRAPPER
+GITypeInfo * T_GPERL_GENERIC_WRAPPER
+GIValueInfo * T_GPERL_GENERIC_WRAPPER
+GIVFuncInfo * T_GPERL_GENERIC_WRAPPER
+
+GMetadata * T_GPERL_GENERIC_WRAPPER
Added: Glib-Object-Introspection/trunk/maps
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/maps Fri Mar 14 13:28:57 2008
@@ -0,0 +1,12 @@
+G_TYPE_IREPOSITORY GIRepository GObject Glib::Object::Introspection::Repository
+
+G_INVOKE_ERROR GIDLPERL_TYPE_INVOKE_ERROR GError Glib::Object::Introspection::InvokeError
+
+GIDLPERL_TYPE_IINFO_TYPE GIInfoType GEnum Glib::Object::Introspection::InfoType
+GIDLPERL_TYPE_ITRANSFER GITransfer GEnum Glib::Object::Introspection::Transfer
+GIDLPERL_TYPE_IDIRECTION GIDirection GEnum Glib::Object::Introspection::Direction
+GIDLPERL_TYPE_ITYPE_TAG GITypeTag GEnum Glib::Object::Introspection::TypeTag
+
+GIDLPERL_TYPE_IFUNCTION_INFO_FLAGS GIFunctionInfoFlags GFlags Glib::Object::Introspection::FunctionInfoFlags
+GIDLPERL_TYPE_IFIELD_INFO_FLAGS GIFieldInfoFlags GFlags Glib::Object::Introspection::FieldInfoFlags
+GIDLPERL_TYPE_IV_FUNC_INFO_FLAGS GIVFuncInfoFlags GFlags Glib::Object::Introspection::VFuncInfoFlags
Added: Glib-Object-Introspection/trunk/t/Idl.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/Idl.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+# $Id: Idl.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+use_ok("Glib::Object::Introspection");
Added: Glib-Object-Introspection/trunk/t/IdlArgInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlArgInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 8;
+
+# $Id: IdlArgInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $interface = $repository -> find_by_name("Foo", "Iface1");
+my $method = $interface -> find_method("method1");
+
+my $arg = ($method -> get_args())[0];
+isa_ok($arg, "Glib::Object::Introspection::ArgInfo");
+
+is($arg -> get_direction(), "in");
+ok(!$arg -> is_dipper());
+ok(!$arg -> is_return_value());
+ok(!$arg -> is_optional());
+ok(!$arg -> may_be_null());
+is($arg -> get_ownership_transfer(), "nothing");
+isa_ok($arg -> get_type(), "Glib::Object::Introspection::TypeInfo");
Added: Glib-Object-Introspection/trunk/t/IdlBaseInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlBaseInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 5;
+
+# $Id: IdlBaseInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $info = $repository -> find_by_name("Foo", "Iface1");
+is($info -> get_name(), "Iface1");
+is($info -> get_namespace(), "Foo");
+ok(!$info -> is_deprecated());
+is($info -> get_annotation("Foo.Iface1"), undef);
+isa_ok($info -> get_container(), "Glib::Object::Introspection::InterfaceInfo");
Added: Glib-Object-Introspection/trunk/t/IdlCallableInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlCallableInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 6;
+
+# $Id: IdlCallableInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $interface = $repository -> find_by_name("Foo", "Iface1");
+
+my $callable = $interface -> find_method("method1");
+isa_ok($callable, "Glib::Object::Introspection::CallableInfo");
+
+isa_ok($callable -> get_return_type(), "Glib::Object::Introspection::TypeInfo");
+ok($callable -> get_caller_owns());
+ok($callable -> may_return_null());
+
+my @args = $callable -> get_args();
+TODO: {
+ local $TODO = "FIXME: get_n_args seems to be broken";
+ is(@args, 1);
+}
+isa_ok($args[0], "Glib::Object::Introspection::ArgInfo");
Added: Glib-Object-Introspection/trunk/t/IdlConstantInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlConstantInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlConstantInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $interface = $repository -> find_by_name("Foo", "Iface1");
+
+my @constants = $interface -> get_constants();
+is(@constants, 1);
+isa_ok($constants[0], "Glib::Object::Introspection::ConstantInfo");
+isa_ok($constants[0] -> get_type(), "Glib::Object::Introspection::TypeInfo");
Added: Glib-Object-Introspection/trunk/t/IdlEnumInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlEnumInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlEnumInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $enum = $repository -> find_by_name("Foo", "Enum1");
+isa_ok($enum, "Glib::Object::Introspection::EnumInfo");
+
+my @values = $enum -> get_values();
+is(@values, 3);
+isa_ok($values[0], "Glib::Object::Introspection::ValueInfo");
Added: Glib-Object-Introspection/trunk/t/IdlErrorDomainInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlErrorDomainInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlErrorDomainInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $domain = $repository -> find_by_name("Foo", "Errors1");
+isa_ok($domain, "Glib::Object::Introspection::ErrorDomainInfo");
+is($domain -> get_quark(), "foo_errors1_get_quark");
+isa_ok($domain -> get_codes(), "Glib::Object::Introspection::InterfaceInfo");
Added: Glib-Object-Introspection/trunk/t/IdlFieldInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlFieldInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 6;
+
+# $Id: IdlFieldInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $struct = $repository -> find_by_name("Foo", "Struct1");
+
+my @fields = $struct -> get_fields();
+is(@fields, 2);
+isa_ok($fields[0], "Glib::Object::Introspection::FieldInfo");
+ok($fields[0] -> get_flags() >= [qw(readable writable)]);
+is($fields[0] -> get_size(), 0);
+is($fields[0] -> get_offset(), 0);
+isa_ok($fields[0] -> get_type(), "Glib::Object::Introspection::TypeInfo");
Added: Glib-Object-Introspection/trunk/t/IdlFunctionInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlFunctionInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 5;
+
+# $Id: IdlFunctionInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $function = $repository -> find_by_name("Foo", "test1");
+isa_ok($function, "Glib::Object::Introspection::FunctionInfo");
+is($function -> get_symbol(), "test1");
+ok($function -> get_flags() == []);
+
+SKIP: {
+ skip "FIXME: get_property() and get_vfunc() are broken", 2;
+ is($function -> get_property(), undef);
+ is($function -> get_vfunc(), undef);
+}
Added: Glib-Object-Introspection/trunk/t/IdlInterfaceInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlInterfaceInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 14;
+
+# $Id: IdlInterfaceInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $interface = $repository -> find_by_name("Foo", "Iface1");
+isa_ok($interface, "Glib::Object::Introspection::InterfaceInfo");
+
+my @prerequisites = $interface -> get_prerequisites();
+is(@prerequisites, 1);
+isa_ok($prerequisites[0], "Glib::Object::Introspection::InterfaceInfo");
+
+my @properties = $interface -> get_properties();
+is(@properties, 1);
+isa_ok($properties[0], "Glib::Object::Introspection::PropertyInfo");
+
+my @methods = $interface -> get_methods();
+is(@methods, 1);
+isa_ok($methods[0], "Glib::Object::Introspection::FunctionInfo");
+isa_ok($interface -> find_method("method1"), "Glib::Object::Introspection::FunctionInfo");
+
+my @signals = $interface -> get_signals();
+is(@signals, 2);
+isa_ok($signals[0], "Glib::Object::Introspection::SignalInfo");
+
+my @vfuncs = $interface -> get_vfuncs();
+is(@vfuncs, 1);
+isa_ok($vfuncs[0], "Glib::Object::Introspection::VFuncInfo");
+
+my @constants = $interface -> get_constants();
+is(@constants, 1);
+isa_ok($constants[0], "Glib::Object::Introspection::ConstantInfo");
Added: Glib-Object-Introspection/trunk/t/IdlObjectInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlObjectInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 17;
+
+# $Id: IdlObjectInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $object = $repository -> find_by_name("Foo", "Object1");
+isa_ok($object, "Glib::Object::Introspection::ObjectInfo");
+isa_ok($object -> get_parent(), "Glib::Object::Introspection::ObjectInfo");
+
+my @interfaces = $object -> get_interfaces();
+is(@interfaces, 1);
+isa_ok($interfaces[0], "Glib::Object::Introspection::InterfaceInfo");
+
+my @fields = $object -> get_fields();
+is(@fields, 1);
+isa_ok($fields[0], "Glib::Object::Introspection::FieldInfo");
+
+my @properties = $object -> get_properties();
+is(@properties, 1);
+isa_ok($properties[0], "Glib::Object::Introspection::PropertyInfo");
+
+my @methods = $object -> get_methods();
+is(@methods, 1);
+isa_ok($methods[0], "Glib::Object::Introspection::FunctionInfo");
+isa_ok($object -> find_method("method1"), "Glib::Object::Introspection::FunctionInfo");
+
+my @signals = $object -> get_signals();
+is(@signals, 2);
+isa_ok($signals[0], "Glib::Object::Introspection::SignalInfo");
+
+my @vfuncs = $object -> get_vfuncs();
+is(@vfuncs, 1);
+isa_ok($vfuncs[0], "Glib::Object::Introspection::VFuncInfo");
+
+my @constants = $object -> get_constants();
+is(@constants, 1);
+isa_ok($constants[0], "Glib::Object::Introspection::ConstantInfo");
Added: Glib-Object-Introspection/trunk/t/IdlPropertyInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlPropertyInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlPropertyInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $object = $repository -> find_by_name("Foo", "Object1");
+
+my $property = $object -> get_properties();
+isa_ok($property, "Glib::Object::Introspection::PropertyInfo");
+ok($property -> get_flags() == []);
+isa_ok($property -> get_type(), "Glib::Object::Introspection::TypeInfo");
Added: Glib-Object-Introspection/trunk/t/IdlRegisteredTypeInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlRegisteredTypeInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlRegisteredTypeInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $type = $repository -> find_by_name("Foo", "Object1");
+isa_ok($type, "Glib::Object::Introspection::RegisteredTypeInfo");
+is($type -> get_type_name(), "Object1");
+is($type -> get_type_init(), "object1_get_type");
Added: Glib-Object-Introspection/trunk/t/IdlRepository.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlRepository.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 6;
+
+# $Id: IdlRepository.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+my $repository = Glib::Object::Introspection::Repository -> get_default();
+isa_ok($repository, "Glib::Object::Introspection::Repository");
+isa_ok($repository, "Glib::Object");
+
+my $metadata = Glib::Object::Introspection::Metadata -> new_from_memory(join "", `cat t/test.raw`);
+$repository -> register($metadata);
+
+my $info = $repository -> find_by_name("Foo", "Enum1");
+isa_ok($info, "Glib::Object::Introspection::BaseInfo");
+
+is_deeply([$repository -> get_namespaces()], ["Foo"]);
+
+my @infos = $repository -> get_infos("Foo");
+is(@infos, 9);
+isa_ok($infos[0], "Glib::Object::Introspection::BaseInfo");
+
+$repository -> unregister($repository->get_namespaces());
Added: Glib-Object-Introspection/trunk/t/IdlSignalInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlSignalInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlSignalInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $object = $repository -> find_by_name("Foo", "Object1");
+my $signal = $object -> get_signals();
+
+ok($signal -> get_flags() >= [qw(run-first no-recurse detailed action no-hooks)]);
+is($signal -> get_class_closure(), undef);
+ok(!$signal -> true_stops_emit());
Added: Glib-Object-Introspection/trunk/t/IdlStructInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlStructInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 6;
+
+# $Id: IdlStructInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $struct = $repository -> find_by_name("Foo", "Struct1");
+isa_ok($struct, "Glib::Object::Introspection::StructInfo");
+
+my @fields = $struct -> get_fields();
+is(@fields, 2);
+isa_ok($fields[0], "Glib::Object::Introspection::FieldInfo");
+
+my @methods = $struct -> get_methods();
+is(@methods, 1);
+isa_ok($methods[0], "Glib::Object::Introspection::FunctionInfo");
+isa_ok($struct -> find_method("method1"), "Glib::Object::Introspection::FunctionInfo");
Added: Glib-Object-Introspection/trunk/t/IdlTypeInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlTypeInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 7;
+
+# $Id: IdlTypeInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $function = $repository -> find_by_name("Foo", "test1");
+my $arg = ($function -> get_args())[0];
+my $type = $arg -> get_type();
+
+ok($type -> is_pointer());
+is($type -> get_tag(), "array");
+isa_ok($type -> get_param_type(0), "Glib::Object::Introspection::TypeInfo");
+is($type -> get_array_length(), 1);
+ok($type -> is_zero_terminated());
+
+is($type -> get_interface(), undef);
+is($type -> get_error_domains(), undef);
Added: Glib-Object-Introspection/trunk/t/IdlVFuncInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlVFuncInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 3;
+
+# $Id: IdlVFuncInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $object = $repository -> find_by_name("Foo", "Object1");
+my $vfunc = $object -> get_vfuncs();
+
+ok($vfunc -> get_flags() == []);
+is($vfunc -> get_offset(), 0);
+is($vfunc -> get_signal(), undef);
Added: Glib-Object-Introspection/trunk/t/IdlValueInfo.t
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/IdlValueInfo.t Fri Mar 14 13:28:57 2008
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Glib::Object::Introspection;
+use Test::More tests => 1;
+
+# $Id: IdlValueInfo.t,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+
+require 't/create-repository.inc';
+my $repository = create_repository();
+
+my $enum = $repository -> find_by_name("Foo", "Enum1");
+my $value = $enum -> get_values();
+
+is($value -> get_value(), 2);
Added: Glib-Object-Introspection/trunk/t/create-repository.inc
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/create-repository.inc Fri Mar 14 13:28:57 2008
@@ -0,0 +1,9 @@
+sub create_repository {
+ my $metadata = Glib::Object::Introspection::Metadata -> new_from_memory(join "", `cat t/test.raw`);
+ my $repository = Glib::Object::Introspection::Repository -> get_default();
+ $repository -> register($metadata);
+ return $repository;
+}
+
+1;
+
Added: Glib-Object-Introspection/trunk/t/test.idl
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/t/test.idl Fri Mar 14 13:28:57 2008
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<!DOCTYPE api SYSTEM "gidl.dtd">
+<api version="1.0">
+ <namespace name="Foo">
+ <interface name="Iface1" type-name="Iface1" get-type="iface1_get_type">
+ <requires>
+ <interface name="Foo.Iface2" />
+ </requires>
+
+ <method name="method1" symbol="method1">
+ <return-type type="Foo.Iface2*"/>
+ <parameters>
+ <parameter name="param1" type="Foo.Iface1*" direction="in"/>
+ </parameters>
+ </method>
+
+ <constant name="constant1" type="gint" value="42" />
+
+ <property name="prop1" readable="0" writable="0" type="gint"/>
+
+ <signal name="signal1" when="LAST">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="obj" type="Foo.Iface1*" direction="in"/>
+ </parameters>
+ </signal>
+
+ <signal name="signal2" when="FIRST" no-recurse="1" detailed="1" action="1" no-hooks="1">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="obj" type="Foo.Iface1*" direction="in"/>
+ </parameters>
+ </signal>
+
+ <vfunc name="vfunc1">
+ <return-type type="Foo.Iface2*"/>
+ <parameters>
+ <parameter name="param1" type="Foo.Iface2*" direction="in"/>
+ </parameters>
+ </vfunc>
+ </interface>
+
+ <interface name="Iface2" type-name="Iface2" get-type="iface2_get_type">
+ </interface>
+
+ <enum name="Enum1" type-name="FooEnum" get-type="foo_enum_get_type">
+ <member name="value1" value="0" />
+ <member name="value2" value="1" />
+ <member name="value3" value="2" />
+ </enum>
+
+ <enum name="ErrorCodes1" type-name="ErrorCodes1" get-type="foo_error_codes1_get_type">
+ <member name="e1" value="0" />
+ <member name="e2" value="1" deprecated="1" />
+ <member name="e3" value="2" />
+ </enum>
+
+ <errordomain name="Errors1" get-quark="foo_errors1_get_quark" codes="Foo.ErrorCodes1" />
+
+ <function name="test1" symbol="test1">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="p1" type="gchar*[length=1,zero-terminated=1]" direction="in"/>
+ <parameter name="p2" type="gint" direction="in"/>
+ </parameters>
+ </function>
+
+ <struct name="Struct1">
+ <field name="field1" readable="1" writable="1" offset="0" type="guint32" />
+ <field name="field2" readable="1" writable="0" offset="2" type="gchar*" />
+
+ <method name="method1" symbol="method1">
+ <return-type type="Foo.Iface2*"/>
+ <parameters>
+ <parameter name="param1" type="Foo.Iface1*" direction="in"/>
+ </parameters>
+ </method>
+ </struct>
+
+ <object name="Object1" parent="Foo.Object2" type-name="Object1" get-type="object1_get_type">
+ <implements>
+ <interface name="Foo.Iface1" />
+ </implements>
+
+ <property name="prop1" readable="0" writable="0" type="gint"/>
+
+ <signal name="signal1" when="LAST">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="obj" type="Foo.Object1*" direction="in"/>
+ </parameters>
+ </signal>
+
+ <signal name="signal2" when="FIRST" no-recurse="1" detailed="1" action="1" no-hooks="1">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="obj" type="Foo.Object1*" direction="in"/>
+ </parameters>
+ </signal>
+
+ <vfunc name="vfunc1">
+ <return-type type="Foo.Object2*"/>
+ <parameters>
+ <parameter name="param1" type="Foo.Object1*" direction="in"/>
+ </parameters>
+ </vfunc>
+
+ <method name="method1" symbol="method1">
+ <return-type type="Foo.Iface2*"/>
+ <parameters>
+ <parameter name="param1" type="Foo.Iface1*" direction="in"/>
+ </parameters>
+ </method>
+
+ <constant name="constant1" type="gint" value="42" />
+
+ <field name="field1" readable="1" writable="1" offset="0" type="guint32" />
+ </object>
+
+ <object name="Object2" parent="GObject.GObject" type-name="Object2" get-type="object2_get_type">
+ </object>
+
+ </namespace>
+</api>
Added: Glib-Object-Introspection/trunk/t/test.raw
==============================================================================
Binary file. No diff available.
Added: Glib-Object-Introspection/trunk/xs/Idl.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/Idl.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: Idl.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+MODULE = Glib::Object::Introspection PACKAGE = Glib::Object::Introspection
+
+BOOT:
+#include "register.xsh"
+#include "boot.xsh"
Added: Glib-Object-Introspection/trunk/xs/IdlArgInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlArgInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlArgInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIArgInfo (GIArgInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::ArgInfo", info);
+}
+
+GIArgInfo *
+SvGIArgInfo (SV *info)
+{
+ return INT2PTR (GIArgInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::ArgInfo PACKAGE = Glib::Object::Introspection::ArgInfo PREFIX = g_arg_info_
+
+GIDirection g_arg_info_get_direction (GIArgInfo *info);
+
+gboolean g_arg_info_is_dipper (GIArgInfo *info);
+
+gboolean g_arg_info_is_return_value (GIArgInfo *info);
+
+gboolean g_arg_info_is_optional (GIArgInfo *info);
+
+gboolean g_arg_info_may_be_null (GIArgInfo *info);
+
+GITransfer g_arg_info_get_ownership_transfer (GIArgInfo *info);
+
+GITypeInfo * g_arg_info_get_type (GIArgInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlBaseInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlBaseInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlBaseInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIBaseInfo (GIBaseInfo *info)
+{
+ SV *sv = newSV (0);
+ char *package = "Glib::Object::Introspection::BaseInfo";
+
+ if (info) {
+ switch (g_base_info_get_type (info)) {
+ case GI_INFO_TYPE_INVALID:
+ croak ("Invalid type?");
+ break;
+ case GI_INFO_TYPE_FUNCTION:
+ package = "Glib::Object::Introspection::FunctionInfo";
+ break;
+ case GI_INFO_TYPE_CALLBACK:
+ croak ("Callback info?");
+ break;
+ case GI_INFO_TYPE_STRUCT:
+ package = "Glib::Object::Introspection::StructInfo";
+ break;
+ case GI_INFO_TYPE_BOXED:
+ package = "Glib::Object::Introspection::BoxedInfo";
+ break;
+ case GI_INFO_TYPE_ENUM:
+ package = "Glib::Object::Introspection::EnumInfo";
+ break;
+ case GI_INFO_TYPE_FLAGS:
+ package = "Glib::Object::Introspection::FlagsInfo";
+ break;
+ case GI_INFO_TYPE_OBJECT:
+ package = "Glib::Object::Introspection::ObjectInfo";
+ break;
+ case GI_INFO_TYPE_INTERFACE:
+ package = "Glib::Object::Introspection::InterfaceInfo";
+ break;
+ case GI_INFO_TYPE_CONSTANT:
+ package = "Glib::Object::Introspection::ConstantInfo";
+ break;
+ case GI_INFO_TYPE_ERROR_DOMAIN:
+ package = "Glib::Object::Introspection::ErrorDomainInfo";
+ break;
+ case GI_INFO_TYPE_UNION:
+ package = "Glib::Object::Introspection::UnionInfo";
+ break;
+ case GI_INFO_TYPE_VALUE:
+ package = "Glib::Object::Introspection::ValueInfo";
+ break;
+ case GI_INFO_TYPE_SIGNAL:
+ package = "Glib::Object::Introspection::SignalInfo";
+ break;
+ case GI_INFO_TYPE_VFUNC:
+ package = "Glib::Object::Introspection::VFuncInfo";
+ break;
+ case GI_INFO_TYPE_PROPERTY:
+ package = "Glib::Object::Introspection::PropertyInfo";
+ break;
+ case GI_INFO_TYPE_FIELD:
+ package = "Glib::Object::Introspection::FieldInfo";
+ break;
+ case GI_INFO_TYPE_ARG:
+ package = "Glib::Object::Introspection::ArgInfo";
+ break;
+ case GI_INFO_TYPE_TYPE:
+ package = "Glib::Object::Introspection::TypeInfo";
+ break;
+ case GI_INFO_TYPE_UNRESOLVED:
+ croak ("Unresolved type?");
+ break;
+ }
+ }
+
+ return sv_setref_pv (sv, package, info);
+}
+
+GIBaseInfo *
+SvGIBaseInfo (SV *info)
+{
+ return INT2PTR (GIBaseInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::BaseInfo PACKAGE = Glib::Object::Introspection::BaseInfo PREFIX = g_base_info_
+
+BOOT:
+ gperl_set_isa ("Glib::Object::Introspection::ArgInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::BoxedInfo", "Glib::Object::Introspection::StructInfo");
+ gperl_set_isa ("Glib::Object::Introspection::CallableInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::ConstantInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::EnumInfo", "Glib::Object::Introspection::RegisteredTypeInfo");
+ gperl_set_isa ("Glib::Object::Introspection::ErrorInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::FieldInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::FlagsInfo", "Glib::Object::Introspection::EnumInfo");
+ gperl_set_isa ("Glib::Object::Introspection::FunctionInfo", "Glib::Object::Introspection::CallableInfo");
+ gperl_set_isa ("Glib::Object::Introspection::InterfaceInfo", "Glib::Object::Introspection::RegisteredTypeInfo");
+ gperl_set_isa ("Glib::Object::Introspection::ObjectInfo", "Glib::Object::Introspection::RegisteredTypeInfo");
+ gperl_set_isa ("Glib::Object::Introspection::PropertyInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::RegisteredTypeInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::SignalInfo", "Glib::Object::Introspection::CallableInfo");
+ gperl_set_isa ("Glib::Object::Introspection::StructInfo", "Glib::Object::Introspection::RegisteredTypeInfo");
+ gperl_set_isa ("Glib::Object::Introspection::TypeInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::UnionInfo", "Glib::Object::Introspection::BaseInfo");
+ gperl_set_isa ("Glib::Object::Introspection::VFuncInfo", "Glib::Object::Introspection::CallableInfo");
+ gperl_set_isa ("Glib::Object::Introspection::ValueInfo", "Glib::Object::Introspection::BaseInfo");
+
+void
+DESTROY (info)
+ GIBaseInfo *info
+ CODE:
+ g_base_info_unref (info);
+
+GIInfoType g_base_info_get_type (GIBaseInfo *info);
+
+const gchar * g_base_info_get_name (GIBaseInfo *info);
+
+const gchar * g_base_info_get_namespace (GIBaseInfo *info);
+
+gboolean g_base_info_is_deprecated (GIBaseInfo *info);
+
+const gchar * g_base_info_get_annotation (GIBaseInfo *info, const gchar *name);
+
+GIBaseInfo * g_base_info_get_container (GIBaseInfo *info);
+
+# FIXME: Needed?
+# GIBaseInfo * g_info_new (GIInfoType type, GIBaseInfo *container, const guchar *metadata, guint32 offset);
Added: Glib-Object-Introspection/trunk/xs/IdlBoxedInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlBoxedInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlBoxedInfo.xs,v 1.2 2005/08/26 18:47:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+#include "gobject-introspection-perl-private.h"
+
+#define ACCESS_VALUE(type, to, fro) \
+ { \
+ type tmp; \
+ if (g_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE) { \
+ memcpy (&tmp, G_STRUCT_MEMBER_P (pointer, offset), sizeof (type)); \
+ RETVAL = to (tmp); \
+ } \
+ if (value) { \
+ if (g_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE) { \
+ tmp = fro (value); \
+ memcpy (G_STRUCT_MEMBER_P (pointer, offset), &tmp, sizeof (type)); \
+ } else { \
+ croak ("Field %s is not writable", \
+ g_base_info_get_name ((GIBaseInfo*) field_info)); \
+ } \
+ } \
+ }
+
+MODULE = Glib::Object::Introspection::BoxedInfo PACKAGE = Glib::Object::Introspection::BoxedInfo PREFIX = g_struct_info_
+
+SV *
+access_field (info, field_info, object, value=NULL)
+ GIBaseInfo *info
+ GIFieldInfo *field_info
+ SV *object
+ SV *value
+ PREINIT:
+ GType type;
+ void *pointer;
+ GITypeInfo *field_type_info;
+ GITypeTag tag;
+ gint offset;
+ CODE:
+ type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) info);
+ pointer = gperl_get_boxed_check (object, type);
+
+ offset = g_field_info_get_offset (field_info);
+
+ field_type_info = g_field_info_get_type (field_info);
+ tag = g_type_info_get_tag (field_type_info);
+
+ RETVAL = &PL_sv_undef;
+
+ switch (tag) {
+ case GI_TYPE_TAG_VOID:
+ break;
+
+ case GI_TYPE_TAG_BOOLEAN:
+ ACCESS_VALUE (gboolean, newSVuv, SvUV);
+ break;
+
+ case GI_TYPE_TAG_INT8:
+ ACCESS_VALUE (gint8, newSViv, SvIV);
+ break;
+
+ case GI_TYPE_TAG_UINT8:
+ ACCESS_VALUE (guint8, newSVuv, SvUV);
+ break;
+
+ case GI_TYPE_TAG_INT16:
+ ACCESS_VALUE (gint16, newSViv, SvIV);
+ break;
+
+ case GI_TYPE_TAG_UINT16:
+ ACCESS_VALUE (guint16, newSVuv, SvUV);
+ break;
+
+ case GI_TYPE_TAG_INT32:
+ ACCESS_VALUE (gint32, newSViv, SvIV);
+ break;
+
+ case GI_TYPE_TAG_UINT32:
+ ACCESS_VALUE (guint32, newSVuv, SvUV);
+ break;
+
+ case GI_TYPE_TAG_INT64:
+ case GI_TYPE_TAG_UINT64:
+ croak ("FIXME - 64bit types");
+ break;
+
+ case GI_TYPE_TAG_INT:
+ ACCESS_VALUE (gint, newSViv, SvIV);
+ break;
+
+ case GI_TYPE_TAG_UINT:
+ ACCESS_VALUE (guint, newSVuv, SvUV);
+ break;
+
+ case GI_TYPE_TAG_LONG:
+ ACCESS_VALUE (glong, newSVnv, SvNV);
+ break;
+
+ case GI_TYPE_TAG_ULONG:
+ ACCESS_VALUE (gulong, newSVnv, SvNV);
+ break;
+
+ case GI_TYPE_TAG_SSIZE:
+ case GI_TYPE_TAG_SIZE:
+ croak ("FIXME - size types");
+ break;
+
+ case GI_TYPE_TAG_FLOAT:
+ ACCESS_VALUE (gfloat, newSVnv, SvNV);
+ break;
+
+ case GI_TYPE_TAG_DOUBLE:
+ ACCESS_VALUE (gdouble, newSVnv, SvNV);
+ break;
+
+ case GI_TYPE_TAG_UTF8:
+ ACCESS_VALUE (gchar*, newSVGChar, SvGChar);
+ break;
+
+ case GI_TYPE_TAG_FILENAME:
+ ACCESS_VALUE (gchar*, gperl_sv_from_filename, gperl_filename_from_sv);
+ break;
+
+ case GI_TYPE_TAG_SYMBOL:
+ {
+ if (g_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE) {
+ RETVAL = gperl_i11n_pointer_to_sv (field_type_info, G_STRUCT_MEMBER_P (pointer, offset), FALSE);
+ }
+ if (value) {
+ if (g_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE) {
+ memcpy (G_STRUCT_MEMBER_P (pointer, offset), gperl_i11n_sv_to_pointer (field_type_info, value), sizeof (void*));
+ } else {
+ croak ("Field %s is not writable",
+ g_base_info_get_name ((GIBaseInfo*) field_info));
+ }
+ }
+ }
+ break;
+
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_ERROR:
+ croak ("FIXME - array, list, hash, error types");
+ break;
+
+ default:
+ croak ("Unhandled type tag: %d", tag);
+ }
+
+ g_base_info_unref ((GIBaseInfo *) field_type_info);
+ OUTPUT:
+ RETVAL
Added: Glib-Object-Introspection/trunk/xs/IdlCallableInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlCallableInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlCallableInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGICallableInfo (GICallableInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::CallableInfo", info);
+}
+
+GICallableInfo *
+SvGICallableInfo (SV *info)
+{
+ return INT2PTR (GICallableInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::CallableInfo PACKAGE = Glib::Object::Introspection::CallableInfo PREFIX = g_callable_info_
+
+GITypeInfo * g_callable_info_get_return_type (GICallableInfo *info);
+
+GITransfer g_callable_info_get_caller_owns (GICallableInfo *info);
+
+gboolean g_callable_info_may_return_null (GICallableInfo *info);
+
+# gint g_callable_info_get_n_args (GICallableInfo *info);
+# GIArgInfo * g_callable_info_get_arg (GICallableInfo *info, gint n);
+void
+g_callable_info_get_args (info)
+ GICallableInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_callable_info_get_n_args (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIArgInfo (
+ g_callable_info_get_arg (info, i))));
Added: Glib-Object-Introspection/trunk/xs/IdlConstantInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlConstantInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlConstantInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIConstantInfo (GIConstantInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::ConstantInfo", info);
+}
+
+GIConstantInfo *
+SvGIConstantInfo (SV *info)
+{
+ return INT2PTR (GIConstantInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::ConstantInfo PACKAGE = Glib::Object::Introspection::ConstantInfo PREFIX = g_constant_info_
+
+GITypeInfo * g_constant_info_get_type (GIConstantInfo *info);
+
+# FIXME
+# gint g_constant_info_get_value (GIConstantInfo *info, GArgument *value);
Added: Glib-Object-Introspection/trunk/xs/IdlEnumInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlEnumInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlEnumInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIEnumInfo (GIEnumInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::EnumInfo", info);
+}
+
+GIEnumInfo *
+SvGIEnumInfo (SV *info)
+{
+ return INT2PTR (GIEnumInfo *, SvIV (SvRV (info)));
+
+}
Added: Glib-Object-Introspection/trunk/xs/IdlErrorDomainInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlErrorDomainInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlErrorDomainInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIErrorDomainInfo (GIErrorDomainInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::ErrorDomainInfo", info);
+}
+
+GIErrorDomainInfo *
+SvGIErrorDomainInfo (SV *info)
+{
+ return INT2PTR (GIErrorDomainInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::ErrorDomainInfo PACKAGE = Glib::Object::Introspection::ErrorDomainInfo PREFIX = g_error_domain_info_
+
+const gchar * g_error_domain_info_get_quark (GIErrorDomainInfo *info);
+
+GIInterfaceInfo * g_error_domain_info_get_codes (GIErrorDomainInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlFieldInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlFieldInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlFieldInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIFieldInfo (GIFieldInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::FieldInfo", info);
+}
+
+GIFieldInfo *
+SvGIFieldInfo (SV *info)
+{
+ return INT2PTR (GIFieldInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::FieldInfo PACKAGE = Glib::Object::Introspection::FieldInfo PREFIX = g_field_info_
+
+GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info);
+
+gint g_field_info_get_size (GIFieldInfo *info);
+
+gint g_field_info_get_offset (GIFieldInfo *info);
+
+GITypeInfo * g_field_info_get_type (GIFieldInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlFunctionInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlFunctionInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,1244 @@
+/*
+ * Copyright (C) 2005-2006 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlFunctionInfo.xs,v 1.3 2005/08/26 18:47:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+#include "gobject-introspection-perl-private.h"
+
+#include <ffi.h>
+
+#include <gperl_marshal.h>
+
+/* ------------------------------------------------------------------------- */
+
+static void *create_callback_closure (GITypeInfo *type, SV *code);
+static void *create_callback_data (SV *data);
+
+static void invoke_callback (ffi_cif* cif, void* resp, void** args, void* userdata);
+static void release_callback (void *data);
+
+/* ------------------------------------------------------------------------- */
+
+GType
+get_gtype_for_unresolved_type (const gchar *namespace, const gchar *name)
+{
+#if 0
+ GIBaseInfo *unresolved_info =
+ g_irepository_find_by_name (NULL, namespace, name);
+ return gperl_i11n_get_gtype (
+ (GIRegisteredTypeInfo *) unresolved_info);
+#else
+ gchar *full_name;
+ GType type;
+
+ if (0 == strcmp (namespace, "GLib"))
+ namespace = "G";
+ full_name = g_strconcat (namespace, name, NULL);
+ type = g_type_from_name (full_name);
+ g_free (full_name);
+
+ return type;
+#endif
+}
+
+void *
+gperl_i11n_sv_to_pointer (GITypeInfo* info, SV *sv)
+{
+ GIBaseInfo *interface = g_type_info_get_interface (info);
+ GIInfoType info_type = g_base_info_get_type (interface);
+
+ void *pointer = NULL;
+
+ switch (info_type) {
+ case GI_INFO_TYPE_OBJECT:
+ pointer = gperl_get_object (sv);
+ break;
+
+ case GI_INFO_TYPE_BOXED:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ pointer = gperl_get_boxed_check (sv, type);
+ break;
+ }
+
+ case GI_INFO_TYPE_ENUM:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ pointer = GINT_TO_POINTER (gperl_convert_enum (type, sv));
+ break;
+ }
+
+ case GI_INFO_TYPE_FLAGS:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ pointer = GUINT_TO_POINTER (gperl_convert_flags (type, sv));
+ break;
+ }
+
+ case GI_INFO_TYPE_CALLBACK:
+ {
+ pointer = create_callback_closure (info, sv);
+ break;
+ }
+
+ case GI_INFO_TYPE_UNRESOLVED:
+ {
+ const gchar *type_name, *type_namespace;
+ GType type;
+
+ type_name = g_base_info_get_name (interface);
+ type_namespace = g_base_info_get_namespace (interface);
+
+ /* FIXME: The following special casing feels very hackish.
+ * Find a better solution. */
+
+ if (0 == strncmp (type_namespace, "GLib", 5)) {
+ /* Handle callback stuff first */
+ if (0 == strncmp (type_name, "CallbackData", 13)) {
+ pointer = create_callback_data (sv);
+ break;
+ }
+
+ if (0 == strncmp (type_name, "DestroyNotify", 14)) {
+ pointer = release_callback;
+ break;
+ }
+
+ /* Then, handle GType. */
+ if (0 == strncmp (type_name, "Type", 5)) {
+ pointer = (void *) gperl_type_from_package (SvPV_nolen (sv));
+ break;
+ }
+ }
+
+ type = get_gtype_for_unresolved_type (type_namespace, type_name);
+ if (!type)
+ croak ("Could not determine type for %s", type_name);
+
+ if (g_type_is_a (type, G_TYPE_OBJECT))
+ pointer = gperl_get_object (sv);
+
+ else if (g_type_is_a (type, G_TYPE_BOXED))
+ pointer = gperl_get_boxed_check (sv, type);
+
+ else if (g_type_is_a (type, G_TYPE_ENUM))
+ pointer = GINT_TO_POINTER (gperl_convert_enum (type, sv));
+
+ else
+ croak ("Don't know how to handle type %d (%s)",
+ type, type_name);
+
+ break;
+ }
+
+ default:
+ croak ("gperl_i11n_sv_to_pointer: Don't know how to handle info type %d", info_type);
+ }
+
+ g_base_info_unref ((GIBaseInfo *) interface);
+
+ return pointer;
+}
+
+SV *
+gperl_i11n_pointer_to_sv (GITypeInfo* info, void* pointer, gboolean own)
+{
+ GIBaseInfo *interface = g_type_info_get_interface (info);
+ GIInfoType info_type = g_base_info_get_type (interface);
+
+ SV *sv = NULL;
+
+ switch (info_type) {
+ case GI_INFO_TYPE_OBJECT:
+ sv = gperl_new_object (pointer, own);
+ break;
+
+ case GI_INFO_TYPE_BOXED:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ sv = gperl_new_boxed (pointer, type, own);
+ break;
+ }
+
+ case GI_INFO_TYPE_ENUM:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ sv = gperl_convert_back_enum (type, GPOINTER_TO_INT (pointer));
+ break;
+ }
+
+ case GI_INFO_TYPE_FLAGS:
+ {
+ GType type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) interface);
+ sv = gperl_convert_back_flags (type, GPOINTER_TO_UINT (pointer));
+ break;
+ }
+
+ case GI_INFO_TYPE_UNRESOLVED:
+ {
+ const gchar *type_name = g_base_info_get_name (interface);
+ const gchar *type_namespace = g_base_info_get_namespace (interface);
+ GType type = get_gtype_for_unresolved_type (type_namespace, type_name);
+
+ if (!type)
+ croak ("Could not determine type for %s", type_name);
+
+ if (g_type_is_a (type, G_TYPE_OBJECT))
+ sv = gperl_new_object (pointer, own);
+
+ else if (g_type_is_a (type, G_TYPE_BOXED))
+ sv = gperl_new_boxed (pointer, type, own);
+
+ else if (g_type_is_a (type, G_TYPE_ENUM))
+ sv = gperl_convert_back_enum (type, GPOINTER_TO_INT (pointer));
+
+ else
+ croak ("Don't know how to handle type %d (%s)",
+ type, type_name);
+
+ break;
+ }
+
+ default:
+ croak ("gperl_i11n_pointer_to_sv: Don't know how to handle info type %d, %d", info_type, GI_INFO_TYPE_ENUM);
+ }
+
+ g_base_info_unref ((GIBaseInfo *) interface);
+
+ return sv;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void
+sv_to_arg (SV * sv,
+ GArgument * arg,
+ GITypeInfo * info,
+ gboolean may_be_null)
+{
+ GITypeTag tag = g_type_info_get_tag (info);
+
+ if (!sv || !SvOK (sv))
+ /* Interfaces need to be able to handle undef separately. */
+ if (!may_be_null && tag != GI_TYPE_TAG_SYMBOL)
+ croak ("undefined value for a mandatory argument encountered");
+
+ switch (tag) {
+ case GI_TYPE_TAG_VOID:
+ /* do nothing */
+ break;
+
+ case GI_TYPE_TAG_BOOLEAN:
+ arg->v_boolean = SvTRUE (sv);
+ break;
+
+ case GI_TYPE_TAG_INT8:
+ arg->v_int8 = (gint8) SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_UINT8:
+ arg->v_uint8 = (guint8) SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_INT16:
+ arg->v_int16 = (gint16) SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_UINT16:
+ arg->v_uint16 = (guint16) SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_INT32:
+ arg->v_int32 = (gint32) SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_UINT32:
+ arg->v_uint32 = (guint32) SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_INT64:
+ arg->v_int64 = SvGInt64 (sv);
+ break;
+
+ case GI_TYPE_TAG_UINT64:
+ arg->v_uint64 = SvGUInt64 (sv);
+ break;
+
+ case GI_TYPE_TAG_FLOAT:
+ arg->v_float = (gfloat) SvNV (sv);
+ break;
+
+ case GI_TYPE_TAG_DOUBLE:
+ arg->v_double = SvNV (sv);
+ break;
+
+ case GI_TYPE_TAG_INT:
+ arg->v_int = SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_UINT:
+ arg->v_uint = SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_LONG:
+ arg->v_long = SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_ULONG:
+ arg->v_ulong = SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_ARRAY:
+ croak ("FIXME - GI_TYPE_TAG_ARRAY");
+ break;
+
+ case GI_TYPE_TAG_SYMBOL:
+ arg->v_pointer = gperl_i11n_sv_to_pointer (info, sv);
+ break;
+
+ case GI_TYPE_TAG_GLIST:
+ croak ("FIXME - GI_TYPE_TAG_GLIST");
+ break;
+
+ case GI_TYPE_TAG_GSLIST:
+ croak ("FIXME - GI_TYPE_TAG_GSLIST");
+ break;
+
+ case GI_TYPE_TAG_GHASH:
+ croak ("FIXME - GI_TYPE_TAG_GHASH");
+ break;
+
+ case GI_TYPE_TAG_ERROR:
+ croak ("FIXME - A GError as an in/inout arg? Should never happen!");
+ break;
+
+ case GI_TYPE_TAG_SSIZE:
+ arg->v_ssize = (gssize) SvIV (sv);
+ break;
+
+ case GI_TYPE_TAG_SIZE:
+ arg->v_size = (gsize) SvUV (sv);
+ break;
+
+ case GI_TYPE_TAG_UTF8:
+ arg->v_string = SvOK (sv) ? SvGChar (sv) : NULL;
+ break;
+
+ case GI_TYPE_TAG_FILENAME:
+ arg->v_string = SvOK (sv) ? gperl_filename_from_sv (sv) : NULL;
+ break;
+
+ default:
+ croak ("Unhandled info tag %d", tag);
+ }
+}
+
+static SV *
+arg_to_sv (const GArgument * arg,
+ GITypeInfo * info,
+ GITransfer transfer)
+{
+ GITypeTag tag = g_type_info_get_tag (info);
+ gboolean own = transfer == GI_TRANSFER_EVERYTHING;
+
+ switch (tag) {
+ case GI_TYPE_TAG_VOID:
+ return NULL;
+
+ case GI_TYPE_TAG_BOOLEAN:
+ return boolSV (arg->v_boolean);
+
+ case GI_TYPE_TAG_INT8:
+ return newSViv (arg->v_int8);
+
+ case GI_TYPE_TAG_UINT8:
+ return newSVuv (arg->v_uint8);
+
+ case GI_TYPE_TAG_INT16:
+ return newSViv (arg->v_int16);
+
+ case GI_TYPE_TAG_UINT16:
+ return newSVuv (arg->v_uint16);
+
+ case GI_TYPE_TAG_INT32:
+ return newSViv (arg->v_int32);
+
+ case GI_TYPE_TAG_UINT32:
+ return newSVuv (arg->v_uint32);
+
+ case GI_TYPE_TAG_INT64:
+ return newSVGInt64 (arg->v_int64);
+
+ case GI_TYPE_TAG_UINT64:
+ return newSVGUInt64 (arg->v_uint64);
+
+ case GI_TYPE_TAG_FLOAT:
+ return newSVnv (arg->v_float);
+
+ case GI_TYPE_TAG_DOUBLE:
+ return newSVnv (arg->v_double);
+
+ case GI_TYPE_TAG_INT:
+ return newSViv (arg->v_int);
+
+ case GI_TYPE_TAG_UINT:
+ return newSVuv (arg->v_uint);
+
+ case GI_TYPE_TAG_LONG:
+ return newSViv (arg->v_long);
+
+ case GI_TYPE_TAG_ULONG:
+ return newSVuv (arg->v_ulong);
+
+ case GI_TYPE_TAG_ARRAY:
+ croak ("FIXME - GI_TYPE_TAG_ARRAY");
+
+ case GI_TYPE_TAG_SYMBOL:
+ return gperl_i11n_pointer_to_sv (info, arg->v_pointer, own);
+
+ case GI_TYPE_TAG_GLIST:
+ {
+ GITypeInfo *param_info;
+ GList *i;
+ AV *av;
+ SV *value;
+
+ param_info = g_type_info_get_param_type (info, 0);
+ av = newAV ();
+
+ for (i = arg->v_pointer; i; i = i->next) {
+ value = gperl_i11n_pointer_to_sv (param_info, i->data, transfer);
+ if (value)
+ av_push (av, value);
+ }
+
+ if (transfer >= GI_TRANSFER_CONTAINER)
+ g_list_free (arg->v_pointer);
+
+ g_base_info_unref ((GIBaseInfo *) param_info);
+
+ return newRV_noinc ((SV *) av);
+ }
+
+ case GI_TYPE_TAG_GSLIST:
+ croak ("FIXME - GI_TYPE_TAG_GSLIST");
+
+ case GI_TYPE_TAG_GHASH:
+ croak ("FIXME - GI_TYPE_TAG_GHASH");
+
+ case GI_TYPE_TAG_ERROR:
+ if (arg->v_pointer)
+ gperl_croak_gerror (NULL, arg->v_pointer);
+ break;
+
+ case GI_TYPE_TAG_SSIZE:
+ return newSViv (arg->v_ssize);
+
+ case GI_TYPE_TAG_SIZE:
+ return newSVuv (arg->v_size);
+
+ case GI_TYPE_TAG_UTF8:
+ {
+ SV *sv = newSVGChar (arg->v_string);
+ if (own)
+ g_free (arg->v_string);
+ return sv;
+ }
+
+ case GI_TYPE_TAG_FILENAME:
+ {
+ SV *sv = gperl_sv_from_filename (arg->v_string);
+ if (own)
+ g_free (arg->v_string);
+ return sv;
+ }
+
+ default:
+ croak ("Unhandled info tag %d", tag);
+ }
+
+ return NULL;
+}
+
+/* ------------------------------------------------------------------------- */
+
+#define CAST_RAW(raw, type) (*((type *) raw))
+
+static void
+raw_to_arg (void *raw, GArgument *arg, GITypeInfo *info)
+{
+ GITypeTag tag = g_type_info_get_tag (info);
+
+ switch (tag) {
+ case GI_TYPE_TAG_VOID:
+ /* do nothing */
+ break;
+
+ case GI_TYPE_TAG_BOOLEAN:
+ arg->v_boolean = CAST_RAW (raw, gboolean);
+ break;
+
+ case GI_TYPE_TAG_INT8:
+ arg->v_int8 = CAST_RAW (raw, gint8);
+ break;
+
+ case GI_TYPE_TAG_UINT8:
+ arg->v_uint8 = CAST_RAW (raw, guint8);
+ break;
+
+ case GI_TYPE_TAG_INT16:
+ arg->v_int16 = CAST_RAW (raw, gint16);
+ break;
+
+ case GI_TYPE_TAG_UINT16:
+ arg->v_uint16 = CAST_RAW (raw, guint16);
+ break;
+
+ case GI_TYPE_TAG_INT32:
+ arg->v_int32 = CAST_RAW (raw, gint32);
+ break;
+
+ case GI_TYPE_TAG_UINT32:
+ arg->v_uint32 = CAST_RAW (raw, guint32);
+ break;
+
+ case GI_TYPE_TAG_INT64:
+ arg->v_int64 = CAST_RAW (raw, gint64);
+ break;
+
+ case GI_TYPE_TAG_UINT64:
+ arg->v_uint64 = CAST_RAW (raw, guint64);
+ break;
+
+ case GI_TYPE_TAG_FLOAT:
+ arg->v_float = CAST_RAW (raw, gfloat);
+ break;
+
+ case GI_TYPE_TAG_DOUBLE:
+ arg->v_double = CAST_RAW (raw, gdouble);
+ break;
+
+ case GI_TYPE_TAG_INT:
+ arg->v_int = CAST_RAW (raw, gint);
+ break;
+
+ case GI_TYPE_TAG_UINT:
+ arg->v_uint = CAST_RAW (raw, guint);
+ break;
+
+ case GI_TYPE_TAG_LONG:
+ arg->v_long = CAST_RAW (raw, glong);
+ break;
+
+ case GI_TYPE_TAG_ULONG:
+ arg->v_ulong = CAST_RAW (raw, gulong);
+ break;
+
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_SYMBOL:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_ERROR:
+ arg->v_pointer = * (void **) raw;
+ break;
+
+ case GI_TYPE_TAG_SSIZE:
+ arg->v_ssize = CAST_RAW (raw, gssize);
+ break;
+
+ case GI_TYPE_TAG_SIZE:
+ arg->v_size = CAST_RAW (raw, gsize);
+ break;
+
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
+ arg->v_string = * (gchar **) raw;
+ break;
+
+ default:
+ croak ("Unhandled info tag %d", tag);
+ }
+}
+
+static void
+arg_to_raw (GArgument *arg, void *raw, GITypeInfo *info)
+{
+ GITypeTag tag = g_type_info_get_tag (info);
+
+ switch (tag) {
+ case GI_TYPE_TAG_VOID:
+ /* do nothing */
+ break;
+
+ case GI_TYPE_TAG_BOOLEAN:
+ * (gboolean *) raw = arg->v_boolean;
+ break;
+
+ case GI_TYPE_TAG_INT8:
+ * (gint8 *) raw = arg->v_int8;
+ break;
+
+ case GI_TYPE_TAG_UINT8:
+ * (guint8 *) raw = arg->v_uint8;
+ break;
+
+ case GI_TYPE_TAG_INT16:
+ * (gint16 *) raw = arg->v_int16;
+ break;
+
+ case GI_TYPE_TAG_UINT16:
+ * (guint16 *) raw = arg->v_uint16;
+ break;
+
+ case GI_TYPE_TAG_INT32:
+ * (gint32 *) raw = arg->v_int32;
+ break;
+
+ case GI_TYPE_TAG_UINT32:
+ * (guint32 *) raw = arg->v_uint32;
+ break;
+
+ case GI_TYPE_TAG_INT64:
+ * (gint64 *) raw = arg->v_int64;
+ break;
+
+ case GI_TYPE_TAG_UINT64:
+ * (guint64 *) raw = arg->v_uint64;
+ break;
+
+ case GI_TYPE_TAG_FLOAT:
+ * (gfloat *) raw = arg->v_float;
+ break;
+
+ case GI_TYPE_TAG_DOUBLE:
+ * (gdouble *) raw = arg->v_double;
+ break;
+
+ case GI_TYPE_TAG_INT:
+ * (gint *) raw = arg->v_int;
+ break;
+
+ case GI_TYPE_TAG_UINT:
+ * (guint *) raw = arg->v_uint;
+ break;
+
+ case GI_TYPE_TAG_LONG:
+ * (glong *) raw = arg->v_long;
+ break;
+
+ case GI_TYPE_TAG_ULONG:
+ * (gulong *) raw = arg->v_ulong;
+ break;
+
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_SYMBOL:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_ERROR:
+ * (void **) raw = arg->v_pointer;
+ break;
+
+ case GI_TYPE_TAG_SSIZE:
+ * (gssize *) raw = arg->v_ssize;
+ break;
+
+ case GI_TYPE_TAG_SIZE:
+ * (gsize *) raw = arg->v_size;
+ break;
+
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
+ * (gchar **) raw = arg->v_string;
+ break;
+
+ default:
+ croak ("Unhandled info tag %d", tag);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+/* Copied from ginvoke.c :-( */
+static ffi_type *
+get_ffi_type (GITypeInfo *info)
+{
+ ffi_type *rettype;
+
+ if (g_type_info_is_pointer (info))
+ rettype = &ffi_type_pointer;
+ else
+ switch (g_type_info_get_tag (info))
+ {
+ case GI_TYPE_TAG_VOID:
+ rettype = &ffi_type_void;
+ break;
+ case GI_TYPE_TAG_BOOLEAN:
+ rettype = &ffi_type_uint;
+ break;
+ case GI_TYPE_TAG_INT8:
+ rettype = &ffi_type_sint8;
+ break;
+ case GI_TYPE_TAG_UINT8:
+ rettype = &ffi_type_uint8;
+ break;
+ case GI_TYPE_TAG_INT16:
+ rettype = &ffi_type_sint16;
+ break;
+ case GI_TYPE_TAG_UINT16:
+ rettype = &ffi_type_uint16;
+ break;
+ case GI_TYPE_TAG_INT32:
+ rettype = &ffi_type_sint32;
+ break;
+ case GI_TYPE_TAG_UINT32:
+ rettype = &ffi_type_uint32;
+ break;
+ case GI_TYPE_TAG_INT64:
+ rettype = &ffi_type_sint64;
+ break;
+ case GI_TYPE_TAG_UINT64:
+ rettype = &ffi_type_uint64;
+ break;
+ case GI_TYPE_TAG_SSIZE:
+ case GI_TYPE_TAG_INT:
+ rettype = &ffi_type_sint;
+ break;
+ case GI_TYPE_TAG_SIZE:
+ case GI_TYPE_TAG_UINT:
+ rettype = &ffi_type_uint;
+ break;
+ case GI_TYPE_TAG_LONG:
+ rettype = &ffi_type_slong;
+ break;
+ case GI_TYPE_TAG_ULONG:
+ rettype = &ffi_type_ulong;
+ break;
+ case GI_TYPE_TAG_FLOAT:
+ rettype = &ffi_type_float;
+ break;
+ case GI_TYPE_TAG_DOUBLE:
+ rettype = &ffi_type_double;
+ break;
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_SYMBOL:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_ERROR:
+ rettype = &ffi_type_pointer;
+ break;
+ default:
+ rettype = NULL;
+ g_assert_not_reached ();
+ }
+
+ return rettype;
+}
+
+/* ------------------------------------------------------------------------- */
+
+typedef struct {
+ ffi_cif *cif;
+ ffi_closure *closure;
+
+ GIBaseInfo *interface;
+
+ SV *code;
+ SV *data;
+
+ void *priv; /* perl context */
+} GPerlI11nCallbackInfo;
+
+/* This gross global variable hack is needed because the callback and callback
+ * user data arguments are handled separately by the argument list converter.
+ * But we need a place to save the callback info struct since that's what has
+ * to be passed back to the caller as the real user data. This in turn is
+ * necessary so that our GDestroyNotify function (release_callback) can free
+ * everything that's been allocated. */
+static GPerlI11nCallbackInfo *current_callback_info = NULL;
+
+static void *
+create_callback_closure (GITypeInfo *cb_type, SV *code)
+{
+ GITypeInfo *ret_info;
+ GICallableInfo *cb_interface;
+ GPerlI11nCallbackInfo *info;
+ ffi_cif *cif;
+ ffi_closure *closure;
+ ffi_type **arg_types;
+ ffi_type *ret_type;
+ gint n_args, i;
+
+ cb_interface = (GICallableInfo *) g_type_info_get_interface (cb_type);
+
+ info = g_new0 (GPerlI11nCallbackInfo, 1);
+ cif = g_new0 (ffi_cif, 1);
+ closure = g_new0 (ffi_closure, 1);
+
+ n_args = g_callable_info_get_n_args (cb_interface);
+ arg_types = g_new0 (ffi_type*, n_args);
+
+ /* lookup type of every arg */
+ for (i = 0; i < n_args; i++) {
+ GIArgInfo *arg_info;
+ GITypeInfo *arg_type;
+
+ arg_info = g_callable_info_get_arg (cb_interface, i);
+ arg_type = g_arg_info_get_type (arg_info);
+
+ arg_types[i] = get_ffi_type (arg_type);
+
+ g_base_info_unref ((GIBaseInfo *) arg_info);
+ g_base_info_unref ((GIBaseInfo *) arg_type);
+ }
+
+ /* lookup return type */
+ ret_info = g_callable_info_get_return_type (cb_interface);
+ ret_type = get_ffi_type (ret_info);
+ g_base_info_unref ((GIBaseInfo *) ret_info);
+
+ /* prepare callback interface */
+ if (FFI_OK != ffi_prep_cif (cif, FFI_DEFAULT_ABI, n_args, ret_type, arg_types))
+ croak ("Couldn't prepare callback interface");
+
+ /* prepare closure; put callback info struct into userdata slot */
+ if (FFI_OK != ffi_prep_closure (closure, cif, invoke_callback, info))
+ croak ("Couldn't prepare callback closure");
+
+ info->cif = cif;
+ info->closure = closure;
+ info->interface = (GIBaseInfo *) cb_interface;
+ info->code = newSVsv (code);
+
+#ifdef PERL_IMPLICIT_CONTEXT
+ info->priv = aTHX;
+#endif
+
+ current_callback_info = info;
+
+ return closure;
+}
+
+static void *
+create_callback_data (SV *data)
+{
+ GPerlI11nCallbackInfo *info = current_callback_info;
+
+ info->data = newSVsv (data);
+ current_callback_info = NULL;
+
+ return info;
+}
+
+static void
+invoke_callback (ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ GPerlI11nCallbackInfo *info;
+ GICallableInfo *cb_interface;
+ int n_args, i;
+ int in_inout;
+ GITypeInfo *return_type;
+ gboolean have_return_type;
+ int n_return_values;
+ I32 context;
+ dGPERL_CALLBACK_MARSHAL_SP;
+
+ /* unwrap callback info struct from userdata */
+ info = (GPerlI11nCallbackInfo *) userdata;
+ cb_interface = (GICallableInfo *) info->interface;
+
+ /* set perl context */
+ GPERL_CALLBACK_MARSHAL_INIT (info);
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK (SP);
+
+ /* find arguments; use type information from interface to find in and
+ * in-out args and their types, count in-out and out args, and find
+ * suitable converters; push in and in-out arguments onto the perl
+ * stack */
+ in_inout = 0;
+ n_args = g_callable_info_get_n_args (cb_interface);
+ for (i = 0; i < n_args; i++) {
+ GIArgInfo *arg_info = g_callable_info_get_arg (cb_interface, i);
+ GITypeInfo *arg_type = g_arg_info_get_type (arg_info);
+ GITransfer transfer = g_arg_info_get_ownership_transfer (arg_info);
+ GIDirection direction = g_arg_info_get_direction (arg_info);
+
+#ifdef NOISY
+ warn ("arg info: 0x%x\n"
+ " direction: %d\n"
+ " is dipper: %d\n"
+ " is return value: %d\n"
+ " is optional: %d\n"
+ " may be null: %d\n"
+ " transfer: %d\n",
+ arg_info,
+ g_arg_info_get_direction (arg_info),
+ g_arg_info_is_dipper (arg_info),
+ g_arg_info_is_return_value (arg_info),
+ g_arg_info_is_optional (arg_info),
+ g_arg_info_may_be_null (arg_info),
+ g_arg_info_get_ownership_transfer (arg_info));
+
+ warn ("arg type: 0x%x\n"
+ " is pointer: %d\n"
+ " tag: %d\n",
+ arg_type,
+ g_type_info_is_pointer (arg_type),
+ g_type_info_get_tag (arg_type));
+#endif
+
+ if (direction == GI_DIRECTION_IN ||
+ direction == GI_DIRECTION_INOUT)
+ {
+ GArgument arg;
+ raw_to_arg (args[i], &arg, arg_type);
+ XPUSHs (sv_2mortal (arg_to_sv (&arg, arg_type, transfer)));
+ }
+
+ if (direction == GI_DIRECTION_INOUT ||
+ direction == GI_DIRECTION_OUT)
+ {
+ in_inout++;
+ }
+
+ g_base_info_unref ((GIBaseInfo *) arg_info);
+ g_base_info_unref ((GIBaseInfo *) arg_type);
+ }
+
+ /* push user data onto the Perl stack */
+ if (info->data)
+ XPUSHs (info->data);
+
+ PUTBACK;
+
+ /* determine suitable Perl call context; return_type is freed further
+ * below */
+ return_type = g_callable_info_get_return_type (cb_interface);
+ have_return_type =
+ GI_TYPE_TAG_VOID != g_type_info_get_tag (return_type);
+
+ context = G_VOID | G_DISCARD;
+ if (have_return_type) {
+ context = in_inout > 0
+ ? G_ARRAY
+ : G_SCALAR;
+ } else {
+ if (in_inout == 1) {
+ context = G_SCALAR;
+ } else if (in_inout > 1) {
+ context = G_ARRAY;
+ }
+ }
+
+ /* do the call, demand #in-out+#out+#return-value return values */
+ n_return_values = have_return_type
+ ? in_inout + 1
+ : in_inout;
+ if (n_return_values == 0) {
+ call_sv (info->code, context);
+ } else {
+ int n_returned = call_sv (info->code, context);
+ if (n_returned != n_return_values) {
+ croak ("callback returned %d values "
+ "but is supposed to return %d values",
+ n_returned, n_return_values);
+ }
+ }
+
+ SPAGAIN;
+
+ /* convert in-out and out values and stuff them back into args */
+ if (in_inout > 0) {
+ SV **returned_values;
+ int out_index;
+
+ returned_values = g_new0 (SV *, in_inout);
+
+ /* pop scalars off the stack and put them into the array;
+ * reverse the order since POPs pops items off of the end of
+ * the stack. */
+ for (i = 0; i < in_inout; i++) {
+ /* FIXME: Does this leak the sv? Should we check the
+ * transfer setting? */
+ returned_values[in_inout - i - 1] = newSVsv (POPs);
+ }
+
+ out_index = 0;
+ for (i = 0; i < n_args; i++) {
+ GIArgInfo *arg_info = g_callable_info_get_arg (cb_interface, i);
+ GITypeInfo *arg_type = g_arg_info_get_type (arg_info);
+ GIDirection direction = g_arg_info_get_direction (arg_info);
+ gboolean may_be_null = g_arg_info_may_be_null (arg_info);
+
+ if (direction == GI_DIRECTION_INOUT ||
+ direction == GI_DIRECTION_OUT)
+ {
+ GArgument tmp_arg;
+ sv_to_arg (returned_values[out_index], &tmp_arg, arg_type, may_be_null);
+ arg_to_raw (&tmp_arg, args[i], arg_type);
+ out_index++;
+ }
+ }
+
+ g_free (returned_values);
+ }
+
+ /* store return value in resp, if any */
+ if (have_return_type) {
+ GArgument arg;
+ GITypeInfo *info;
+ gboolean may_be_null;
+
+ info = g_callable_info_get_return_type (cb_interface);
+ may_be_null = g_callable_info_may_return_null (cb_interface);
+
+#ifdef NOISY
+ warn ("ret type: 0x%x\n"
+ " is pointer: %d\n"
+ " tag: %d\n",
+ info,
+ g_type_info_is_pointer (info),
+ g_type_info_get_tag (info));
+#endif
+
+ /* FIXME: Does this leak the sv? Should we check the transfer
+ * setting? */
+ sv_to_arg (newSVsv (POPs), &arg, info, may_be_null);
+ arg_to_raw (&arg, resp, info);
+
+ g_base_info_unref ((GIBaseInfo *) info);
+ }
+
+ PUTBACK;
+
+ g_base_info_unref ((GIBaseInfo *) return_type);
+
+ FREETMPS;
+ LEAVE;
+}
+
+static void
+release_callback (void *data)
+{
+ GPerlI11nCallbackInfo *info = data;
+
+ if (info->cif)
+ g_free (info->cif);
+
+ if (info->closure)
+ g_free (info->closure);
+
+ if (info->interface)
+ g_base_info_unref (info->interface);
+
+
+ if (info->code)
+ SvREFCNT_dec (info->code);
+
+ if (info->data)
+ SvREFCNT_dec (info->data);
+
+ g_free (info);
+}
+
+/* ------------------------------------------------------------------------- */
+
+SV *
+newSVGIFunctionInfo (GIFunctionInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::FunctionInfo", info);
+}
+
+GIFunctionInfo *
+SvGIFunctionInfo (SV *info)
+{
+ return INT2PTR (GIFunctionInfo *, SvIV (SvRV (info)));
+
+}
+
+/* ------------------------------------------------------------------------- */
+
+XS(XS_Glib__Idl__FunctionInfo_invoke)
+{
+ dXSARGS;
+
+ if (items < 1)
+ Perl_croak(aTHX_ "Usage: Glib::Object::Introspection::FunctionInfo::invoke(info, ...)");
+
+ SP -= items;
+
+ {
+ GIFunctionInfo * info = SvGIFunctionInfo (ST(0));
+ int have_args;
+ int n_args;
+ int n_in_args;
+ int n_out_args;
+ int i, out_i;
+ GITypeInfo ** out_arg_type = NULL;
+ GITypeInfo * return_type_info = NULL;
+ GITransfer return_type_transfer;
+ gboolean has_return_value;
+ GArgument return_value;
+ GArgument * in_args = NULL;
+ GArgument * out_args = NULL;
+ GError * error = NULL;
+
+#ifdef NOISY
+ warn ("invoke: %s\n", g_function_info_get_symbol (info));
+#endif
+
+#define OFFSET 1
+ have_args = items - OFFSET;
+ n_args = g_callable_info_get_n_args ((GICallableInfo *) info);
+
+ /* to allow us to make only one pass through the arg list, allocate
+ * enough space for all args in both the out and in lists. we'll
+ * only use as much as we need. since function argument lists are
+ * typically small, this shouldn't be a big problem. */
+ if (n_args) {
+ in_args = gperl_alloc_temp (sizeof (GArgument) * n_args);
+ out_args = gperl_alloc_temp (sizeof (GArgument) * n_args);
+ out_arg_type = gperl_alloc_temp (sizeof (GITypeInfo*) * n_args);
+ }
+
+ n_in_args = n_out_args = 0;
+ for (i = 0 ; i < n_args ; i++) {
+ GIArgInfo * arg_info =
+ g_callable_info_get_arg ((GICallableInfo *) info, i);
+ GITypeInfo * arg_type = g_arg_info_get_type (arg_info);
+ gboolean may_be_null = g_arg_info_may_be_null (arg_info);
+
+#ifdef NOISY
+ warn (" arg tag: %d\n", g_type_info_get_tag (arg_type));
+#endif
+
+ switch (g_arg_info_get_direction (arg_info)) {
+ case GI_DIRECTION_IN:
+ sv_to_arg (ST (i+OFFSET), in_args+n_in_args++, arg_type, may_be_null);
+ g_base_info_unref ((GIBaseInfo *) arg_type);
+ break;
+ case GI_DIRECTION_OUT:
+ out_args[n_out_args++].v_pointer =
+ gperl_alloc_temp (sizeof (GArgument));
+ out_arg_type[n_out_args-1] = arg_type;
+ break;
+ case GI_DIRECTION_INOUT:
+ {
+ GArgument * temp =
+ gperl_alloc_temp (sizeof (GArgument));
+ sv_to_arg (ST (i+OFFSET), temp, arg_type, may_be_null);
+ in_args[n_in_args++].v_pointer =
+ out_args[n_out_args++].v_pointer =
+ temp;
+ out_arg_type[n_out_args-1] = arg_type;
+ }
+ break;
+ }
+
+ g_base_info_unref ((GIBaseInfo*) arg_info);
+ }
+#undef OFFSET
+
+ /* if (n_in_args != have_args)
+ croak ("%s needs %d args, got %d",
+ g_function_info_get_symbol (info),
+ n_in_args, have_args); */
+
+ if (! g_function_info_invoke (info, in_args, n_in_args,
+ out_args, n_out_args,
+ &return_value, &error))
+ gperl_croak_gerror (NULL, error);
+
+ /*
+ * place return value and output args on the stack
+ */
+ return_type_info = g_callable_info_get_return_type ((GICallableInfo *) info);
+ return_type_transfer = g_callable_info_get_caller_owns ((GICallableInfo *) info);
+ has_return_value = GI_TYPE_TAG_VOID != g_type_info_get_tag (return_type_info);
+
+ if (has_return_value) {
+ SV *value = arg_to_sv (&return_value,
+ return_type_info,
+ return_type_transfer);
+ if (value)
+ XPUSHs (sv_2mortal (value));
+ }
+
+ g_base_info_unref ((GIBaseInfo *) return_type_info);
+
+ /* out args */
+ for (i = out_i = 0 ; i < n_args ; i++) {
+ GIArgInfo * arg_info =
+ g_callable_info_get_arg ((GICallableInfo *) info, i);
+
+ switch (g_arg_info_get_direction (arg_info)) {
+ case GI_DIRECTION_OUT:
+ case GI_DIRECTION_INOUT:
+ {
+ GITransfer transfer = g_arg_info_get_ownership_transfer (arg_info);
+ SV *sv = arg_to_sv (out_args[out_i].v_pointer, out_arg_type[out_i], transfer);
+ if (sv)
+ XPUSHs (sv_2mortal (sv));
+ g_base_info_unref ((GIBaseInfo*) out_arg_type[out_i]);
+ }
+ out_i++;
+ break;
+ default:
+ break;
+ }
+
+ g_base_info_unref ((GIBaseInfo *) arg_info);
+ }
+
+ if (has_return_value)
+ out_i++;
+
+ if (out_i == 0) {
+ XSRETURN_EMPTY;
+ } else if (out_i == 1) {
+ XSRETURN (1);
+ } else {
+ PUTBACK;
+ return;
+ }
+ }
+}
+
+MODULE = Glib::Object::Introspection::FunctionInfo PACKAGE = Glib::Object::Introspection::FunctionInfo PREFIX = g_function_info_
+
+BOOT:
+ newXS("Glib::Object::Introspection::FunctionInfo::invoke", XS_Glib__Idl__FunctionInfo_invoke, file);
+
+const gchar * g_function_info_get_symbol (GIFunctionInfo *info);
+
+GIFunctionInfoFlags g_function_info_get_flags (GIFunctionInfo *info);
+
+GIPropertyInfo * g_function_info_get_property (GIFunctionInfo *info);
+
+GIVFuncInfo * g_function_info_get_vfunc (GIFunctionInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlInterfaceInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlInterfaceInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlInterfaceInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIInterfaceInfo (GIInterfaceInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::InterfaceInfo", info);
+}
+
+GIInterfaceInfo *
+SvGIInterfaceInfo (SV *info)
+{
+ return INT2PTR (GIInterfaceInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::InterfaceInfo PACKAGE = Glib::Object::Introspection::InterfaceInfo PREFIX = g_interface_info_
+
+# gint g_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
+# GIBaseInfo * g_interface_info_get_prerequisite (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_prerequisites (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_prerequisites (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIBaseInfo (
+ g_interface_info_get_prerequisite (info, i))));
+
+# gint g_interface_info_get_n_properties (GIInterfaceInfo *info);
+# GIPropertyInfo * g_interface_info_get_property (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_properties (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_properties (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIPropertyInfo (
+ g_interface_info_get_property (info, i))));
+
+# gint g_interface_info_get_n_methods (GIInterfaceInfo *info);
+# GIFunctionInfo * g_interface_info_get_method (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_methods (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_methods (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIFunctionInfo (
+ g_interface_info_get_method (info, i))));
+
+GIFunctionInfo * g_interface_info_find_method (GIInterfaceInfo *info, const gchar *name);
+
+# gint g_interface_info_get_n_signals (GIInterfaceInfo *info);
+# GISignalInfo * g_interface_info_get_signal (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_signals (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_signals (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGISignalInfo (
+ g_interface_info_get_signal (info, i))));
+
+# gint g_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
+# GIVFuncInfo * g_interface_info_get_vfunc (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_vfuncs (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_vfuncs (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIVFuncInfo (
+ g_interface_info_get_vfunc (info, i))));
+
+# gint g_interface_info_get_n_constants (GIInterfaceInfo *info);
+# GIConstantInfo * g_interface_info_get_constant (GIInterfaceInfo *info, gint n);
+void
+g_interface_info_get_constants (info)
+ GIInterfaceInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_interface_info_get_n_constants (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIConstantInfo (
+ g_interface_info_get_constant (info, i))));
Added: Glib-Object-Introspection/trunk/xs/IdlMetadata.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlMetadata.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGMetadata (GMetadata *metadata)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::Metadata", metadata);
+}
+
+GMetadata *
+SvGMetadata (SV *metadata)
+{
+ return INT2PTR (GMetadata *, SvIV (SvRV (metadata)));
+
+}
+
+MODULE = Glib::Object::Introspection::Metadata PACKAGE = Glib::Object::Introspection::Metadata PREFIX = g_metadata_
+
+# void g_metadata_free (GMetadata *metadata);
+# void
+# DESTROY (GMetadata *metadata)
+# CODE:
+# g_metadata_free (metadata);
+
+# GMetadata * g_metadata_new_from_memory (guchar *memory, gsize len);
+# GMetadata * g_metadata_new_from_const_memory (const guchar *memory, gsize len);
+# GMetadata * g_metadata_new_from_mapped_file (GMappedFile *mfile);
+GMetadata *
+g_metadata_new_from_memory (class, SV *scalar)
+ PREINIT:
+ gchar *memory;
+ STRLEN length;
+ CODE:
+ memory = SvPV (scalar, length);
+ RETVAL = g_metadata_new_from_memory ((guchar *) memory, length);
+ OUTPUT:
+ RETVAL
+
+# void g_metadata_set_module (GMetadata *metadata, GModule *module);
+
+const gchar * g_metadata_get_namespace (GMetadata *metadata);
Added: Glib-Object-Introspection/trunk/xs/IdlObjectInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlObjectInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlObjectInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIObjectInfo (GIObjectInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::ObjectInfo", info);
+}
+
+GIObjectInfo *
+SvGIObjectInfo (SV *info)
+{
+ return INT2PTR (GIObjectInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::ObjectInfo PACKAGE = Glib::Object::Introspection::ObjectInfo PREFIX = g_object_info_
+
+GIObjectInfo * g_object_info_get_parent (GIObjectInfo *info);
+
+# gint g_object_info_get_n_interfaces (GIObjectInfo *info);
+# GIInterfaceInfo * g_object_info_get_interface (GIObjectInfo *info, gint n);
+void
+g_object_info_get_interfaces (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_interfaces (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIInterfaceInfo (
+ g_object_info_get_interface (info, i))));
+
+# gint g_object_info_get_n_fields (GIObjectInfo *info);
+# GIFieldInfo * g_object_info_get_field (GIObjectInfo *info, gint n);
+void
+g_object_info_get_fields (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_fields (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIFieldInfo (
+ g_object_info_get_field (info, i))));
+
+# gint g_object_info_get_n_properties (GIObjectInfo *info);
+# GIPropertyInfo * g_object_info_get_property (GIObjectInfo *info, gint n);
+void
+g_object_info_get_properties (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_properties (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIPropertyInfo (
+ g_object_info_get_property (info, i))));
+
+# gint g_object_info_get_n_methods (GIObjectInfo *info);
+# GIFunctionInfo * g_object_info_get_method (GIObjectInfo *info, gint n);
+void
+g_object_info_get_methods (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_methods (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIFunctionInfo (
+ g_object_info_get_method (info, i))));
+
+GIFunctionInfo * g_object_info_find_method (GIObjectInfo *info, const gchar *name);
+
+# gint g_object_info_get_n_signals (GIObjectInfo *info);
+# GISignalInfo * g_object_info_get_signal (GIObjectInfo *info, gint n);
+void
+g_object_info_get_signals (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_signals (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGISignalInfo (
+ g_object_info_get_signal (info, i))));
+
+# gint g_object_info_get_n_vfuncs (GIObjectInfo *info);
+# GIVFuncInfo * g_object_info_get_vfunc (GIObjectInfo *info, gint n);
+void
+g_object_info_get_vfuncs (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_vfuncs (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIVFuncInfo (
+ g_object_info_get_vfunc (info, i))));
+
+# gint g_object_info_get_n_constants (GIObjectInfo *info);
+# GIConstantInfo * g_object_info_get_constant (GIObjectInfo *info, gint n);
+void
+g_object_info_get_constants (info)
+ GIObjectInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_object_info_get_n_constants (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIConstantInfo (
+ g_object_info_get_constant (info, i))));
Added: Glib-Object-Introspection/trunk/xs/IdlPropertyInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlPropertyInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlPropertyInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIPropertyInfo (GIPropertyInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::PropertyInfo", info);
+}
+
+GIPropertyInfo *
+SvGIPropertyInfo (SV *info)
+{
+ return INT2PTR (GIPropertyInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::PropertyInfo PACKAGE = Glib::Object::Introspection::PropertyInfo PREFIX = g_property_info_
+
+GParamFlags g_property_info_get_flags (GIPropertyInfo *info);
+
+GITypeInfo * g_property_info_get_type (GIPropertyInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlRegisteredTypeInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlRegisteredTypeInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlRegisteredTypeInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIRegisteredTypeInfo (GIRegisteredTypeInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::RegisteredTypeInfo", info);
+}
+
+GIRegisteredTypeInfo *
+SvGIRegisteredTypeInfo (SV *info)
+{
+ return INT2PTR (GIRegisteredTypeInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::RegisteredTypeInfo PACKAGE = Glib::Object::Introspection::RegisteredTypeInfo PREFIX = g_registered_type_info_
+
+const gchar * g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
+
+const gchar * g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlRepository.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlRepository.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlRepository.xs,v 1.2 2005/08/26 18:47:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+#include <dlfcn.h>
+#include "ffi.h"
+
+GType
+gperl_i11n_get_gtype (GIRegisteredTypeInfo *info)
+{
+ const gchar *symbol;
+ gpointer func;
+ ffi_type *return_type;
+ ffi_cif cif;
+ GType return_value = 0;
+
+ symbol = g_registered_type_info_get_type_init (
+ (GIRegisteredTypeInfo *) info);
+ func = dlsym (NULL, symbol);
+ if (!func)
+ croak ("Couldn't retrieve function pointer for %s: %s",
+ symbol, dlerror ());
+
+ /* GType == gulong */
+ return_type = &ffi_type_ulong;
+
+ if (FFI_OK != ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 0, return_type, NULL))
+ croak ("Couldn't prepare function call");
+
+ ffi_call (&cif, func, &return_value, NULL);
+ if (!return_value)
+ croak ("Couldn't retrieve type");
+
+ return return_value;
+}
+
+MODULE = Glib::Object::Introspection::Repository PACKAGE = Glib::Object::Introspection::Repository PREFIX = g_irepository_
+
+# GIRepository * g_irepository_get_default (void);
+GIRepository_noinc *
+g_irepository_get_default (class)
+ C_ARGS:
+ /* void */
+
+void g_irepository_register (GIRepository *repository, GMetadata *metadata);
+
+void g_irepository_unregister (GIRepository *repository, const gchar *namespace);
+
+=for apidoc __gerror__
+=cut
+# const gchar * g_irepository_register_file (GIRepository *repository, const gchar *filename, GError **error);
+const gchar *
+g_irepository_register_file (GIRepository *repository, const gchar *filename)
+ PREINIT:
+ GError *error = NULL;
+ CODE:
+ RETVAL = g_irepository_register_file (repository, filename, &error);
+ if (error)
+ gperl_croak_gerror (NULL, error);
+ OUTPUT:
+ RETVAL
+
+GIBaseInfo * g_irepository_find_by_name (GIRepository *repository, const gchar *namespace, const gchar *name);
+
+# gchar ** g_irepository_get_namespaces (GIRepository *repository);
+void
+g_irepository_get_namespaces (repository)
+ GIRepository *repository
+ PREINIT:
+ gchar **namespaces = NULL;
+ gchar *namespace = NULL;
+ PPCODE:
+ namespaces = g_irepository_get_namespaces (repository);
+ while ((namespace = *namespaces++)) {
+ XPUSHs (sv_2mortal (newSVGChar (namespace)));
+ g_free (namespace);
+ }
+
+# FIXME: Needed?
+# GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository, GType gtype);
+
+# gint g_irepository_get_n_infos (GIRepository *repository, const gchar *namespace);
+# GIBaseInfo * g_irepository_get_info (GIRepository *repository, const gchar *namespace, gint index);
+void
+g_irepository_get_infos (repository, namespace)
+ GIRepository *repository
+ const gchar *namespace
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_irepository_get_n_infos (repository, namespace);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIBaseInfo (
+ g_irepository_get_info (repository, namespace, i))));
+
+void
+register_types (repository, namespace, package)
+ GIRepository *repository
+ const gchar *namespace
+ const gchar *package
+ PREINIT:
+ gint number, i;
+ CODE:
+ number = g_irepository_get_n_infos (repository, namespace);
+ for (i = 0; i < number; i++) {
+ GIBaseInfo *info;
+ GIInfoType info_type;
+ const gchar *name;
+ gchar *full_package;
+ GType type;
+
+ info = g_irepository_get_info (repository, namespace, i);
+ info_type = g_base_info_get_type (info);
+
+ if (info_type != GI_INFO_TYPE_OBJECT &&
+ info_type != GI_INFO_TYPE_BOXED &&
+ info_type != GI_INFO_TYPE_ENUM &&
+ info_type != GI_INFO_TYPE_FLAGS) {
+ g_base_info_unref ((GIBaseInfo *) info);
+ continue;
+ }
+
+ type = gperl_i11n_get_gtype ((GIRegisteredTypeInfo *) info);
+
+ name = g_base_info_get_name (info);
+ full_package = g_strconcat (package, "::", name, NULL);
+
+ /* FIXME: This is a hack to get our AUTOLOAD involved. */
+ if (info_type == GI_INFO_TYPE_OBJECT ||
+ info_type == GI_INFO_TYPE_BOXED) {
+ gperl_set_isa (full_package, package);
+ }
+
+ switch (info_type) {
+ case GI_INFO_TYPE_OBJECT:
+ gperl_register_object (type, full_package);
+ break;
+
+ case GI_INFO_TYPE_BOXED:
+ gperl_register_boxed (type, full_package, NULL);
+ break;
+
+ case GI_INFO_TYPE_ENUM:
+ case GI_INFO_TYPE_FLAGS:
+ gperl_register_fundamental (type, full_package);
+ break;
+
+ default:
+ break;
+ }
+
+ g_free (full_package);
+ g_base_info_unref ((GIBaseInfo *) info);
+ }
Added: Glib-Object-Introspection/trunk/xs/IdlSignalInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlSignalInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlSignalInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGISignalInfo (GISignalInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::SignalInfo", info);
+}
+
+GISignalInfo *
+SvGISignalInfo (SV *info)
+{
+ return INT2PTR (GISignalInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::SignalInfo PACKAGE = Glib::Object::Introspection::SignalInfo PREFIX = g_signal_info_
+
+GSignalFlags g_signal_info_get_flags (GISignalInfo *info);
+
+GIVFuncInfo * g_signal_info_get_class_closure (GISignalInfo *info);
+
+gboolean g_signal_info_true_stops_emit (GISignalInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlStructInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlStructInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlStructInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIStructInfo (GIStructInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::StructInfo", info);
+}
+
+GIStructInfo *
+SvGIStructInfo (SV *info)
+{
+ return INT2PTR (GIStructInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::StructInfo PACKAGE = Glib::Object::Introspection::StructInfo PREFIX = g_struct_info_
+
+# gint g_struct_info_get_n_fields (GIStructInfo *info);
+# GIFieldInfo * g_struct_info_get_field (GIStructInfo *info, gint n);
+void
+g_struct_info_get_fields (info)
+ GIStructInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_struct_info_get_n_fields (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIFieldInfo (
+ g_struct_info_get_field (info, i))));
+
+# gint g_struct_info_get_n_methods (GIStructInfo *info);
+# GIFunctionInfo * g_struct_info_get_method (GIStructInfo *info, gint n);
+void
+g_struct_info_get_methods (info)
+ GIStructInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_struct_info_get_n_methods (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIFunctionInfo (
+ g_struct_info_get_method (info, i))));
+
+GIFunctionInfo * g_struct_info_find_method (GIStructInfo *info, const gchar *name);
Added: Glib-Object-Introspection/trunk/xs/IdlTypeInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlTypeInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlTypeInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGITypeInfo (GITypeInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::TypeInfo", info);
+}
+
+GITypeInfo *
+SvGITypeInfo (SV *info)
+{
+ return INT2PTR (GITypeInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::TypeInfo PACKAGE = Glib::Object::Introspection::TypeInfo PREFIX = g_type_info_
+
+gboolean g_type_info_is_pointer (GITypeInfo *info);
+
+GITypeTag g_type_info_get_tag (GITypeInfo *info);
+
+GITypeInfo * g_type_info_get_param_type (GITypeInfo *info, gint n);
+
+GIBaseInfo * g_type_info_get_interface (GITypeInfo *info);
+
+gint g_type_info_get_array_length (GITypeInfo *info);
+
+gboolean g_type_info_is_zero_terminated (GITypeInfo *info);
+
+# gint g_type_info_get_n_error_domains (GITypeInfo *info);
+# GIErrorDomainInfo * g_type_info_get_error_domain (GITypeInfo *info, gint n);
+void
+g_type_info_get_error_domains (info)
+ GITypeInfo *info
+ PREINIT:
+ gint number, i;
+ PPCODE:
+ number = g_type_info_get_n_error_domains (info);
+ EXTEND (sp, number);
+ for (i = 0; i < number; i++)
+ PUSHs (sv_2mortal (newSVGIErrorDomainInfo (
+ g_type_info_get_error_domain (info, i))));
Added: Glib-Object-Introspection/trunk/xs/IdlVFuncInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlVFuncInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlVFuncInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIVFuncInfo (GIVFuncInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::VFuncInfo", info);
+}
+
+GIVFuncInfo *
+SvGIVFuncInfo (SV *info)
+{
+ return INT2PTR (GIVFuncInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::VFuncInfo PACKAGE = Glib::Object::Introspection::VFuncInfo PREFIX = g_vfunc_info_
+
+GIVFuncInfoFlags g_vfunc_info_get_flags (GIVFuncInfo *info);
+
+gint g_vfunc_info_get_offset (GIVFuncInfo *info);
+
+GISignalInfo * g_vfunc_info_get_signal (GIVFuncInfo *info);
Added: Glib-Object-Introspection/trunk/xs/IdlValueInfo.xs
==============================================================================
--- (empty file)
+++ Glib-Object-Introspection/trunk/xs/IdlValueInfo.xs Fri Mar 14 13:28:57 2008
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005 by the gtk2-perl team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: IdlValueInfo.xs,v 1.1.1.1 2005/08/21 14:39:45 torsten Exp $
+ */
+
+#include "gobject-introspection-perl.h"
+
+SV *
+newSVGIValueInfo (GIValueInfo *info)
+{
+ SV *sv = newSV (0);
+
+ return sv_setref_pv (sv, "Glib::Object::Introspection::ValueInfo", info);
+}
+
+GIValueInfo *
+SvGIValueInfo (SV *info)
+{
+ return INT2PTR (GIValueInfo *, SvIV (SvRV (info)));
+
+}
+
+MODULE = Glib::Object::Introspection::ValueInfo PACKAGE = Glib::Object::Introspection::ValueInfo PREFIX = g_value_info_
+
+glong g_value_info_get_value (GIValueInfo *info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]