Pango-1.227/ 000755 001750 000024 00000000000 12651231244 013664 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/AUTHORS 000644 001750 000024 00000000517 11664366563 014757 0 ustar 00bdmanning staff 000000 000000 The Gtk2-Perl Team - contact us at gtk-perl-list@gnome.org
==========================================================
muppet scott at asofyet dot org
Torsten Schoenfeld kaffeetisch at gmx dot de
Marc Lehmann pcg at goof dot com
gtk2-perl is covered by the LGPL -- see the file LICENSE for details.
Pango-1.227/ChangeLog.pre-git 000644 001750 000024 00000005255 11705717000 017011 0 ustar 00bdmanning staff 000000 000000 === ChangeLog discontinued ===
With the move to git, we stop maintaining a separate ChangeLog and
rely on proper commit messages instead. Web view of changes:
.
2009-03-25 Torsten Schoenfeld
* MANIFEST: Remove pango-perl-private.h.
2009-03-24 Torsten Schoenfeld
* pango.exports: Fix the list of exported functions so that
linking against us works on MSWin32. Patch by Martin
Schlemmer. (GNOME #576373)
2009-03-24 Torsten Schoenfeld
* pango-perl.h
* pango-perl-private.h (removed)
* xs/PangoAttributes.xs: Clean up a holdover from the split-off:
properly declare gtk2perl_pango_attribute_register_custom_type in
pango-perl.h so that Gtk2 can use it without having to jump
through hoops, and move the one macro that is in use out of
pango-perl-private.h which thus becomes empty.
2009-03-17 Torsten Schoenfeld
* Makefile.PL
* NEWS
* README
* lib/Pango.pm: Stable release 1.220.
2009-03-17 Torsten Schoenfeld
* t/inc/PangoTestHelper.pm
* t/PangoLayout.t: Change version checks to refer to stable
versions only.
2009-03-08 Torsten Schoenfeld
* NEWS
* lib/Pango.pm: Release 1.211.
2009-03-08 Torsten Schoenfeld
* Makefile.PL: Use Glib::MakeMaker to add a precompiled-headers
Makefile target that precompiles pango-perl.h.
2009-01-01 Torsten Schoenfeld
* t/PangoLayout.t
* xs/PangoLayout.xs: Allow passing undef to
Gtk2::Pango::Layout::set_attributes(). Patch by Emmanuel
Rodriguez. (RT #42079)
2008-12-16 Torsten Schoenfeld
* t/PangoLayout.t: Fix a skip count. Patch by Kevin Ryde.
2008-11-24 Torsten Schoenfeld
* t/PangoLayout.t
* xs/PangoLayout.xs: Wrap pango_layout_get_baseline. Patch by
Thierry Vignaud.
2008-11-16 Torsten Schoenfeld
* NEWS
* lib/Pango.pm: Release 1.210.
2008-11-16 Torsten Schoenfeld
* README: Add small introductory paragraph.
2008-11-16 Torsten Schoenfeld
* MANIFEST
* examples/cairo-simple.pl (added): Add an example demonstrating
how to use Pango in conjunction with Cairo and Gtk2.
2008-11-16 Torsten Schoenfeld
* AUTHORS
* lib/Pango.pm: Update list of authors.
* lib/Pango.pm: Add some documentation.
* Makefile.PL: Use META_MERGE instead of EXTRA_META.
* lib/Pango.pm
* Makefile.PL: Remove unused code for handling constants.
* Makefile.PL
* README: Update dependencies.
2008-11-02 Torsten Schoenfeld
Initial import into GNOME SVN.
Pango-1.227/copyright.pod 000644 001750 000024 00000000173 11664366563 016421 0 ustar 00bdmanning staff 000000 000000 Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See L for a full notice.
Pango-1.227/doctypes 000644 001750 000024 00000000157 11664366563 015464 0 ustar 00bdmanning staff 000000 000000 # C name description
# ------------ ----------------
PangoRectangle array reference
PangoGlyph integer
Pango-1.227/examples/ 000755 001750 000024 00000000000 12651231244 015502 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/lib/ 000755 001750 000024 00000000000 12651231244 014432 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/LICENSE 000644 001750 000024 00000063502 12301027576 014702 0 ustar 00bdmanning staff 000000 000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
Copyright (C)
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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
Pango-1.227/Makefile.PL 000644 001750 000024 00000016572 12631316624 015655 0 ustar 00bdmanning staff 000000 000000 # Copyright (C) 2003-2007, 2013 by the gtk2-perl team (see the file AUTHORS
# for the full list)
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for the
# full license terms.
BEGIN { require 5.008; }
use strict;
use warnings;
use ExtUtils::MakeMaker;
use File::Spec;
use Cwd;
# minimum required version of dependencies we need to build
our %build_reqs = (
'perl-ExtUtils-Depends' => '0.300',
'perl-ExtUtils-PkgConfig' => '1.030',
'perl-Glib' => '1.220',
'perl-Cairo' => '1.000',
'pango' => '1.0.0',
);
our %PREREQ_PM = (
'ExtUtils::Depends' => $build_reqs{'perl-ExtUtils-Depends'},
'ExtUtils::PkgConfig' => $build_reqs{'perl-ExtUtils-PkgConfig'},
'Glib' => $build_reqs{'perl-Glib'},
);
#
# look for our prerequisites. if they can't be found, warn and exit with
# status 0 to indicate to CPAN testers that their system isn't supported.
#
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::CodeGen;"
. "use Glib::MakeHelper;"
. "1") {
warn <<"__EOW__";
Pre-requisites not found:
$@
Please install them manually.
__EOW__
exit 0;
}
# all the generated stuff will go into this subdir...
mkdir 'build', 0777;
#
# look for our packages. if they can't be found, warn and exit with status 0
# to indicate to CPAN testers that their system isn't supported.
#
my %pango_pkgcfg;
unless (eval { %pango_pkgcfg = ExtUtils::PkgConfig->find ('pango'); 1; }) {
warn $@;
exit 0;
}
#
# retrieve pango's version
#
my @pango_version = split /\./, $pango_pkgcfg{modversion};
#
# decide what files to use in the build based on the version we found.
#
my @xs_files = ();
my @xs_lists =
Glib::MakeHelper->select_files_by_version ("xs_files", @pango_version);
foreach my $filename (@xs_lists) {
my @names = Glib::MakeHelper->read_source_list_file ($filename);
push @xs_files, @names;
}
#
# if pango >= 1.10, we depend on Cairo
#
my $have_cairo = 0;
my %pangocairo_pkgcfg;
if ($pango_version[0] > 1 || ($pango_version[0] == 1 && $pango_version[1] >= 10)) {
$PREREQ_PM{Cairo} = $build_reqs{'perl-Cairo'};
unless (eval "use Cairo '$build_reqs{'perl-Cairo'}'; 1;") {
warn <<"__EOW__";
Pre-requisites not found:
$@
Please install them manually.
__EOW__
exit 0;
}
unless (eval { %pangocairo_pkgcfg = ExtUtils::PkgConfig->find ('pangocairo'); 1; }) {
warn $@;
exit 0;
}
$have_cairo = 1;
}
#
# create version macros
#
ExtUtils::PkgConfig->write_version_macros(
"build/pango-perl-versions.h",
pango => "PANGO",
);
#
# since we've started down the dark path of breaking from standard MakeMaker,
# forever will it dominate our destiny; we must specify install paths for the
# modules and man files by hand.
#
our %pm_files = (
'lib/Pango.pm' => '$(INST_LIBDIR)/Pango.pm',
);
our %pod_files = (
'lib/Pango.pm' => '$(INST_MAN3DIR)/Pango.$(MAN3EXT)',
Glib::MakeHelper->do_pod_files (@xs_files),
);
#
# autogeneration
#
# we have a whole lot of types which need cast macros, typemap entries,
# and package mapping registration; instead of writing this by hand, we
# use a set of map files which define how things are laid out, and then use
# some boilerplate code to convert those mappings into a header, typemap,
# and xsh file. see the docs for Glib::CodeGen for more info.
#
# all possible maps must be available at xsubpp time, as xsubpp processes
# all code, even inside #ifdefs.
Glib::CodeGen->parse_maps ('pango-perl', input => []);
# one more command generates code to boot all the various extra XS modules.
# we need this because we have lots of XS files without corresponding PMs to
# bootstrap them.
Glib::CodeGen->write_boot (xs_files => \@xs_files);
#
# now we're ready to start creating the makefile... finally.
# we need to use ExtUtils::Depends to get relevant information out of
# the Glib extension, and to save config information for other modules which
# will chain from this one.
#
my @deps = qw/Glib/;
my $inc = $pango_pkgcfg{cflags} . ' -I./build ';
my $libs = $pango_pkgcfg{libs};
if ($have_cairo) {
push @deps, qw/Cairo/;
$inc .= $pangocairo_pkgcfg{cflags};
$libs .= ' ' . $pangocairo_pkgcfg{libs};
}
my @typemaps = map { File::Spec->catfile(cwd(), $_) }
qw(build/pango-perl.typemap pango.typemap);
my $pango = ExtUtils::Depends->new ('Pango', @deps);
$pango->set_inc ($inc);
$pango->set_libs ($libs);
$pango->add_pm (%pm_files);
$pango->add_xs (@xs_files);
$pango->add_typemaps (@typemaps);
$pango->install (qw(pango-perl.h
build/pango-perl-autogen.h
build/pango-perl-versions.h
doctypes));
$pango->save_config ('build/IFiles.pm');
# exports list needed for win32, unused on others
my @exports = Glib::MakeHelper->read_source_list_file ('pango.exports');
my %meta_merge = (
q(meta-spec) => {
version => '2',
url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
},
author =>
['gtk2-perl Team '],
release_status => 'stable',
# valid values: https://metacpan.org/module/CPAN::Meta::Spec#license
license => 'lgpl_2_1',
resources => {
license => 'http://www.gnu.org/licenses/lgpl-2.1.html',
homepage => 'http://gtk2-perl.sourceforge.net',
x_MailingList =>
'https://mail.gnome.org/mailman/listinfo/gtk-perl-list',
x_twitter => 'https://twitter.com/GTKPerl',
bugtracker => {
web =>
'http://rt.cpan.org/Public/Dist/Display.html?Name=Pango',
mailto => 'bug-Pango [at] rt.cpan.org',
},
repository => {
url => 'git://git.gnome.org/perl-Pango',
type => 'git',
web => 'http://git.gnome.org/browse/perl-Pango',
},
},
prereqs => {
configure => {
requires => {%PREREQ_PM}, # no direct ref for 5.14 compatibility
},
},
no_index => {
file => \@xs_files,
},
);
WriteMakefile(
NAME => 'Pango',
VERSION_FROM => 'lib/Pango.pm',
ABSTRACT_FROM => 'lib/Pango.pm',
PREREQ_PM => \%PREREQ_PM,
XSPROTOARG => '-noprototypes',
MAN3PODS => \%pod_files,
FUNCLIST => \@exports,
DL_FUNCS => { Pango => [] },
META_MERGE => \%meta_merge,
$pango->get_makefile_vars,
);
#
# extra makefile override stuff
#
sub MY::postamble
{
return Glib::MakeHelper->postamble_precompiled_headers (qw/pango-perl.h/)
. Glib::MakeHelper->postamble_clean ()
. Glib::MakeHelper->postamble_docs_full (
DEPENDS => $pango,
DOCTYPES => 'doctypes',
COPYRIGHT_FROM => 'copyright.pod');
}
Pango-1.227/MANIFEST 000644 001750 000024 00000001755 12651231244 015025 0 ustar 00bdmanning staff 000000 000000 AUTHORS
ChangeLog.pre-git
copyright.pod
doctypes
examples/cairo-simple.pl
lib/Pango.pm
LICENSE
Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
maps-1.0
maps-1.10
maps-1.16
maps-1.18
maps-1.4
maps-1.6
maps-1.8
NEWS
pango-perl.h
pango.exports
pango.typemap
perl-Pango.doap
README
t/inc/PangoTestHelper.pm
t/Pango.t
t/PangoAttributes.t
t/PangoCairo.t
t/PangoContext.t
t/PangoFont.t
t/PangoFontMap.t
t/PangoFontset.t
t/PangoGravity.t
t/PangoLayout.t
t/PangoMatrix.t
t/PangoRenderer.t
t/PangoScript.t
t/PangoTabs.t
t/PangoTypes.t
xs/Pango.xs
xs/PangoAttributes.xs
xs/PangoCairo.xs
xs/PangoContext.xs
xs/PangoFont.xs
xs/PangoFontMap.xs
xs/PangoFontset.xs
xs/PangoGravity.xs
xs/PangoLayout.xs
xs/PangoMatrix.xs
xs/PangoRenderer.xs
xs/PangoScript.xs
xs/PangoTabs.xs
xs/PangoTypes.xs
xs_files-1.0
xs_files-1.10
xs_files-1.16
xs_files-1.6
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
Pango-1.227/MANIFEST.SKIP 000644 001750 000024 00000000122 11664366563 015575 0 ustar 00bdmanning staff 000000 000000 \.bak$
\.git
blib
build
^Makefile$
^Pango\.bs$
^pm_to_blib$
^xs/.*\.c$
^xs/.*\.o$
Pango-1.227/maps-1.0 000644 001750 000024 00000003566 11664366563 015075 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.0.x
#
PANGO_TYPE_ALIGNMENT PangoAlignment GEnum Pango::Alignment
PANGO_TYPE_ATTR_LIST PangoAttrList GBoxed Pango::AttrList
PANGO_TYPE_ATTR_TYPE PangoAttrType GEnum Pango::AttrType
PANGO_TYPE_COLOR PangoColor GBoxed Pango::Color
PANGO_TYPE_CONTEXT PangoContext GObject Pango::Context
PANGO_TYPE_COVERAGE_LEVEL PangoCoverageLevel GEnum Pango::CoverageLevel
PANGO_TYPE_DIRECTION PangoDirection GEnum Pango::Direction
PANGO_TYPE_FONT_DESCRIPTION PangoFontDescription GBoxed Pango::FontDescription
PANGO_TYPE_FONT_FACE PangoFontFace GObject Pango::FontFace
PANGO_TYPE_FONT_FAMILY PangoFontFamily GObject Pango::FontFamily
PANGO_TYPE_FONT_MAP PangoFontMap GObject Pango::FontMap
PANGO_TYPE_FONT_MASK PangoFontMask GFlags Pango::FontMask
PANGO_TYPE_FONT_METRICS PangoFontMetrics GBoxed Pango::FontMetrics
PANGO_TYPE_FONT PangoFont GObject Pango::Font
PANGO_TYPE_FONTSET PangoFontset GObject Pango::Fontset
PANGO_TYPE_GLYPH_STRING PangoGlyphString GBoxed Pango::GlyphString
PANGO_TYPE_LANGUAGE PangoLanguage GBoxed Pango::Language
PANGO_TYPE_LAYOUT PangoLayout GObject Pango::Layout
PANGO_TYPE_SCRIPT PangoScript GEnum Pango::Script
PANGO_TYPE_STRETCH PangoStretch GEnum Pango::Stretch
PANGO_TYPE_STYLE PangoStyle GEnum Pango::Style
PANGO_TYPE_TAB_ALIGN PangoTabAlign GEnum Pango::TabAlign
PANGO_TYPE_TAB_ARRAY PangoTabArray GBoxed Pango::TabArray
PANGO_TYPE_UNDERLINE PangoUnderline GEnum Pango::Underline
PANGO_TYPE_VARIANT PangoVariant GEnum Pango::Variant
PANGO_TYPE_WEIGHT PangoWeight GEnum Pango::Weight
PANGO_TYPE_WRAP_MODE PangoWrapMode GEnum Pango::WrapMode
# custom types
PANGO_TYPE_ATTRIBUTE PangoAttribute GBoxed Pango::Attribute
PANGO_TYPE_ATTR_ITERATOR PangoAttrIterator GBoxed Pango::AttrIterator
PANGO_TYPE_LAYOUT_ITER PangoLayoutIter GBoxed Pango::LayoutIter
PANGO_TYPE_LAYOUT_LINE PangoLayoutLine GBoxed Pango::LayoutLine
Pango-1.227/maps-1.10 000644 001750 000024 00000000233 11664366563 015142 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.10.x
#
PANGO_TYPE_CAIRO_FONT_MAP PangoCairoFontMap GInterface Pango::Cairo::FontMap
Pango-1.227/maps-1.16 000644 001750 000024 00000000306 11664366563 015151 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.16.x
#
PANGO_TYPE_GRAVITY PangoGravity GEnum Pango::Gravity
PANGO_TYPE_GRAVITY_HINT PangoGravityHint GEnum Pango::GravityHint
Pango-1.227/maps-1.18 000644 001750 000024 00000000221 11664366563 015147 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.18.x
#
PANGO_TYPE_CAIRO_FONT PangoCairoFont GInterface Pango::Cairo::Font
Pango-1.227/maps-1.4 000644 001750 000024 00000000215 11664366563 015065 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.4.x
#
PANGO_TYPE_SCRIPT_ITER PangoScriptIter GBoxed Pango::ScriptIter
Pango-1.227/maps-1.6 000644 001750 000024 00000000310 11664366563 015063 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.6.x
#
PANGO_TYPE_MATRIX PangoMatrix GBoxed Pango::Matrix
PANGO_TYPE_ELLIPSIZE_MODE PangoEllipsizeMode GEnum Pango::EllipsizeMode
Pango-1.227/maps-1.8 000644 001750 000024 00000000315 11664366563 015072 0 ustar 00bdmanning staff 000000 000000 #
# this file defines mappings only for types that existed in pango 1.8.x
#
PANGO_TYPE_RENDERER PangoRenderer GObject Pango::Renderer
PANGO_TYPE_RENDER_PART PangoRenderPart GEnum Pango::RenderPart
Pango-1.227/META.json 000644 001750 000024 00000004253 12651231244 015311 0 ustar 00bdmanning staff 000000 000000 {
"abstract" : "Layout and render international text",
"author" : [
"gtk2-perl Team "
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001",
"license" : [
"lgpl_2_1"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "Pango",
"no_index" : {
"directory" : [
"t",
"inc"
],
"file" : [
"xs/Pango.xs",
"xs/PangoAttributes.xs",
"xs/PangoContext.xs",
"xs/PangoFont.xs",
"xs/PangoFontset.xs",
"xs/PangoFontMap.xs",
"xs/PangoLayout.xs",
"xs/PangoRenderer.xs",
"xs/PangoScript.xs",
"xs/PangoTabs.xs",
"xs/PangoTypes.xs",
"xs/PangoCairo.xs",
"xs/PangoGravity.xs",
"xs/PangoMatrix.xs"
]
},
"prereqs" : {
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
"Cairo" : "1.000",
"ExtUtils::Depends" : "0.300",
"ExtUtils::MakeMaker" : "0",
"ExtUtils::PkgConfig" : "1.030",
"Glib" : "1.220"
}
},
"runtime" : {
"requires" : {
"Cairo" : "1.000",
"ExtUtils::Depends" : "0.300",
"ExtUtils::PkgConfig" : "1.030",
"Glib" : "1.220"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"mailto" : "bug-Pango [at] rt.cpan.org",
"web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Pango"
},
"homepage" : "http://gtk2-perl.sourceforge.net",
"license" : [
"http://www.gnu.org/licenses/lgpl-2.1.html"
],
"repository" : {
"type" : "git",
"url" : "git://git.gnome.org/perl-Pango",
"web" : "http://git.gnome.org/browse/perl-Pango"
},
"x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list",
"x_twitter" : "https://twitter.com/GTKPerl"
},
"version" : "1.227"
}
Pango-1.227/META.yml 000644 001750 000024 00000002514 12651231244 015137 0 ustar 00bdmanning staff 000000 000000 ---
abstract: 'Layout and render international text'
author:
- 'gtk2-perl Team '
build_requires:
ExtUtils::MakeMaker: '0'
configure_requires:
Cairo: '1.000'
ExtUtils::Depends: '0.300'
ExtUtils::MakeMaker: '0'
ExtUtils::PkgConfig: '1.030'
Glib: '1.220'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001'
license: lgpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Pango
no_index:
directory:
- t
- inc
file:
- xs/Pango.xs
- xs/PangoAttributes.xs
- xs/PangoContext.xs
- xs/PangoFont.xs
- xs/PangoFontset.xs
- xs/PangoFontMap.xs
- xs/PangoLayout.xs
- xs/PangoRenderer.xs
- xs/PangoScript.xs
- xs/PangoTabs.xs
- xs/PangoTypes.xs
- xs/PangoCairo.xs
- xs/PangoGravity.xs
- xs/PangoMatrix.xs
requires:
Cairo: '1.000'
ExtUtils::Depends: '0.300'
ExtUtils::PkgConfig: '1.030'
Glib: '1.220'
resources:
MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Twitter: https://twitter.com/GTKPerl
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Pango
homepage: http://gtk2-perl.sourceforge.net
license: http://www.gnu.org/licenses/lgpl-2.1.html
repository: git://git.gnome.org/perl-Pango
version: '1.227'
Pango-1.227/NEWS 000644 001750 000024 00000003527 12651231046 014372 0 ustar 00bdmanning staff 000000 000000 Overview of changes in Pango 1.227
==================================
* Ensure word separation in linker arguments with pkg-config >= 0.29
Overview of changes in Pango 1.226
==================================
* LICENSE: updated FSF address
* Update license terms, refer to main LICENSE file
* README: group project contact addresses/links together
* Makefile.PL: added Twitter URL to resources block
Overview of changes in Pango 1.225
==================================
* Fix bug report email address
Overview of changes in Pango 1.224
==================================
* Ignore MYMETA.*
* Hush a few compiler warnings
* Add gitweb link to old ChangeLog
* Created %meta_merge which follows v2 of CPAN Meta Spec
- %meta_merge is used for generating metadata via
ExtUtils::MakeMaker/CPAN::Meta
Overview of changes in Pango 1.223
==================================
* Fix a test failure in t/PangoCairo.t
Overview of changes in Pango 1.222
==================================
* Don't leak Pango::Attribute objects.
* Fix a few test failures.
Overview of changes in Pango 1.221
==================================
* Properly export all our public symbols so that linking against us works on
MSWin32. (GNOME #576373)
Overview of changes in Pango 1.220
==================================
Compared to the bindings in Gtk2 1.20x
--------------------------------------
* Wrap pango_layout_get_baseline.
* Allow passing undef to Gtk2::Pango::Layout::set_attributes().
Since 1.211
-----------
* Nada.
Overview of changes in Pango 1.211
==================================
* Wrap pango_layout_get_baseline.
* Allow passing undef to Gtk2::Pango::Layout::set_attributes().
Overview of changes in Pango 1.210
==================================
* Initial standalone release.
* Add an example demonstrating how to use Pango in conjunction with Cairo and
Gtk2.
Pango-1.227/pango-perl.h 000644 001750 000024 00000004451 12301027576 016110 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (C) 2003-2008, 2014 by the gtk2-perl team (see the file AUTHORS
* for the full list)
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#ifndef _PANGO_PERL_H_
#define _PANGO_PERL_H_
#include
#include
#include "pango-perl-versions.h"
#if PANGO_CHECK_VERSION (1, 10, 0)
# include
#endif
/* custom GType for PangoAttribute */
#ifndef PANGO_TYPE_ATTRIBUTE
# define PANGO_TYPE_ATTRIBUTE (gtk2perl_pango_attribute_get_type ())
GType gtk2perl_pango_attribute_get_type (void) G_GNUC_CONST;
#endif
/* custom GType for PangoAttrIter */
#ifndef PANGO_TYPE_ATTR_ITERATOR
# define PANGO_TYPE_ATTR_ITERATOR (gtk2perl_pango_attr_iterator_get_type ())
GType gtk2perl_pango_attr_iterator_get_type (void) G_GNUC_CONST;
#endif
/* custom GType for PangoLayoutIter */
#ifndef PANGO_TYPE_LAYOUT_ITER
# define PANGO_TYPE_LAYOUT_ITER (gtk2perl_pango_layout_iter_get_type ())
GType gtk2perl_pango_layout_iter_get_type (void) G_GNUC_CONST;
#endif
/* custom GType for PangoLayoutLine */
#ifndef PANGO_TYPE_LAYOUT_LINE
# define PANGO_TYPE_LAYOUT_LINE (gtk2perl_pango_layout_line_get_type ())
GType gtk2perl_pango_layout_line_get_type (void) G_GNUC_CONST;
#endif
/* custom GType for PangoScriptIter */
#if PANGO_CHECK_VERSION (1, 4, 0)
# ifndef PANGO_TYPE_SCRIPT_ITER
# define PANGO_TYPE_SCRIPT_ITER (gtk2perl_pango_script_iter_get_type ())
GType gtk2perl_pango_script_iter_get_type (void) G_GNUC_CONST;
# endif
#endif
#include "pango-perl-autogen.h"
/* exported for various other parts of pango */
SV * newSVPangoRectangle (PangoRectangle * rectangle);
PangoRectangle * SvPangoRectangle (SV * sv);
/* for registering custom attribute types */
void gtk2perl_pango_attribute_register_custom_type (PangoAttrType type, const char *package);
#endif /* _PANGO_PERL_H_ */
Pango-1.227/pango.exports 000644 001750 000024 00000000407 11664366563 016437 0 ustar 00bdmanning staff 000000 000000 newSVPangoRectangle
SvPangoRectangle
gtk2perl_pango_attribute_get_type
gtk2perl_pango_attribute_register_custom_type
gtk2perl_pango_attr_iterator_get_type
gtk2perl_pango_layout_iter_get_type
gtk2perl_pango_layout_line_get_type
gtk2perl_pango_script_iter_get_type
Pango-1.227/pango.typemap 000644 001750 000024 00000000316 11664366563 016411 0 ustar 00bdmanning staff 000000 000000 #
# Copyright (C) 2004 by the gtk2-perl team (see the file AUTHORS)
#
# Licensed under the LGPL, see LICENSE file for more information.
#
TYPEMAP
PangoGlyph T_UV
PangoRectangle * T_GPERL_GENERIC_WRAPPER
Pango-1.227/perl-Pango.doap 000644 001750 000024 00000001410 11664366563 016551 0 ustar 00bdmanning staff 000000 000000
Pango
Layout and render international text
Torsten Schönfeld
tsch
Pango-1.227/README 000644 001750 000024 00000010131 12301027576 014543 0 ustar 00bdmanning staff 000000 000000 Pango
=====
Pango is a library for laying out and rendering text, with an emphasis on
internationalization. Pango can be used anywhere that text layout is needed,
but using Pango in conjunction with L and/or L provides a complete
solution with high quality text handling and graphics rendering.
INSTALLATION
------------
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
------------
This module requires these other modules and libraries:
perl >= 5.8.0
Glib >= 1.220 (Perl module)
pango >= 1.x (C library)
If pango is as new or newer as 1.10, the Cairo module is also required:
Cairo >= 1.000 (Perl module)
In order to build it from source, you'll also need
ExtUtils::Depends >= 0.300
ExtUtils::PkgConfig >= 1.030
HOW TO CONTACT US
-----------------
Homepage: http://gtk2-perl.sourceforge.net/
Mailing list: gtk-perl-list [at] gnome.org
Mailing list archives: https://mail.gnome.org/archives/gtk-perl-list/
IRC: irc://irc.gnome.org/#gtk-perl
E-mail bug submission via CPAN's RT:
bug-Pango [at] rt.cpan.org
Web bug submission via gnome.org's bugzilla:
http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-perl
Please do not contact any of the maintainers directly unless they ask you to.
The first point of contact for questions/problems/issues should always be the
mailing list.
BUG REPORTS
-----------
For help with problems, please contact the mailing list (above). If you
already know you have a bug, please file it with one of the bug trackers
below. With any problems and/or bug reports, it's always helpful for the
developers to have the following information:
- A small script that demonstrates the problem; this is not required, however,
it will get your issue looked at much faster than a description of the
problem alone.
- Version of Perl (perl -v)
- Versions of Gtk2-Perl modules (Glib/Gtk2/Pango/Cairo)
- Optional, but nice to have: versions of GTK+ libraries on your system
(libglib, libgtk+, libpango, libcairo, etc.)
There are multiple project bug trackers, please choose the one you are most
comfortable with using and/or already have an account for.
Request Tracker:
- submitting bugs via the Web (requires a PAUSE account/Bitcard):
https://rt.cpan.org/Public/Bug/Report.html?Queue=Pango
- submitting bugs via e-mail (open to anyone with e-mail):
bug-Pango [at] rt.cpan.org
Gnome's bugtracker:
- report bugs to the 'gnome-perl' product (requires login)
http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-perl
PATCH SUBMISSION GUIDELINES
---------------------------
You can send us patches by...
- E-mailing it to the mailing list (above); please use a pastebin service of
some kind for longer patchfiles (over say 20k in size).
- Those with gnome.org Git ID's can push trivial patches to git directly; if
you're not sure what a trivial patch is, please ask first on the mailing
list prior to pushing your commit.
OBTAINING SOURCE FROM THE GNOME.ORG GIT REPO
--------------------------------------------
Assuming you already have the 'git' command installed on your system, you can
use the 'git://' protocol:
git clone git://git.gnome.org/perl-Pango
Or, read-only access via HTTP:
git clone http://git.gnome.org/browse/perl-Pango
To update an existing clone of the source:
git pull
Most Linux distros package the 'git' command in a package called either 'git'
or 'git-core'.
COPYRIGHT AND LICENSE
---------------------
Copyright (C) 2003-2014, by the gtk2-perl team (see the file AUTHORS
for the full list)
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for the
full license terms.
Pango-1.227/t/ 000755 001750 000024 00000000000 12651231244 014127 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/xs/ 000755 001750 000024 00000000000 12651231244 014316 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/xs_files-1.0 000644 001750 000024 00000000304 11664366563 015734 0 ustar 00bdmanning staff 000000 000000 xs/Pango.xs
xs/PangoAttributes.xs
xs/PangoContext.xs
xs/PangoFont.xs
xs/PangoFontset.xs
xs/PangoFontMap.xs
xs/PangoLayout.xs
xs/PangoRenderer.xs
xs/PangoScript.xs
xs/PangoTabs.xs
xs/PangoTypes.xs
Pango-1.227/xs_files-1.10 000644 001750 000024 00000000021 11664366563 016011 0 ustar 00bdmanning staff 000000 000000 xs/PangoCairo.xs
Pango-1.227/xs_files-1.16 000644 001750 000024 00000000023 11664366563 016021 0 ustar 00bdmanning staff 000000 000000 xs/PangoGravity.xs
Pango-1.227/xs_files-1.6 000644 001750 000024 00000000022 11664366563 015737 0 ustar 00bdmanning staff 000000 000000 xs/PangoMatrix.xs
Pango-1.227/xs/Pango.xs 000644 001750 000024 00000002741 12301027576 015745 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2008, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango PACKAGE = Pango PREFIX = PANGO_
BOOT:
#include "register.xsh"
#include "boot.xsh"
gperl_handle_logs_for ("Pango");
# Don't doc these in Pango, or we'll clobber the main POD page!
=for object Pango::version
=cut
=for see_also L
=cut
=for see_also L
=cut
=for apidoc
=for signature (MAJOR, MINOR, MICRO) = Pango->GET_VERSION_INFO
Fetch as a list the version of pango with which the Perl module was built.
=cut
void
GET_VERSION_INFO (class)
PPCODE:
EXTEND (SP, 3);
PUSHs (sv_2mortal (newSViv (PANGO_MAJOR_VERSION)));
PUSHs (sv_2mortal (newSViv (PANGO_MINOR_VERSION)));
PUSHs (sv_2mortal (newSViv (PANGO_MICRO_VERSION)));
PERL_UNUSED_VAR (ax);
bool
PANGO_CHECK_VERSION (class, int major, int minor, int micro)
C_ARGS:
major, minor, micro
Pango-1.227/xs/PangoAttributes.xs 000644 001750 000024 00000075045 12301027576 020023 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2005-2006, 2013-2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
#define PANGO_PERL_ATTR_STORE_INDICES(offset, attr) \
if (items == offset + 2) { \
guint start = SvUV (ST (offset)); \
guint end = SvUV (ST (offset + 1)); \
attr->start_index = start; \
attr->end_index = end; \
}
/* ------------------------------------------------------------------------- */
static GPerlBoxedWrapperClass pango_color_wrapper_class;
static SV *
pango_color_wrap (GType gtype,
const char * package,
gpointer boxed,
gboolean own)
{
PangoColor *color = boxed;
AV *av;
PERL_UNUSED_VAR (gtype);
PERL_UNUSED_VAR (package);
if (!color)
return &PL_sv_undef;
av = newAV ();
av_push (av, newSVuv (color->red));
av_push (av, newSVuv (color->green));
av_push (av, newSVuv (color->blue));
if (own)
pango_color_free (color);
return sv_bless (newRV_noinc ((SV *) av),
gv_stashpv ("Pango::Color", TRUE));
}
/* This uses gperl_alloc_temp so make sure you don't hold on to pointers
* returned by SvPangoColor for too long. */
static gpointer
pango_color_unwrap (GType gtype,
const char * package,
SV * sv)
{
PangoColor *color;
AV * av;
SV ** v;
PERL_UNUSED_VAR (gtype);
PERL_UNUSED_VAR (package);
if (!gperl_sv_is_defined (sv))
return NULL;
if (!gperl_sv_is_array_ref (sv))
croak ("a PangoColor must be an array reference with three values: "
"red, green, and blue");
color = gperl_alloc_temp (sizeof (PangoColor));
av = (AV *) SvRV (sv);
v = av_fetch (av, 0, 0);
if (v && gperl_sv_is_defined (*v))
color->red = SvUV (*v);
v = av_fetch (av, 1, 0);
if (v && gperl_sv_is_defined (*v))
color->green = SvUV (*v);
v = av_fetch (av, 2, 0);
if (v && gperl_sv_is_defined (*v))
color->blue = SvUV (*v);
return color;
}
static void
pango_color_destroy (SV * sv)
{
/* We allocated nothing in wrap, so do nothing here. */
PERL_UNUSED_VAR (sv);
}
/* ------------------------------------------------------------------------- */
GType
gtk2perl_pango_attribute_get_type (void)
{
static GType t = 0;
if (!t)
t = g_boxed_type_register_static ("PangoAttribute",
(GBoxedCopyFunc) pango_attribute_copy,
(GBoxedFreeFunc) pango_attribute_destroy);
return t;
}
static GHashTable *gtk2perl_pango_attribute_table = NULL;
/* Exported for Gtk2/xs/GdkPango.xs. */
void
gtk2perl_pango_attribute_register_custom_type (PangoAttrType type,
const char *package)
{
if (!gtk2perl_pango_attribute_table)
gtk2perl_pango_attribute_table =
g_hash_table_new (g_direct_hash, g_direct_equal);
g_hash_table_insert (gtk2perl_pango_attribute_table,
GINT_TO_POINTER (type), (gpointer) package);
}
static const char *
gtk2perl_pango_attribute_lookup_custom_type (PangoAttrType type)
{
return g_hash_table_lookup (gtk2perl_pango_attribute_table,
GINT_TO_POINTER (type));
}
static const char *
gtk2perl_pango_attribute_get_package (PangoAttribute * attr)
{
/* the interface is designed to allow extensibility by registering
* new PangoAttrType values, but pango doesn't allow us to query
* those. but we have hacks in place, so we can try anyway. */
switch (attr->klass->type) {
case PANGO_ATTR_INVALID:
croak ("invalid PangoAttribute encountered; should not happen");
return NULL;
case PANGO_ATTR_LANGUAGE:
return "Pango::AttrLanguage";
case PANGO_ATTR_FAMILY:
return "Pango::AttrFamily";
case PANGO_ATTR_STYLE:
return "Pango::AttrStyle";
case PANGO_ATTR_WEIGHT:
return "Pango::AttrWeight";
case PANGO_ATTR_VARIANT:
return "Pango::AttrVariant";
case PANGO_ATTR_STRETCH:
return "Pango::AttrStretch";
case PANGO_ATTR_SIZE:
#if PANGO_CHECK_VERSION (1, 8, 0)
case PANGO_ATTR_ABSOLUTE_SIZE:
#endif
return "Pango::AttrSize";
case PANGO_ATTR_FONT_DESC:
return "Pango::AttrFontDesc";
case PANGO_ATTR_FOREGROUND:
return "Pango::AttrForeground";
case PANGO_ATTR_BACKGROUND:
return "Pango::AttrBackground";
case PANGO_ATTR_UNDERLINE:
return "Pango::AttrUnderline";
case PANGO_ATTR_STRIKETHROUGH:
return "Pango::AttrStrikethrough";
case PANGO_ATTR_RISE:
return "Pango::AttrRise";
case PANGO_ATTR_SHAPE:
return "Pango::AttrShape";
case PANGO_ATTR_SCALE:
return "Pango::AttrScale";
#if PANGO_CHECK_VERSION (1, 4, 0)
case PANGO_ATTR_FALLBACK:
return "Pango::AttrFallback";
#endif
#if PANGO_CHECK_VERSION (1, 6, 0)
case PANGO_ATTR_LETTER_SPACING:
return "Pango::AttrLetterSpacing";
#endif
#if PANGO_CHECK_VERSION (1, 8, 0)
case PANGO_ATTR_UNDERLINE_COLOR:
return "Pango::AttrUnderlineColor";
case PANGO_ATTR_STRIKETHROUGH_COLOR:
return "Pango::AttrStrikethroughColor";
#endif
#if PANGO_CHECK_VERSION (1, 16, 0)
case PANGO_ATTR_GRAVITY:
return "Pango::AttrGravity";
case PANGO_ATTR_GRAVITY_HINT:
return "Pango::AttrGravityHint";
#endif
default:
{
const char *package =
gtk2perl_pango_attribute_lookup_custom_type
(attr->klass->type);
if (package)
return package;
return "Pango::Attribute";
}
}
}
static GPerlBoxedWrapperClass gtk2perl_pango_attribute_wrapper_class;
static GPerlBoxedWrapperClass * default_wrapper_class;
static SV *
gtk2perl_pango_attribute_wrap (GType gtype,
const char * package,
gpointer boxed,
gboolean own)
{
PangoAttribute * attr = boxed;
HV * stash;
SV * sv;
sv = default_wrapper_class->wrap (gtype, package, boxed, own);
/* Override the default package */
package = gtk2perl_pango_attribute_get_package (attr);
stash = gv_stashpv (package, TRUE);
return sv_bless (sv, stash);
}
static gpointer
gtk2perl_pango_attribute_unwrap (GType gtype,
const char * package,
SV * sv)
{
PangoAttribute * attr = default_wrapper_class->unwrap (gtype, package, sv);
/* Override the default package */
package = gtk2perl_pango_attribute_get_package (attr);
if (!sv_derived_from (sv, package))
croak ("%s is not of type %s",
gperl_format_variable_for_output (sv),
package);
return attr;
}
/* ------------------------------------------------------------------------- */
GType
gtk2perl_pango_attr_iterator_get_type (void)
{
static GType t = 0;
if (!t)
t = g_boxed_type_register_static ("PangoAttrIterator",
(GBoxedCopyFunc) pango_attr_iterator_copy,
(GBoxedFreeFunc) pango_attr_iterator_destroy);
return t;
}
/* ------------------------------------------------------------------------- */
#if PANGO_CHECK_VERSION (1, 2, 0)
static GPerlCallback *
gtk2perl_pango_attr_filter_func_create (SV * func, SV * data)
{
GType param_types [1];
param_types[0] = PANGO_TYPE_ATTRIBUTE;
return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
param_types, G_TYPE_BOOLEAN);
}
static gboolean
gtk2perl_pango_attr_filter_func (PangoAttribute *attribute,
gpointer data)
{
GPerlCallback * callback = (GPerlCallback*)data;
GValue value = {0,};
gboolean retval;
g_value_init (&value, callback->return_type);
gperl_callback_invoke (callback, &value, attribute);
retval = g_value_get_boolean (&value);
g_value_unset (&value);
return retval;
}
#endif
/* ------------------------------------------------------------------------- */
MODULE = Pango::Attributes PACKAGE = Pango::Color PREFIX = pango_color_
BOOT:
PERL_UNUSED_VAR (file);
pango_color_wrapper_class.wrap = pango_color_wrap;
pango_color_wrapper_class.unwrap = pango_color_unwrap;
pango_color_wrapper_class.destroy = pango_color_destroy;
gperl_register_boxed (PANGO_TYPE_COLOR, "Pango::Color",
&pango_color_wrapper_class);
##gboolean pango_color_parse (PangoColor *color, const char *spec);
PangoColor *
pango_color_parse (class, const gchar * spec)
PREINIT:
PangoColor color;
CODE:
if (! pango_color_parse (&color, spec))
XSRETURN_UNDEF;
RETVAL = &color;
OUTPUT:
RETVAL
#if PANGO_CHECK_VERSION (1, 16, 0)
=for apidoc
=for signature string = $color->to_string
=cut
##gchar *pango_color_to_string(const PangoColor *color);
gchar_own *
pango_color_to_string (...)
CODE:
if (items == 1)
RETVAL = pango_color_to_string (SvPangoColor (ST (0)));
else if (items == 2)
RETVAL = pango_color_to_string (SvPangoColor (ST (1)));
else
croak ("Usage: Pango::Color::to_string($color)");
OUTPUT:
RETVAL
#endif
# --------------------------------------------------------------------------- #
# First, the base class of all attributes
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::Attribute PREFIX = pango_attribute_
BOOT:
default_wrapper_class = gperl_default_boxed_wrapper_class ();
gtk2perl_pango_attribute_wrapper_class = * default_wrapper_class;
gtk2perl_pango_attribute_wrapper_class.wrap = gtk2perl_pango_attribute_wrap;
gtk2perl_pango_attribute_wrapper_class.unwrap = gtk2perl_pango_attribute_unwrap;
gperl_register_boxed (PANGO_TYPE_ATTRIBUTE, "Pango::Attribute",
>k2perl_pango_attribute_wrapper_class);
guint
start_index (PangoAttribute * attr, ...)
ALIAS:
end_index = 1
CODE:
RETVAL = ix == 0 ? attr->start_index : attr->end_index;
if (items > 1) {
guint new_index = SvIV (ST (1));
if (ix == 0)
attr->start_index = new_index;
else
attr->end_index = new_index;
}
OUTPUT:
RETVAL
gboolean pango_attribute_equal (PangoAttribute * attr1, PangoAttribute * attr2);
# --------------------------------------------------------------------------- #
# Then, a few abstract base classes
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrString
BOOT:
gperl_set_isa ("Pango::AttrString", "Pango::Attribute");
gchar_own *
value (PangoAttribute * attr, ...)
CODE:
RETVAL = g_strdup (((PangoAttrString*)attr)->value);
if (items > 1) {
/* this feels evil... */
if (((PangoAttrString*)attr)->value)
g_free (((PangoAttrString*)attr)->value);
((PangoAttrString*)attr)->value = g_strdup (SvGChar (ST (1)));
}
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrInt
BOOT:
gperl_set_isa ("Pango::AttrInt", "Pango::Attribute");
int
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*)attr)->value;
if (items > 1)
((PangoAttrInt*)attr)->value = SvIV (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrColor
BOOT:
gperl_set_isa ("Pango::AttrColor", "Pango::Attribute");
##
## the PangoAttrColor holds an actual color, not a pointer...
## how can we make it editable from perl? you can replace it,
## but you get a copy back and editing it does nothing...
##
PangoColor *
value (PangoAttribute * attr, ...)
PREINIT:
PangoColor copy;
CODE:
copy = ((PangoAttrColor*)attr)->color;
RETVAL = ©
if (items > 1) {
PangoColor * color = SvPangoColor (ST (1));
((PangoAttrColor*)attr)->color = *color;
}
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
# And finally, the special-purpose attributes
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrLanguage PREFIX = pango_attr_language_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrLanguage");
gperl_set_isa ("Pango::AttrLanguage", "Pango::Attribute");
=for apidoc
C doesn't take a reference and doesn't copy the
C object, but demands its validity nonetheless. So make
sure the language object stays alive at least as long as the attribute.
=cut
PangoAttribute_own * pango_attr_language_new (class, PangoLanguage *language, ...);
C_ARGS:
language
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoLanguage *
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrLanguage*)attr)->value;
if (items > 1) {
/* from the pango source, this is all we need to do. */
((PangoAttrLanguage*)attr)->value = SvPangoLanguage (ST (1));
}
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrFamily PREFIX = pango_attr_family_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrFamily");
gperl_set_isa ("Pango::AttrFamily", "Pango::AttrString");
PangoAttribute_own * pango_attr_family_new (class, const char *family, ...);
C_ARGS:
family
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrForeground PREFIX = pango_attr_foreground_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrForeground");
gperl_set_isa ("Pango::AttrForeground", "Pango::AttrColor");
PangoAttribute_own * pango_attr_foreground_new (class, guint16 red, guint green, guint16 blue, ...);
C_ARGS:
red, green, blue
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (4, RETVAL);
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrBackground PREFIX = pango_attr_background_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrBackground");
gperl_set_isa ("Pango::AttrBackground", "Pango::AttrColor");
PangoAttribute_own * pango_attr_background_new (class, guint16 red, guint green, guint16 blue, ...);
C_ARGS:
red, green, blue
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (4, RETVAL);
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrSize PREFIX = pango_attr_size_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrSize");
gperl_set_isa ("Pango::AttrSize", "Pango::AttrInt");
PangoAttribute_own * pango_attr_size_new (class, int size, ...)
C_ARGS:
size
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
#if PANGO_CHECK_VERSION (1, 8, 0)
PangoAttribute_own * pango_attr_size_new_absolute (class, int size, ...)
C_ARGS:
size
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
#endif
# Later versions of pango use PangoAttrSize rather than PangoAttrInt, but
# they're compatible with respect to the value field. So we can safely use the
# value accessor of Pango::AttrInt.
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrStyle PREFIX = pango_attr_style_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrStyle");
gperl_set_isa ("Pango::AttrStyle", "Pango::Attribute");
PangoAttribute_own * pango_attr_style_new (class, PangoStyle style, ...)
C_ARGS:
style
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoStyle
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvPangoStyle (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrWeight PREFIX = pango_attr_weight_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrWeight");
gperl_set_isa ("Pango::AttrWeight", "Pango::Attribute");
PangoAttribute_own * pango_attr_weight_new (class, PangoWeight weight, ...);
C_ARGS:
weight
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoWeight
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvPangoWeight (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrVariant PREFIX = pango_attr_variant_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrVariant");
gperl_set_isa ("Pango::AttrVariant", "Pango::Attribute");
PangoAttribute_own * pango_attr_variant_new (class, PangoVariant variant, ...)
C_ARGS:
variant
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoVariant
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvPangoVariant (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrStretch PREFIX = pango_attr_stretch_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrStretch");
gperl_set_isa ("Pango::AttrStretch", "Pango::Attribute");
PangoAttribute_own * pango_attr_stretch_new (class, PangoStretch stretch, ...)
C_ARGS:
stretch
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoStretch
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvPangoStretch (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrUnderline PREFIX = pango_attr_underline_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrUnderline");
gperl_set_isa ("Pango::AttrUnderline", "Pango::Attribute");
PangoAttribute_own * pango_attr_underline_new (class, PangoUnderline underline, ...)
C_ARGS:
underline
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoUnderline
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvPangoUnderline (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrStrikethrough PREFIX = pango_attr_strikethrough_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrStrikethrough");
gperl_set_isa ("Pango::AttrStrikethrough", "Pango::Attribute");
PangoAttribute_own * pango_attr_strikethrough_new (class, gboolean strikethrough, ...)
C_ARGS:
strikethrough
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
gboolean
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvTRUE (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrFontDesc PREFIX = pango_attr_font_desc_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrFontDesc");
gperl_set_isa ("Pango::AttrFontDesc", "Pango::Attribute");
PangoAttribute_own * pango_attr_font_desc_new (class, PangoFontDescription * font_desc, ...)
C_ARGS:
font_desc
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoFontDescription_own *
desc (PangoAttribute * attr, ...)
CODE:
RETVAL = pango_font_description_copy (((PangoAttrFontDesc*) attr)->desc);
if (items > 1) {
if (((PangoAttrFontDesc*) attr)->desc)
pango_font_description_free (((PangoAttrFontDesc*) attr)->desc);
((PangoAttrFontDesc*) attr)->desc =
pango_font_description_copy (SvPangoFontDescription (ST (1)));
}
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrScale PREFIX = pango_attr_scale_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrScale");
gperl_set_isa ("Pango::AttrScale", "Pango::Attribute");
PangoAttribute_own * pango_attr_scale_new (class, float scale, ...)
C_ARGS:
scale
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
double
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrFloat*) attr)->value;
if (items > 1)
((PangoAttrFloat*) attr)->value = SvNV (ST (1));
OUTPUT:
RETVAL
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrRise PREFIX = pango_attr_rise_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrRise");
gperl_set_isa ("Pango::AttrRise", "Pango::AttrInt");
PangoAttribute_own * pango_attr_rise_new (class, int rise, ...)
C_ARGS:
rise
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrShape PREFIX = pango_attr_shape_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrShape");
gperl_set_isa ("Pango::AttrShape", "Pango::Attribute");
PangoAttribute_own * pango_attr_shape_new (class, PangoRectangle *ink_rect, PangoRectangle *logical_rect, ...)
C_ARGS:
ink_rect, logical_rect
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (3, RETVAL);
PangoRectangle *
ink_rect (PangoAttribute * attr, ...)
ALIAS:
logical_rect = 1
PREINIT:
PangoAttrShape * attrshape;
CODE:
attrshape = (PangoAttrShape *) attr;
RETVAL = ix == 0 ? &(attrshape->ink_rect) : &(attrshape->logical_rect);
if (items > 1) {
PangoRectangle * rect = SvPangoRectangle (ST (1));
if (ix == 0)
attrshape->ink_rect = *rect;
else
attrshape->logical_rect = *rect;
}
OUTPUT:
RETVAL
# FIXME: Needed?
# PangoAttribute * pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, const PangoRectangle *logical_rect, gpointer data, PangoAttrDataCopyFunc copy_func, GDestroyNotify destroy_func)
# --------------------------------------------------------------------------- #
#if PANGO_CHECK_VERSION (1, 4, 0)
MODULE = Pango::Attributes PACKAGE = Pango::AttrFallback PREFIX = pango_attr_fallback_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrFallback");
gperl_set_isa ("Pango::AttrFallback", "Pango::Attribute");
PangoAttribute_own * pango_attr_fallback_new (class, gboolean enable_fallback, ...)
C_ARGS:
enable_fallback
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
gboolean
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*) attr)->value;
if (items > 1)
((PangoAttrInt*) attr)->value = SvTRUE (ST (1));
OUTPUT:
RETVAL
#endif
# --------------------------------------------------------------------------- #
#if PANGO_CHECK_VERSION (1, 6, 0)
MODULE = Pango::Attributes PACKAGE = Pango::AttrLetterSpacing PREFIX = pango_attr_letter_spacing_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrLetterSpacing");
gperl_set_isa ("Pango::AttrLetterSpacing", "Pango::AttrInt");
PangoAttribute_own * pango_attr_letter_spacing_new (class, int letter_spacing, ...)
C_ARGS:
letter_spacing
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
#endif
# --------------------------------------------------------------------------- #
#if PANGO_CHECK_VERSION (1, 8, 0)
MODULE = Pango::Attributes PACKAGE = Pango::AttrUnderlineColor PREFIX = pango_attr_underline_color_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrUnderlineColor");
gperl_set_isa ("Pango::AttrUnderlineColor", "Pango::AttrColor");
PangoAttribute_own * pango_attr_underline_color_new (class, guint16 red, guint16 green, guint16 blue, ...)
C_ARGS:
red, green, blue
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (4, RETVAL);
#endif
# --------------------------------------------------------------------------- #
#if PANGO_CHECK_VERSION (1, 8, 0)
MODULE = Pango::Attributes PACKAGE = Pango::AttrStrikethroughColor PREFIX = pango_attr_strikethrough_color_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrStrikethroughColor");
gperl_set_isa ("Pango::AttrStrikethroughColor", "Pango::AttrColor");
PangoAttribute_own * pango_attr_strikethrough_color_new (class, guint16 red, guint16 green, guint16 blue, ...)
C_ARGS:
red, green, blue
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (4, RETVAL);
#endif
# --------------------------------------------------------------------------- #
#if PANGO_CHECK_VERSION (1, 16, 0)
MODULE = Pango::Attributes PACKAGE = Pango::AttrGravity PREFIX = pango_attr_gravity_
BOOT:
gperl_register_boxed_alias (PANGO_TYPE_ATTRIBUTE, "Pango::AttrGravity");
gperl_set_isa ("Pango::AttrGravity", "Pango::Attribute");
PangoAttribute_own * pango_attr_gravity_new (class, PangoGravity gravity, ...)
C_ARGS:
gravity
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoGravity
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*)attr)->value;
if (items > 1)
((PangoAttrInt*)attr)->value = SvPangoGravity (ST (1));
OUTPUT:
RETVAL
MODULE = Pango::Attributes PACKAGE = Pango::AttrGravityHint PREFIX = pango_attr_gravity_hint_
BOOT:
gperl_set_isa ("Pango::AttrGravityHint", "Pango::Attribute");
PangoAttribute_own * pango_attr_gravity_hint_new (class, PangoGravityHint hint, ...)
C_ARGS:
hint
POSTCALL:
PANGO_PERL_ATTR_STORE_INDICES (2, RETVAL);
PangoGravityHint
value (PangoAttribute * attr, ...)
CODE:
RETVAL = ((PangoAttrInt*)attr)->value;
if (items > 1)
((PangoAttrInt*)attr)->value = SvPangoGravityHint (ST (1));
OUTPUT:
RETVAL
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrList PREFIX = pango_attr_list_
=for position DESCRIPTION
=head1 DESCRIPTION
Pango::AttrList is a collection of Pango::Attributes. These
attributes annotate text with styles.
=cut
PangoAttrList_own * pango_attr_list_new (class)
C_ARGS:
/*void*/
# The various insert functions assume ownership of the attribute, so we have to
# hand them a copy.
void pango_attr_list_insert (PangoAttrList *list, PangoAttribute *attr)
C_ARGS:
list, pango_attribute_copy (attr)
void pango_attr_list_insert_before (PangoAttrList *list, PangoAttribute *attr)
C_ARGS:
list, pango_attribute_copy (attr)
void pango_attr_list_change (PangoAttrList *list, PangoAttribute *attr)
C_ARGS:
list, pango_attribute_copy (attr)
void pango_attr_list_splice (PangoAttrList *list, PangoAttrList *other, gint pos, gint len);
#if PANGO_CHECK_VERSION (1, 2, 0)
##PangoAttrList *pango_attr_list_filter (PangoAttrList *list, PangoAttrFilterFunc func, gpointer data);
PangoAttrList_own_ornull *
pango_attr_list_filter (PangoAttrList *list, SV *func, SV *data = NULL)
PREINIT:
GPerlCallback *callback;
CODE:
callback = gtk2perl_pango_attr_filter_func_create (func, data);
RETVAL = pango_attr_list_filter (
list, gtk2perl_pango_attr_filter_func, callback);
gperl_callback_destroy (callback);
OUTPUT:
RETVAL
#endif
PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list);
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango::AttrIterator PREFIX = pango_attr_iterator_
void pango_attr_iterator_range (PangoAttrIterator *iterator, OUTLIST gint start, OUTLIST gint end);
gboolean pango_attr_iterator_next (PangoAttrIterator *iterator);
PangoAttribute_ornull *pango_attr_iterator_get (PangoAttrIterator *iterator, PangoAttrType type);
##void pango_attr_iterator_get_font (PangoAttrIterator *iterator, PangoFontDescription *desc, PangoLanguage **language, GSList **extra_attrs);
=for apidoc
=for signature ($desc, $lang, $extra_attrs) = $iterator->get_font
=cut
void
pango_attr_iterator_get_font (PangoAttrIterator *iterator)
PREINIT:
PangoFontDescription *desc;
PangoLanguage *language;
GSList *extra_attrs, *i;
PPCODE:
desc = pango_font_description_new ();
language = NULL;
extra_attrs = NULL;
pango_attr_iterator_get_font (iterator, desc, &language, &extra_attrs);
XPUSHs (sv_2mortal (newSVPangoFontDescription_copy (desc)));
XPUSHs (sv_2mortal (newSVPangoLanguage_ornull (language)));
for (i = extra_attrs; i != NULL; i = i->next)
XPUSHs (sv_2mortal (newSVPangoAttribute_own (i->data)));
if (extra_attrs)
g_slist_free (extra_attrs);
#if PANGO_CHECK_VERSION (1, 2, 0)
##GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator);
void
pango_attr_iterator_get_attrs (PangoAttrIterator *iterator)
PREINIT:
GSList *result, *i;
PPCODE:
result = pango_attr_iterator_get_attrs (iterator);
for (i = result; i != NULL; i = i->next)
XPUSHs (sv_2mortal (newSVPangoAttribute_own (i->data)));
g_slist_free (result);
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Attributes PACKAGE = Pango PREFIX = pango_
# don't clobber the pod for Pango!
=for object Pango::AttrList
=cut
##gboolean pango_parse_markup (const char *markup_text,
## int length,
## gunichar accel_marker,
## PangoAttrList **attr_list,
## char **text,
## gunichar *accel_char,
## GError **error);
##
=for apidoc __gerror__
=for signature ($attr_list, $text, $accel_char) = Pango->parse_markup ($markup_text, $accel_marker)
Parses marked-up text to create a plaintext string and an attribute list.
If I<$accel_marker> is supplied and nonzero, the given character will mark the
character following it as an accelerator. For example, the accel marker might
be an ampersand or underscore. All characters marked as an acclerator will
receive a PANGO_UNDERLINE_LOW attribute, and the first character so marked will
be returned in I<$accel_char>. Two I<$accel_marker> characters following each
other reduce to a single literal I<$accel_marker> character.
=cut
void
pango_parse_markup (class, const gchar_length * markup_text, int length(markup_text), gunichar accel_marker=0)
PREINIT:
PangoAttrList * attr_list;
char * text;
gunichar accel_char;
GError * error = NULL;
PPCODE:
if (! pango_parse_markup (markup_text, XSauto_length_of_markup_text,
accel_marker, &attr_list, &text,
&accel_char, &error))
gperl_croak_gerror (NULL, error);
EXTEND (SP, 3);
PUSHs (sv_2mortal (newSVPangoAttrList (attr_list)));
PUSHs (sv_2mortal (newSVGChar (text)));
g_free (text);
if (accel_char) {
/* adapted from Glib/typemap */
gchar temp[6];
gint length = g_unichar_to_utf8 (accel_char, temp);
PUSHs (sv_2mortal (newSVpv (temp, length)));
SvUTF8_on (ST (2));
}
Pango-1.227/xs/PangoCairo.xs 000644 001750 000024 00000015303 12301027576 016721 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2005, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
#include
#include
/* ------------------------------------------------------------------------- */
#if PANGO_CHECK_VERSION (1, 17, 0)
static void
gtk2perl_pango_cairo_shape_renderer_func (cairo_t *cr,
PangoAttrShape *attr,
gboolean do_path,
gpointer data)
{
GPerlCallback *callback = (GPerlCallback *) data;
dGPERL_CALLBACK_MARSHAL_SP;
GPERL_CALLBACK_MARSHAL_INIT (callback);
ENTER;
SAVETMPS;
PUSHMARK (SP);
EXTEND (SP, 3);
PUSHs (sv_2mortal (newSVCairo (cr)));
PUSHs (sv_2mortal (newSVPangoAttribute (attr)));
PUSHs (sv_2mortal (newSVuv (do_path)));
if (callback->data)
XPUSHs (sv_2mortal (newSVsv (callback->data)));
PUTBACK;
call_sv (callback->func, G_DISCARD);
FREETMPS;
LEAVE;
}
#endif
/* ------------------------------------------------------------------------- */
MODULE = Pango::Cairo PACKAGE = Pango::Cairo::FontMap PREFIX = pango_cairo_font_map_
# PangoFontMap *pango_cairo_font_map_new (void);
PangoFontMap_noinc * pango_cairo_font_map_new (class)
C_ARGS:
/* void */
# PangoFontMap *pango_cairo_font_map_get_default (void);
PangoFontMap * pango_cairo_font_map_get_default (class)
C_ARGS:
/* void */
void pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap, double dpi);
double pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
# PangoContext *pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
SV *
pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap)
PREINIT:
PangoContext *context;
HV *stash;
CODE:
context = pango_cairo_font_map_create_context (fontmap);
if (!context)
XSRETURN_UNDEF;
RETVAL = newSVPangoContext (context);
stash = gv_stashpv ("Pango::Cairo::Context", TRUE);
sv_bless (RETVAL, stash);
OUTPUT:
RETVAL
#if PANGO_CHECK_VERSION (1, 18, 0)
# PangoFontMap *pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype);
PangoFontMap_noinc * pango_cairo_font_map_new_for_font_type (class, cairo_font_type_t fonttype)
C_ARGS:
fonttype
cairo_font_type_t pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap);
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Cairo PACKAGE = Pango::Cairo::Font PREFIX = pango_cairo_font_
#if PANGO_CHECK_VERSION (1, 18, 0)
cairo_scaled_font_t *pango_cairo_font_get_scaled_font (PangoCairoFont *font);
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Cairo PACKAGE = Pango::Cairo PREFIX = pango_cairo_
=for position DESCRIPTION
I contains a few functions that help integrate pango and
cairo. Since they aren't methods of a particular object, they are bound as
plain functions.
=cut
=for apidoc __function__
=cut
void pango_cairo_update_context (cairo_t *cr, PangoContext *context);
=for apidoc __function__
=cut
PangoLayout *pango_cairo_create_layout (cairo_t *cr);
=for apidoc __function__
=cut
void pango_cairo_update_layout (cairo_t *cr, PangoLayout *layout);
=for apidoc __function__
=cut
void pango_cairo_show_glyph_string (cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs);
=for apidoc __function__
=cut
void pango_cairo_show_layout_line (cairo_t *cr, PangoLayoutLine *line);
=for apidoc __function__
=cut
void pango_cairo_show_layout (cairo_t *cr, PangoLayout *layout);
=for apidoc __function__
=cut
void pango_cairo_glyph_string_path (cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs);
=for apidoc __function__
=cut
void pango_cairo_layout_line_path (cairo_t *cr, PangoLayoutLine *line);
=for apidoc __function__
=cut
void pango_cairo_layout_path (cairo_t *cr, PangoLayout *layout);
#if PANGO_CHECK_VERSION (1, 14, 0)
=for apidoc __function__
=cut
void pango_cairo_show_error_underline (cairo_t *cr, double x, double y, double width, double height);
=for apidoc __function__
=cut
void pango_cairo_error_underline_path (cairo_t *cr, double x, double y, double width, double height);
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Cairo PACKAGE = Pango::Cairo::Context PREFIX = pango_cairo_context_
BOOT:
gperl_set_isa ("Pango::Cairo::Context", "Pango::Context");
=for position post_hierarchy
=head1 HIERARCHY
Glib::Object
+----Pango::Context
+----Pango::Cairo::Context
=cut
=for apidoc __function__
=cut
void pango_cairo_context_set_font_options (PangoContext *context, const cairo_font_options_t *options);
=for apidoc __function__
=cut
# const cairo_font_options_t *pango_cairo_context_get_font_options (PangoContext *context);
const cairo_font_options_t *pango_cairo_context_get_font_options (PangoContext *context);
CODE:
RETVAL = cairo_font_options_copy (
pango_cairo_context_get_font_options (context));
OUTPUT:
RETVAL
=for apidoc __function__
=cut
void pango_cairo_context_set_resolution (PangoContext *context, double dpi);
=for apidoc __function__
=cut
double pango_cairo_context_get_resolution (PangoContext *context);
#if PANGO_CHECK_VERSION (1, 18, 0)
=for apidoc __function__
=cut
# void pango_cairo_context_set_shape_renderer (PangoContext *context, PangoCairoShapeRendererFunc func, gpointer data, GDestroyNotify dnotify)
void
pango_cairo_context_set_shape_renderer (PangoContext *context, SV *func=NULL, SV *data=NULL)
PREINIT:
GPerlCallback *callback;
GDestroyNotify dnotify;
CODE:
if (gperl_sv_is_defined (func)) {
callback = gperl_callback_new (func, data, 0, NULL, 0);
dnotify = (GDestroyNotify) gperl_callback_destroy;
} else {
callback = NULL;
dnotify = NULL;
}
pango_cairo_context_set_shape_renderer (
context,
gtk2perl_pango_cairo_shape_renderer_func,
callback,
dnotify);
# Is this useful? You can't use it to store away the old renderer while you
# temporarily install your own, since when you call set_shape_renderer(), the
# old renderer's destruction notification is executed. So the stuff you got
# from get_shape_renderer() is now garbage.
# PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer (PangoContext *context, gpointer *data)
#endif
Pango-1.227/xs/PangoContext.xs 000644 001750 000024 00000012476 12301027576 017320 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2003-2004, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Context PACKAGE = Pango::Context PREFIX = pango_context_
## applications have no cause to use pango_context_new() -- it is intended
## to be used by backends. i seriously doubt anyone would want to write a
## pango backend in Perl, unless they want something that's really slow.
## higher-level APIs are used to create contexts appropriate for the desired
## backend, e.g. $gtkwidget->create_pango_context.
## PangoContext *pango_context_new (void)
## same thing goes for pango_context_set_font_map.
## void pango_context_set_font_map (PangoContext *context, PangoFontMap *font_map)
#if PANGO_CHECK_VERSION (1, 6, 0)
## PangoFontMap *pango_context_get_font_map (PangoContext *context)
PangoFontMap *
pango_context_get_font_map (context)
PangoContext *context
#endif
### void pango_context_list_families (PangoContext *context, PangoFontFamily ***families, int *n_families)
=for apidoc
=for signature @families = $context->list_families
=cut
void
pango_context_list_families (context)
PangoContext *context
PREINIT:
PangoFontFamily **families = NULL;
int n_families;
PPCODE:
pango_context_list_families (context, &families, &n_families);
if (n_families > 0) {
int i;
EXTEND (SP, n_families);
for (i = 0 ; i < n_families ; i++)
PUSHs (sv_2mortal (newSVPangoFontFamily (families[i])));
g_free (families);
}
## PangoFont * pango_context_load_font (PangoContext *context, const PangoFontDescription *desc)
### may return NULL....
PangoFont_noinc *
pango_context_load_font (context, desc)
PangoContext *context
PangoFontDescription_ornull *desc
CODE:
RETVAL = pango_context_load_font (context, desc);
if (!RETVAL)
XSRETURN_UNDEF;
OUTPUT:
RETVAL
## PangoFontset *pango_context_load_fontset (PangoContext *context, const PangoFontDescription *desc, PangoLanguage *language)
PangoFontset_noinc *
pango_context_load_fontset (context, desc, language)
PangoContext *context
PangoFontDescription *desc
PangoLanguage_ornull *language
CODE:
RETVAL = pango_context_load_fontset (context, desc, language);
if (!RETVAL)
XSRETURN_UNDEF;
OUTPUT:
RETVAL
## PangoFontMetrics *pango_context_get_metrics (PangoContext *context, const PangoFontDescription *desc, PangoLanguage *language)
PangoFontMetrics_own *
pango_context_get_metrics (context, desc, language)
PangoContext *context
PangoFontDescription *desc
PangoLanguage_ornull *language
## void pango_context_set_font_description (PangoContext *context, const PangoFontDescription *desc)
void
pango_context_set_font_description (context, desc)
PangoContext *context
PangoFontDescription *desc
## PangoFontDescription * pango_context_get_font_description (PangoContext *context)
## caller must not alter the returned value! should use use a copy instead?
PangoFontDescription *
pango_context_get_font_description (context)
PangoContext *context
## PangoLanguage *pango_context_get_language (PangoContext *context)
PangoLanguage *
pango_context_get_language (context)
PangoContext *context
## void pango_context_set_language (PangoContext *context, PangoLanguage *language)
void
pango_context_set_language (context, language)
PangoContext *context
PangoLanguage *language
## void pango_context_set_base_dir (PangoContext *context, PangoDirection direction)
void
pango_context_set_base_dir (context, direction)
PangoContext *context
PangoDirection direction
## PangoDirection pango_context_get_base_dir (PangoContext *context)
PangoDirection
pango_context_get_base_dir (context)
PangoContext *context
# FIXME
### GList *pango_itemize (PangoContext *context, const char *text, int start_index, int length, PangoAttrList *attrs, PangoAttrIterator *cached_iter)
#GList *
#pango_itemize (context, text, start_index, length, attrs, cached_iter)
# PangoContext *context
# const char *text
# int start_index
# int length
# PangoAttrList *attrs
# PangoAttrIterator *cached_iter
#if PANGO_CHECK_VERSION (1, 6, 0)
## PangoMatrix * pango_context_get_matrix (PangoContext *context)
const PangoMatrix_ornull *
pango_context_get_matrix (context)
PangoContext *context
## void pango_context_set_matrix (PangoContext *context, PangoMatrix *matrix)
void
pango_context_set_matrix (context, matrix)
PangoContext *context
PangoMatrix_ornull *matrix
#endif
#if PANGO_CHECK_VERSION (1, 16, 0)
void pango_context_set_base_gravity (PangoContext *context, PangoGravity gravity);
PangoGravity pango_context_get_base_gravity (PangoContext *context);
PangoGravity pango_context_get_gravity (PangoContext *context);
void pango_context_set_gravity_hint (PangoContext *context, PangoGravityHint hint);
PangoGravityHint pango_context_get_gravity_hint (PangoContext *context);
#endif
Pango-1.227/xs/PangoFont.xs 000644 001750 000024 00000027714 12301027576 016603 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2003-2005, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Font PACKAGE = Pango
=for object Pango::FontDescription
=cut
### some constants...
double
scale (class)
ALIAS:
Pango::scale_xx_small = 1
Pango::scale_x_small = 2
Pango::scale_small = 3
Pango::scale_medium = 4
Pango::scale_large = 5
Pango::scale_x_large = 6
Pango::scale_xx_large = 7
CODE:
switch (ix) {
case 0: RETVAL = (double)PANGO_SCALE; break;
case 1: RETVAL = PANGO_SCALE_XX_SMALL; break;
case 2: RETVAL = PANGO_SCALE_X_SMALL; break;
case 3: RETVAL = PANGO_SCALE_SMALL; break;
case 4: RETVAL = PANGO_SCALE_MEDIUM; break;
case 5: RETVAL = PANGO_SCALE_LARGE; break;
case 6: RETVAL = PANGO_SCALE_X_LARGE; break;
case 7: RETVAL = PANGO_SCALE_XX_LARGE; break;
default:
RETVAL = 0.0;
g_assert_not_reached ();
}
OUTPUT:
RETVAL
double
PANGO_PIXELS (class, d)
double d
ALIAS:
Pango::pixels = 1
C_ARGS:
d
CLEANUP:
PERL_UNUSED_VAR (ix);
MODULE = Pango::Font PACKAGE = Pango::FontDescription PREFIX = pango_font_description_
##PangoFontDescription* pango_font_description_new (void)
PangoFontDescription_own *
pango_font_description_new (class)
C_ARGS:
/* void */
## guint pango_font_description_hash (const PangoFontDescription *desc)
guint
pango_font_description_hash (desc)
PangoFontDescription *desc
## gboolean pango_font_description_equal (const PangoFontDescription *desc1, const PangoFontDescription *desc2)
gboolean
pango_font_description_equal (desc1, desc2)
PangoFontDescription *desc1
PangoFontDescription *desc2
# should be taken care of automagically
## void pango_font_description_free (PangoFontDescription *desc)
## void pango_font_descriptions_free (PangoFontDescription **descs, int n_descs)
## void pango_font_description_set_family (PangoFontDescription *desc, const char *family)
void
pango_font_description_set_family (desc, family)
PangoFontDescription *desc
const char *family
## void pango_font_description_set_family_static (PangoFontDescription *desc, const char *family)
void
pango_font_description_set_family_static (desc, family)
PangoFontDescription *desc
const char *family
## void pango_font_description_get_family (PangoFontDescription *desc, )
const char *
pango_font_description_get_family (desc)
PangoFontDescription *desc
## void pango_font_description_set_style (PangoFontDescription *desc, PangoStyle style)
void
pango_font_description_set_style (desc, style)
PangoFontDescription *desc
PangoStyle style
## PangoStyle pango_font_description_get_style (const PangoFontDescription *desc)
PangoStyle
pango_font_description_get_style (desc)
PangoFontDescription *desc
## void pango_font_description_set_variant (PangoFontDescription *desc, PangoVariant variant)
void
pango_font_description_set_variant (desc, variant)
PangoFontDescription *desc
PangoVariant variant
## PangoVariant pango_font_description_get_variant (const PangoFontDescription *desc)
PangoVariant
pango_font_description_get_variant (desc)
PangoFontDescription *desc
## void pango_font_description_set_weight (PangoFontDescription *desc, PangoWeight weight)
void
pango_font_description_set_weight (desc, weight)
PangoFontDescription *desc
PangoWeight weight
## PangoWeight pango_font_description_get_weight (const PangoFontDescription *desc)
PangoWeight
pango_font_description_get_weight (desc)
PangoFontDescription *desc
## void pango_font_description_set_stretch (PangoFontDescription *desc, PangoStretch stretch)
void
pango_font_description_set_stretch (desc, stretch)
PangoFontDescription *desc
PangoStretch stretch
## PangoStretch pango_font_description_get_stretch (const PangoFontDescription *desc)
PangoStretch
pango_font_description_get_stretch (desc)
PangoFontDescription *desc
## void pango_font_description_set_size (PangoFontDescription *desc, gint size)
void
pango_font_description_set_size (desc, size)
PangoFontDescription *desc
gint size
## gint pango_font_description_get_size (const PangoFontDescription *desc)
gint
pango_font_description_get_size (desc)
PangoFontDescription *desc
## PangoFontMask pango_font_description_get_set_fields (const PangoFontDescription *desc)
PangoFontMask
pango_font_description_get_set_fields (desc)
PangoFontDescription *desc
## void pango_font_description_unset_fields (PangoFontDescription *desc, PangoFontMask to_unset)
void
pango_font_description_unset_fields (desc, to_unset)
PangoFontDescription *desc
PangoFontMask to_unset
## void pango_font_description_merge (PangoFontDescription *desc, const PangoFontDescription *desc_to_merge, gboolean replace_existing)
void
pango_font_description_merge (desc, desc_to_merge, replace_existing)
PangoFontDescription *desc
PangoFontDescription *desc_to_merge
gboolean replace_existing
## void pango_font_description_merge_static (PangoFontDescription *desc, const PangoFontDescription *desc_to_merge, gboolean replace_existing)
void
pango_font_description_merge_static (desc, desc_to_merge, replace_existing)
PangoFontDescription *desc
PangoFontDescription *desc_to_merge
gboolean replace_existing
## gboolean pango_font_description_better_match (const PangoFontDescription *desc, const PangoFontDescription *old_match, const PangoFontDescription *new_match)
gboolean
pango_font_description_better_match (desc, old_match, new_match)
PangoFontDescription *desc
PangoFontDescription_ornull *old_match
PangoFontDescription *new_match
##PangoFontDescription *pango_font_description_from_string (const char *str)
PangoFontDescription_own *
pango_font_description_from_string (class, str)
const char * str
C_ARGS:
str
## char * pango_font_description_to_string (const PangoFontDescription *desc)
char *
pango_font_description_to_string (desc)
PangoFontDescription *desc
CLEANUP:
g_free (RETVAL);
## char * pango_font_description_to_filename (const PangoFontDescription *desc)
char *
pango_font_description_to_filename (desc)
PangoFontDescription *desc
CLEANUP:
g_free (RETVAL);
#if PANGO_CHECK_VERSION (1, 8, 0)
void pango_font_description_set_absolute_size (PangoFontDescription *desc, double size);
gboolean pango_font_description_get_size_is_absolute (const PangoFontDescription *desc);
#endif
#if PANGO_CHECK_VERSION (1, 16, 0)
void pango_font_description_set_gravity (PangoFontDescription *desc, PangoGravity gravity);
PangoGravity pango_font_description_get_gravity (const PangoFontDescription *desc);
#endif
MODULE = Pango::Font PACKAGE = Pango::FontMetrics PREFIX = pango_font_metrics_
# should happen automagicly
## void pango_font_metrics_unref (PangoFontMetrics *metrics)
## int pango_font_metrics_get_ascent (PangoFontMetrics *metrics)
int
pango_font_metrics_get_ascent (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_descent (PangoFontMetrics *metrics)
int
pango_font_metrics_get_descent (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics)
int
pango_font_metrics_get_approximate_char_width (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics)
int
pango_font_metrics_get_approximate_digit_width (metrics)
PangoFontMetrics *metrics
#if PANGO_CHECK_VERSION (1, 6, 0)
## int pango_font_metrics_get_underline_position (PangoFontMetrics *metrics)
int
pango_font_metrics_get_underline_position (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics)
int
pango_font_metrics_get_underline_thickness (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics)
int
pango_font_metrics_get_strikethrough_position (metrics)
PangoFontMetrics *metrics
## int pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics)
int
pango_font_metrics_get_strikethrough_thickness (metrics)
PangoFontMetrics *metrics
#endif
MODULE = Pango::Font PACKAGE = Pango::FontFamily PREFIX = pango_font_family_
BOOT:
gperl_object_set_no_warn_unreg_subclass (PANGO_TYPE_FONT_FAMILY, TRUE);
## void pango_font_family_list_faces (PangoFontFamily *family, PangoFontFace ***faces, int *n_faces)
=for apidoc
=for apidoc @faces = $family->list_faces
Lists the different font faces that make up family. The faces in a family
share a common design, but differ in slant, weight, width and other aspects.
=cut
void
pango_font_family_list_faces (family)
PangoFontFamily *family
PREINIT:
PangoFontFace ** faces = NULL;
int n_faces;
PPCODE:
pango_font_family_list_faces(family, &faces, &n_faces);
if (n_faces > 0) {
int i;
EXTEND(SP,n_faces);
for (i = 0 ; i < n_faces ; i++)
PUSHs(sv_2mortal(newSVPangoFontFace(faces[i])));
g_free (faces);
}
const char * pango_font_family_get_name (PangoFontFamily * family)
#if PANGO_CHECK_VERSION(1, 4, 0)
gboolean pango_font_family_is_monospace (PangoFontFamily * family)
#endif
MODULE = Pango::Font PACKAGE = Pango::FontFace PREFIX = pango_font_face_
#
# PangoFontFace
#
BOOT:
gperl_object_set_no_warn_unreg_subclass (PANGO_TYPE_FONT_FACE, TRUE);
## PangoFontDescription *pango_font_face_describe (PangoFontFace *face);
PangoFontDescription_own * pango_font_face_describe (PangoFontFace *face);
## G_CONST_RETURN char *pango_font_face_get_face_name (PangoFontFace *face);
const char *pango_font_face_get_face_name (PangoFontFace *face);
#if PANGO_CHECK_VERSION(1, 4, 0)
## void pango_font_face_list_sizes (PangoFontFace *face, int **sizes, int *n_sizes);
=for apidoc
=for signature @sizes = $face->list_sizes
List the sizes available for a bitmapped font. For scalable fonts, this will
return an empty list.
=cut
void
pango_font_face_list_sizes (PangoFontFace *face)
PREINIT:
int *sizes=NULL, n_sizes, i;
PPCODE:
pango_font_face_list_sizes (face, &sizes, &n_sizes);
if (n_sizes > 0) {
EXTEND (SP, n_sizes);
for (i = 0 ; i < n_sizes ; i++)
PUSHs (sv_2mortal (newSViv (sizes[i])));
g_free (sizes);
}
#endif
#if PANGO_CHECK_VERSION(1, 18, 0)
gboolean pango_font_face_is_synthesized (PangoFontFace *face);
#endif
MODULE = Pango::Font PACKAGE = Pango::Font PREFIX = pango_font_
## PangoFontMetrics * pango_font_get_metrics (PangoFont *font, PangoLanguage *language)
PangoFontMetrics *
pango_font_get_metrics (font, language)
PangoFont *font
PangoLanguage *language
## PangoFontDescription* pango_font_describe (PangoFont *font)
PangoFontDescription_own *
pango_font_describe (font)
PangoFont *font
#if PANGO_CHECK_VERSION(1, 14, 0)
## PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont *font);
PangoFontDescription_own *pango_font_describe_with_absolute_size (PangoFont *font);
#endif
## void pango_font_get_glyph_extents (PangoFont *font, PangoGlyph glyph, PangoRectangle *ink_rect, PangoRectangle *logical_rect)
void
pango_font_get_glyph_extents (font, glyph)
PangoFont *font
PangoGlyph glyph
PREINIT:
PangoRectangle ink_rect;
PangoRectangle logical_rect;
PPCODE:
pango_font_get_glyph_extents (font, glyph, &ink_rect, &logical_rect);
EXTEND (sp, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
#if PANGO_CHECK_VERSION(1, 10, 0)
PangoFontMap * pango_font_get_font_map (PangoFont *font);
#endif
### no typemaps for this stuff.
### it looks like it would only be useful from C, though.
### PangoCoverage * pango_font_get_coverage (PangoFont *font, PangoLanguage *language)
### PangoEngineShape * pango_font_find_shaper (PangoFont *font, PangoLanguage *language, guint32 ch)
Pango-1.227/xs/PangoFontMap.xs 000644 001750 000024 00000003531 12301027576 017230 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2004, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::FontMap PACKAGE = Pango::FontMap PREFIX = pango_font_map_
## PangoFont * pango_font_map_load_font (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc)
PangoFont_ornull *
pango_font_map_load_font (fontmap, context, desc)
PangoFontMap *fontmap
PangoContext *context
const PangoFontDescription *desc
## PangoFontset * pango_font_map_load_fontset (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc, PangoLanguage *language)
PangoFontset_ornull *
pango_font_map_load_fontset (fontmap, context, desc, language)
PangoFontMap *fontmap
PangoContext *context
const PangoFontDescription *desc
PangoLanguage *language
## void pango_font_map_list_families (PangoFontMap *fontmap, PangoFontFamily ***families, int *n_families)
void
pango_font_map_list_families (fontmap)
PangoFontMap *fontmap
PREINIT:
PangoFontFamily **families = NULL;
int n_families = 0, i;
PPCODE:
pango_font_map_list_families (fontmap, &families, &n_families);
if (families) {
EXTEND (sp, n_families);
for (i = 0; i < n_families; i++)
PUSHs (sv_2mortal (newSVPangoFontFamily (families[i])));
g_free (families);
}
Pango-1.227/xs/PangoFontset.xs 000644 001750 000024 00000004645 12301027576 017315 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2003, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
#if PANGO_CHECK_VERSION (1, 4, 0)
static GPerlCallback *
gtk2perl_pango_fontset_foreach_func_create (SV *func, SV *data)
{
GType param_types[2];
param_types[0] = PANGO_TYPE_FONTSET;
param_types[1] = PANGO_TYPE_FONT;
return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
param_types, G_TYPE_BOOLEAN);
}
static gboolean
gtk2perl_pango_fontset_foreach_func (PangoFontset *fontset, PangoFont *font, GPerlCallback *callback)
{
GValue value = {0,};
gboolean retval;
g_value_init (&value, callback->return_type);
gperl_callback_invoke (callback, &value, fontset, font);
retval = g_value_get_boolean (&value);
g_value_unset (&value);
return retval;
}
#endif /* 1.4.0 */
MODULE = Pango::Fontset PACKAGE = Pango::Fontset PREFIX = pango_fontset_
BOOT:
gperl_object_set_no_warn_unreg_subclass (PANGO_TYPE_FONTSET, TRUE);
## PangoFont * pango_fontset_get_font (PangoFontset *fontset, guint wc)
PangoFont *
pango_fontset_get_font (fontset, wc)
PangoFontset *fontset
guint wc
## PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset)
PangoFontMetrics *
pango_fontset_get_metrics (fontset)
PangoFontset *fontset
#if PANGO_CHECK_VERSION (1, 4, 0)
## void pango_fontset_foreach (PangoFontset *fontset, PangoFontsetForeachFunc func, gpointer data)
void
pango_fontset_foreach (fontset, func, data=NULL)
PangoFontset *fontset
SV *func
SV *data
PREINIT:
GPerlCallback *callback;
CODE:
callback = gtk2perl_pango_fontset_foreach_func_create (func, data);
pango_fontset_foreach (fontset,
(PangoFontsetForeachFunc)
gtk2perl_pango_fontset_foreach_func,
callback);
gperl_callback_destroy (callback);
#endif /* 1.4.0 */
Pango-1.227/xs/PangoGravity.xs 000644 001750 000024 00000002356 12301027576 017315 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2007, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Gravity PACKAGE = Pango::Gravity PREFIX = pango_gravity_
=for apidoc __function__
=cut
gboolean
is_vertical (PangoGravity gravity)
CODE:
RETVAL = PANGO_GRAVITY_IS_VERTICAL (gravity);
OUTPUT:
RETVAL
=for apidoc __function__
=cut
double pango_gravity_to_rotation (PangoGravity gravity);
=for apidoc __function__
=cut
PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix);
=for apidoc __function__
=cut
PangoGravity pango_gravity_get_for_script (PangoScript script, PangoGravity base_gravity, PangoGravityHint hint);
Pango-1.227/xs/PangoLayout.xs 000644 001750 000024 00000051044 12301027576 017143 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2003-2005, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
/* ------------------------------------------------------------------------- */
#if !PANGO_CHECK_VERSION (1, 20, 0)
static gpointer
gtk2perl_pango_layout_iter_copy (gpointer boxed)
{
croak ("Can't copy a PangoLayoutIter");
return boxed;
}
#endif
GType
gtk2perl_pango_layout_iter_get_type (void)
{
static GType t = 0;
if (!t)
t = g_boxed_type_register_static ("PangoLayoutIter",
#if PANGO_CHECK_VERSION (1, 20, 0)
(GBoxedCopyFunc) pango_layout_iter_copy,
#else
(GBoxedCopyFunc) gtk2perl_pango_layout_iter_copy,
#endif
(GBoxedFreeFunc) pango_layout_iter_free);
return t;
}
/* ------------------------------------------------------------------------- */
GType
gtk2perl_pango_layout_line_get_type (void)
{
static GType t = 0;
if (!t)
t = g_boxed_type_register_static ("PangoLayoutLine",
(GBoxedCopyFunc) pango_layout_line_ref,
(GBoxedFreeFunc) pango_layout_line_unref);
return t;
}
/* ------------------------------------------------------------------------- */
SV *
newSVPangoRectangle (PangoRectangle * rectangle)
{
HV * hv;
if (!rectangle)
return &PL_sv_undef;
hv = newHV ();
hv_store (hv, "x", 1, newSViv (rectangle->x), 0);
hv_store (hv, "y", 1, newSViv (rectangle->y), 0);
hv_store (hv, "width", 5, newSViv (rectangle->width), 0);
hv_store (hv, "height", 6, newSViv (rectangle->height), 0);
return newRV_noinc ((SV *) hv);
}
PangoRectangle *
SvPangoRectangle (SV * sv)
{
PangoRectangle *rectangle;
SV ** v;
if (!gperl_sv_is_defined (sv))
return NULL;
rectangle = gperl_alloc_temp (sizeof (PangoRectangle));
if (gperl_sv_is_hash_ref (sv)) {
HV * hv = (HV *) SvRV (sv);
v = hv_fetch (hv, "x", 1, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->x = SvIV (*v);
v = hv_fetch (hv, "y", 1, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->y = SvIV (*v);
v = hv_fetch (hv, "width", 5, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->width = SvIV (*v);
v = hv_fetch (hv, "height", 6, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->height = SvIV (*v);
} else if (gperl_sv_is_array_ref (sv)) {
AV * av = (AV *) SvRV (sv);
v = av_fetch (av, 0, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->x = SvIV (*v);
v = av_fetch (av, 1, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->y = SvIV (*v);
v = av_fetch (av, 2, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->width = SvIV (*v);
v = av_fetch (av, 3, 0);
if (v && gperl_sv_is_defined (*v))
rectangle->height = SvIV (*v);
} else {
croak ("a PangoRectangle must be a reference to a hash "
"or a reference to an array");
}
return rectangle;
}
/* ------------------------------------------------------------------------- */
static SV *
newSVPangoLogAttr (PangoLogAttr * logattr)
{
HV * hv = newHV ();
#define STORE_BIT(key) \
hv_store (hv, #key, sizeof (#key) - 1, newSVuv (logattr->key), 0)
STORE_BIT (is_line_break);
STORE_BIT (is_mandatory_break);
STORE_BIT (is_char_break);
STORE_BIT (is_white);
STORE_BIT (is_cursor_position);
STORE_BIT (is_word_start);
STORE_BIT (is_word_end);
STORE_BIT (is_sentence_boundary);
STORE_BIT (is_sentence_start);
STORE_BIT (is_sentence_end);
#if PANGO_CHECK_VERSION (1, 4, 0)
STORE_BIT (backspace_deletes_character);
#endif
#if PANGO_CHECK_VERSION (1, 18, 0)
STORE_BIT (is_expandable_space);
#endif
#undef STORE_BIT
return newRV_noinc ((SV*) hv);
}
MODULE = Pango::Layout PACKAGE = Pango::Layout PREFIX = pango_layout_
## PangoLayout *pango_layout_new (PangoContext *context)
PangoLayout_noinc *
pango_layout_new (class, context)
PangoContext * context
C_ARGS:
context
## PangoLayout *pango_layout_copy (PangoLayout *src)
PangoLayout_noinc *
pango_layout_copy (src)
PangoLayout *src
## PangoContext *pango_layout_get_context (PangoLayout *layout)
PangoContext *
pango_layout_get_context (layout)
PangoLayout *layout
## void pango_layout_set_attributes (PangoLayout *layout, PangoAttrList *attrs)
void
pango_layout_set_attributes (layout, attrs)
PangoLayout *layout
PangoAttrList_ornull *attrs
## PangoAttrList *pango_layout_get_attributes (PangoLayout *layout)
PangoAttrList_ornull *
pango_layout_get_attributes (layout)
PangoLayout *layout
## void pango_layout_set_text (PangoLayout *layout, const char *text, int length)
void
pango_layout_set_text (PangoLayout *layout, const gchar_length *text, int length(text))
## const char * pango_layout_get_text (PangoLayout *layout);
const gchar *
pango_layout_get_text (layout)
PangoLayout * layout
## void pango_layout_set_markup (PangoLayout *layout, const char *markup, int length)
void
pango_layout_set_markup (PangoLayout * layout, const gchar_length * markup, int length(markup))
## void pango_layout_set_markup_with_accel (PangoLayout *layout, const char *markup, int length, gunichar accel_marker, gunichar *accel_char)
void
pango_layout_set_markup_with_accel (PangoLayout * layout, const char * markup, int length(markup), gunichar accel_marker, OUTLIST gunichar accel_char)
## void pango_layout_set_font_description (PangoLayout *layout, const PangoFontDescription *desc)
void
pango_layout_set_font_description (layout, desc)
PangoLayout *layout
PangoFontDescription_ornull *desc
#if PANGO_CHECK_VERSION (1, 8, 0)
const PangoFontDescription_ornull * pango_layout_get_font_description (PangoLayout *layout);
#endif
## int pango_layout_get_width (PangoLayout *layout)
## int pango_layout_get_indent (PangoLayout *layout)
## int pango_layout_get_spacing (PangoLayout *layout)
## gboolean pango_layout_get_justify (PangoLayout *layout)
## gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout)
int
pango_layout_get_width (layout)
PangoLayout * layout
ALIAS:
Pango::Layout::get_indent = 1
Pango::Layout::get_spacing = 2
Pango::Layout::get_justify = 3
Pango::Layout::get_single_paragraph_mode = 4
CODE:
switch (ix) {
case 0: RETVAL = pango_layout_get_width (layout); break;
case 1: RETVAL = pango_layout_get_indent (layout); break;
case 2: RETVAL = pango_layout_get_spacing (layout); break;
case 3: RETVAL = pango_layout_get_justify (layout); break;
case 4: RETVAL = pango_layout_get_single_paragraph_mode (layout); break;
default:
RETVAL = 0;
g_assert_not_reached ();
}
OUTPUT:
RETVAL
## void pango_layout_set_width (PangoLayout *layout, int width)
## void pango_layout_set_indent (PangoLayout *layout, int indent)
## void pango_layout_set_spacing (PangoLayout *layout, int spacing)
## void pango_layout_set_justify (PangoLayout *layout, gboolean justify)
## void pango_layout_set_single_paragraph_mode (PangoLayout *layout, gboolean setting)
void
pango_layout_set_width (layout, newval)
PangoLayout * layout
int newval
ALIAS:
Pango::Layout::set_indent = 1
Pango::Layout::set_spacing = 2
Pango::Layout::set_justify = 3
Pango::Layout::set_single_paragraph_mode = 4
CODE:
switch (ix) {
case 0: pango_layout_set_width (layout, newval); break;
case 1: pango_layout_set_indent (layout, newval); break;
case 2: pango_layout_set_spacing (layout, newval); break;
case 3: pango_layout_set_justify (layout, newval); break;
case 4: pango_layout_set_single_paragraph_mode (layout, newval); break;
default:
g_assert_not_reached ();
}
## void pango_layout_set_wrap (PangoLayout *layout, PangoWrapMode wrap)
void
pango_layout_set_wrap (layout, wrap)
PangoLayout *layout
PangoWrapMode wrap
## PangoWrapMode pango_layout_get_wrap (PangoLayout *layout)
PangoWrapMode
pango_layout_get_wrap (layout)
PangoLayout *layout
#if PANGO_CHECK_VERSION (1, 6, 0)
## void pango_layout_set_ellipsize (PangoLayout *layout, PangoEllipsizeMode ellipsize)
void
pango_layout_set_ellipsize (layout, ellipsize)
PangoLayout *layout
PangoEllipsizeMode ellipsize
## PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout)
PangoEllipsizeMode
pango_layout_get_ellipsize (layout)
PangoLayout *layout
#endif
#if PANGO_CHECK_VERSION (1, 4, 0)
## void pango_layout_set_auto_dir (PangoLayout *layout, gboolean auto_dir)
void
pango_layout_set_auto_dir (layout, auto_dir)
PangoLayout *layout
gboolean auto_dir
## gboolean pango_layout_get_auto_dir (PangoLayout *layout)
gboolean
pango_layout_get_auto_dir (layout)
PangoLayout *layout
#endif
## void pango_layout_set_alignment (PangoLayout *layout, PangoAlignment alignment)
void
pango_layout_set_alignment (layout, alignment)
PangoLayout *layout
PangoAlignment alignment
## PangoAlignment pango_layout_get_alignment (PangoLayout *layout)
PangoAlignment
pango_layout_get_alignment (layout)
PangoLayout *layout
## void pango_layout_set_tabs (PangoLayout *layout, PangoTabArray *tabs)
void
pango_layout_set_tabs (layout, tabs)
PangoLayout *layout
PangoTabArray_ornull *tabs
## PangoTabArray* pango_layout_get_tabs (PangoLayout *layout)
PangoTabArray_own_ornull *
pango_layout_get_tabs (layout)
PangoLayout *layout
## void pango_layout_context_changed (PangoLayout *layout)
void
pango_layout_context_changed (layout)
PangoLayout *layout
## void pango_layout_get_log_attrs (PangoLayout *layout, PangoLogAttr **attrs, gint *n_attrs)
=for apidoc
Returns a list of Pango::LogAttr's
=cut
void
pango_layout_get_log_attrs (layout)
PangoLayout * layout
PREINIT:
PangoLogAttr * attrs = NULL;
gint n_attrs;
PPCODE:
pango_layout_get_log_attrs (layout, &attrs, &n_attrs);
if (n_attrs) {
int i;
EXTEND (SP, n_attrs);
for (i = 0 ; i < n_attrs; i++)
PUSHs (sv_2mortal (newSVPangoLogAttr (attrs+i)));
g_free (attrs);
}
## void pango_layout_index_to_pos (PangoLayout *layout, int index_, PangoRectangle *pos)
PangoRectangle *
pango_layout_index_to_pos (layout, index_)
PangoLayout *layout
int index_
PREINIT:
PangoRectangle pos;
CODE:
pango_layout_index_to_pos (layout, index_, &pos);
RETVAL = &pos;
OUTPUT:
RETVAL
## void pango_layout_get_cursor_pos (PangoLayout *layout, int index_, PangoRectangle *strong_pos, PangoRectangle *weak_pos)
=for apidoc
=for signature (strong_pos, weak_pos) = $layout->get_cursor_pos ($index)
=cut
void
pango_layout_get_cursor_pos (layout, index_)
PangoLayout *layout
int index_
PREINIT:
PangoRectangle strong_pos;
PangoRectangle weak_pos;
PPCODE:
pango_layout_get_cursor_pos (layout, index_, &strong_pos, &weak_pos);
EXTEND (sp, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (&strong_pos)));
PUSHs (sv_2mortal (newSVPangoRectangle (&weak_pos)));
## void pango_layout_move_cursor_visually (PangoLayout *layout, gboolean strong, int old_index, int old_trailing, int direction, int *new_index, int *new_trailing)
void pango_layout_move_cursor_visually (PangoLayout *layout, gboolean strong, int old_index, int old_trailing, int direction, OUTLIST int new_index, OUTLIST int new_trailing)
## gboolean pango_layout_xy_to_index (PangoLayout *layout, int x, int y, int *index_, int *trailing)
=for apidoc
=for signature (index, trailing) = $layout->xy_to_index ($x, $y)
=cut
void
pango_layout_xy_to_index (layout, x, y)
PangoLayout *layout
int x
int y
PREINIT:
int index_;
int trailing;
PPCODE:
if (pango_layout_xy_to_index (layout, x, y, &index_, &trailing)) {
EXTEND (SP, 2);
PUSHs (sv_2mortal (newSViv (index_)));
PUSHs (sv_2mortal (newSViv (trailing)));
}
## void pango_layout_get_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect)
=for apidoc
=for signature (ink_rect, logical_rect) = $layout->get_extents
=for signature (ink_rect, logical_rect) = $layout->get_pixel_extents
=cut
void
pango_layout_get_extents (layout)
PangoLayout *layout
ALIAS:
Pango::Layout::get_pixel_extents = 1
PREINIT:
PangoRectangle ink_rect;
PangoRectangle logical_rect;
PPCODE:
switch (ix) {
case 0:
pango_layout_get_extents (layout, &ink_rect, &logical_rect);
break;
case 1:
pango_layout_get_pixel_extents (layout, &ink_rect, &logical_rect);
break;
default:
g_assert_not_reached ();
}
EXTEND (sp, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
## void pango_layout_get_size (PangoLayout *layout, int *width, int *height)
void pango_layout_get_size (PangoLayout *layout, OUTLIST int width, OUTLIST int height)
## void pango_layout_get_pixel_size (PangoLayout *layout, int *width, int *height)
void pango_layout_get_pixel_size (PangoLayout *layout, OUTLIST int width, OUTLIST int height)
## int pango_layout_get_line_count (PangoLayout *layout)
int
pango_layout_get_line_count (layout)
PangoLayout *layout
## PangoLayoutLine *pango_layout_get_line (PangoLayout *layout, int line)
PangoLayoutLine_ornull *
pango_layout_get_line (layout, line)
PangoLayout *layout
int line
## GSList * pango_layout_get_lines (PangoLayout *layout)
void
pango_layout_get_lines (layout)
PangoLayout *layout
PREINIT:
GSList * lines, * i;
PPCODE:
lines = pango_layout_get_lines (layout);
for (i = lines ; i != NULL ; i = i->next)
XPUSHs (sv_2mortal (newSVPangoLayoutLine (i->data)));
/* the list is owned by the layout. */
#if PANGO_CHECK_VERSION (1, 16, 0)
## PangoLayoutLine *pango_layout_get_line_readonly (PangoLayout *layout, int line)
PangoLayoutLine_ornull *
pango_layout_get_line_readonly (layout, line)
PangoLayout *layout
int line
## GSList * pango_layout_get_lines_readonly (PangoLayout *layout)
void
pango_layout_get_lines_readonly (layout)
PangoLayout *layout
PREINIT:
GSList * lines, * i;
PPCODE:
lines = pango_layout_get_lines_readonly (layout);
for (i = lines ; i != NULL ; i = i->next)
XPUSHs (sv_2mortal (newSVPangoLayoutLine (i->data)));
/* the list is owned by the layout. */
#endif
## PangoLayoutIter *pango_layout_get_iter (PangoLayout *layout)
PangoLayoutIter_own *
pango_layout_get_iter (layout)
PangoLayout *layout
#if PANGO_CHECK_VERSION (1, 16, 0)
gboolean pango_layout_is_wrapped (PangoLayout *layout);
gboolean pango_layout_is_ellipsized (PangoLayout *layout);
int pango_layout_get_unknown_glyphs_count (PangoLayout *layout);
#endif
#if PANGO_CHECK_VERSION (1, 20, 0)
void pango_layout_set_height (PangoLayout *layout, int height);
int pango_layout_get_height (PangoLayout *layout);
#endif
#if PANGO_CHECK_VERSION (1, 22, 0)
int pango_layout_get_baseline (PangoLayout*layout)
#endif
# --------------------------------------------------------------------------- #
MODULE = Pango::Layout PACKAGE = Pango::LayoutLine PREFIX = pango_layout_line_
## gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, int x_pos, int *index_, int *trailing)
void
pango_layout_line_x_to_index (PangoLayoutLine *line, int x_pos)
PREINIT:
gboolean retval;
int index_;
int trailing;
PPCODE:
retval = pango_layout_line_x_to_index (line, x_pos, &index_, &trailing);
EXTEND (SP, 3);
PUSHs (sv_2mortal (boolSV (retval)));
PUSHs (sv_2mortal (newSViv (index_)));
PUSHs (sv_2mortal (newSViv (trailing)));
## void pango_layout_line_index_to_x (PangoLayoutLine *line, int index_, gboolean trailing, int *x_pos)
void pango_layout_line_index_to_x (PangoLayoutLine *line, int index_, gboolean trailing, OUTLIST int x_pos);
## void pango_layout_line_get_x_ranges (PangoLayoutLine *line, int start_index, int end_index, int **ranges, int *n_ranges)
void
pango_layout_line_get_x_ranges (line, start_index, end_index)
PangoLayoutLine *line
int start_index
int end_index
PREINIT:
int *ranges;
int n_ranges, i;
PPCODE:
pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
EXTEND (SP, n_ranges);
for (i = 0; i < 2*n_ranges; i += 2) {
AV *av = newAV ();
av_push (av, newSViv (ranges[i]));
av_push (av, newSViv (ranges[i + 1]));
PUSHs (sv_2mortal (newRV_noinc ((SV *) av)));
}
g_free (ranges);
#### void pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle *ink_rect, PangoRectangle *logical_rect)
#### void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, PangoRectangle *ink_rect, PangoRectangle *logical_rect)
=for apidoc
=for signature (ink_rect, logical_rect) = $line->get_extents
=for signature (ink_rect, logical_rect) = $line->get_pixel_extents
=cut
void
pango_layout_line_get_extents (line)
PangoLayoutLine *line
ALIAS:
Pango::LayoutLine::get_pixel_extents = 1
PREINIT:
PangoRectangle ink_rect;
PangoRectangle logical_rect;
PPCODE:
switch (ix) {
case 0:
pango_layout_line_get_extents (line, &ink_rect, &logical_rect);
break;
case 1:
pango_layout_line_get_pixel_extents (line, &ink_rect, &logical_rect);
break;
default:
g_assert_not_reached ();
}
EXTEND (sp, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
# --------------------------------------------------------------------------- #
MODULE = Pango::Layout PACKAGE = Pango::LayoutIter PREFIX = pango_layout_iter_
## void pango_layout_iter_free (PangoLayoutIter *iter)
## int pango_layout_iter_get_index (PangoLayoutIter *iter)
int
pango_layout_iter_get_index (iter)
PangoLayoutIter *iter
# FIXME: no typemap for PangoLayoutRun / PangoGlyphItem.
# ## PangoLayoutRun *pango_layout_iter_get_run (PangoLayoutIter *iter)
# PangoLayoutRun *
# pango_layout_iter_get_run (iter)
# PangoLayoutIter *iter
## PangoLayoutLine *pango_layout_iter_get_line (PangoLayoutIter *iter)
PangoLayoutLine *
pango_layout_iter_get_line (iter)
PangoLayoutIter *iter
#if PANGO_CHECK_VERSION (1, 16, 0)
# FIXME: no typemap for PangoLayoutRun / PangoGlyphItem.
# ## PangoLayoutRun *pango_layout_iter_get_run_readonly (PangoLayoutIter *iter)
# PangoLayoutRun *
# pango_layout_iter_get_run_readonly (iter)
# PangoLayoutIter *iter
## PangoLayoutLine *pango_layout_iter_get_line_readonly (PangoLayoutIter *iter)
PangoLayoutLine *
pango_layout_iter_get_line_readonly (iter)
PangoLayoutIter *iter
#endif
## gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter)
gboolean
pango_layout_iter_at_last_line (iter)
PangoLayoutIter *iter
## gboolean pango_layout_iter_next_char (PangoLayoutIter *iter)
gboolean
pango_layout_iter_next_char (iter)
PangoLayoutIter *iter
## gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter)
gboolean
pango_layout_iter_next_cluster (iter)
PangoLayoutIter *iter
## gboolean pango_layout_iter_next_run (PangoLayoutIter *iter)
gboolean
pango_layout_iter_next_run (iter)
PangoLayoutIter *iter
## gboolean pango_layout_iter_next_line (PangoLayoutIter *iter)
gboolean
pango_layout_iter_next_line (iter)
PangoLayoutIter *iter
## void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, PangoRectangle *logical_rect)
PangoRectangle *
pango_layout_iter_get_char_extents (iter)
PangoLayoutIter *iter
PREINIT:
PangoRectangle logical_rect;
CODE:
pango_layout_iter_get_char_extents (iter, &logical_rect);
RETVAL = &logical_rect;
OUTPUT:
RETVAL
## void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect)
void
pango_layout_iter_get_cluster_extents (iter)
PangoLayoutIter *iter
ALIAS:
Pango::LayoutIter::get_run_extents = 1
Pango::LayoutIter::get_line_extents = 2
Pango::LayoutIter::get_layout_extents = 3
PREINIT:
PangoRectangle ink_rect;
PangoRectangle logical_rect;
PPCODE:
switch (ix) {
case 0:
pango_layout_iter_get_cluster_extents (iter, &ink_rect, &logical_rect);
break;
case 1:
pango_layout_iter_get_run_extents (iter, &ink_rect, &logical_rect);
break;
case 2:
pango_layout_iter_get_line_extents (iter, &ink_rect, &logical_rect);
break;
case 3:
pango_layout_iter_get_layout_extents (iter, &ink_rect, &logical_rect);
break;
default:
g_assert_not_reached ();
}
EXTEND (sp, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (&ink_rect)));
PUSHs (sv_2mortal (newSVPangoRectangle (&logical_rect)));
## void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, int *y0_, int *y1_)
void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, OUTLIST int y0_, OUTLIST int y1_)
## int pango_layout_iter_get_baseline (PangoLayoutIter *iter)
int
pango_layout_iter_get_baseline (iter)
PangoLayoutIter *iter
#if PANGO_CHECK_VERSION (1, 20, 0)
PangoLayout * pango_layout_iter_get_layout (PangoLayoutIter *iter);
#endif
Pango-1.227/xs/PangoMatrix.xs 000644 001750 000024 00000006520 12301027576 017131 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2007, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Matrix PACKAGE = Pango::Matrix PREFIX = pango_matrix_
double
xx (matrix, new = 0)
PangoMatrix *matrix
double new
ALIAS:
Pango::Matrix::xy = 1
Pango::Matrix::yx = 2
Pango::Matrix::yy = 3
Pango::Matrix::x0 = 4
Pango::Matrix::y0 = 5
CODE:
RETVAL = 0.0;
switch (ix) {
case 0: RETVAL = matrix->xx; break;
case 1: RETVAL = matrix->xy; break;
case 2: RETVAL = matrix->yx; break;
case 3: RETVAL = matrix->yy; break;
case 4: RETVAL = matrix->x0; break;
case 5: RETVAL = matrix->y0; break;
default: g_assert_not_reached ();
}
if (items == 2) {
switch (ix) {
case 0: matrix->xx = new; break;
case 1: matrix->xy = new; break;
case 2: matrix->yx = new; break;
case 3: matrix->yy = new; break;
case 4: matrix->x0 = new; break;
case 5: matrix->y0 = new; break;
default: g_assert_not_reached ();
}
}
OUTPUT:
RETVAL
PangoMatrix_own *
pango_matrix_new (class, xx = 1., xy = 0., yx = 0., yy = 1., x0 = 0., y0 = 0.)
double xx
double xy
double yx
double yy
double x0
double y0
CODE:
#if PANGO_CHECK_VERSION (1, 12, 0)
RETVAL = g_slice_new0 (PangoMatrix);
#else
RETVAL = g_new0 (PangoMatrix, 1);
#endif
RETVAL->xx = xx;
RETVAL->xy = xy;
RETVAL->yx = yx;
RETVAL->yy = yy;
RETVAL->x0 = x0;
RETVAL->y0 = y0;
OUTPUT:
RETVAL
## void pango_matrix_translate (PangoMatrix *matrix, double tx, double ty)
void
pango_matrix_translate (matrix, tx, ty)
PangoMatrix *matrix
double tx
double ty
## void pango_matrix_scale (PangoMatrix *matrix, double scale_x, double scale_y)
void
pango_matrix_scale (matrix, scale_x, scale_y)
PangoMatrix *matrix
double scale_x
double scale_y
## void pango_matrix_rotate (PangoMatrix *matrix, double degrees)
void
pango_matrix_rotate (matrix, degrees)
PangoMatrix *matrix
double degrees
## void pango_matrix_concat (PangoMatrix *matrix, PangoMatrix *new_matrix)
void
pango_matrix_concat (matrix, new_matrix)
PangoMatrix *matrix
PangoMatrix *new_matrix
#if PANGO_CHECK_VERSION (1, 16, 0)
void pango_matrix_transform_distance (const PangoMatrix *matrix, IN_OUTLIST double dx, IN_OUTLIST double dy);
void pango_matrix_transform_point (const PangoMatrix *matrix, IN_OUTLIST double x, IN_OUTLIST double y);
# void pango_matrix_transform_rectangle (const PangoMatrix *matrix, PangoRectangle *rect)
PangoRectangle *
pango_matrix_transform_rectangle (const PangoMatrix *matrix, PangoRectangle *rect)
ALIAS:
transform_pixel_rectangle = 1
CODE:
switch (ix) {
case 0: pango_matrix_transform_rectangle (matrix, rect); break;
case 1: pango_matrix_transform_pixel_rectangle (matrix, rect); break;
default: g_assert_not_reached ();
}
RETVAL = rect;
OUTPUT:
RETVAL
#endif
Pango-1.227/xs/PangoRenderer.xs 000644 001750 000024 00000005075 12301027576 017437 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2004, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Renderer PACKAGE = Pango::Renderer PREFIX = pango_renderer_
BOOT:
PERL_UNUSED_VAR (file);
#if PANGO_CHECK_VERSION (1, 8, 0)
void pango_renderer_draw_layout (PangoRenderer *renderer, PangoLayout *layout, int x, int y);
void pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoLayoutLine *line, int x, int y);
# FIXME: We do have typemaps for PangoGlyphString, but no way to actually get
# one. pango_shape() would be about the only function that returns one,
# AFAICT.
# void pango_renderer_draw_glyphs (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y);
void pango_renderer_draw_rectangle (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height);
void pango_renderer_draw_error_underline (PangoRenderer *renderer, int x, int y, int width, int height);
void pango_renderer_draw_trapezoid (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22);
void pango_renderer_draw_glyph (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y);
void pango_renderer_activate (PangoRenderer *renderer);
void pango_renderer_deactivate (PangoRenderer *renderer);
void pango_renderer_part_changed (PangoRenderer *renderer, PangoRenderPart part);
void pango_renderer_set_color (PangoRenderer *renderer, PangoRenderPart part, const PangoColor_ornull *color);
PangoColor_ornull *pango_renderer_get_color (PangoRenderer *renderer, PangoRenderPart part);
void pango_renderer_set_matrix (PangoRenderer *renderer, const PangoMatrix_ornull *matrix);
const PangoMatrix_ornull *pango_renderer_get_matrix (PangoRenderer *renderer);
#endif /* 1.8.0 */
#if PANGO_CHECK_VERSION (1, 20, 0)
PangoLayout * pango_renderer_get_layout (PangoRenderer *renderer);
PangoLayoutLine * pango_renderer_get_layout_line (PangoRenderer *renderer);
#endif
Pango-1.227/xs/PangoScript.xs 000644 001750 000024 00000006367 12301027576 017142 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2004, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
/* ------------------------------------------------------------------------- */
#if PANGO_CHECK_VERSION (1, 4, 0)
static gpointer
gtk2perl_pango_script_iter_copy (gpointer boxed)
{
croak ("Can't copy a PangoScriptIter");
return boxed;
}
GType
gtk2perl_pango_script_iter_get_type (void)
{
static GType t = 0;
if (!t)
t = g_boxed_type_register_static ("PangoScriptIter",
(GBoxedCopyFunc) gtk2perl_pango_script_iter_copy,
(GBoxedFreeFunc) pango_script_iter_free);
return t;
}
#endif
/* ------------------------------------------------------------------------- */
MODULE = Pango::Script PACKAGE = Pango::Script PREFIX = pango_script_
BOOT:
PERL_UNUSED_VAR (file);
#if PANGO_CHECK_VERSION (1, 4, 0)
## PangoScript pango_script_for_unichar (gunichar ch)
PangoScript
pango_script_for_unichar (class, ch)
gunichar ch
C_ARGS:
ch
## PangoLanguage * pango_script_get_sample_language (PangoScript script)
PangoLanguage_ornull *
pango_script_get_sample_language (class, script)
PangoScript script
C_ARGS:
script
MODULE = Pango::Script PACKAGE = Pango::ScriptIter PREFIX = pango_script_iter_
## Using gchar instead of char here all over the place to enforce utf8.
## PangoScriptIter * pango_script_iter_new (const char *text, int length)
PangoScriptIter *
pango_script_iter_new (class, text)
const gchar *text
CODE:
RETVAL = pango_script_iter_new (text, strlen (text));
OUTPUT:
RETVAL
=for apidoc
Returns the bounds and the script for the region pointed to by I<$iter>.
=cut
## void pango_script_iter_get_range (PangoScriptIter *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, PangoScript *script)
void
pango_script_iter_get_range (iter)
PangoScriptIter *iter
PREINIT:
gchar *start = NULL;
gchar *end = NULL;
PangoScript script;
PPCODE:
pango_script_iter_get_range (iter,
(const char **) &start,
(const char **) &end,
&script);
EXTEND (sp, 3);
PUSHs (sv_2mortal (newSVGChar (start)));
PUSHs (sv_2mortal (newSVGChar (end)));
PUSHs (sv_2mortal (newSVPangoScript (script)));
## gboolean pango_script_iter_next (PangoScriptIter *iter)
gboolean
pango_script_iter_next (iter)
PangoScriptIter *iter
## void pango_script_iter_free (PangoScriptIter *iter)
MODULE = Pango::Script PACKAGE = Pango::Language PREFIX = pango_language_
## gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script)
gboolean
pango_language_includes_script (language, script)
PangoLanguage *language
PangoScript script
#endif /* 1.4.0 */
Pango-1.227/xs/PangoTabs.xs 000644 001750 000024 00000007735 12301027576 016567 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2003, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::TabArray PACKAGE = Pango::TabArray PREFIX = pango_tab_array_
## PangoTabArray *pango_tab_array_new (gint initial_size, gboolean positions_in_pixels)
### PangoTabArray *pango_tab_array_new_with_positions (gint size, gboolean positions_in_pixels, PangoTabAlign first_alignment, gint first_position, ...)
=for apidoc Pango::TabArray::new
=for arg ... pairs of Pango::TabAlign's and integers, the alignments and positions of the tab stops.
=cut
=for apidoc new_with_positions
=for arg ... pairs of Pango::TabAlign's and integers, the alignments and positions of the tab stops.
Alias for Lnew ($initial_size, $positions_in_pixels, ...)>.
=cut
PangoTabArray_own *
pango_tab_array_new (class, initial_size, positions_in_pixels, ...)
gint initial_size
gboolean positions_in_pixels
ALIAS:
new_with_positions = 1
CODE:
PERL_UNUSED_VAR (ix);
RETVAL = pango_tab_array_new (initial_size, positions_in_pixels);
if (items > 3) {
int i;
for (i = 3 ; i < items ; i += 2) {
pango_tab_array_set_tab (RETVAL, (i - 3) / 2,
SvPangoTabAlign (ST (i)),
SvIV (ST (i+1)));
}
}
OUTPUT:
RETVAL
## see Glib::Boxed
## PangoTabArray *pango_tab_array_copy (PangoTabArray *src)
## void pango_tab_array_free (PangoTabArray *tab_array)
## gint pango_tab_array_get_size (PangoTabArray *tab_array)
gint
pango_tab_array_get_size (tab_array)
PangoTabArray *tab_array
## void pango_tab_array_resize (PangoTabArray *tab_array, gint new_size)
void
pango_tab_array_resize (tab_array, new_size)
PangoTabArray *tab_array
gint new_size
## void pango_tab_array_set_tab (PangoTabArray *tab_array, gint tab_index, PangoTabAlign alignment, gint location)
void
pango_tab_array_set_tab (tab_array, tab_index, alignment, location)
PangoTabArray *tab_array
gint tab_index
PangoTabAlign alignment
gint location
## void pango_tab_array_get_tab (PangoTabArray *tab_array, gint tab_index, PangoTabAlign *alignment, gint *location)
void
pango_tab_array_get_tab (PangoTabArray *tab_array, gint tab_index)
PREINIT:
PangoTabAlign alignment;
gint location;
PPCODE:
pango_tab_array_get_tab (tab_array, tab_index, &alignment, &location);
EXTEND (SP, 2);
PUSHs (sv_2mortal (newSVPangoTabAlign (alignment)));
PUSHs (sv_2mortal (newSViv (location)));
## void pango_tab_array_get_tabs (PangoTabArray *tab_array, PangoTabAlign **alignments, gint **locations)
=for apidoc
Returns a list of Pango::TabAlign's, alignments, and integers, locations.
Even elemtents are alignments and odd elements are locations, so 0 is the first
alignment and 1 is the first location, 2 the second alignment, 3 the second
location, etc.
=cut
void
pango_tab_array_get_tabs (tab_array)
PangoTabArray *tab_array
PREINIT:
PangoTabAlign *alignments = NULL;
gint *locations = NULL, i, n;
PPCODE:
pango_tab_array_get_tabs (tab_array, &alignments, &locations);
n = pango_tab_array_get_size (tab_array);
EXTEND (SP, 2 * n);
for (i = 0 ; i < n ; i++) {
PUSHs (sv_2mortal (newSVPangoTabAlign (alignments[i])));
PUSHs (sv_2mortal (newSViv (locations[i])));
}
g_free (alignments);
g_free (locations);
## gboolean pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array)
gboolean
pango_tab_array_get_positions_in_pixels (tab_array)
PangoTabArray *tab_array
Pango-1.227/xs/PangoTypes.xs 000644 001750 000024 00000005123 12301027576 016767 0 ustar 00bdmanning staff 000000 000000 /*
* Copyright (c) 2004, 2014 by the gtk2-perl team (see the AUTHORS
* file for a full list of authors)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for
* the full license terms.
*
*/
#include "pango-perl.h"
MODULE = Pango::Types PACKAGE = Pango PREFIX = pango_
#if PANGO_CHECK_VERSION (1, 4, 0)
=for object Pango::Language
=cut
## PangoDirection pango_find_base_dir (const gchar *text, gint length)
PangoDirection
pango_find_base_dir (class, text)
const gchar *text
C_ARGS:
text, strlen (text)
#endif
#if PANGO_CHECK_VERSION (1, 16, 0)
=for object Pango::Font
=cut
=for apidoc __function__
=cut
int pango_units_from_double (double d);
=for apidoc __function__
=cut
double pango_units_to_double (int i);
=for apidoc __function__
=cut
## void pango_extents_to_pixels (PangoRectangle *inclusive, PangoRectangle *nearest)
void
pango_extents_to_pixels (PangoRectangle *inclusive, PangoRectangle *nearest)
PPCODE:
pango_extents_to_pixels (inclusive, nearest);
EXTEND (SP, 2);
PUSHs (sv_2mortal (newSVPangoRectangle (inclusive)));
PUSHs (sv_2mortal (newSVPangoRectangle (nearest)));
#endif
MODULE = Pango::Types PACKAGE = Pango::Language PREFIX = pango_language_
## PangoLanguage * pango_language_from_string (const char *language)
PangoLanguage *
pango_language_from_string (class, language)
const char *language
CODE:
RETVAL = pango_language_from_string (language);
OUTPUT:
RETVAL
## const char * pango_language_to_string (PangoLanguage *language)
const char *
pango_language_to_string (language)
PangoLanguage *language
# FIXME: WTF is the Gnome2::Pango::Language::matches alias doing here? It's
# totally bogus, but has been in a stable release already ...
## gboolean pango_language_matches (PangoLanguage *language, const char *range_list)
gboolean
pango_language_matches (language, range_list)
PangoLanguage *language
const char *range_list
ALIAS:
Gnome2::Pango::Language::matches = 0
CLEANUP:
PERL_UNUSED_VAR (ix);
#if PANGO_CHECK_VERSION (1, 16, 0)
## PangoLanguage * pango_language_get_default (void)
PangoLanguage *
pango_language_get_default (class)
C_ARGS:
/* void */
#endif
Pango-1.227/t/inc/ 000755 001750 000024 00000000000 12651231244 014700 5 ustar 00bdmanning staff 000000 000000 Pango-1.227/t/Pango.t 000644 001750 000024 00000000454 11664366563 015403 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 4;
use_ok ('Pango');
my @version = Pango->GET_VERSION_INFO;
is (@version, 3, 'version info is three items long');
ok (Pango->CHECK_VERSION(0, 0, 0), 'CHECK_VERSION pass');
ok (!Pango->CHECK_VERSION(50, 0, 0), 'CHECK_VERSION fail');
Pango-1.227/t/PangoAttributes.t 000644 001750 000024 00000032601 11664366563 017451 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 202;
#
# pango_color_parse(), pango_color_to_string()
#
my $color = Pango::Color->parse ('white');
isa_ok ($color, 'Pango::Color');
isa_ok ($color, 'ARRAY');
is_deeply ($color, [0xffff, 0xffff, 0xffff]);
SKIP: {
skip 'new 1.16 stuff', 2
unless Pango->CHECK_VERSION (1, 16, 0);
is (Pango::Color->to_string ($color), '#ffffffffffff');
is ($color->to_string, '#ffffffffffff');
}
#
# PangoAttrLanguage
#
my $lang = Pango::Language->from_string ('de-de');
my $attr = Pango::AttrLanguage->new ($lang);
isa_ok ($attr, 'Pango::AttrLanguage');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value->to_string, 'de-de');
$lang = Pango::Language->from_string ('en-us');
$attr->value ($lang);
is ($attr->value->to_string, 'en-us');
$attr = Pango::AttrLanguage->new ($lang, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrFamily
#
$attr = Pango::AttrFamily->new ('sans');
isa_ok ($attr, 'Pango::AttrFamily');
isa_ok ($attr, 'Pango::AttrString');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'sans');
is ($attr->value ('sans-serif'), 'sans');
is ($attr->value, 'sans-serif');
$attr = Pango::AttrFamily->new ('sans', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrForeground
#
$attr = Pango::AttrForeground->new (0, 0, 0);
isa_ok ($attr, 'Pango::AttrForeground');
isa_ok ($attr, 'Pango::AttrColor');
isa_ok ($attr, 'Pango::Attribute');
is_deeply ($attr->value, [0, 0, 0]);
is_deeply ($attr->value ([0xffff, 0xffff, 0xffff]), [0, 0, 0]);
is_deeply ($attr->value, [0xffff, 0xffff, 0xffff]);
$attr = Pango::AttrForeground->new (0, 0, 0, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrBackground
#
$attr = Pango::AttrBackground->new (0, 0, 0);
isa_ok ($attr, 'Pango::AttrBackground');
isa_ok ($attr, 'Pango::AttrColor');
isa_ok ($attr, 'Pango::Attribute');
is_deeply ($attr->value, [0, 0, 0]);
$attr->value ([0xffff, 0xffff, 0xffff]);
is_deeply ($attr->value, [0xffff, 0xffff, 0xffff]);
$attr = Pango::AttrBackground->new (0, 0, 0, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrSize
#
$attr = Pango::AttrSize->new (23);
isa_ok ($attr, 'Pango::AttrSize');
isa_ok ($attr, 'Pango::AttrInt');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 23);
$attr->value (42);
is ($attr->value, 42);
$attr = Pango::AttrSize->new (23, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
SKIP: {
skip 'Pango::AttrSize->new_absolute', 7
unless Pango->CHECK_VERSION (1, 8, 0);
$attr = Pango::AttrSize->new_absolute (23);
isa_ok ($attr, 'Pango::AttrSize');
isa_ok ($attr, 'Pango::AttrInt');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 23);
$attr->value (42);
is ($attr->value, 42);
$attr = Pango::AttrSize->new_absolute (23, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrStyle
#
$attr = Pango::AttrStyle->new ('normal');
isa_ok ($attr, 'Pango::AttrStyle');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'normal');
$attr->value ('italic');
is ($attr->value, 'italic');
$attr = Pango::AttrStyle->new ('normal', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrWeight
#
$attr = Pango::AttrWeight->new ('bold');
isa_ok ($attr, 'Pango::AttrWeight');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'bold');
$attr->value ('heavy');
is ($attr->value, 'heavy');
$attr = Pango::AttrWeight->new ('bold', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrVariant
#
$attr = Pango::AttrVariant->new ('normal');
isa_ok ($attr, 'Pango::AttrVariant');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'normal');
$attr->value ('small-caps');
is ($attr->value, 'small-caps');
$attr = Pango::AttrVariant->new ('normal', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrStretch
#
$attr = Pango::AttrStretch->new ('normal');
isa_ok ($attr, 'Pango::AttrStretch');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'normal');
$attr->value ('condensed');
is ($attr->value, 'condensed');
$attr = Pango::AttrStretch->new ('normal', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrUnderline
#
$attr = Pango::AttrUnderline->new ('none');
isa_ok ($attr, 'Pango::AttrUnderline');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'none');
$attr->value ('double');
is ($attr->value, 'double');
$attr = Pango::AttrUnderline->new ('none', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrStrikethrough
#
$attr = Pango::AttrStrikethrough->new (FALSE);
isa_ok ($attr, 'Pango::AttrStrikethrough');
isa_ok ($attr, 'Pango::Attribute');
ok (!$attr->value);
$attr->value (TRUE);
ok ($attr->value);
$attr = Pango::AttrStrikethrough->new (FALSE, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrFontDesc
#
my $desc = Pango::FontDescription->from_string ('Sans 12');
$attr = Pango::AttrFontDesc->new ($desc);
isa_ok ($attr, 'Pango::AttrFontDesc');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->desc->to_string, 'Sans 12');
$desc = Pango::FontDescription->from_string ('Sans 14');
is ($attr->desc ($desc)->to_string, 'Sans 12');
is ($attr->desc->to_string, 'Sans 14');
$attr = Pango::AttrFontDesc->new ($desc, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrScale
#
$attr = Pango::AttrScale->new (2.0);
isa_ok ($attr, 'Pango::AttrScale');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 2.0);
$attr->value (4.0);
is ($attr->value, 4.0);
$attr = Pango::AttrScale->new (2.0, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrRise
#
$attr = Pango::AttrRise->new (23);
isa_ok ($attr, 'Pango::AttrRise');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 23);
$attr->value (42);
is ($attr->value, 42);
$attr = Pango::AttrRise->new (23, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrShape
#
my $ink = { x => 23, y => 42, width => 10, height => 15 };
my $logical = { x => 42, y => 23, width => 15, height => 10 };
$attr = Pango::AttrShape->new ($ink, $logical);
isa_ok ($attr, 'Pango::AttrShape');
isa_ok ($attr, 'Pango::Attribute');
is_deeply ($attr->ink_rect, $ink);
is_deeply ($attr->logical_rect, $logical);
$attr->ink_rect ($logical);
is_deeply ($attr->ink_rect, $logical);
$attr->logical_rect ($ink);
is_deeply ($attr->logical_rect, $ink);
$attr = Pango::AttrShape->new ($ink, $logical, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
#
# PangoAttrFallback
#
SKIP: {
skip 'Pango::AttrFallback', 6
unless Pango->CHECK_VERSION (1, 4, 0);
$attr = Pango::AttrFallback->new (FALSE);
isa_ok ($attr, 'Pango::AttrFallback');
isa_ok ($attr, 'Pango::Attribute');
ok (!$attr->value);
$attr->value (TRUE);
ok ($attr->value);
$attr = Pango::AttrFallback->new (FALSE, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrLetterSpacing
#
SKIP: {
skip 'Pango::AttrLetterSpacing', 7
unless Pango->CHECK_VERSION (1, 6, 0);
$attr = Pango::AttrLetterSpacing->new (23);
isa_ok ($attr, 'Pango::AttrLetterSpacing');
isa_ok ($attr, 'Pango::AttrInt');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 23);
$attr->value (42);
is ($attr->value, 42);
$attr = Pango::AttrLetterSpacing->new (23, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrUnderlineColor
#
SKIP: {
skip 'Pango::AttrUnderlineColor', 8
unless Pango->CHECK_VERSION (1, 8, 0);
$attr = Pango::AttrUnderlineColor->new (0, 0, 0);
isa_ok ($attr, 'Pango::AttrUnderlineColor');
isa_ok ($attr, 'Pango::AttrColor');
isa_ok ($attr, 'Pango::Attribute');
is_deeply ($attr->value, [0, 0, 0]);
is_deeply ($attr->value ([0xffff, 0xffff, 0xffff]), [0, 0, 0]);
is_deeply ($attr->value, [0xffff, 0xffff, 0xffff]);
$attr = Pango::AttrUnderlineColor->new (0, 0, 0, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrStrikethroughColor
#
SKIP: {
skip 'Pango::AttrStrikethroughColor', 8
unless Pango->CHECK_VERSION (1, 8, 0);
$attr = Pango::AttrStrikethroughColor->new (0, 0, 0);
isa_ok ($attr, 'Pango::AttrStrikethroughColor');
isa_ok ($attr, 'Pango::AttrColor');
isa_ok ($attr, 'Pango::Attribute');
is_deeply ($attr->value, [0, 0, 0]);
is_deeply ($attr->value ([0xffff, 0xffff, 0xffff]), [0, 0, 0]);
is_deeply ($attr->value, [0xffff, 0xffff, 0xffff]);
$attr = Pango::AttrStrikethroughColor->new (0, 0, 0, 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrGravity, PangoAttrGravityHint
#
SKIP: {
skip 'PangoAttrGravity, PangoAttrGravityHint', 14
unless Pango->CHECK_VERSION (1, 16, 0);
$attr = Pango::AttrGravity->new ('south');
isa_ok ($attr, 'Pango::AttrGravity');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'south');
is ($attr->value ('north'), 'south');
is ($attr->value, 'north');
$attr = Pango::AttrGravity->new ('south', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
$attr = Pango::AttrGravityHint->new ('strong');
isa_ok ($attr, 'Pango::AttrGravityHint');
isa_ok ($attr, 'Pango::Attribute');
is ($attr->value, 'strong');
is ($attr->value ('line'), 'strong');
is ($attr->value, 'line');
$attr = Pango::AttrGravityHint->new ('strong', 23, 42);
is ($attr->start_index, 23);
is ($attr->end_index, 42);
}
#
# PangoAttrList
#
my $attr_one = Pango::AttrWeight->new ('light', 23, 42);
my $attr_two = Pango::AttrWeight->new ('normal', 23, 42);
my $attr_three = Pango::AttrWeight->new ('bold', 23, 42);
my $list_one = Pango::AttrList->new;
$list_one->insert ($attr_one);
$list_one->insert_before ($attr_two);
$list_one->change ($attr_three);
my $list_two = Pango::AttrList->new;
$list_one->insert ($attr_three);
$list_one->insert_before ($attr_two);
$list_one->change ($attr_one);
$list_one->splice ($list_two, 0, 2);
#
# PangoAttrIterator
#
my $list = Pango::AttrList->new;
my $attr_weight = Pango::AttrWeight->new ('normal', 0, 23);
$list->insert ($attr_weight);
my $attr_variant = Pango::AttrVariant->new ('normal', 0, 42);
$list->insert ($attr_variant);
my $iter = $list->get_iterator;
isa_ok ($iter, 'Pango::AttrIterator');
is_deeply ([$iter->range], [0, 23]);
ok ($iter->get ('weight')->equal ($attr_weight));
SKIP: {
skip 'get_attrs', 6
unless Pango->CHECK_VERSION (1, 2, 0);
my @attrs = $iter->get_attrs;
is (scalar @attrs, 2);
ok ($attrs[1]->equal ($attr_variant));
ok ($iter->next);
ok ($iter->next);
@attrs = $iter->get_attrs;
is (scalar @attrs, 0);
is ($iter->get ('weight'), undef);
}
# get_font
$list = Pango::AttrList->new;
$lang = Pango::Language->from_string ('de-de');
$attr = Pango::AttrLanguage->new ($lang, 0, 23);
$list->insert($attr);
$attr = Pango::AttrWeight->new ('bold', 0, 23);
$list->insert($attr);
$iter = $list->get_iterator;
my ($desc_new, $lang_new, @extra) = $iter->get_font;
is ($desc_new->get_weight, 'bold');
is ($lang_new->to_string, 'de-de');
is (scalar @extra, 0);
$attr = Pango::AttrBackground->new (0, 0, 0, 0, 23);
$list->insert($attr);
$attr = Pango::AttrForeground->new (0, 0, 0, 0, 23);
$list->insert($attr);
$iter = $list->get_iterator;
($desc_new, $lang_new, @extra) = $iter->get_font;
is ($desc_new->get_weight, 'bold');
is ($lang_new->to_string, 'de-de');
is (scalar @extra, 2);
isa_ok ($extra[0], 'Pango::AttrBackground');
isa_ok ($extra[1], 'Pango::AttrForeground');
# filter
SKIP: {
skip 'filter', 12
unless Pango->CHECK_VERSION (1, 2, 0);
# run four times -> 8 tests
my $callback = sub {
my ($attr, $data) = @_;
isa_ok ($attr, 'Pango::Attribute');
is ($data, 'urgs');
return $attr->isa ('Pango::AttrWeight');
};
my $list_new = $list->filter ($callback, 'urgs');
$iter = $list_new->get_iterator;
my @attrs = $iter->get_attrs;
is (scalar @attrs, 1);
isa_ok ($attrs[0], 'Pango::AttrWeight');
ok ($iter->next);
ok (!$iter->next);
}
#
# pango_parse_markup()
#
my ($attr_list, $text, $accel_char) =
Pango->parse_markup
('this text is really cool (no lie)');
isa_ok ($attr_list, 'Pango::AttrList');
is ($text, 'this text is really cool (no lie)', 'text is stripped of tags');
ok ((not defined $accel_char), 'no accel_char if no accel_marker');
SKIP: {
skip 'need get_attrs', 7
unless Pango->CHECK_VERSION (1, 2, 0);
# first, only
my $iter = $attr_list->get_iterator;
my @attrs = $iter->get_attrs;
is (scalar @attrs, 1);
isa_ok ($attrs[0], 'Pango::AttrScale');
# then, and
$iter->next;
@attrs = $iter->get_attrs;
is (scalar @attrs, 2);
isa_ok ($attrs[0], 'Pango::AttrScale');
isa_ok ($attrs[1], 'Pango::AttrStyle');
# finally, only again
$iter->next;
@attrs = $iter->get_attrs;
is (scalar @attrs, 1);
isa_ok ($attrs[0], 'Pango::AttrScale');
}
($attr_list, $text) = Pango->parse_markup ('no markup here');
isa_ok ($attr_list, 'Pango::AttrList');
is ($text, 'no markup here', 'no tags, nothing stripped');
($attr_list, $text, $accel_char) =
Pango->parse_markup ('Text with _accel__chars', '_');
isa_ok ($attr_list, 'Pango::AttrList');
is ($text, 'Text with accel_chars');
is ($accel_char, 'a');
# invalid markup causes an exception...
eval { Pango->parse_markup ('invalid markup') };
isa_ok ($@, 'Glib::Error');
isa_ok ($@, 'Glib::Markup::Error');
is ($@->domain, 'g-markup-error-quark');
ok ($@->matches ('Glib::Markup::Error', 'unknown-element'),
'invalid markup causes exceptions');
$@ = undef;
__END__
Copyright (C) 2005-2006 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoCairo.t 000644 001750 000024 00000007410 11664366563 016360 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper;
if (UNIVERSAL::can("Pango::Cairo::FontMap", "new") &&
Pango -> CHECK_VERSION(1, 10, 0)) {
plan tests => 22;
} else {
plan skip_all => "PangoCairo stuff: need Cairo and pango >= 1.10.0";
}
my $fontmap = Pango::Cairo::FontMap -> new();
isa_ok($fontmap, "Pango::Cairo::FontMap");
isa_ok($fontmap, "Pango::FontMap");
SKIP: {
skip 'new 1.18 stuff', 3
unless Pango -> CHECK_VERSION(1, 18, 0);
$fontmap = Pango::Cairo::FontMap -> new_for_font_type('ft');
skip 'new_for_font_type returned undef', 3
unless defined $fontmap;
isa_ok($fontmap, "Pango::Cairo::FontMap");
isa_ok($fontmap, "Pango::FontMap");
is($fontmap -> get_font_type(), 'ft');
}
$fontmap = Pango::Cairo::FontMap -> get_default();
isa_ok($fontmap, "Pango::Cairo::FontMap");
isa_ok($fontmap, "Pango::FontMap");
$fontmap -> set_resolution(72);
is($fontmap -> get_resolution(), 72);
my $context = $fontmap -> create_context();
isa_ok($context, "Pango::Context");
# Just to make sure this is a valid Pango::FontMap
isa_ok(($fontmap -> list_families())[0], "Pango::FontFamily");
my $target = Cairo::ImageSurface -> create("argb32", 100, 100);
my $cr = Cairo::Context -> create($target);
Pango::Cairo::update_context($cr, $context);
my $options = Cairo::FontOptions -> create();
# Function interface
{
Pango::Cairo::Context::set_font_options($context, $options);
isa_ok(Pango::Cairo::Context::get_font_options($context),
"Cairo::FontOptions");
Pango::Cairo::Context::set_resolution($context, 72);
is(Pango::Cairo::Context::get_resolution($context), 72);
}
# Method interface
{
isa_ok($context, "Pango::Cairo::Context");
$context -> set_font_options($options);
isa_ok($context -> get_font_options(), "Cairo::FontOptions");
$context -> set_resolution(72);
is($context -> get_resolution(), 72);
}
my $layout = Pango::Cairo::create_layout($cr);
isa_ok($layout, "Pango::Layout");
my $line = $layout -> get_line(0);
Pango::Cairo::show_layout_line($cr, $line);
Pango::Cairo::show_layout($cr, $layout);
Pango::Cairo::layout_line_path($cr, $line);
Pango::Cairo::layout_path($cr, $layout);
Pango::Cairo::update_layout($cr, $layout);
# FIXME: pango_cairo_show_glyph_string, pango_cairo_glyph_string_path.
SKIP: {
skip "error line stuff", 0
unless Pango -> CHECK_VERSION(1, 14, 0);
Pango::Cairo::show_error_underline($cr, 23, 42, 5, 5);
Pango::Cairo::error_underline_path($cr, 23, 42, 5, 5);
}
SKIP: {
skip 'new 1.18 stuff', 6
unless Pango -> CHECK_VERSION(1, 18, 0);
$context -> set_shape_renderer(undef, undef);
my $target = Cairo::ImageSurface -> create('argb32', 100, 100);
my $cr = Cairo::Context -> create($target);
my $layout = Pango::Cairo::create_layout($cr);
Pango::Cairo::Context::set_shape_renderer(
$layout -> get_context(),
sub {
my ($cr, $shape, $do_path, $data) = @_;
isa_ok($cr, 'Cairo::Context');
isa_ok($shape, 'Pango::AttrShape');
ok(defined $do_path);
is($data, 'bla');
},
'bla');
$layout -> set_text('Bla');
my $ink = { x => 23, y => 42, width => 10, height => 15 };
my $logical = { x => 42, y => 23, width => 15, height => 10 };
my $attr = Pango::AttrShape -> new($ink, $logical, 0, 1);
my $list = Pango::AttrList -> new();
$list -> insert($attr);
$layout -> set_attributes($list);
Pango::Cairo::show_layout($cr, $layout);
my $desc = Pango::FontDescription -> from_string('Sans 10');
my $font = $fontmap -> load_font($context, $desc);
skip 'could not load font', 2
unless defined $font;
isa_ok($font, 'Pango::Cairo::Font');
isa_ok($font -> get_scaled_font(), 'Cairo::ScaledFont');
}
__END__
Copyright (C) 2005 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoContext.t 000644 001750 000024 00000003440 11664366563 016746 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 15;
my $label = Gtk2::Label -> new("Bla");
my $context = $label -> create_pango_context();
isa_ok($context, "Pango::Context");
my @families = $context->list_families;
ok (@families > 0, 'got a list of somethings');
isa_ok ($families[0], 'Pango::FontFamily');
my $font = Pango::FontDescription -> from_string("Sans 12");
my $language = Gtk2 -> get_default_language();
$context -> set_font_description($font);
isa_ok($context -> get_font_description(), "Pango::FontDescription");
$context -> set_language($language);
isa_ok($context -> get_language(), "Pango::Language");
$context -> set_base_dir("ltr");
is($context -> get_base_dir(), "ltr");
isa_ok($context -> load_font($font), "Pango::Font");
isa_ok($context -> load_fontset($font, $language), "Pango::Fontset");
isa_ok($context -> get_metrics($font, $language), "Pango::FontMetrics");
SKIP: {
skip("[sg]et_matrix are new in 1.6", 2)
unless (Pango -> CHECK_VERSION(1, 6, 0));
$context -> set_matrix(Pango::Matrix -> new());
isa_ok($context -> get_matrix(), "Pango::Matrix");
$context -> set_matrix(undef);
is($context -> get_matrix(), undef);
}
SKIP: {
skip("get_font_map is new in 1.6", 1)
unless (Pango -> CHECK_VERSION(1, 6, 0));
isa_ok($context -> get_font_map(), "Pango::FontMap");
}
SKIP: {
skip("new 1.16 stuff", 3)
unless (Pango -> CHECK_VERSION(1, 16, 0));
ok(defined $context -> get_gravity());
$context -> set_base_gravity("north");
is($context -> get_base_gravity(), "north");
$context -> set_gravity_hint("natural");
is($context -> get_gravity_hint(), "natural");
}
__END__
Copyright (C) 2003-2004 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoFont.t 000644 001750 000024 00000011703 11664366563 016231 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 57;
my $description = Pango::FontDescription -> new();
isa_ok($description, "Pango::FontDescription");
like($description -> hash(), qr/^\d+$/);
is($description -> equal($description), 1);
$description -> set_family("Sans");
$description -> set_family_static("Sans");
is($description -> get_family(), "Sans");
$description -> set_style("normal");
is($description -> get_style(), "normal");
$description -> set_variant("normal");
is($description -> get_variant(), "normal");
$description -> set_weight("bold");
is($description -> get_weight(), "bold");
$description -> set_stretch("condensed");
is($description -> get_stretch(), "condensed");
$description -> set_size(23);
is($description -> get_size(), 23);
isa_ok($description -> get_set_fields(), "Pango::FontMask");
$description -> unset_fields([qw(size stretch)]);
$description -> merge($description, 1);
$description -> merge_static($description, 1);
ok(!$description -> better_match($description, $description));
ok($description -> better_match(undef, $description));
$description = Pango::FontDescription -> from_string("Sans 12");
isa_ok($description, "Pango::FontDescription");
is($description -> to_string(), "Sans 12");
ok(defined($description -> to_filename()));
SKIP: {
skip("new 1.8 stuff", 1)
unless (Pango -> CHECK_VERSION(1, 8, 0));
$description -> set_absolute_size(23.42);
is($description -> get_size_is_absolute(), TRUE);
}
SKIP: {
skip("new 1.16 stuff", 1)
unless (Pango -> CHECK_VERSION(1, 16, 0));
$description -> set_gravity("south");
is($description -> get_gravity(), "south");
}
###############################################################################
my $label = Gtk2::Label -> new("Bla");
my $context = $label -> create_pango_context();
my $font = $context -> load_font($description);
my $language = Gtk2 -> get_default_language();
my $number = qr/^-?\d+$/;
isa_ok($font -> describe(), "Pango::FontDescription");
SKIP: {
skip "new 1.14 stuff", 1
unless Pango -> CHECK_VERSION(1, 14, 0);
isa_ok($font -> describe_with_absolute_size(), "Pango::FontDescription");
}
foreach my $rectangle ($font -> get_glyph_extents(23)) {
foreach my $key (qw(x y width height)) {
like($rectangle -> { $key }, $number);
}
}
my $metrics = $font -> get_metrics($language);
isa_ok($metrics, "Pango::FontMetrics");
like($metrics -> get_ascent(), $number);
like($metrics -> get_descent(), $number);
like($metrics -> get_approximate_char_width(), $number);
like($metrics -> get_approximate_digit_width(), $number);
SKIP: {
skip("new 1.6 stuff", 4)
unless (Pango -> CHECK_VERSION(1, 6, 0));
like($metrics -> get_underline_position(), $number);
like($metrics -> get_underline_thickness(), $number);
like($metrics -> get_strikethrough_position(), $number);
like($metrics -> get_strikethrough_thickness(), $number);
}
SKIP: {
skip("new 1.10 stuff", 1)
unless (Pango -> CHECK_VERSION(1, 10, 0));
isa_ok($font -> get_font_map(), "Pango::FontMap");
}
###############################################################################
like(int(Pango -> scale()), $number);
like(int(Pango -> scale_xx_small()), $number);
like(int(Pango -> scale_x_small()), $number);
like(int(Pango -> scale_small()), $number);
like(int(Pango -> scale_medium()), $number);
like(int(Pango -> scale_large()), $number);
like(int(Pango -> scale_x_large()), $number);
like(int(Pango -> scale_xx_large()), $number);
like(int(Pango -> PANGO_PIXELS(23)), $number);
like(int(Pango -> pixels(23)), $number);
###############################################################################
my @families = $context->list_families;
ok (@families > 0, 'got a list of families');
isa_ok ($families[0], 'Pango::FontFamily');
ok ($families[0]->get_name, 'get_name works');
SKIP: {
skip "is_monospace is new in 1.4.0", 1
unless Pango->CHECK_VERSION (1, 4, 0);
# we don't really have a way of knowing if this font should actually
# be monospaced, so just check that the function doesn't die.
$families[0]->is_monospace;
ok (1, 'is_monospace works');
}
my @faces = $families[0]->list_faces;
#print "faces @faces\n";
ok (@faces > 0, 'got a list of faces');
isa_ok ($faces[0], 'Pango::FontFace');
my $desc = $faces[0]->describe;
isa_ok ($desc, 'Pango::FontDescription');
ok ($faces[0]->get_face_name);
SKIP: {
skip "list_sizes is new in 1.4.0", 1
unless Pango->CHECK_VERSION (1, 4, 0);
# again, whether we'll get sizes depends on whether this first font and
# face is a bitmapped font. we can't know that, so just test that the
# call does not result in a crash.
my @sizes = $faces[0]->list_sizes;
#print "sizes @sizes\n";
ok (1, 'list_sizes did not crash');
}
SKIP: {
skip("new 1.18 stuff", 1)
unless (Pango -> CHECK_VERSION(1, 18, 0));
ok(defined $faces[0]->is_synthesized);
}
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoFontMap.t 000644 001750 000024 00000001455 11664366563 016672 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 4;
my $label = Gtk2::Label -> new("Bla");
my $context = $label -> create_pango_context();
isa_ok($context, "Pango::Context");
SKIP: {
skip("get_font_map is new in 1.6", 3)
unless (Pango -> CHECK_VERSION(1, 6, 0));
my $map = $context -> get_font_map();
my $desc = Pango::FontDescription -> from_string("Sans 12");
my $lang = Pango::Language -> from_string("de_DE");
isa_ok($map -> load_font($context, $desc), "Pango::Font");
isa_ok($map -> load_fontset($context, $desc, $lang), "Pango::Fontset");
isa_ok(($map -> list_families())[0], "Pango::FontFamily");
}
__END__
Copyright (C) 2004 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoFontset.t 000644 001750 000024 00000001664 11664366563 016752 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 7;
my $label = Gtk2::Label -> new("Bla");
my $context = $label -> create_pango_context();
my $font = Pango::FontDescription -> from_string("Sans 12");
my $language = Gtk2 -> get_default_language();
my $set = $context -> load_fontset($font, $language);
isa_ok($set -> get_font(23), "Pango::Font");
isa_ok($set -> get_metrics(), "Pango::FontMetrics");
SKIP: {
skip("foreach is new in 1.4", 5)
unless (Pango -> CHECK_VERSION(1, 4, 0));
$set -> foreach(sub {
isa_ok(shift(), "Pango::Fontset");
isa_ok(shift(), "Pango::Font");
return 1;
});
$set -> foreach(sub {
isa_ok(shift(), "Pango::Fontset");
isa_ok(shift(), "Pango::Font");
is(shift(), "bla");
return 1;
}, "bla");
}
__END__
Copyright (C) 2004 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoGravity.t 000644 001750 000024 00000001075 11664366563 016751 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 4;
SKIP: {
skip "PangoGravity", 4
unless Pango->CHECK_VERSION (1, 16, 0);
is (Pango::Gravity::to_rotation ('south'), 0.0);
ok (!Pango::Gravity::is_vertical ('south'));
my $matrix = Pango::Matrix->new;
is (Pango::Gravity::get_for_matrix ($matrix), 'south');
is (Pango::Gravity::get_for_script ('common', 'south', 'strong'), 'south');
}
__END__
Copyright (C) 2007 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoLayout.t 000644 001750 000024 00000013225 11664366563 016601 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 73;
my $label = Gtk2::Label -> new("Bla");
my $context = $label -> create_pango_context();
my $layout = Pango::Layout -> new($context);
isa_ok($layout, "Pango::Layout");
is($layout -> get_context(), $context);
$layout -> context_changed();
$layout -> set_text("Bla bla.");
is($layout -> get_text(), "Bla bla.");
$layout -> set_markup("Bla bla.");
is($layout -> set_markup_with_accel("Bla _bla.", "_"), "b");
my $font = Pango::FontDescription -> new();
$layout -> set_font_description($font);
SKIP: {
skip("set_font_description was slightly borken", 0)
unless (Pango -> CHECK_VERSION(1, 4, 0));
$layout -> set_font_description(undef);
}
SKIP: {
skip("new 1.8 stuff", 2)
unless (Pango -> CHECK_VERSION(1, 8, 0));
is($layout -> get_font_description(), undef);
$layout -> set_font_description($font);
isa_ok($layout -> get_font_description(), "Pango::FontDescription");
}
$layout -> set_width(23);
is($layout -> get_width(), 23);
$layout -> set_wrap("word");
is($layout -> get_wrap(), "word");
$layout -> set_indent(5);
is($layout -> get_indent(), 5);
$layout -> set_spacing(5);
is($layout -> get_spacing(), 5);
$layout -> set_justify(1);
is($layout -> get_justify(), 1);
my $attributes = $layout -> get_attributes();
isa_ok($attributes, "Pango::AttrList");
my $copy = $attributes -> copy();
$layout -> set_attributes(undef);
is($layout -> get_attributes(), undef);
$layout -> set_attributes($copy);
SKIP: {
skip("[sg]et_auto_dir are new in 1.3.5", 1)
unless (Pango -> CHECK_VERSION(1, 4, 0));
$layout -> set_auto_dir(1);
is($layout -> get_auto_dir(), 1);
}
$layout -> set_alignment("left");
is($layout -> get_alignment(), "left");
$layout -> set_tabs(Pango::TabArray -> new(8, 0));
isa_ok($layout -> get_tabs(), "Pango::TabArray");
$layout -> set_single_paragraph_mode(1);
is($layout -> get_single_paragraph_mode(), 1);
my $attribute = ($layout -> get_log_attrs())[0];
isa_ok($attribute, "HASH");
is_deeply($attribute, {
is_line_break => 0,
is_mandatory_break => 0,
is_char_break => 1,
is_white => 0,
is_cursor_position => 1,
is_word_start => 1,
is_word_end => 0,
is_sentence_boundary =>
(Pango -> CHECK_VERSION(1, 22, 0) ? 1 : 0),
is_sentence_start => 1,
is_sentence_end => 0,
Pango -> CHECK_VERSION(1, 4, 0) ?
(backspace_deletes_character => 1) :
(),
Pango -> CHECK_VERSION(1, 18, 0) ?
(is_expandable_space => 0) :
()
});
foreach ($layout -> index_to_pos(23),
$layout -> get_cursor_pos(1),
$layout -> get_extents(),
$layout -> get_pixel_extents()) {
isa_ok($_, "HASH");
}
my $number = qr/^\d+$/;
my ($index, $trailing) = $layout -> xy_to_index(5, 5);
like($index, $number);
like($trailing, $number);
is_deeply([$layout -> move_cursor_visually(1, 0, 0, 1)], [1, 0]);
my ($width, $height) = $layout -> get_size();
like($width, $number);
like($height, $number);
($width, $height) = $layout -> get_pixel_size();
like($width, $number);
like($height, $number);
like($layout -> get_line_count(), $number);
{
my @lines = $layout -> get_lines();
isa_ok($lines[0], "Pango::LayoutLine");
is(scalar @lines, $layout -> get_line_count());
my $line = $layout -> get_line(0);
isa_ok($line, "Pango::LayoutLine");
my ($outside, $index, $trailing) = $line -> x_to_index(23);
ok(defined $outside && defined $index && defined $trailing);
ok(defined $line -> index_to_x(0, TRUE));
my @ranges = $line -> get_x_ranges(0, 8000);
isa_ok($ranges[0], "ARRAY");
is(scalar @{$ranges[0]}, 2);
my ($ink, $logical);
($ink, $logical) = $line -> get_extents();
isa_ok($ink, "HASH");
isa_ok($logical, "HASH");
($ink, $logical) = $line -> get_pixel_extents();
isa_ok($ink, "HASH");
isa_ok($logical, "HASH");
}
{
my $iter = $layout -> get_iter();
isa_ok($iter, "Pango::LayoutIter");
foreach ($iter -> get_char_extents(),
$iter -> get_cluster_extents(),
$iter -> get_run_extents(),
$iter -> get_line_extents(),
$iter -> get_layout_extents()) {
isa_ok($_, "HASH");
}
my ($y0, $y1) = $iter -> get_line_yrange();
like($y0, $number);
like($y1, $number);
ok($iter -> next_run());
ok($iter -> next_char());
ok($iter -> next_cluster());
ok(!$iter -> next_line());
ok($iter -> at_last_line());
like($iter -> get_index(), $number);
like($iter -> get_baseline(), $number);
isa_ok($iter -> get_line(), "Pango::LayoutLine");
}
SKIP: {
skip("[sg]et_ellipsize are new in 1.6", 1)
unless (Pango -> CHECK_VERSION(1, 6, 0));
$layout -> set_ellipsize("end");
is($layout -> get_ellipsize(), "end");
}
SKIP: {
skip "1.16 stuff", 3
unless Pango -> CHECK_VERSION(1, 16, 0);
isa_ok($layout -> get_line_readonly(0), "Pango::LayoutLine");
my @lines = $layout -> get_lines_readonly();
is(scalar @lines, $layout -> get_line_count());
my $iter = $layout -> get_iter();
isa_ok($iter -> get_line_readonly(), "Pango::LayoutLine");
}
SKIP: {
skip 'new 1.20 stuff', 2
unless (Pango -> CHECK_VERSION(1, 20, 0));
my $iter = $layout -> get_iter();
is($iter -> get_layout(), $layout);
isa_ok($iter -> copy(), 'Pango::LayoutIter');
}
SKIP: {
skip 'new 1.20 stuff', 1
unless (Pango -> CHECK_VERSION(1, 20, 0));
$layout -> set_height(23);
is($layout -> get_height(), 23);
}
SKIP: {
skip 'new 1.22 stuff', 1
unless Pango->CHECK_VERSION(1, 22, 0);
my $font = Pango::FontDescription -> from_string('Sans 12');
$layout -> set_font_description($font);
like($layout -> get_baseline(), $number);
}
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoMatrix.t 000644 001750 000024 00000004401 11664366563 016564 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 48;
SKIP: {
skip("PangoMatrix is new in 1.6", 44)
unless (Pango -> CHECK_VERSION(1, 6, 0));
my $matrix = Pango::Matrix -> new(2.3, 2.3, 2.3, 2.3, 2.3, 2.3);
isa_ok($matrix, "Pango::Matrix");
delta_ok($matrix -> xx, 2.3);
delta_ok($matrix -> xy, 2.3);
delta_ok($matrix -> yx, 2.3);
delta_ok($matrix -> yy, 2.3);
delta_ok($matrix -> x0, 2.3);
delta_ok($matrix -> y0, 2.3);
$matrix = Pango::Matrix -> new();
isa_ok($matrix, "Pango::Matrix");
is($matrix -> xx, 1);
is($matrix -> xy, 0);
is($matrix -> yx, 0);
is($matrix -> yy, 1);
is($matrix -> x0, 0);
is($matrix -> y0, 0);
$matrix -> translate(5, 5);
is($matrix -> xx, 1);
is($matrix -> xy, 0);
is($matrix -> yx, 0);
is($matrix -> yy, 1);
is($matrix -> x0, 5);
is($matrix -> y0, 5);
$matrix -> scale(2, 2);
is($matrix -> xx, 2);
is($matrix -> xy, 0);
is($matrix -> yx, 0);
is($matrix -> yy, 2);
is($matrix -> x0, 5);
is($matrix -> y0, 5);
$matrix -> rotate(0);
is($matrix -> xx, 2);
is($matrix -> xy, 0);
is($matrix -> yx, 0);
is($matrix -> yy, 2);
is($matrix -> x0, 5);
is($matrix -> y0, 5);
$matrix -> concat($matrix);
is($matrix -> xx, 4);
is($matrix -> xy, 0);
is($matrix -> yx, 0);
is($matrix -> yy, 4);
is($matrix -> x0, 15);
is($matrix -> y0, 15);
$matrix -> xx(2.3);
$matrix -> xy(2.3);
$matrix -> yx(2.3);
$matrix -> yy(2.3);
$matrix -> x0(2.3);
$matrix -> y0(2.3);
delta_ok($matrix -> xx, 2.3);
delta_ok($matrix -> xy, 2.3);
delta_ok($matrix -> yx, 2.3);
delta_ok($matrix -> yy, 2.3);
delta_ok($matrix -> x0, 2.3);
delta_ok($matrix -> y0, 2.3);
}
SKIP: {
skip "1.16 stuff", 4
unless Pango -> CHECK_VERSION(1, 16, 0);
my $matrix = Pango::Matrix -> new(); # identity
is_deeply([$matrix -> transform_distance(1.0, 2.0)], [1.0, 2.0]);
is_deeply([$matrix -> transform_point(1.0, 2.0)], [1.0, 2.0]);
my $rect = {x => 1.0, y => 2.0, width => 23.0, height => 42.0};
is_deeply($matrix -> transform_rectangle($rect), $rect);
is_deeply($matrix -> transform_pixel_rectangle($rect), $rect);
}
__END__
Copyright (C) 2007 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoRenderer.t 000644 001750 000024 00000004024 11664366563 017067 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper need_gtk => 1, tests => 7;
SKIP: {
skip("PangoRenderer is new in 1.8", 5)
unless (Pango -> CHECK_VERSION(1, 8, 0));
my $screen = Gtk2::Gdk::Screen -> get_default();
my $renderer = Gtk2::Gdk::PangoRenderer -> new($screen);
isa_ok($renderer, "Pango::Renderer");
my $window = Gtk2::Window -> new();
$window -> realize();
$renderer -> set_drawable($window -> window);
my $gc = Gtk2::Gdk::GC -> new($window -> window);
$renderer -> set_gc($gc);
$renderer -> activate();
my $layout = $window -> create_pango_layout("Bla");
$renderer -> draw_layout($layout, 0, 0);
$renderer -> draw_layout_line($layout -> get_line(0), 0, 0);
$renderer -> draw_rectangle("foreground", 0, 0, 10, 10);
$renderer -> draw_error_underline(0, 0, 10, 10);
my $description = Pango::FontDescription -> new();
$description -> set_family("Sans");
$description -> set_size(23);
my $context = $window -> create_pango_context();
my $font = $context -> load_font($description);
$renderer -> draw_glyph($font, 0, 0, 0);
$renderer -> part_changed("foreground");
$renderer -> set_color("foreground", undef);
is($renderer -> get_color("foreground"), undef);
$renderer -> set_color("background", [0xaaaa, 0xbbbb, 0xcccc]);
is_deeply($renderer -> get_color("background"), [0xaaaa, 0xbbbb, 0xcccc]);
$renderer -> set_matrix(undef);
is($renderer -> get_matrix(), undef);
my $matrix = Pango::Matrix -> new();
$renderer -> set_matrix($matrix);
isa_ok($renderer -> get_matrix(), "Pango::Matrix");
$renderer -> deactivate();
SKIP: {
skip 'new 1.20 stuff', 2
unless (Pango -> CHECK_VERSION(1, 20, 0));
# These always return undef unless called from inside a subclass' drawing
# function. How do we test that?
is($renderer -> get_layout(), undef);
is($renderer -> get_layout_line(), undef);
}
}
__END__
Copyright (C) 2005 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoScript.t 000644 001750 000024 00000001340 11664366563 016563 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 8;
SKIP: {
skip("PangoScript is new in 1.4", 8)
unless (Pango -> CHECK_VERSION(1, 4, 0));
is(Pango::Script -> for_unichar("a"), "latin");
my $lang = Pango::Script -> get_sample_language("latin");
isa_ok($lang, "Pango::Language");
is($lang -> includes_script("latin"), 1);
my $iter = Pango::ScriptIter -> new("urgs");
isa_ok($iter, "Pango::ScriptIter");
my ($start, $end, $script) = $iter -> get_range();
is($start, "urgs");
is($end, "");
is($script, "latin");
ok(!$iter -> next());
}
__END__
Copyright (C) 2004 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoTabs.t 000644 001750 000024 00000001427 11664366563 016216 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 6;
SKIP: {
skip("PangoTabs was broken prior to 1.3.3", 6)
unless (Pango -> CHECK_VERSION(1, 4, 0));
my $array = Pango::TabArray -> new(8, 0);
isa_ok($array, "Pango::TabArray");
$array = Pango::TabArray -> new_with_positions(2, 1, "left", 8, "left", 16);
isa_ok($array, "Pango::TabArray");
$array -> resize(3);
is($array -> get_size(), 3);
$array -> set_tab(2, "left", 24);
is_deeply([$array -> get_tab(2)], ["left", 24]);
is_deeply([$array -> get_tabs()], ["left", 8, "left", 16, "left", 24]);
is($array -> get_positions_in_pixels(), 1);
}
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/PangoTypes.t 000644 001750 000024 00000001771 11664366563 016433 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
use strict;
use warnings;
use lib qw(t/inc);
use PangoTestHelper tests => 9;
SKIP: {
skip("find_base_dir is new in 1.4", 1)
unless (Pango -> CHECK_VERSION(1, 4, 0));
is(Pango -> find_base_dir("urgs"), "ltr");
}
my $language = Pango::Language -> from_string("de_DE");
isa_ok($language, "Pango::Language");
is($language -> to_string(), "de-de");
is($language -> matches("*"), 1);
SKIP: {
skip "1.16 stuff", 5
unless Pango -> CHECK_VERSION(1, 16, 0);
isa_ok(Pango::Language -> get_default(), "Pango::Language");
is(Pango::units_from_double(Pango::units_to_double(23)), 23);
my $rect = {x => 1.0, y => 2.0, width => 23.0, height => 42.0};
my ($new_ink, $new_logical) = Pango::extents_to_pixels($rect, $rect);
isa_ok($new_ink, "HASH");
isa_ok($new_logical, "HASH");
is_deeply([Pango::extents_to_pixels(undef, undef)], [undef, undef]);
}
__END__
Copyright (C) 2004-2007 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
Pango-1.227/t/inc/PangoTestHelper.pm 000644 001750 000024 00000001115 11664366563 020320 0 ustar 00bdmanning staff 000000 000000 package PangoTestHelper;
use Test::More;
my $REQ_GTK2_VERSION = 1.220;
sub import {
my $class = shift;
my %options = @_;
if ($options{need_gtk}) {
unless (eval "use Gtk2 $REQ_GTK2_VERSION; Gtk2->init_check;") {
plan skip_all =>
"This test needs Gtk2 >= $REQ_GTK2_VERSION and a display";
}
}
if (exists $options{tests}) {
plan tests => $options{tests};
}
}
package main;
use Glib qw/TRUE FALSE/;
use Pango;
use Test::More;
# Inspired by Test::Number::Delta
sub delta_ok ($$;$) {
my ($a, $b, $msg) = @_;
ok (abs ($a - $b) < 1e-6, $msg);
}
1;
Pango-1.227/lib/Pango.pm 000644 001750 000024 00000007420 12651231064 016037 0 ustar 00bdmanning staff 000000 000000 #
# Copyright (C) 2003-2008, 2013-2014 by the gtk2-perl team (see the file
# AUTHORS for the full list)
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library 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 LICENSE file in the top-level directory of this distribution for the
# full license terms.
package Pango;
use 5.008;
use strict;
use warnings;
use Glib;
# if pango is at 1.10.0 or newer, we need to import the Cairo module for the
# cairo glue in pango.
eval "use Cairo;";
use Exporter;
require DynaLoader;
our $VERSION = '1.227';
our @ISA = qw(DynaLoader Exporter);
sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
# now load the XS code.
Pango->bootstrap ($VERSION);
1;
__END__
# documentation is a good thing.
=head1 NAME
Pango - Layout and render international text
=head1 SYNOPSIS
my $surface = Cairo::ImageSurface->create ('argb32', 200, 100);
my $cr = Cairo::Context->create ($surface);
my $layout = Pango::Cairo::create_layout ($cr);
$layout->set_text ("\x{03A0}\x{03B1}\x{03BD}\x{8A9E}");
my $font = Pango::FontDescription->from_string ('Serif Bold 27');
$layout->set_font_description ($font);
Pango::Cairo::show_layout($cr, $layout);
$surface->write_to_png ('pango.png');
=head1 ABSTRACT
Pango is a library for laying out and rendering text, with an emphasis on
internationalization. Pango can be used anywhere that text layout is needed,
but using Pango in conjunction with L and/or L provides a complete
solution with high quality text handling and graphics rendering.
Dynamically loaded modules handle text layout for particular combinations of
script and font backend. Pango provides a wide selection of modules, including
modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic
scripts. Virtually all of the world's major scripts are supported.
In addition to the low level layout rendering routines, Pango includes
L, a high level driver for laying out entire blocks of text, and
routines to assist in editing internationalized text.
[Adapted from L.]
=head1 DOCUMENTATION
L tries to stick very close in spirit to the C API of the underlying
pango library. Thus, the manual available at
L also applies to this module.
Additionally, API listings in POD form are generated during compilation for
each of the sub-modules. An index of those POD pages is available at
L.
=head1 SEE ALSO
L, L, L, L.
L lists the autogenerated API documentation pod files for Pango.
L is the homepage of the pango C library. Its API
documentation is available at L.
=head1 AUTHORS
muppet
Torsten Schoenfeld
Marc Lehmann
=head1 COPYRIGHT AND LICENSE
Copyright 2003-2011, 2014 by the gtk2-perl team.
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 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 LICENSE file in the top-level directory of this distribution for the
full license terms.
=cut
Pango-1.227/examples/cairo-simple.pl 000644 001750 000024 00000003377 11664366563 020455 0 ustar 00bdmanning staff 000000 000000 #!/usr/bin/perl
# This is adopted from the cairosimple.c example in the pango distribution
# written by Behdad Esfahbod.
use strict;
use warnings;
use Math::Trig qw(pi);
use Cairo;
use Glib qw(TRUE FALSE);
use Gtk2 -init;
use Gtk2::Pango;
use constant RADIUS => 150;
use constant N_WORDS => 10;
use constant FONT => "Sans Bold 27";
sub draw_text {
my ($cr) = @_;
$cr -> translate(RADIUS, RADIUS);
my $layout = Pango::Cairo::create_layout($cr);
$layout -> set_text("Text");
my $desc = Pango::FontDescription -> from_string(FONT);
$layout -> set_font_description($desc);
# Draw the layout N_WORDS times in a circle
foreach (0 .. N_WORDS) {
my $angle = (360. * $_) / N_WORDS;
$cr -> save();
# Gradient from red at angle == 60 to blue at angle == 300
my $red = (1 + cos(($angle - 60) * pi / 180.)) / 2;
$cr -> set_source_rgb($red, 0, 1.0 - $red);
$cr -> rotate($angle * pi / 180.);
# Inform Pango to re-layout the text with the new transformation
Pango::Cairo::update_layout($cr, $layout);
my ($width, $height) = $layout -> get_size();
$cr -> move_to(- ($width / PANGO_SCALE) / 2, - RADIUS);
Pango::Cairo::show_layout($cr, $layout);
$cr -> restore();
}
}
my $window = Gtk2::Window -> new();
$window -> signal_connect(delete_event => sub { Gtk2 -> main_quit(); });
my $area = Gtk2::DrawingArea -> new();
$area -> signal_connect(expose_event => sub {
my ($widget, $event) = @_;
my $cr = Gtk2::Gdk::Cairo::Context -> create($widget -> window());
$cr -> set_source_rgb(1.0, 1.0, 1.0);
$cr -> rectangle(0, 0, 2 * RADIUS, 2 * RADIUS);
$cr -> fill();
draw_text($cr);
return FALSE;
});
$window -> set_default_size(2 * RADIUS, 2 * RADIUS);
$window -> add($area);
$window -> show_all();
Gtk2 -> main();