From 0ec9dd32b6045a9b5be0ed717e8ad6dc523475af Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 16 2020 09:52:57 +0000 Subject: pango-1.42.4 base --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..181b49d --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Owen Taylor , with help from many others. +See file named THANKS for a list. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..bf50f20 --- /dev/null +++ b/COPYING @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + 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 Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, 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 or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the 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 a program 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. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + 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, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +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 compile 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) 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. + + c) 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. + + d) 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 source code 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 to +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 Library 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 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 GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307 USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..564febd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,856 @@ +commit a6a89818246b0b14c0fe3d00d6120929fc0a11d9 +Author: Matthias Clasen +Date: Mon Aug 20 10:21:39 2018 -0400 + + 1.42.4 + + NEWS | 5 +++++ + configure.ac | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit 71aaeaf020340412b8d012fe23a556c0420eda5f +Author: Matthias Clasen +Date: Fri Aug 17 22:29:36 2018 -0400 + + Prevent an assertion with invalid Unicode sequences + + Invalid Unicode sequences, such as 0x2665 0xfe0e 0xfe0f, + can trick the Emoji iter code into returning an empty + segment, which then triggers an assertion in the itemizer. + + Prevent this by ensuring that we make progress. + + This issue was reported by Jeffrey M. + + pango/pango-emoji.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit ccfd3b466ca43b202681ce951600aac8f97d8dc4 +Merge: 0cbae46c 3d04cc2b +Author: Khaled Hosny +Date: Sat Aug 4 20:12:22 2018 +0000 + + Merge branch 'c89' into 'master' + + Fix build failure in C89 mode + + See merge request GNOME/pango!10 + +commit 0cbae46ca1d0a1bbf50ddd69553e047118812be5 +Merge: 67471cbf dce7ba63 +Author: Khaled Hosny +Date: Sat Aug 4 20:11:11 2018 +0000 + + Merge branch 'surrogate' into 'master' + + Fix build failure on Mac OS X 10.5 and earlier + + Closes #263 + + See merge request GNOME/pango!11 + +commit dce7ba63ed8b0567f674ade72da827d4a4c1b603 +Author: Ryan Schmidt +Date: Sat Aug 4 12:20:02 2018 -0500 + + Fix build failure on Mac OS X 10.5 and earlier + + Provides definitions of CFStringIsSurrogateHighCharacter, + CFStringIsSurrogateLowCharacter and + CFStringGetLongCharacterForSurrogatePair. + + Closes #263 + + pango/pangocoretext-shape.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 3d04cc2bbdce0a8b561d0e19255309f8d470816e +Author: Ryan Schmidt +Date: Sat Aug 4 11:57:31 2018 -0500 + + Fix build failure in C89 mode + + Fixes build error with default compilers on Mac OS X 10.6 and earlier: + + pangocoretext-fontmap.c: In function + ‘pango_core_text_fontset_new’: + pangocoretext-fontmap.c:1563: error: ‘for’ loop initial + declaration used outside C99 mode + + pango/pangocoretext-fontmap.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 67471cbfe24cd4418e9e97837ac85207f0d974de +Author: Matthias Clasen +Date: Mon Jul 30 13:32:51 2018 -0400 + + 1.42.3 + + configure.ac | 2 +- + meson.build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit cab3c9844487526f1996a150adac5bde44f48a70 +Merge: 87e71365 5c467cdb +Author: Matthias Clasen +Date: Sat Jul 28 11:27:25 2018 +0000 + + Merge branch 'wip/chergert/bidi-leak' into 'master' + + bidi: fix leak of bidi bracket types + + See merge request GNOME/pango!8 + +commit 5c467cdbae02233b04c97ba10a11f124b2d33eba +Author: Christian Hergert +Date: Fri Jul 27 20:43:06 2018 -0700 + + bidi: fix leak of bidi bracket types + + This fixes a leak when goto is used to jump past the cleanup of the + bracket_types. + + pango/pango-bidi-type.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 87e713656de19846bede953fed41bd25b25252d9 +Merge: a03d16a8 633fd804 +Author: Khaled Hosny +Date: Sat Jul 21 17:09:31 2018 +0000 + + Merge branch 'patch-1' into 'master' + + fix comma-separated font list on macOS fixes #252 + + Closes #252 + + See merge request GNOME/pango!4 + +commit a03d16a850253eae321be4bd2d134a9c6a1ed6ce +Author: Matthias Clasen +Date: Wed Jul 18 22:32:54 2018 -0400 + + 1.42.2 + + NEWS | 7 +++++++ + configure.ac | 2 +- + meson.build | 2 +- + 3 files changed, 9 insertions(+), 2 deletions(-) + +commit 6b2c48571b31f95b68214752ce89e11f46b4b731 +Author: Matthias Clasen +Date: Wed Jul 18 22:26:20 2018 -0400 + + Add pango-list to meson build + + utils/meson.build | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 65f6fee5bfa5929fac1111badff6b497dd10d12a +Author: Behdad Esfahbod +Date: Mon Jul 16 10:35:44 2018 +0200 + + [fc] Speed-up font face enumeration + + Instead of a O(n^2.log(n)), we now do O(n) by avoiding calling + FcFontList for each PangoFontFace, and FcFontMatch in + pango_fc_face_describe(). + + Makes pango-list over 100 times faster for me. + + pango/pangofc-fontmap.c | 94 + ++++++++++++++++++++----------------------------- + 1 file changed, 38 insertions(+), 56 deletions(-) + +commit b1a5be6c245b6c3e7e0e7c5b88c15f475ea9a9d4 +Author: Behdad Esfahbod +Date: Mon Jul 16 10:37:04 2018 +0200 + + [pango-list] Don't print sizes + + They are not used in font chooser, so don't call them. My goal + for pango-list was to measure font chooser performance... + + utils/pango-list.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0414be91fcf24dc995592609c3bc4ce569b7e2b8 +Author: Behdad Esfahbod +Date: Thu Jul 12 16:20:53 2018 +0200 + + [fc] Remove ancient #ifdef FC_* conditionals + + pango/pangofc-fontmap.c | 33 +-------------------------------- + 1 file changed, 1 insertion(+), 32 deletions(-) + +commit 5eb16c3c397e3825e145b3127ddc172e34fce522 +Merge: bd06f7b9 3cf58991 +Author: Matthias Clasen +Date: Mon Jul 16 01:02:03 2018 +0000 + + Merge branch 'wip/nirbheek/meson-declare-dependency' into 'master' + + meson: Add not-found dependencies for conditional declared deps + + See merge request GNOME/pango!6 + +commit bd06f7b94e563f276550cb81c3a0e5612c88c314 +Merge: 58b1930c 5507a16c +Author: Matthias Clasen +Date: Mon Jul 16 00:53:13 2018 +0000 + + Merge branch 'requires-private-fribidi' into 'master' + + pango.pc.in: Add fribidi to Requires.private + + Closes #301 + + See merge request GNOME/pango!5 + +commit 58b1930c95db12deebb015870352e3e696583571 +Author: Behdad Esfahbod +Date: Wed Jul 11 16:19:33 2018 +0200 + + Requires.private fribidi + + Fixes https://gitlab.gnome.org/GNOME/pango/issues/301 + Fixes https://gitlab.gnome.org/GNOME/pango/issues/305 + + pango.pc.in | 1 + + 1 file changed, 1 insertion(+) + +commit 293d56ceeaf64b9909ba296965603edd0a656203 +Author: Behdad Esfahbod +Date: Sun Jul 8 17:47:59 2018 +0200 + + [fc] List all bitmap sizes of FcPattern + + Apple Color Emoji for example has multiple strikes... We were + only listing first. + + pango/pangofc-fontmap.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit a1d2da411c2ff78165ad406e0f2befce3a117af1 +Author: Behdad Esfahbod +Date: Sun Jul 8 17:38:48 2018 +0200 + + [pango-list] Minor fixup + + utils/pango-list.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3c1bda5c747e4039b11c7dc897c826885f6400de +Author: Behdad Esfahbod +Date: Sun Jul 8 17:34:35 2018 +0200 + + [pango-list] Improve output format + + Also write out description of each face. This is really broken for + free-style style names (as we knew), and very slow, as is + O(N^3.log(N)) + in the number of fonts... + + utils/pango-list.c | 42 ++++++++++++++++++++++++++++++------------ + 1 file changed, 30 insertions(+), 12 deletions(-) + +commit 0727ba98a52823deb44550c2977bf9bffbff3765 +Author: Behdad Esfahbod +Date: Sun Jul 8 15:50:34 2018 +0200 + + [utils] Add pango-list commandline tool + + My main interest is performance of font listing API. Figured I can + just make a tool out of it. Output format to be improved. + + utils/Makefile.am | 11 ++++++++ + utils/pango-list.c | 80 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 91 insertions(+) + +commit 0b785d94d3d8aa7f7fe76ac7851d088fc9541952 +Author: Behdad Esfahbod +Date: Sun Jul 8 14:52:59 2018 +0200 + + [pango-view] Remove unused include stdio.h + + utils/viewer.h | 1 - + 1 file changed, 1 deletion(-) + +commit 899841121260d62fc3f1c1728f82f5c02185dd97 +Author: Behdad Esfahbod +Date: Sun Jul 8 14:45:32 2018 +0200 + + Rename pango-view/ dir to utils/ + + Makefile.am | 4 ++-- + configure.ac | 2 +- + meson.build | 2 +- + {pango-view => utils}/EMOJI-MODIFIERS.txt | 0 + {pango-view => utils}/GLASS.txt | 0 + {pango-view => utils}/HELLO.txt | 0 + {pango-view => utils}/Makefile.am | 0 + {pango-view => utils}/meson.build | 0 + {pango-view => utils}/pango-view.c | 0 + {pango-view => utils}/test-arabic.txt | 0 + {pango-view => utils}/test-chinese.txt | 0 + {pango-view => utils}/test-devanagari.txt | 0 + {pango-view => utils}/test-feature-tag.markup | 0 + {pango-view => utils}/test-font-variations.markup | 0 + {pango-view => utils}/test-gurmukhi.txt | 0 + {pango-view => utils}/test-hebrew.txt | 0 + {pango-view => utils}/test-ipa.txt | 0 + {pango-view => utils}/test-justify.txt | 0 + {pango-view => utils}/test-lao.txt | 0 + {pango-view => utils}/test-latin.txt | 0 + {pango-view => utils}/test-long-paragraph.txt | 0 + {pango-view => utils}/test-mixed.markup | 0 + {pango-view => utils}/test-mixed.txt | 0 + {pango-view => utils}/test-mongolian.txt | 0 + {pango-view => utils}/test-nko.txt | 0 + {pango-view => utils}/test-opentype-language.markup | 0 + {pango-view => utils}/test-syriac.txt | 0 + {pango-view => utils}/test-tamil.txt | 0 + {pango-view => utils}/test-thai.txt | 0 + {pango-view => utils}/test-tibetan.txt | 0 + {pango-view => utils}/viewer-cairo.c | 0 + {pango-view => utils}/viewer-cairo.h | 0 + {pango-view => utils}/viewer-main.c | 0 + {pango-view => utils}/viewer-pangocairo.c | 0 + {pango-view => utils}/viewer-pangoft2.c | 0 + {pango-view => utils}/viewer-pangoxft.c | 0 + {pango-view => utils}/viewer-render.c | 0 + {pango-view => utils}/viewer-render.h | 0 + {pango-view => utils}/viewer-x.c | 0 + {pango-view => utils}/viewer-x.h | 0 + {pango-view => utils}/viewer.h | 0 + 41 files changed, 4 insertions(+), 4 deletions(-) + +commit 5ec478dac9146175de7ba4a1f88ebbab963f4c0f +Author: Behdad Esfahbod +Date: Sun Jul 8 14:34:34 2018 +0200 + + Minor; use default hb_buffer_t Unicode funcs + + pango/pango-ot-buffer.c | 1 - + 1 file changed, 1 deletion(-) + +commit 0a9f6a0c1f0e4750e2a9864392370a20c511e71e +Author: Behdad Esfahbod +Date: Sat Jul 7 17:27:02 2018 +0200 + + Make pango_bidi_type_for_unichar() not crash with new FriBidi + + This function has not been updated for latest FriBidi. + Should add new types and / or deprecate this function. + + pango/pango-bidi-type.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 9f65356b7b473b607bea0510709a4d7330be9c9a +Author: Behdad Esfahbod +Date: Sat Jul 7 16:42:03 2018 +0200 + + Short-circuit FriBidi call if paragraph is unidirectional + + This was included in Pango's mini-fribidi but removed when we moved to + external FriBidi. + + Most apps create PangoLayout twice to show text, one to measure, + one to + render. Each PangoLayout shaping apparently calls FriBidi twice + (TODO: + figure out why and fix); FriBidi creates two runs per work. So that's + eight malloc calls per word to show text. That's a lot. With this + optimization that completely disappears for most text. + + We should make an API in FriBidi out of this. + + Reported by Christian Hergert. + + pango/pango-bidi-type.c | 69 + +++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 64 insertions(+), 5 deletions(-) + +commit 3cf58991d5a3d47203b8b6f6ac02b674aaf5c13b +Author: Nirbheek Chauhan +Date: Sat Jul 7 00:07:51 2018 +0530 + + meson: Add not-found dependencies for conditional declared deps + + Instead of not defining the variable, or defining it to [], define it + to the not-found dependency instead, so that when other projects (such + as gtk+) are using pango as a subproject, they get a valid dependency + object which tells them that the dependency cannot be found. + + pango/meson.build | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 5507a16c726ffdcedcf2ae22d4689f94823bf863 +Author: Simon McVittie +Date: Sun Jul 1 17:21:37 2018 +0100 + + pango.pc.in: Add fribidi to Requires.private + + In current versions of pkg-config, the most appropriate place for most + library dependencies is Requires.private. When compared with Requires, + this avoids "overlinking" when an executable is linked to the pango + shared library: in modern OSs, a shared library's library dependencies + are + automatically loaded by the dynamic linker along with that shared + library. + + It would not be correct to omit fribidi from the .pc file either, + because that would break static linking: when linking statically, + it is necessary to list all dependencies explicitly, because static + libraries (unlike shared libraries) do not carry their own dependency + metadata. + + Using Requires.private also has the effect of adding fribidi's + CFLAGS to the output of `pkg-config --cflags pango`. That is in fact + unnecessary here, because fribidi is only used internally, so + https://bugs.freedesktop.org/show_bug.cgi?id=105572 proposes a new + dependency type "Requires.internal" which would additionally omit + fribidi from `pkg-config --cflags pango`. However, this is not yet + supported in pkg-config, so it cannot be used yet. + + For more details on Requires.private please see this article by the + current Debian pkg-config maintainer and former upstream + pkg-config maintainer: + https://err.no/personal/blog/tech/2008-03-25-18-07_pkg-config,_sonames_and_Requires.private/ + and this description of the various dependency types that can exist: + https://bugs.freedesktop.org/show_bug.cgi?id=105572#c1 + + Fixes: #301 + Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895235 + Signed-off-by: Simon McVittie + + pango.pc.in | 1 + + 1 file changed, 1 insertion(+) + +commit 633fd80428374b0c675e3dcf563c06ff9e4876b0 +Author: Pravdomil Toman +Date: Wed Jun 27 20:15:19 2018 +0000 + + fix comma-separated font list on macOS fixes #252 + + pango/pangocoretext-fontmap.c | 58 + +++++++++++++++++++++++++++---------------- + 1 file changed, 36 insertions(+), 22 deletions(-) + +commit cdb88930da73bdbeb0e6167825121435d7e5e99f +Merge: 4032ff27 37881737 +Author: Khaled Hosny +Date: Sat May 26 22:53:51 2018 +0000 + + Merge branch 'ci' into 'master' + + Initial CI config + + Closes #310 + + See merge request GNOME/pango!2 + +commit 37881737cda04b2f773a0d807880dd8bd989efcf +Author: Khaled Hosny +Date: Sun May 27 00:51:15 2018 +0200 + + Initial CI config + + Fixes https://gitlab.gnome.org/GNOME/pango/issues/310 + + .gitlab-ci.yml | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit 4032ff276cc73f368459b8d341ebcdcadff53640 +Merge: f661cdbf 73e45483 +Author: Khaled Hosny +Date: Sat May 26 20:58:54 2018 +0000 + + Merge branch '304-fix-linker-options-on-darwin' into 'master' + + Resolve "Fix linker options on Darwin" + + Closes #304 + + See merge request GNOME/pango!1 + +commit 73e454832a7ac592dfa600cb6b495dc99660b0ca +Author: Philip Chimento +Date: Sat Apr 7 23:50:32 2018 -0700 + + build: Correct Darwin linker options + + The Darwin linker doesn't want equal signs here. + + Closes: #304 + + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f661cdbf8cfbdb2ba7241d8dfa4a579c6dfe0a94 +Author: John Ralls +Date: Sun Apr 29 16:03:08 2018 -0700 + + Restore scaling of CoreText fonts. + + Fixes bug 787867. + + pango/pangocairo-coretextfont.c | 17 ++++++++++++++++- + pango/pangocairo-coretextfontmap.c | 2 +- + pango/pangocoretext-fontmap.c | 15 ++++++++++++--- + pango/pangocoretext-private.h | 2 ++ + pango/pangocoretext.c | 5 +---- + tests/test-layout.c | 11 +---------- + 6 files changed, 33 insertions(+), 19 deletions(-) + +commit edb0dff3454d4d9ce6242a0f30ddaef993ee1e89 +Author: Kalev Lember +Date: Mon May 7 12:34:21 2018 +0200 + + build: Bump required harfbuzz version + + We use hb_variation_t that was added in harfbuzz 1.4.2. + + configure.ac | 2 +- + meson.build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit d983aa95537d67ef14417dc3663edea36b653e86 +Author: Khaled Hosny +Date: Wed Apr 25 21:58:03 2018 +0200 + + Revert "Add fribidi dependency to pango.pc" + + This reverts commit 68cc13d04ed9d89609727f4448e5d2e08dd6626c. + + pango.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 63e1fc9b23b4f0e8eaacd151ad39403eaa2b48ef +Author: Khaled Hosny +Date: Wed Apr 11 13:52:07 2018 +0200 + + Use non-deprecated libthai API when available + + I’m assuming the new API is thread-safe as claimed. + + configure.ac | 4 ++++ + meson.build | 4 ++++ + pango/break-thai.c | 16 +++++++++++----- + 3 files changed, 19 insertions(+), 5 deletions(-) + +commit 5d46e21df66a11233186ddf27ca8c70149307871 +Author: Christoph Reiter +Date: Sat Apr 7 06:44:53 2018 +0200 + + pangowin32: fix script cache hash key for 64bit builds + + It joins the HFONT and script key to a gint64 and uses this as a + hash key, but HFONT is a pointer type and on 64bit Windows it + doesn't fit in 32bit and the value gets truncated. + + This breaks the build with meson where -Werror=pointer-to-int-cast + is enabled by default. + + Instead of using the gint64 hash functions add our own key type + and implement + matching hash and equality functions for it. + + https://bugzilla.gnome.org/show_bug.cgi?id=795045 + + pango/pangowin32-shape.c | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +commit 8e86f613160d023257d041ff24f94c88a8e12a46 +Author: Christoph Reiter +Date: Sun Apr 8 19:16:49 2018 +0200 + + meson: skip pangoxft headers for the Windows gtk-doc build + + The API isn't available on Windows and gtk-doc fails with a + linker error otherwise. + + https://bugzilla.gnome.org/show_bug.cgi?id=795045 + + docs/meson.build | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 0fc06306063d8f3c8bd1e0d371eeb35ba9a9ea64 +Author: Christoph Reiter +Date: Sat Apr 7 06:33:43 2018 +0200 + + build: move usp10 before gdi32 + + Without this pango on mingw64 tries to lookup up the Script* functions + in gdi32 and fails. It already fails at the build stage because the + introspection dump crashes with a missing entry point error. + + Moving usp10 before gdi32 makes things work. + + This might be related to the warning in the uniscribe docs: + "Important Starting with Windows 8: To maintain the ability to run on + Windows 7, a module that uses Uniscribe must specify Usp10.lib + before gdi32.lib in its library list." + + https://bugzilla.gnome.org/show_bug.cgi?id=795045 + + pango/Makefile.am | 2 +- + pango/meson.build | 4 +++- + pangowin32.pc.in | 2 +- + 3 files changed, 5 insertions(+), 3 deletions(-) + +commit 4b16a0bf5c9795fe57255d5594a27c3cef634202 +Author: Khaled Hosny +Date: Sun Apr 8 00:56:06 2018 +0200 + + Remove stray letters in NEWS + + Introduced in 46f8583c87c45b304ac98d06005c49df67d53b07 + + NEWS | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 46f8583c87c45b304ac98d06005c49df67d53b07 +Author: Matthias Clasen +Date: Sat Apr 7 10:08:56 2018 +0000 + + 1.42.1 + + NEWS | 9 +++++++-- + configure.ac | 2 +- + meson.build | 2 +- + 3 files changed, 9 insertions(+), 4 deletions(-) + +commit 34a7c7a7cd165997dd6d4ae7b1f90472e0844118 +Author: Christoph Reiter +Date: Thu Apr 5 22:04:43 2018 +0200 + + meson: don't use quotes in help2man options to work around a MinGW + Python bug + + For some reason MinGW Python (the one running meson) mangles arguments + for this case (even adding a space makes it work). Since quotes + are not needed here just drop them. + + Python issue filed upstream: + https://github.com/Alexpux/MINGW-packages/issues/3548 + + https://bugzilla.gnome.org/show_bug.cgi?id=795012 + + pango-view/meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6fcae8644b9231edba93d795963a39e3a9612a7e +Author: Christoph Reiter +Date: Thu Apr 5 21:31:23 2018 +0200 + + win32: remove redundant function declarations + + The meson build uses -Werror=redundant-decls and fails. + + https://bugzilla.gnome.org/show_bug.cgi?id=795012 + + pango/pangowin32-shape.c | 2 -- + pango/pangowin32.c | 5 ----- + 2 files changed, 7 deletions(-) + +commit b136f150b4e230db7901af0d88d3c91a3a4c9e7c +Author: Chun-wei Fan +Date: Fri Mar 30 16:31:53 2018 +0800 + + pangowin32-fontmap.c: Add an Emoji font family + + Add an Emoji font family that maps to the following fonts in this + order + (by fallback): + Segoe UI Emoji + Segoe UI Symbol + Segoe UI + + This will enable Emoji to be displayed correctly in GTK+ apps (without + the use of FontConfig) on Windows Vista and later, providing that one + of the aforementioned fonts are installed. + + Note that this only enables Emoji display (*not* colored ones) as + achieving colored Emoji requires PangoWin32 and Cairo to be ported to + Direct2D and DirectWrite from Uniscribe and GDI, as Uniscribe and GDI + does not support colored Emoji. + + https://bugzilla.gnome.org/show_bug.cgi?id=794705 + + pango/pangowin32-fontmap.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 08649ce12fb7ea41928a17f05fa1916cbe44361c +Author: Chun-wei Fan +Date: Mon Mar 19 20:54:23 2018 +0800 + + tests/markup-parse.c: Fix build on Visual Studio + + Visual Studio does not ship with a unistd.h, so include the proper + header on Windows when unistd.h is not found on Windows. + + tests/markup-parse.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 18fb749d658e86edad8145a3032c4b6e3be48d72 +Author: Chun-wei Fan +Date: Fri Aug 18 17:56:44 2017 +0800 + + build: Add fallbacks for finding non-GNOME deps on MSVC + + Many of Pango's dependencies do not support a build system for Visual + Studio that would generate the pkg-config files for them, so we + need to + try to look for them using cc.has_header() and cc.find_library() for + them, namely for Cairo, FreeType, FontConfig and HarfBuzz as + fallbacks. + + For Cairo, things are more complicated as there are multiple build + options and configurations for it, so we need to check for those + that we + need after we find the Cairo headers and libraries by: + + -Including the respective headers (for cairo-win32.h, cairo-ps.h, + cairo-pdf.h, cairo-quartz.h and cairo-xlib.h, since these features + must have been enabled when Cairo is built and installed in order for + those headers to be succesfully included) + -For pangocairo with FreeType support, we need to check whether the + FontConfig support is built into Cairo as well, as FontConfig support + is actually required in Cairo for this. + -For Cairo/PNG output surface support, check whether Cairo is + built with + PNG output surface support. + + We also need to update how pangocairo.pc and pangoft2 are generated: + -On builds where pkg-config files can be found for cairo, freetype, + fontconfig and/or harfbuzz: + Generate it with "Requires: pango " as before, otherwise + for MSVC builds where we find these libraries manually, we don't put + these packages under "Requires:..." or "Requires.private:...", but + instead put them under "Libs:", linking to each dep as -l<.lib file + name> + + This is so that pangocairo.pc and pangooft2.pc can be correctly + used by + items that need to make use of it, such as g-ir-scanner. + + https://bugzilla.gnome.org/show_bug.cgi?id=783274 + + configure.ac | 19 +++++++ + meson.build | 147 + ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + pangocairo.pc.in | 4 +- + pangoft2.pc.in | 6 +-- + 4 files changed, 164 insertions(+), 12 deletions(-) + +commit 55afeeca8031ba74cbcdf569500334ebef6b61e0 +Author: Chun-wei Fan +Date: Wed May 31 17:17:17 2017 +0800 + + meson: Check for HarfBuzz and FontConfig for PangoFT2 + + It is possible that we can have the following situations, at least on + Windows: + -FreeType present, FontConfig missing + -Cairo-FT present, with no FontConfig support. + + As gen-script-for-lang requires FontConfig, and PangoFT2 depends on + HarfBuzz, FontConfig and Freetype, we need to check for them before we + build PangoFT2, and so that we could include PangoFT2 support in + PangoCairo. + + The tests and pango-view have an optional dependency on PangoFT2, + so we + need to also check whether we built PangoFT2 before we try to build + things related to PangoFT2. + + For the tools, since gen-script-for-lang.c depends on FontConfig, + check + for it as well before we build it. + + https://bugzilla.gnome.org/show_bug.cgi?id=783274 + + docs/meson.build | 2 +- + meson.build | 19 +++++++++++++++---- + pango-view/meson.build | 4 ++-- + pango/meson.build | 2 +- + tests/meson.build | 2 +- + tools/meson.build | 12 +++++++----- + 6 files changed, 27 insertions(+), 14 deletions(-) + +commit ec8251d9728d0691365249eec4c681218e379819 +Author: Khaled Hosny +Date: Tue Mar 27 18:04:51 2018 +0200 + + Update version number in meson.build as well + + Follow up of commit d4f3370336a40907f528a41e75a55fe4f50c1a11. + Maintaining two build systems is tricky! + + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 68cc13d04ed9d89609727f4448e5d2e08dd6626c +Author: Khaled Hosny +Date: Mon Mar 26 12:00:32 2018 +0200 + + Add fribidi dependency to pango.pc + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=794570 + + pango.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3dfe2b9a5c8ac5ae37c210ba050f3720189cebb7 +Author: Patrick Griffis +Date: Fri Mar 9 15:03:28 2018 +0000 + + Fix view-cairo on Windows + + pango-view/viewer-cairo.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit dd4f26d4e01cde141feed16ddad1f9d522812514 +Author: Khaled Hosny +Date: Wed Mar 14 00:41:07 2018 +0200 + + Drop mention of long gone files + + docs/Makefile.am | 2 -- + docs/meson.build | 1 - + 2 files changed, 3 deletions(-) + +commit 248669f3ba716a990fb164e32d69ef81185a8ac3 +Author: Khaled Hosny +Date: Wed Mar 14 00:15:38 2018 +0200 + + Modules are long gone + + HACKING | 4 ---- + README | 3 --- + docs/Makefile.am | 1 - + docs/meson.build | 1 - + 4 files changed, 9 deletions(-) + +commit d4f3370336a40907f528a41e75a55fe4f50c1a11 +Author: Matthias Clasen +Date: Mon Mar 12 16:02:24 2018 +0000 + + 1.42.0 + + NEWS | 4 ++++ + configure.ac | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +commit 505eeb7b89cce51ec1226de399c4e772433d3cb6 +Author: Khaled Hosny +Date: Sat Feb 17 12:12:04 2018 +0200 + + Update README a bit + + Fix FontConfig casing, remove a dead link and outdated sections. + + README | 38 ++++---------------------------------- + 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..25929a7 --- /dev/null +++ b/HACKING @@ -0,0 +1,109 @@ +Formatting +========== + +The Pango formatting style is basically the GNU style of formatting +(see http://www.gnu.org/prep/standards.html), with a few additions. +In brief overview: + + - Two character indents are used; braces go on a separate line, and + get a separate indentation level, so the total indent for an + enclosed block is 4 characters. + + if (x < foo (y, z)) + haha = bar[4] + 5; + else + { + while (z) + { + haha += foo (z, z); + z--; + } + return abc (haha); + } + + - Spaces should be present between function name and argument block, + and after commas. + + foo (z, z) + + - In pointer types, the '*' is grouped with the variable name, + not with the base type. + + int *a; + + NOT: 'int* a'. + + In cases where there is no variable name, for instance, return + values, there should be a single space between the base type + and the '*'. + + - function and variable names are lower_case_with_underscores + type names are StudlyCaps, macro names are UPPER_CASE_WITH_UNDERSCORES + + +Documentation comments +====================== + +All public API functions should have inline documentation headers +in the gtk-doc / gnome-doc style. For instance: + +/** + * pango_layout_get_line: + * @layout: a #PangoLayout + * @line: the index of a line, which must be between 0 and + * pango_layout_get_line_count(layout) - 1, inclusive. + * + * Retrieves a particular line from a #PangoLayout (or @layout.) + * + * Return value: the requested #PangoLayoutLine, or %NULL if the + * index is out of range. This layout line can + * be ref'ed and retained, but will become invalid + * if changes are made to the #PangoLayout. + * + * Since: 1.6 + **/ +PangoLayoutLine * +pango_layout_get_line (PangoLayout *layout, + int line) +[...] + + +Choosing Function Names +======================= + +- Don't abbreviate in unexpected ways: + + pango_layout_get_line_count () + + Not: + + pango_layout_ln_cnt () + +- function that retrieve a value in a side-effect free fashion, should + include "get" in the name. + + int pango_layout_get_line_count (PangoLayout *layout) + + not + + pango_layout_line_count () + + +- functions that set a single parameter in a side-effect free fashion + should include "set" in the name, for instance: + + void pango_layout_set_width (PangoLayout *layout, + int width); + +Other comments +============== + +- Avoid unsigned values for all but flags fields. This is because + the way C handles unsigned values generates bugs like crazy: + + If width is unsigned and 10, then: + + int new_width = MAX (width - 15, 1); + + produces 4294967291, not 1. + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8865734 --- /dev/null +++ b/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/MAINTAINERS b/MAINTAINERS new file mode 100644 index 0000000..c04d1d2 --- /dev/null +++ b/MAINTAINERS @@ -0,0 +1,7 @@ +Owen Taylor +Email: otaylor@redhat.com +Userid: otaylor + +Behdad Esfahbod +Email: behdad@gnome.org +Userid: behdad diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..16d8c8d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,86 @@ +## Process this file with automake to create Makefile.in. + +SUBDIRS= pango utils examples docs tools tests win32 + +meson_dist_files = \ + pango/pango-features.h.meson \ + utils/meson.build \ + meson.build \ + meson_options.txt \ + pango/meson.build \ + docs/meson.build \ + docs/xml/meson.build \ + docs/xml/gtkdocentities.ent.in \ + examples/meson.build \ + tools/meson.build \ + tests/meson.build \ + tests/gen-all-unicode.py \ + tests/gen-installed-test.py \ + $() + +EXTRA_DIST = \ + autogen.sh \ + pango.pc.in \ + pangocairo.pc.in \ + pangoxft.pc.in \ + pangoft2.pc.in \ + pangowin32.pc.in \ + MAINTAINERS \ + HACKING \ + README.win32 \ + config.h.win32 \ + pango.doap \ + $(meson_dist_files) + +MAINTAINERCLEANFILES = \ + $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ + $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ + $(srcdir)/INSTALL \ + $(srcdir)/omf.make \ + $(srcdir)/xmldocs.make \ + $(srcdir)/gtk-doc.make \ + $(srcdir)/ChangeLog + +### ChangeLog generation + +CHANGELOG_START = "`git describe --abbrev=0 | sed -e 's|\([0-9]*\)\.\([0-9]*\)\.[0-9]*|\1.\2.0^^|'`" + +ChangeLog: $(srcdir)/ChangeLog +$(srcdir)/ChangeLog: + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ + (GIT_DIR=$(top_srcdir)/.git ./missing --run \ + git log $(CHANGELOG_START).. --stat) | fmt --split-only > $@.tmp \ + && mv -f $@.tmp $@ \ + || ($(RM) $@.tmp; \ + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ + (test -f $@ || echo git-log is required to generate this file >> $@)); \ + else \ + test -f $@ || \ + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ + echo A git checkout and git-log is required to generate this file >> $@); \ + fi +.PHONY: $(srcdir)/ChangeLog + + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = pango.pc + +if HAVE_CAIRO +pkgconfig_DATA += pangocairo.pc +endif + +if HAVE_XFT +pkgconfig_DATA += pangoxft.pc +endif + +if HAVE_FREETYPE +pkgconfig_DATA += pangoft2.pc +endif + +if HAVE_WIN32 +pkgconfig_DATA += pangowin32.pc +endif + +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection + +-include $(top_srcdir)/git.mk diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..fecf52d --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1017 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_CAIRO_TRUE@am__append_1 = pangocairo.pc +@HAVE_XFT_TRUE@am__append_2 = pangoxft.pc +@HAVE_FREETYPE_TRUE@am__append_3 = pangoft2.pc +@HAVE_WIN32_TRUE@am__append_4 = pangowin32.pc +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = pango.pc pangowin32.pc pangoft2.pc pangoxft.pc \ + pangocairo.pc config.h.win32 +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/config.h.win32.in $(srcdir)/pango.pc.in \ + $(srcdir)/pangocairo.pc.in $(srcdir)/pangoft2.pc.in \ + $(srcdir)/pangowin32.pc.in $(srcdir)/pangoxft.pc.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README THANKS compile \ + config.guess config.sub install-sh ltmain.sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = pango utils examples docs tools tests win32 +meson_dist_files = \ + pango/pango-features.h.meson \ + utils/meson.build \ + meson.build \ + meson_options.txt \ + pango/meson.build \ + docs/meson.build \ + docs/xml/meson.build \ + docs/xml/gtkdocentities.ent.in \ + examples/meson.build \ + tools/meson.build \ + tests/meson.build \ + tests/gen-all-unicode.py \ + tests/gen-installed-test.py \ + $() + +EXTRA_DIST = \ + autogen.sh \ + pango.pc.in \ + pangocairo.pc.in \ + pangoxft.pc.in \ + pangoft2.pc.in \ + pangowin32.pc.in \ + MAINTAINERS \ + HACKING \ + README.win32 \ + config.h.win32 \ + pango.doap \ + $(meson_dist_files) + +MAINTAINERCLEANFILES = \ + $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ + $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ + $(srcdir)/INSTALL \ + $(srcdir)/omf.make \ + $(srcdir)/xmldocs.make \ + $(srcdir)/gtk-doc.make \ + $(srcdir)/ChangeLog + + +### ChangeLog generation +CHANGELOG_START = "`git describe --abbrev=0 | sed -e 's|\([0-9]*\)\.\([0-9]*\)\.[0-9]*|\1.\2.0^^|'`" +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = pango.pc $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnits'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnits \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +pango.pc: $(top_builddir)/config.status $(srcdir)/pango.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +pangowin32.pc: $(top_builddir)/config.status $(srcdir)/pangowin32.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +pangoft2.pc: $(top_builddir)/config.status $(srcdir)/pangoft2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +pangoxft.pc: $(top_builddir)/config.status $(srcdir)/pangoxft.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +pangocairo.pc: $(top_builddir)/config.status $(srcdir)/pangocairo.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +config.h.win32: $(top_builddir)/config.status $(srcdir)/config.h.win32.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +ChangeLog: $(srcdir)/ChangeLog +$(srcdir)/ChangeLog: + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ + (GIT_DIR=$(top_srcdir)/.git ./missing --run \ + git log $(CHANGELOG_START).. --stat) | fmt --split-only > $@.tmp \ + && mv -f $@.tmp $@ \ + || ($(RM) $@.tmp; \ + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ + (test -f $@ || echo git-log is required to generate this file >> $@)); \ + else \ + test -f $@ || \ + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ + echo A git checkout and git-log is required to generate this file >> $@); \ + fi +.PHONY: $(srcdir)/ChangeLog + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..753ff1f --- /dev/null +++ b/NEWS @@ -0,0 +1,2933 @@ +Overview of changes in 1.42.4 +============================= +- Fix build failures (OS X, C89) +- Prevent an assertion with invalid Unicode sequences + +Overview of changes in 1.42.2 +============================= +- Require harfbuzz 1.4.2 +- Restore scaling of CoreText fonts +- Speed up font face enumeration +- Add a pango-list utility + +Overview of changes in 1.42.1 +============================= +- Fix meson build, in particular on Windows (#783274, #795012) +- Add an Emoji font family on Windows, using Segoe UI (#794705) + +Overview of changes in 1.42.0 +============================= +- No changes + +Overview of changes in 1.41.1 +============================= +- Build fixes +- Avoid UTF-32 conversion for fribidi +- Use external fribidi and drop mini-fribidi +- Only enable freetype if fontconfig is available (#792363) + +Overview of changes in 1.41.0 +============================= +- Fix up font options from cairo (#790747) +- Add support for font variations +- Fix compiler warnings (#792231) + +Overview of changes between 1.40.13 and 1.40.14 +=============================================== +- Fix char break problem introduced in 1.40.13 (#789625) +- Add tests for char breaking + +Overview of changes between 1.40.12 and 1.40.13 +=============================================== +- Some performance improvements (#788643) +- Update pango_default_break for line breaks (#788115) +- Fix an introspection warning (#781857) + +Overview of changes between 1.40.11 and 1.40.12 +=============================================== +- Fix pango_default_break for sentence start/end (#785978) +- Fix multilib issue in pango-enum-types.h (#786887) + +Overview of changes between 1.40.10 and 1.40.11 +=============================================== +- Fix backspacing for more Emoji sequences +- Make tests run faster + +Overview of changes between 1.40.9 and 1.40.10 +============================================== +- Update Emoji data to version 5 +- Apply gravity across spans in markup (#784243) +- Support variation selectors for shaping +- CoreText: Rely on CGFont for scaling (#782393) +- Fix grapheme breaks and backspacing for Emoji + +Overview of changes between 1.40.8 and 1.40.9 +============================================= +- Build and dist fixes +- Fix build on Windows with MSVC (#783274) + +Overview of changes between 1.40.7 and 1.40.8 +============================================= +- Support emoji sequences in boundary determination +- Choose emoji font for color emoji + +Overview of changes between 1.40.6 and 1.40.7 +============================================= +- Some fixes for meson build support +- Don't change fonts for variation selectors (#781123) +- Fix some bugs in the libthai glue layer +- Pass text along when calling into cairo (#784394) + +Overview of changes between 1.40.5 and 1.40.6 +============================================= +- Don't use deprecated harfbuzz api +- Correctly implement min-required/max-allowed support +- Avoid compiler warnings +- Drop -uninstalled.pd files +- Add support for building with meson + +Overview of changes between 1.40.4 and 1.40.5 +============================================= +- Add missing introspection annotations (#778663) +- Fix line-end handling in pango_read_line (#778816) +- Make alpha attribute work without color (#773767) +- win32: Enable rendering colored texti and underlines (#768779) + +Overview of changes between 1.40.3 and 1.40.4 +============================================= +- Fix some Coverity findings (#778601, #778602, #778654, #778656) +- Fix introspection annotation of pango_lkayout_get_size (#779232) + +Overview of changes between 1.40.2 and 1.40.3 +============================================= +- Fix export of pango_cairo_win32_font_map_get_type (#771004) +- Fix build on OS X (#770729) + +Overview of changes between 1.40.1 and 1.40.2 +============================================= +- Improve introspection builds in msvc (#764984) +- Properly handle UTF32 chars in coretext +- Add rebeccapurple to list of colors +- Correct font weight mapping in coretext (#766148) +- Use version macros for exports (#767587) + +Overview of changes between 1.40.0 and 1.40.1 +============================================= +- Use $PKG_CONFIG consistently (#764191) +- Fix a PangoWin32FontMap memory leak (#7640890) + +Overview of changes between 1.39.1 and 1.40.0 +============================================= +- Fix typos +- Don't treat OGHAM SPACE MARK as whitespace + +Overview of changes between 1.38.1 and 1.39.0 +============================================= +- Update PangoScript to Unicode 8.0 + +Overview of changes between 1.38.0 and 1.38.1 +============================================= +- Require 0.9.30 +- Fix make check with --enable-debug=no +- Win32 build fixes + +Overview of changes between 1.37.5 and 1.38.0 +============================================= +- No changes + +Overview of changes between 1.37.4 and 1.37.5 +============================================= +- Small optimizations + +Overview of changes between 1.37.3 and 1.37.4 +============================================= +- Use grapheme boundaries in justification +- Support coloring marks and bases independently (#541608) +- Fix a crash (#753167) +- Make Thai and Arabic support thread-safe +- Fix justification (#753772) + +Overview of changes between 1.37.2 and 1.37.3 +============================================= +- Fix pango_glyph_item_iter_prev +- Add alpha attributes +- Add support for alpha in markup + +Overview of changes between 1.37.1 and 1.37.2 +============================================= +- Don't use hb_glib_get_unicode_funcs +- Warning fixes + +Overview of changes between 1.37.0 and 1.37.1 +============================================= +- Add attributes for OpenType font features (#738505) +- CoreText: locale handling improvements (#750017) +- Fix ellipsization with line space (#750383) +- Fix issues with hex boxes (#750463) + +Overview of changes between 1.36.8 and 1.37.0 +============================================= +- Pango modules, engines, and config have been removed (#733882) +- Added pango_fc_font_map_config_changed() (#748767) +- Added pango_fc_font_map_[sg]et_config() (#547671) +- Added pango_matrix_get_font_scale_factors +- Lot of API has been deprecated +- Fix CoreText font fallback +- General build fixes +- Win32 build fixes + +Overview of changes between 1.36.7 and 1.36.8 +============================================= +- Make tests not fail on build.gnome.org + +Overview of changes between 1.36.6 and 1.36.7 +============================================= +- Add tests for pango markup +- Add tests for PangoLayout +- Add an analysis flag for ellipsis (#735719) +- Treat attributes in ellipsis better (#735732) + +Overview of changes between 1.36.5 and 1.36.6 +============================================= +- Cope with lack of LC_CTYPE (#732276) +- Prevent harfbuzz from using replacement char +- Don't force static builds on win32 (#733137) +- Allow backend selection via PANGOCAIRO_BACKEND +- Support more font weights (#733764) +- Fix vertical positioning on win32 +- Don't break in the middle of jamo (#705727) + +Overview of changes between 1.36.4 and 1.36.5 +============================================= +- Lower the harfbuzz requirement + +Overview of changes between 1.36.3 and 1.36.4 +============================================= +- Improve thread-safety on Windows (#695913) +- Add missing annotations (#729840) +- Update PangoWeight documentation +- Require harfbuzz 0.9.29 + +Overview of changes between 1.36.2 and 1.36.3 +============================================= +- Fix builddir != srdir builds +- Avoid a crash when FT_Face is NULL (#724006) +- Win32 build fixes +- Update pango_color_parse docs (#711061) + +Overview of changes between 1.36.1 and 1.36.2 +============================================= +- Win32 build fixes +- Fix a possible strtol(NULL) (#719549) +- Fix --with-included-modules +- Fix a FPE in pango_layout_iter_get_char_extents (#720379) +- Use 96 dpi for CoreText by default + +Overview of changes between 1.36.0 and 1.36.1 +============================================= +- Handle scaling absolute font sizes (#708778) +- Small documentation fixes + +Overview of changes between 1.35.3 and 1.36.0 +============================================= +- Remove a useless test (#707131) +- Never return NULL from pango_layout_get_test (#707659) +- Correct an annotation (#707874) +- Fix gravity map (#708432) + +Overview of changes between 1.35.2 and 1.35.3 +============================================ +- Compiler warnings about strict aliasing (#703995) +- Getting rid of the arbitrary MAX_SIZE for font (707131) + +Overview of changes between 1.35.0 and 1.35.2 +============================================ +- Bypass line reordering in some cases (#705007) + +Overview of changes between 1.34 and 1.35.0 +=========================================== +- Requires cairo 1.12.10 +- Add a --with-cairo option +- Handle invalid utf8 better (#700577) +- Install some tests +- Don't change fonts for space (#701652) + +Overview of changes between 1.34.0 and 1.34.1 +============================================= +- 96238 - PangoAttrFilterFunc vs pango_attr_list_filter docs +- Update win32/CoreText shaper signature +- Fix CoreText scaling (again) +- Align word breaking with newer Unicode specs + +Overview of changes between 1.33.9 and 1.34.0 +============================================= +No changes + +Overview of changes between 1.33.8 and 1.33.9 +============================================= +- Port PangoWin32 to use GWeakRef +- 682846 - Use G_DEFINE_TYPE in pangowin32-fontmap +- Fix scale in pangocairo-threads test +- Misc Win32 build fixes + +Overview of changes between 1.33.7 and 1.33.8 +============================================= +- 694095 - Fails make check: -pango_cairo_win32_font_map_get_type +- 668154 - GTK+ Crashes on Non BMP utf-8 charpoints +- 694626 - Add pango_font_map_changed +- 694626 - PangoFc: change FontMap in pango_fc_font_map_clear_cache +- 694830 - Fails make check: +pango_font_map_change +- 694918 - Pango layout is misrendered with non-identity transformation +- 694882 - build broken - introspection of pangoxft2 and pangoxft + +Overview of changes between 1.32.6 and 1.33.7 +============================================= +- Allow enabling font features through fontconfig snipplets +- Fix an infinite loop when starting Inkscape + +Overview of changes between 1.32.5 and 1.32.6 +============================================= +- Make pango threadsafe +- Pass down BOT/EOT flags to HarfBuzz +- 690279 - broken relocation of modules +- 691263 - Build with automake-1.13 broken + +Overview of changes between 1.32.4 and 1.32.5 +============================================= +- 689843 - Drop last ues of G_CONST_RETURN +- 689864 - build failure +- 689882 - pango-font.h:381: error: comma at end of enumerator list +- 686512 - pango_cairo_font_get_scaled_font failed under wine +- 690081 - pangofc-fontmap: Remove bad use of the comma operator +- 679299 - Allow incrementally parsing pango markup + +Overview of changes between 1.32.3 and 1.32.4 +============================================= +- Require harfbuzz 0.9.9 +- 340066 - Add serials tracking changes in PangoFontMap/PangoContext/PangoLayout +- Automatically relayout PangoLayout if PangoContext has changed +- Fix rendering of rotated frames +- 576156 - Remove Thai/Lao Prepend/Extend properties +- Fix grapheme properties of joiner / nonjoiner +- Fix grapheme properties of U+FFxx range +- Fix line break of surrogate characters +- Fix grapheme boundaries of surrogates and unassigned default ignorables +- Update bidi tables to Unicode 6.2.0 +- 689648 - Use -Bsymbolic-functions by default if available +- Fix Win32 and CoreText cairo backends to take cairo CTM into account + +Overview of changes between 1.32.2 and 1.32.3 +============================================= +- make gobject-introspection PANGO_GLYPH happy +- provide a phony define for LANGUAGE +- adjust to harfbuzz 0.97 api + +Overview of changes between 1.32.1 and 1.32.2 +============================================= +- 685021 - Fix load_fontset() for Win32 backend +- pango-viewer: Flush cairo surface when done +- 687470 - Xft: Fix a deadlock on display close +- Add missing colors from the web palette +- Rename configure.in to configure.ac + +Overview of changes between 1.32.0 and 1.32.1 +============================================= +- Fixup grapheme clusters +- 684959 - crash after "Add pango_shape_full()" + +Overview of changes between 1.31.2 and 1.32.0 +============================================= +- Add a --without-xfg configure option +- Add pango_shape_full() + +Overview of changes between 1.31.1 and 1.31.2 +============================================= +- More work on towards thread-safety +- Build fixes on OS X + +Overview of changes between 1.31.0 and 1.31.1 +============================================= +- The module cache file can now be located in libdir +- Initial work towards making pango thread-safe +- Update to Unicode 6.1. +- 682421 - Fix vertical text, gravity, etc, with HarfBuzz +- 678721 - Don't need to get item properties... +- 678997 - Colors aqua, silver and indigo missing... +- 653347 - rise units documented incorrectly +- 682952 - remove old glib check +- Deprecate pango-ot.h. +- Deprecate pango_fc_font_kern_glyphs +- Deprecate pango_lookup_aliases + +Overview of changes between 1.30.1 and 1.31.0 +============================================= +- Port to harfbuzz 0.9.x, use external harfbuzz +- Remove Arabic, Syriac, Hangul Hebrew, Khmer, + Tibetan and Thai shapers (replaced by harfbuzz) +- Remove Indic module (replaced by harfbuzz) +- Remove Atsui support (superseded by CoreText) +- Remove PangoX +- 679654 - Crash for PangoContext.list_families +- 680965 - missing language strings for ... +- 681423 - introspection: assorted fixes... + +Overview of changes between 1.30.0 and 1.30.1 +============================================= +- Update Arabic joining classes to 6.1.0 +- Build fixes +- Annotation fixes +- 667960 - add --system option to querymodules +- 675400 - respect XDG_CONFIG_HOME for rc files +- 673497 - Fix corefont fallback + +Overview of changes between 1.29.5 and 1.30.0 +============================================= +- 667799 - Fix cross-compiling bug in configure.in +- 664125 - Zero-width spaces cause missing characters +- CoreText backend: implement font fallbacks +- CoreText backend: make more robust against broken fonts +- CoreText backend: make shaping engine more robust +- CoreText backend: Guard against glyph count of zero +- Win32 build fixes + +Overview of changes between 1.29.4 and 1.29.5 +============================================= +- Documentation fixes +- Build fixes for ATSUI backend +- Add more Chinese poetry +- Fix ChanContext backtrack matching with GPOS +- Bug 653985 - Pango 1.29.x make GTK3-demo.exe crashed in Windows +- Bug 635399 - Add C include and exported packages information to GIRs +- Bug 658561 - Double free after calling Pango.Context.get_font_des... +- Bug 656014 - Missing GIR annotation/wrapper for pango_layout_get_... +- Bug 654689 - Slightly broken Introspection build +- Bug 403499 - Text Attribute Markup page does not describe charact... +- Bug 650456 - Visual C++ 2010 Project Files to compile Pango +- Bug 653985 - Pango 1.29.x make GTK3-demo.exe crashed in Windows +- Bug 661612 - Add deprecation attributes to deprecated functions + +Overview of changes between 1.29.1 and 1.29.3 +============================================= +- Minor fix in 1.29.1 tarball + +Overview of changes between 1.28.4 and 1.29.1 +============================================= +- Lots of introspection markup added +- Misc fixes + +Overview of changes between 1.28.3 and 1.28.4 +============================================= +- Various introspection annotation fixes +- Build fixes +- Require glib >= 2.24.0 +- Bugs fixed: + Bug 636348 - Hex boxes are incorrectly scaled with non identity cairo scale + Bug 639882 - Heap corruption in font parsing with FreeType2 backend + +Overview of changes between 1.28.2 and 1.28.3 +============================================= +- Bugs fixed: + Bug 630857 - introspection: Use --include-uninstalled + +Overview of changes between 1.28.1 and 1.28.2 +============================================= +- Reduce DLL hijack risk and simplify code in basic-win32 module +- Improve performance on Windows especially for non-Latin scripts +- Bugs fixed: + Bug 628497 - Crash in pango_layout_line_get_extents at pango-layout.c + Bug 626966 - SIGFPE _hb_sanitize_array + Bug 629632 - configure bug + Bug 625807 - approximate character width is 0 on pangoft2 + +Overview of changes between 1.28.0 and 1.28.1 +============================================= +- pango-view now accepts --margin +- Various HarfBuzz bug fixes +- Build fixes +- Bugs fixed: + Bug 582698 - Support CSS-style margin specification + Bug 621612 - VPATH build fix + Bug 605870 - Incorrect shaping for Syriac + Bug 457990 - font metrics are not converted to user space in cairo backend + Bug 613015 - [HB] Does not sanitize Device tables referenced from ValueRecords + +Overview of changes between 1.27.1 and 1.28.0 +============================================= +- [HB] Fix leak when duplicating blob +- Misc bug fixes +- Bugs fixed: + Bug 611033 - Layout using ATSUI fontmap treats absolute font sizes a... + Bug 605655 - Pango 1.26.2 introduces kerning bug + Bug 611229 - Pango reads from uninitialized memory + Bug 594101 - [Indic] needed character class data updates to support unicode 5.1 + Bug 345066 - backspace changes independent indic characters + Bug 609326 - Complex script shaping failed in the FT2 backend on Windows + Bug 604128 - Applications crash when displaying Hebrew characters + Bug 608923 - Incorrect/broken ligatures on MacOS + Bug 610791 - checks fail for unused documented symbols + +Overview of changes between 1.26.2 and 1.27.1 +============================================= +- Enable introspection again +- Misc HarfBuzz bug fixes +- Improve PangoLayout line breaking +- Revert usage of CoreText in ATSUI backend +- Fix FT_Face finalizer call +- Bugs fixed: + Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X + Bug 610183 - Pango doesn't compile with gcc 3.3.3 + Bug 582697 - Add pango-view --pixels option + +Overview of changes between 1.26.1 and 1.26.2 +============================================= +- Fix non-standard C++ usage +- Fix OpenType mark ligation +- Bugs fixed: + Bug 602823 - void function cannot return value + Bug 602660 - [HB] don't use flexible arrays + Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler + +Overview of changes between 1.26.0 and 1.26.1 +============================================= +- Finally fix GPOS positioning and kerning with non-identity cairo matrices +- [HB] Fix lookup_flag ignoring +- Fix leak with non-mmapped fonts +- Allow using uninstalled glib +- Bugs fixed: + Bug 341481 - pangocairo kerning problem with nonidentity scaling + Bug 587768 - [patch] Don't build pango-view twice + Bug 594101 - [Indic] character class data updates to support unicode 5.1 + Bug 596837 - Typo in pango_cairo_show_layout documentation + +Overview of changes between 1.25.6 and 1.26.0 +============================================= +- New stable release series +- Bugs fixed: + Bug 595539 - Regressions in rendering certain Thai sequences + +Overview of changes between 1.25.5 and 1.25.6 +============================================= +- Fix a couple of array overflow bugs +- Bugs fixed: + Bug 593240 - updating pango to latest git master makes things crash + Bug 593231 - < c99 compiler dislikes ValueRecord + +Overview of changes between 1.25.4 and 1.25.5 +============================================= +- Minor HarfBuzz code shuffling +- Bugs fixed: + Bug 592484 - invalid write in HB + Bug 592194 - Fix missing _SC_PAGE_SIZE macro + +Overview of changes between 1.25.3 and 1.25.4 +============================================= +- Fix various possible overflows in HarfBuzz +- Improve HB font sanitizing +- Improved win32 performance +- Really fix ming32 build issues +- Re-enable introspection +- Bugs fixed: + Bug 592131 - Add AM_SILENT_RULES + Bug 592036 - integer overflow bug causes misrendering of Nepali + characters + Bug 591511 – hh-blob.c does not compile using mingw on windows + +Overview of changes between 1.25.2 and 1.25.3 +============================================= +- Fix couple of crashers +- Enforce -fno-exceptions better, should fix build issues for + distros on x86-64. +- Call mprotect() only when available. +- New public API: pango_glyph_item_get_logical_widths() +- Remove G_GNUC_PURE attr from pango_glyph_string_get_width() +- Fix buffer corruption in HarfBuzz +- Bugs fixed: + Bug 591413 – needs to link with libstdc++ + Bug 591511 – hb-blob.c does not compile using mingw on windows + Bug 591557 – [HB] crash scrolling the evolution message list + Bug 591576 – crashed with SIGSEGV at pango + Bug 591465 – Gimp crashes upon opening the font selection dialog + +Overview of changes between 1.25.1 and 1.25.2 +============================================= +- Tweak C++ compiler options. If you get link errors with gcc on + x86-64 about __gxx_personality_v0(), make sure your CXXFLAGS does + not have -fexceptions. This will be fixed in Pango itself later. +- Fix crasher with gzipped fonts. + Bug 591409 – crash in firefox. Handle non-mmapped FT_Face + +Overview of changes between 1.24.5 and 1.25.1 +============================================= +- Merge harfbuzz-ng: brand new OpenType Layout engine + Currently is not very portable. Will be fixed as + reports come in. + +- Port to ATSUI backend to use CoreText instead of ATS +- New public API: + + pango_gravity_get_for_script_and_width() + +- Misc bug fixes + Bug 590042 – pango-view.1 manpage should not be gzipped + Bug 410169 – gravity problem with Common chars + Bug 589113 – Some characters rotated incorrectly in vertical text + Bug 582851 -- Little fix for compiling with Cygwin + Bug 588060 -- Fonts missing on Cygwin + +Overview of changes between 1.24.4 and 1.24.5 +============================================= +- Build introspection again +- Misc bug fixes + Bug 589133 – Firefox 3.5 complains about invalid weak references + Bug 585806 – crash during pango_fc_font_map_shutdown + Bug 588678 – pango crash: install a new theme from + +Overview of changes between 1.24.3 and 1.24.4 +============================================= +- Misc bug fixes + Bug 586814 – Crashes related to fontmap destruction after upgrade + +Overview of changes between 1.24.2 and 1.24.3 +============================================= +- Fix build with new automake +- Misc bug fixes + Bug 585337 – Fails to install: install: will not overwrite + just-created + Bug 585164 – 'man preload' shows man page for pango-view + Bug 584328 – Persian sample text is not good + Bug 583250 – pango_font_metrics_get_approximate_char_width is + wrong when LANG=fa_IR + +Overview of changes between 1.24.1 and 1.24.2 +============================================= +- Misc bug fixes + Bug 580987 – SIGFPE in pango_glyph_string_index_to_x + Bug 580273 – Font metrics functions incorrectly listed as reporting + point sizes + Bug 579694 – Cygwin parallel-build patch + Bug 578944 – pango-1.24.1 fails its testsuite + Bug 578935 – Syntax error (missing semicolon) in + pango/pangowin32-fontmap.c + +Overview of changes between 1.24.0 and 1.24.1 +============================================= +- Fix a couple of crashers +- Fix minor pangofc API semantics breakage +- Better handle SFNT fonts in dfont containers +- Improved docs +- Improved Indic shaper for new Unicode 5.1 characters +- Misc bug fixes +- Bugs fixed in this release: + + Bug 577952 – Error loading {GDEF,GSUB,GPOS} table 0x6EAD + Bug 578336 – ABI breakage from 1.22 to 1.24 in fontmap field + of PangoFcFont + Bug 556132 – gnome-panel crashed with SIGSEGV in + g_cclosure_marshal_VOID__BOXED() + Bug 571291 – Unicode 5.1 support in pango - Indic Lanuages + Bug 576298 – Fails to link pango-view if --without-x is specified + but cairo has X11 support + +Overview of changes between 1.23.0 and 1.24.0 +============================================= +- pango-view improvements: + + * pango-view -q now works without a X server. + + * Ability to save to PS, EPS, PDF, and SVG files. Filetype is + detected from output file extension. + + * New options --foreground, --background, and --annotate. + + * Now installs a manual page, thanks to help2man. + +- PangoFc API changes: + + * PangoFcFont now has a "fontmap" property that subclasses can use + at construction time to setup the font->fontmap link. + + * New backend-public API: + + pango_fc_font_map_find_decoder() + +- Misc optimizations +- Build fixes +- Misc bug fixes +- Bugs fixed in this release: + Bug 547963 – man page for pango-view + Bug 502804 – pango-view or pangocairo-view option to annotate + Bug 502801 – per-backend pango-view options + Bug 502805 – pango-view option for foreground/background color + Red Hat Bug 490331 - Crash of galeon in libpango + Bug 523166 – pango-view opens display even when invoked with -q + Bug 567160 – Share cmap cache between PangoFcFont's of the same face + Red Hat Bug 487593 - crash changing language in gdm + Bug 572662 – Remove deprecated GTK+ symbols + Bug 572529 – Poor -I ordering can break build + +Overview of changes between 1.22.4 and 1.23.0 +============================================= +- Change the PangoFc font loading API to allow for lazy loading of fonts. +- Add private PangoFcFontset that loads fallback fonts as needed. +- Call FcFontMatch() and only if fallback fonts are needed call FcFontSort(). +- Optimize HarfBuzz number of malloc calls +- Don't malloc megs of unused memory in HarfBuzz +- Print-out, and parse, numeric styles correctly. Things like + "DejaVu Sans weight=100" parse as font description now. +- New public API: + + Add two new public macros: + + PANGO_ATTRIBUTE_INDEX_FROM_TEXT_BEGINNING + PANGO_ATTRIBUTE_INDEX_TO_TEXT_END + + Add new public enum values: + + PANGO_WEIGHT_BOOK + PANGO_WEIGHT_ULTRAHEAVY + PANGO_WEIGHT_THIN + PANGO_WEIGHT_MEDIUM + +- Misc bug fixes +- Bugs fixed in this release: + Bug 569763 – pango doesn't like font descriptions without family! + Bug 560792 – Make PangoLayoutLine with line->layout==NULL renderable + Bug 567392 – Abiword crashes in pango when opening document with + certain locales + Bug 566727 – PangoFontsetLazy + Bug 567165 – Apply all pattern matrices + Bug 567934 – Add introspection support inside pango + Bug 549532 – Correction to the sample string for Hindi in + pango-language-sample-table.h + Bug 566726 – Minor optimization + Bug 566941 – Add PANGO_ATTRIBUTE_INDEX_FROM_TEXT_BEGINNING and + PANGO_ATTRIBUTE_INDEX_TO_TEXT_END + Bug 551469 – Fold '@' to '-' when parsing PangoLanguages + Bug 328206 – Update/remove some old files + Bug 166709 – Handle font variants more consistently + Bug 166676 – pango_fc_font_map_finalize + Bug 164001 - pango-querymodules doesn't work uninstalled on win32 + Bug 384362 – pango can't select some font styles + Bug 168085 – numeric styles in pango_font_description_to_string() + Bug 529591 – Code related to malayalam is misplaced. + Patch from Rahul Bhalerao + Bug 515807 – Don't bind modules lazily + Bug 512662 – Update check.docs for pango-undeclared.txt + Bug 565644 – Maybe pango_font_descriptions_free is deprecated + Bug 469049 – Fix all compiler warnings + Bug 565379 – pango_font_description_better_match some style attributes + of old_match are not checked + Bug 564877 – pango-engine.h: PANGO_MODULE_PREFIX and G_MODULE_EXPORT + +Overview of changes between 1.22.3 and 1.22.4 +============================================= +- Misc bug fixes +- Improved docs +- Bugs fixed in this release: + Bug 564644 – Not complete description of the + pango_font_description_better_match function + Bug 563898 – Generated output is not deterministic + Bug 563803 – pango_renderer_finalize fails to call parent finalize + Bug 499626 – Space should be optional after comma in + PangoFontDescription input string + Bug 499624 – Spaces around commas in PangoFontDescription family name + should be trimmed + Bug 563557 – set g_get_prgname() in fc pattern + Bug 563356 – The input area of firefox and the blank width after text + in gnome-menu was stretched too wide, under pango-1.22.3 + Bug 562574 – Pangocariowin32 is leaking every cairo font it ever + creates + +Overview of changes between 1.22.2 and 1.22.3 +============================================= +- Minor bug fix with matrix operations +- Fix build with older compilers +- Bugs fixed in this release: + Bug 561779 – incorrect calculations in pango_matrix_concat + implementation + Bug 560730 – pango 1.22.2 build failure on Solaris 10, too many array + initializers in pango-language.c + Bug 561740 – Use stack allocation for thai_engine_break + +Overview of changes between 1.22.1 and 1.22.2 +============================================= +- Fix crasher when a PangoFcFontMap was freed before its fonts. +- Mark monospace fonts as monospace in the pangoatsui backend. +- Fix font description parsing to better handle "normal". +- Bugs fixed in this release: + Bug 558254 – Internal reference handling messed up + Bug 558107 – is_monospace always returns FALSE in pangoatsui + Bug 557620 – pango_font_description_from_string not correct + +Overview of changes between 1.22.0 and 1.22.1 +============================================= +- Fix crasher when freeing PangoLayoutIter's +- Fix loading of bogus OpenType anchor tables +- Fix OpenType CursiveChain positioning +- Misc bug fixes +- Bugs fixed in this release: + Bug 528272 – "Error loading GPOS table 5503" when using katakana + characters + Bug 552107 – Small libtool fixes + Patch by Patryk Zawadzki + Bug 539623 – document that pango_color_parse accepts NULL + Bug 555219 – Memory leak when using pango_layout_iter_copy + Patch from Falk Rohsiepe + Bug 553345 – Japanese pangram. + Patch from Takeshi AIHANA + +Overview of changes between 1.21.6 and 1.22.0 +============================================= +- Require cairo >= 1.7.6. +- Improved Romanian sample text +- Don't use deprecated glib win32 API +- Misc bug fixes +- Bugs fixed in this release: + Bug 552993 – Romanian pangram + Bug 551865 – Can't change justification of a PangoLayout after first + draw + Bug 551416 - pangowin32-fontcache.c: argument is different type + +Overview of changes between 1.21.5 and 1.21.6 +============================================= +- Win32 cross-compiling build system fix +- Improve language sample strings. +- Bugs fixed in this release: + Bug 550659 – configure.in ignores a win32 backend only scenario + Bug 549758 – Swedish font sample text could use punctuation + Bug 549522 – New pt_BR pangram for pango + Bug 549520 – fr sample string + +Overview of changes between 1.21.4 and 1.21.5 +============================================= +- Make the reference the font->fontmap reference weak. Previously all + fontmaps had circular references to their fonts and back, making them + leak instead of being freed upon finalization. Now they all clean after + themselves. There's a slight semantic change though, that a PangoFont does + not keep its fontmap alive anymore, so that's up to the user. But then + again, finalizing fontmaps is not a good idea to begin with. + +- Improve pango_language_get_sample_string() to add language sample texts that + are actually usable. Compiled from a variety of sources. + See pango-language-sample-table.h. + +- In pango_language_get_sample_string() use default language if provided + language is NULL. + +- Update OpenType language-system tags to OpenType 1.5 draft intersected with + ISO639-3 of 2008/08/04. + +- New API additions: + Add a minor new public API: + + pango_language_get_scripts() + + This is what pango_language_includes_script() has been using + internally. Previously one had to call that function over all + possible script values to determine which scripts a language + uses. The new API makes that much easier. + +- Bugs fixed in this release: + Bug 549003 – pango_layout_set_height(): layout should not be cleared + unless required + Bug 143542 – PangoFT2Fontmap leak + Bug 314094 – Get rid of poutpourri default sample string + Bug 473806 – Improve pango_language_get_sample_string() + Bug 473805 – Add API enumerating scripts for a language + Bug 470895 – Improve OpenType language tag list + Bug 547432 – Deprecation of pango_(backend)_font_map_create_context() + not clean + +Overview of changes between 1.21.3 and 1.21.4 +============================================= +- Use cairo_show_text_glyphs() if target cairo surface supports that. + This is done by adding a new PangoRenderer method, draw_glyph_item(). + Custom PangoRenderer implementations that delegate to pango_cairo + may want to implement this method if they target PDF files. +- Requires cairo >= 1.7.4 now +- Win32 build improvements +- Justify lines broken by U+2028 LINE SEPARATOR +- Various small fixes and improvements +- New API additions: + + New public API: + + PangoRenderer::draw_glyph_item() + pango_renderer_draw_glyph_item() + + Make layout and layout-line default renderers go through + draw_glyph_item(), which then by default falls back to + draw_glyphs(). The advantage in draw_glyph_item() is that it + has access to the text and cluster information. + + New public API, for iterating a PangoGlyphItem: + + PangoGlyphItemIter + PANGO_TYPE_GLYPH_ITEM_ITER + pango_glyph_item_iter_copy() + pango_glyph_item_iter_free() + pango_glyph_item_iter_init_start() + pango_glyph_item_iter_init_end() + pango_glyph_item_iter_next_cluster() + pango_glyph_item_iter_prev_cluster() + + Make the following previously backend-only API public: + + pango_context_new() + pango_context_set_font_map() + + This also means that bindings are recommended to allow + instantiation of pango.Context. This was discouraged before. + + New public API: + + pango_font_map_create_context() + + This is equivalent to pango_context_new() followed by an + immediate pango_context_set_font_map(). This change also + deprecates various per-fontmap-type context constructors: + + Deprecate pango_cairo_font_map_create_context(). + Deprecate pango_fc_font_map_create_context(). + Deprecate pango_ft2_font_map_create_context(). + Deprecate pango_win32_get_context(). + Deprecate pango_xft_get_context(). + Deprecate pango_x_get_context(). + + Language bindings are encouraged to bind + pango.Fontmap.create_context() and remove the create_context() + method from subclass implementations. + + +- Bugs fixed in this release: + Bug 547303 – pango_layout_get_cursor_pos crashes on certain text + buffers + Fedora Bug 457883 - Sindhi Characters are not supported in + pango [U+097B-U+097F] + Patch from Pravin Satpute + Bug 441654 – prefix fails when more than one base characters (as + conjuncts) present after a half form the next prefix renders + incorrectly + Patch from Rahul Bhalerao + Bug 546534 – pango_cairo_font_map_set_default(NULL) errs + Bug 431394 – Use pango_glyph_item_iter in more places + Bug 377948 – Make pango_glyph_item_iter public + Bug 472625 – Add draw_glyph_item() to PangoRenderer + Bug 540592 – Crash in HB_GSUB_Apply_String with Linux-Libertine font + Bug 540036 – Doesn't link to fontconfig + Bug 380094 – Fix split matra rendering bug for Kannada language + Bug 536017 – Remove SF_MPRE_FIXUP from Sinhala script flags + Patch by Harshula + +Overview of changes between 1.21.2 and 1.21.3 +============================================== +- Various small fixes and improvements +- Bugs fixed in this release: + Bug 538661 – Improve pango_cairo_context_update_context() + Bug 536190 – Make pango_fc_font_map_clear_cache() public? + Bug 537258 – Add a pango_language_to_string() function + Bug 537257 – pango_language_from_string(NULL) not happy + Bug 537186 – Make PangoFcFont pattern property readable + +Overview of changes between 1.21.1 and 1.21.2 +============================================== +- Various win32 font handling improvements +- Bugs fixed in this release: + Bug 510299 – OpenType font variants are broken with ATSUI/Cairo + Bug 436363 - Bold and Bold Italic style of MS-Mincho font are not + listed in GtkFontSelection + Bug 523193 – Vista Hebrew, CJK fonts to builtin win32 pango aliases + Patch by Daniel Atallah. + +Overview of changes between 1.21.0 and 1.21.1 +============================================== +- Partial work to make pango_break() exactly follow Unicode TR#14 and TR#29. + The Grapheme Boundaries and Word Boundaries now work. For word boundaries, + a new member was added to PangoLogAttr. Sentence Boundaries and Line Breaks + to follow in the next release. +- Err if no cairo font backends found +- Misc bug fixes +- New public API: + Add new PangoLogAttr member is_word_boundary, that implements UAX#29's + Word Boundaries semantics. The is_word_start and is_word_end members + will change implementation later on to be consitent with the word + boundaries. + +- Bugs fixed in this release: + Bug 531242 – Leak when calculating win32 font coverage + Patch from Daniel Atallah + Bug 530757 – Docs build breaks because of hash sign in URL in + Bug 530685 – Pango no longer using cairo as a backend as of pango 1.19.4 + Part of Bug 97545 – Make pango_default_break follow Unicode TR #29 + +Overview of changes between 1.20.2 and 1.21.0 +============================================== +- Require cairo >= 1.6.4. +- Write out HarfBuzz errors as hex. +- Add a section in the docs for bidirectional text. +- Improved hex-box rendering in the cairo backend. +- Add some aliases for tag attributes. +- Preserve current-point around pango_cairo_* functions. +- New public API: + pango_attr_type_get_name() + enum PangoBidiType; + pango_bidi_type_get_type() + pango_bidi_type_for_unichar() + pango_layout_get_baseline() + pango_cairo_create_context() + pango_cairo_font_map_set_default() + +- Bugs fixed in this release: + Bug 515432 – Add function to get bidirectional character type of a + unicode character + Patch from Jürg Billeter + Bug 517119 – Add pango_cairo_create_context() + Bug 404416 – pango_layout_get_baseline or something + Bug 474706 – cairo hexbox looks ugly + Bug 490669 – add some attribute aliases + Bug 501334 – Make pango_cairo_[show_]*[_path]() functions preserve + current point + Bug 514617 – Add pango_cairo_font_map_set_default() + Bug 511183 – Add pango_attr_type_get_name() + +Overview of changes between 1.20.1 and 1.20.2 +============================================== +- Really fix build on OS X. + +Overview of changes between 1.20.0 and 1.20.1 +============================================== +- Update to Unicode Character Databse 5.1.0. This adds new entries to + the PangoScript enum. Requires glib >= 2.16.3 for the update Unicode + data there, but not bumping the requirement in a stable point release. +- Try making our OS X stuff compile with latest cairo 1.5.x snapshots + that renamed cairo-atsui to cairo-quartz-font, as well as older versions. +- Minor bug fixes. + +Overview of changes between 1.19.4 and 1.20.0 +============================================== +- New stable release! +- Bugs fixed in this release: + Bug 518084 – Thai is not Virama language + Patch from Theppitak Karoonboonyanan + +Overview of changes between 1.19.3 and 1.19.4 +============================================== +- Make Win32 backend be able to use Type1 fonts +- Fixed blocker bug with pango_layout_set_height() and positive height. +- Fixed small leak in ATSUI backend. +- Improved docs. +- Bugs fixed in this release: + Bug 511172 – pango_layout_set_height() with positive height always + shows at least two lines + Bug 515484 – Uniscribe interface handles surrogate + pairs incorrectly + Bug 515484 – Pango on Windows is missing Type 1 + font support + Patch from Adrian Johnson. + Bug 517083 – pango modules: wrong fallback adding code? + Bug 515484 – Variable is initialized twice + Bug 504810 – Samvruthokaram (combination of U+0D41 and U+0D4D) is not + rendered correctly + Patch from Praveen A + Bug 496244 – Don't use freetype-config, use pkg-config + Bug 512566 – dont' use deprecated macro + Patch from Christian Persch + Bug 512473 – [patch] gtk-doc warnings + +Overview of changes between 1.19.2 and 1.19.3 +============================================== +- pango_layout_get_pixel_extents() and pango_layout_line_get_pixel_extents() + now round extents to pixels inclusively. That is, pass both ink_rect and + logical_rect as first argument to pango_extents_to_pixels(). + +- Rename pango_extents_to_pixels() function arguments from @ink_rect and + @logical_rect to @inclusive and @nearest. Given that this API is a + fairly new addition and not commonly used, language bindings are + encouraged to update their argument names accordingly. Moreover, they + are encouraged to wrap this function as two different calls: + extents_to_pixels_inclusive() and extents_to_pixels_nearest(), or + similar conventions that best reflect their native language. + +- HarfBuzz was relicensed to a more generous and simpler license. + Adapt. See pango/opentype/COPYING for the new license which is + LGPL-compatible. + +- New public API: + + pango_layout_set_height() + + This sets the height to which the #PangoLayout should be ellipsized at. + There are two different behaviors, based on whether @height is positive or + negative. + + If @height is positive, it will be the maximum height of the layout. Only + lines would be shown that would fit, and if there is any text ommitted, an + ellipsis added. At least one line is included in each paragraph regardless + of how small the height value is. A value of zero will render exactly one + line for the entire layout. + + If @height is negative, it will be the (negative of) maximum number of lines + per paragraph. That is, the total number of lines shown may well be more + than this value if the layout contains multiple paragraphs of text. The + default value of -1 means that first line of each paragraph is ellipsized. + + Height setting only has effect if a positive width is set on @layout and + ellipsization mode of @layout is not %PANGO_ELLIPSIZE_NONE. + The behavior is undefined if a height other than -1 is set and ellipsization + mode is set to %PANGO_ELLIPSIZE_NONE, and may change in the future. + + There are still bugs remaining to be fixed, notably bug 511172 (which will + be fixed before 1.20), and bug 511171 (which will be fixed in a future + version). + +- New command-line arguments to pango-view: --height and --single-par. + +- Make the following symbols available to engines: + + PANGO_IS_OT_INFO + PANGO_IS_OT_RULESET + PANGO_OT_INFO + PANGO_OT_RULESET + PANGO_TYPE_OT_INFO + PANGO_TYPE_OT_RULESET + pango_ot_info_get_type + pango_ot_ruleset_get_type + +- Bugs fixed in this release: + Bug 508002 – change pango_layout_pixel_extents() to round logical rect + to be inclusive + Bug 469313 – Add pango_layout_set_height() + Bug 508179 – PangoGlyphUnit confusion + Bug 508381 – indent and center alignment don't mix + Bug 508007 – Add option for single-paragraph mode to pango-view + Bug 506284 – docs typo for pango_coverage_unref + Patch from Christian Persch + Bug 504802 – build failure: No rule to make target + `pango-querymodules.1', needed by `all-am'. Stop. + Bug 504585 – pango-querymodules.1 syntax error + Red Hat Bug 426178: gtkdoc-scan fails on pango + +Overview of changes between 1.19.1 and 1.19.2 +============================================== +- Render a crossed box for each invalid input byte to pango_layout_set_text(). + Previously we rendered an ASCII question mark instead. The crossed box has + a glyph of value of PANGO_GLYPH_INVALID_INPUT. +- Use pkg-config to detect cairo features [Benjamin Otte] +- Improved docs. Particularly, examples/cairo*.c have inline docs now. +- New public macro: + + PANGO_GLYPH_INVALID_INPUT + +- Bugs fixed in this release: + Bug 502926 – pango-1.16.4 configure bug: can fail to accept cairo + Bug 399573 – replace strtoul in pango-markup.c with pango_scan_int() + Bug 478914 – Use something invalid instead of '?' when validating + input text + Bug 501938 – Arabic shaping broken with vertical layout with + vertical-hint=line + Bug 501575 – Compile errors + Patch from Jens Granseuer + +Overview of changes between 1.19.0 and 1.19.1 +============================================== +- Various cleanup in the HarfBuzz code and merging with upstream/Qt changes. +- Built-in pango.aliases file for Win32 default aliases. +- Document cairo examples and misc documentation improvements. +- Bugs fixed in this release: + Bug 485536 – underline_position can be zero + Bug 500549 – pangocairo.h should include pango.h and cairo.h + Bug 492517 – Built-in default aliases file + Bug 495091 – pango-utils.c:variable is declared at middle of block + +Overview of changes between 1.18.3 and 1.19.0 +============================================== +- Update list of languages to that of fontconfig-2.4.91. +- Various optimizations, making rendering the same Pango layout using + changing cairo matrices much faster. + +- Make sure all boxed type copy/free functions accept NULL as legitimate + input. Previously most were g_return_[val_]if_fail()ing it. This is + mostly for convenience when writing code in C. + +- Apply 'vkrn' GPOS feature in vertical writing. + +- In pangofc, set "pangoversion" in pattern passed to fontconfig, + such that font configuration can condition on being driven by Pango + or not. + +- Various optimizations and cleanups in the OpenType Layout engine, + aka HarfBuzz. + + +- Changed APIs: + + * All PangoAttribute constructors are changed to initialize the + attribute to the range [0..MAXUINT]. The range was undefined + previously. All custom attribute constructors are recommended + to call the new pango_attribute_init() to do the same. + + * Public API chance: Mark the following types as abstract: + + PangoFont + PangoFontFace + PangoFontFamily + PangoFontMap + PangoFcFont + PangoFcFontMap + + PangoContext may be marked so in the future too. + + * Make following macros public. Previously they were only + defined for backend/engine implementations. + + PANGO_GLYPH_EMPTY + PANGO_GLYPH_UNKNOWN_FLAG + PANGO_GET_UNKNOWN_GLYPH() + + +- New public API: + + * Convenience for initializing custom attributes: + + pango_attribute_init() + + * Adding boxed type for PangoGlyphItem: + + PANGO_TYPE_GLYPH_ITEM + pango_glyph_item_copy() + pango_glyph_item_get_type() + + * Add missing copy function for a boxed type in C: + + pango_layout_iter_copy() + + * Add missing getter: + + pango_layout_iter_get_layout() + + * Convenience for writing custom PangoRenderer's: + + pango_renderer_get_layout() + pango_renderer_get_layout_line() + + * PangoFc extensions to fontconfig's pattern syntax: + + PANGO_FC_GRAVITY + PANGO_FC_VERSION + + +- Bugs fixed in this release: + Bug 490661 – Pango Markup: Link to font_desc syntax explanation + Based on patch from Chris Toshok + Bug 489909 – pango_cairo_update_context() should ignore matrix + translation + Bug 488840 – harfbuzz: protect against ligid overflow + Bug 486932 – Apply vkrn GPOS feature in vertical writing + Bug 486951 – ChangeLog.pre-1-18 + Bug 485621 – Get rid of freetype memory allocator in harfbuzz + Bug 485566 – Cache one OpenType Buffer + Bug 485559 – Boston Summit HarfBuzz optimizations + Bug 481537 – compiler warning fixes + Patch from Kjartan Maraas + Bug 478865 – Drastically reduce number of PangoFont objects created + for rotating text + Bug 472924 – Mark some classes abstract + Bug 472629 – Add pango_renderer_get_layout(_line) + Bug 472303 – Make PANGO_GLYPH_EMPTY and PANGO_GLYPH_UNKNOWN_FLAG public + Bug 471601 – Pass pango version information to fontconfig + Bug 471577 – GBoxed GType for PangoGlyphItem + Bug 471571 – Add pango_layout_iter_get_layout() + Bug 471568 – Optimizations in _pango_cairo_update_context() + Bug 469641 – Initialize attribute start/end to [0..MAXUINT] + + +Overview of changes between 1.18.2 and 1.18.3 +============================================== +- Two OpenType engine fixes. Makes Nafees Nastaliq font + work great, and avoids warnings with some other fonts. +- Fix minor leak in win32 backend. +- Bugs fixed in this release: + Bug 483600 – Leak of font family name in + pango_win32_font_description_from_logfont(w) + Patch from Daniel Atallah + +Overview of changes between 1.18.1 and 1.18.2 +============================================== +- Require libthai >= 0.1.9 for enabling thai-lang module +- Misc bug fixes +- Bugs fixed in this release: + Bug 474708 – pangocairo leaks memory + Bug 472891 – Bad consistency check in pango_get_log_attrs + Patch from Mathias Hasselmann + Bug 302952 – The placement of a diacritic marks for an arabic ligature + is not correct + Bug 410152 – testboundaries test fails + +Overview of changes between 1.18.0 and 1.18.1 +============================================== +- Misc bug fixes, including fix for an infinite-loop bug. + +- Bugs fixed in this release: + Bug 470042 – missing Macedonian OT tag + Patch from Denis Jacquerye + Bug 468953 – pango-renderer.c: using function without prototype + Bug 463430 – Gets stuck while "formatting message" + +Overview of changes between 1.17.5 and 1.18.0 +============================================== +- Make pango_script_for_unichar() just call g_unichar_get_script(), + and document that PangoScript and GUnicodeScript are interchangeable + enumerations. + +- Misc bug fixes + +- Bugs fixed in this release: + Bug 348348 – Add a way to get the script name of a gunichar + Bug 451682 – Cursor positioning for Sinhala is broken + Based on patch from Harshula + Bug 462137 – memory corruption in pango_default_break + Bug 462420 – Clicking on pixbuf should move the cursor to the position + nearest to the click point + Bug 462630 – pango_cairo_context_set_font_options() and some others + don't have a Since: tag + Bug 464183 – Minimum tab width enforcement in pango-layout breaks + TabArray positions + Patch by David Trowbridge + Bug 464270 – ellipsize doesn't work consistent + Bug 465174 – TextView is ignoring multiple consecutive \t's + Bug 466755 – pango hangul is crashing in gnome-about because it is + failing to retrieve a font. + Bug 467056 – Shape attribute handling is not consistent + Bug 467077 – Remove special-case for shape attribute in + pango_layout_line_index_to_x() + +Overview of changes between 1.17.4 and 1.17.5 +============================================== +- Export PangoCairoFont and cleanup various standard macros. + +- Bugs fixed in this release: + Bug 150883 – Unicode LRO defect + Bug 449482 – Build error when xft not present + Part of Bug 347236 – provide pango_cairo_font_get_scaled_font + +Overview of changes between 1.17.3 and 1.17.4 +============================================== +- Refactored the ATSUI font backend and install pangoatsui.h + that has a single function pango_atsui_font_get_atsu_font_id() and + a couple of types. + +- Bugs fixed in this release: + Bug 451547 – FAIL: runtests.sh + Bug 449543 - Ship pangoatsui.h + +Overview of changes between 1.17.2 and 1.17.3 +============================================== +- Extensive pangocairo internal code refactoring and cleanup + +- New public API: + + pango_font_face_is_synthesized() + + pango_cairo_font_get_scaled_font() + pango_cairo_font_map_new_for_font_type() + pango_cairo_font_map_get_font_type() + +- New engine macros: + + PANGO_OT_TAG_MAKE() + PANGO_OT_TAG_MAKE_FROM_STRING() + +- New PangoFontFace method is_synthesized. + +- Misc bug fixes +- Bugs fixed in this release: + Bug 337593 – move glyph extents code (and cache) from + pangocairo-*font.c into pangocairo-font.c + Bug 347235 – Add pango_cairo_font_map_get_font_type + Bug 347236 – provide pango_cairo_font_get_scaled_font + Bug 353291 – Provide pango_cairo_font_map_new_for_font_type + Bug 438801 – underline should add "error" type. + Bug 440588 – Add pango_font_face_is_synthesized() + Bug 445832 – pango_cairo_update_layout() always invalidates layout + Bug 446018 – Bus error in the pango_ot_tag_from_language() + Bug 446355 – the parsing with pango_parse_markup is not coherent + Bug 447189 – fonts.c: pango_font_face_is_synthesized returns NULL + Bug 447568 – improve docs on what absolute size means + Bug 448342 – pango_layout_index_to_line_x() counts lines from 1 + +Overview of changes between 1.17.1 and 1.17.2 +============================================== +- Rename recently added pango_ot_ruleset_get_for() to + pango_ot_ruleset_get_for_description(). + +- New engine API: pango_ot_ruleset_new_from_description(). + +- Treat Unknown script like Common and other non-"real" scripts. + [Martin Hosken] + +- Misc typo fixes [Peter Moulder] + +- Bugs fixed in this release: + + Bug 443206 – PANGO_SCRIPT_UNKNOWN should not cause a run break + Patch from Martin Hosken + +Overview of changes between 1.17.0 and 1.17.1 +============================================== + +- Ported the rest of OpenType shapers to the new OpenType APIs and + added standard features to them: Hebrew, Indic, Khmer, Thai, and Tibetan. + +- Added N'Ko support to the Arabic module. [Eugeniy Meshcheryakov] + +- Small Indic module fix for Malayalam. + +- Fixed font metrics returned by the ATSUI backend. [Richard Hult] + +- Make itemization use pango_language_get_default() if context has no + language set on it. Ditto for pango_context_get_metrics() if both + input language and context language are NULL. + +- Improved documentation on vertical text, also added stability note + to those parts of Pango API that are not indefinitely stable (shaper + and language engine APIs). + +- Misc bug fixes. + +- New OpenType engine API: + + pango_ot_ruleset_get_feature_count() + +- Bugs fixed in this release: + + Bug 357790 – Rendering problem for malayalam consonant RA (U+0D30) + Bug 385168 – indic, khmer, and tibetan modules don't apply ccmp + Bug 385477 – kern feature is not supported in OpenType layout for Tibetan. + Bug 433805 - [Atsui] Approximate char/digit width width often 0 + Bug 436699 – N'Ko support + Bug 438705 – Test runs non-existent "/bin/bash" on HP-UX 11.11 + Bug 438814 – synaptic crash with pango 1.17.0 + Bug 440603 – Minor ABI change + +Overview of changes between 1.16.4 and 1.17.0 +============================================== + +General: + +- Text justification. A simple justification algorithm is implemented + that tries to justify by expanding spaces in the line, and if none + found, by adjust letter spacing. [Based on patch by Mathias + Hasselmann] + +- The pango_script_get_sample_language() function is modified to use + the value of environment variables PANGO_LANGUAGE or LANGUAGE + (checked in that order) to make guess better languages for scripts. + The env var should be a list of language tags, like "en:fa" for + example where in effect makes Pango choose Persian (fa) fonts + instead of Arabic (ar) fonts when a run of text in the Arabic script + is found in an otherwise non-Arabic layout. + + This trick is also useful for East Asian languages. For example a + Japanese user that cannot set her primary language to Japanese can + still set PANGO_LANGUAGE="ja" and Pango will map CJK characters to + Japanese. + + The LANGUAGE env var is a standard gettext variable listing + languages the user wants to receive UI translated messages in. + However, since most packages don't provide separate English + translations, setting LANGUAGE="en:ja" doesn't have the intended + effect and UI messages will be shown in Japanese. For these + situations one can use LANGUAGE="en:C:ja". Pango skips the special + language tag 'C'. + +- Simplified embedded-shape rendering with pangocairo backends do. + [Richard Hult] + +- New header file: Moved PangoLanguage APIs into its own header + pango-language.h, which is included from pango-types.h. + +- ATSUI backend now lists synthesized italic faces like other + +- Misc optimizations and fixes. + +OpenType Layout Engine Improvements: + +- Vertical glyph variants are not selected in vertical text if the + font supports them. + +- Instead of hardcoded OpenType script tag in each module, and using + Default Language System unconditionally, Pango will now find and use + the script/lang-sys pair that best matches the detected script and + language of a run of text. Moreover, it also applies the OpenType + 'locl' feature. + + These, plus the PANGO_LANGUAGE env var, give font designers and + users lots of options to provide/choose language-specific glyph + variants. + + Only basic, arabic, and syriac modules updated to take advantage of + the new support so far. + +New pango-view command line options: + + --align + --justify + --language + +Public API Changes: + +- New public pangocairo API: + + PangoCairoShapeRendererFunc + pango_cairo_context_set_shape_renderer() + pango_cairo_context_get_shape_renderer() + + These are used by the default pangocairo renderer to render shape + attributes (see examples/cairoshape.c). Cairo-based PangoRenderer + implementations outside Pango may want to implement the draw_shape() + method similarly to provide compatibility with these new APIs. (See + bug #437533 for GdkPangoRenderer for example.) + +- Other public API changes: + + New is_expandable_space member in PangoLogAttr + New macro PANGO_UNITS_ROUND() + +- New OpenType engine API. These are engine API, for use by Pango + modules, and typically need not to be bound by language bindings: + + PANGO_OT_NO_FEATURE + PANGO_OT_NO_SCRIPT + PANGO_OT_TAG_DEFAULT_SCRIPT + PANGO_OT_TAG_DEFAULT_LANGUAGE + PangoOTFeatureMap + PangoOTRulesetDescription + pango_ot_ruleset_get_for() + pango_ot_ruleset_new_for() + pango_ot_ruleset_maybe_add_feature() + pango_ot_ruleset_maybe_add_features() + pango_ot_ruleset_description_hash() + pango_ot_ruleset_description_equal() + pango_ot_ruleset_description_copy() + pango_ot_ruleset_description_free() + pango_ot_tag_from_script() + pango_ot_tag_to_script() + pango_ot_tag_from_language() + pango_ot_tag_to_language() + +- Bugs fixed in this release: + + Bug 64538 – pango_layout_set_justify() doesn't work + Bug 325714 – Pango should respect $LANGUAGE + Bug 414264 – Pango vertical writing support is different with real + CJK usage. + Bug 416515 – Time is not aligned with date on vertical panel + Bug 429397 – Updated MS Mincho/Gothic are not listed in font dialog + properly on Vista/ + Bug 433805 – [Atsui] Approximate char/digit width width often 0 + (worked around) + Bug 434160 - [atsui] Italic versions of some faces can't be created + Bug 435709 – pango_cairo_context_[sg]et_shape_renderer() + Bug 355789 – Pango misaligns word-wrapped text due to trailing + whitespace + Bug 436154 – Error building the pango.modules file while cross + compiling + Bug 436988 – Adding PangoScript to PangoAnalysis + Bug 437534 – pango_language_includes_script is buggy + +Overview of changes between 1.16.3 and 1.16.4 +============================================== +- Add new configure option --disable-doc-cross-references and make + sure releases are made using it. Distributions are encouraged to + build with --enable-gtk-doc such that their Pango docs correctly + cross reference glib and cairo docs. +- Bugs fixed in this release: + Bug 432991 – developer docs for libpango are broken + +Overview of changes between 1.16.2 and 1.16.3 +============================================== +- Quantize kerning value if metrics hinting is on. This greatly improves + screen text rendering with certain fonts like DejaVu Sans. + See: http://behdad.org/blog/mces/image/metricshinting-kerning.png +- Improved hex-box positioning in the cairo backend + +Overview of changes between 1.16.1 and 1.16.2 +============================================== +- Fixed various bug in the OpenType Layout code (HarfBuzz) +- Improved documentation +- Improved ATSUI backend +- Misc build system fixes +- Bugs fixed in this release: + Bug 417946 – pangowin32-fontmap.c:using function without prototype + Bug 419262 - Don't create coverage every time it's asked for + +Overview of changes between 1.16.0 and 1.16.1 +============================================== +- Improved Win32 backend: The Win32 backend has been + updated to always require Uniscribe at compile-time (it still + is optional at run-time), and to use the wide-character variants + of Windows APIs which improves the backend in many ways. The + 1.16.0 release is obsolete as far as the Win32 backend is + concerned, and official DLLs were not built for it. +- Misc build system fixes +- Bugs fixed in this release: + Bug 110521 – can't find bold and/or italic fonts on win32 + Bug 120195 – there are some functions in pangowin32-fontmap.c that + might maybe should be static + Bug 407315 – Use wide character Win32 API in the pangowin32 code + Bug 412654 – SED variable undefined in the `libtool --config' output + used by configure + Bug 414297 – Fails to build with --enable-static + --with-included-modules in thai lang module + Patch from Loïc Minier + +Overview of changes between 1.15.6 and 1.16.0 +============================================== +- Improved docs, with an object hierarchy and cross references to glib and + cairo docs now (may require rebuilding the docs to correctly detect glib + and cairo prefixes). +- Improved font selection for space characters +- Misc build system fixes +- Bugs fixed in this release: + Bug 407087 – autogen.sh wants automake-1.7 + Bug 409212 – Missing link flag prevents build with "-z defs" ld flags + Patch from Loïc Minier + Bug 355987 – choosing font/shaper for spaces breaks Arabic runs on + spaces + +Overview of changes between 1.15.5 and 1.15.6 +============================================== +- Fix possible crasher in win32 font selection [Owen Taylor] +- Misc build fixes. +- Bugs fixed in this release: + Bug 399738 – pango 1.15.5 won't compile on Mac OS X: 'FC_HINT_STYLE' + undeclared (first use in this function) + Bug 404295 – Crash initializing pango-win32 fontmap + +Overview of changes between 1.15.4 and 1.15.5 +============================================== +- Fix the "menu accels are two chars wide" bug that was introduced in 1.15.4 +- Respect FC_HINT_STYLE in the ft2 backend. Patch has been in Fedora for ages. +- Require automake 1.9 +Bugs fixed in this release: + Bug 398238 – pangorc file missing from tests directory + +Overview of changes between 1.15.3 and 1.15.4 +============================================== +General: +- Finish vertical text support. +- Fix various bugs that could cause ellipsization to stop prematurely. +- Fix rendering of background color being off in presence of rise attribute. +- Improved text-on-path example (examples/cairotwisted.c) + +Win32 Improvements: +- Don't check for X and don't warn about missing fontconfig. [Tor Lillqvist] +- Automatically use -mms-bitfields on Windows when building with gcc. [Tor] +- Update makefile.msv. [Hans Breuer] + +Code base cleanups: +- Whitespace cleanups. Hopefully patches still apply using patch -l +- Replace C++-style // comments with C-style /* */ ones. +- Move the pango-view tool from examples/ into pango-view/. The examples/ + dir is still available and for simple examples only. + +Public API changes: + +- New PangoLayout query functions: + + pango_layout_is_wrapped() + pango_layout_is_ellipsized() + pango_layout_get_unknown_glyphs_count() + + The is_wrapped and is_ellipsized functions return whether the layout + had to wrap/ellipsize any paragraphs, as opposed to the get_wrap and + get_ellipsize that return the wrap/ellipsize mode set. + +- Misc new function: + pango_parse_enum() + + This is more a convenience function for internal use, but set public + to go with other pango_parse_* functions. Bindings should feel free + to ignore this. + + +- New header files: + + Moved gravity and matrix stuff into their own header files pango-gravity.h + and pango-matrix.h. Both are included from pango-types.h. + +- Vertical text: + + New attribute types: + + PANGO_ATTR_GRAVITY + PANGO_ATTR_GRAVITY_HINT. + + New enum type: + + PangoGravityHint + + New macro: + + PANGO_GRAVITY_IS_VERTICAL() + + New public functions: + + pango_attr_gravity_new() + pango_attr_gravity_hint_new() + pango_gravity_hint_get_type + pango_context_set_gravity_hint() + pango_context_get_gravity_hint() + pango_gravity_get_for_matrix() + pango_gravity_get_for_script() + + Removed: + pango_matrix_to_gravity() + + replaced by pango_gravity_get_for_matrix() + + Gravity API added in previous releases: + + PangoGravity + pango_gravity_get_type + pango_context_get_base_gravity + pango_context_get_gravity + pango_context_set_base_gravity + pango_font_description_get_gravity + pango_font_description_set_gravity + pango_gravity_to_rotation + + A tip on using the vertical text support: If you just want to get correct + behavior in rotated labels (say, vertical Chinese/Japanese, but rotated + Latin, etc), all you need to do is to set the context gravity to + PANGO_GRAVITY_AUTO. You can do this for example + + #if defined(PANGO_VERSION_CHECK) && PANGO_VERSION_CHECK(1,15,4) + pango_context_set_gravity (context, PANGO_GRAVITY_AUTO); + #endif + +Bugs fixed in this release: + Bug 395328 – Map kATSDeletedGlyphcode to PANGO_GLYPH_EMPTY + Bug 397337 – Use is_ellipsized and is_wrapped to optimize property + changes + Bug 328585 – Need to know if a layout has unknown glyphs + Patch from LingNing Zhang + Bug 326693 – PangoLayouts should be query-able about their + effective properties (width / wrapped / ellipsized / etc) + Bug 397327 – pango-layout.c: 'pango_layout_is_ellipsized' must return + a value + Bug 323173 – Add layout of mixed direction text for vertical layout + Bug 394453 – Use -mms-bitfields + Bug 392628 – Don't check for X on win32 + + +Overview of changes between 1.15.2 and 1.15.3 +============================================== +- Fix Hangul crasher and other Hangul bugs introduced in 1.15.2 +- Spell-checked docs +- Build fixes +- Don't introduce bitfields in public structs. This changes some public API + that was broken in the 1.15 series. The new struct is backward compatible + with the older Pango series, but not with earlier 1.15.x devel releases. + +- New Public API: + + * PangoAnalysis.flags and PANGO_ANALYSIS_FLAGS_CENTERED_BASELINE. These are + mostly only useful for the vertical text support in Pango, but language + bindings probably want to update their bindings for PangoAnalysis to + include these. + + * New PangoMatrix methods: + + pango_matrix_transform_distance() + pango_matrix_transform_point() + pango_matrix_transform_rectangle() + pango_matrix_transform_pixel_rectangle() + + The transform_rectangle methods are particularly useful when an + app/toolkit wants to know the extents of a rotated layout in device + coordinates. It will be used by Gtk+ for example, and is used by the + pango-view tool too. The _pixel_ variant takes a PangoRectangle in device + units instead of Pango units. + + * Unit conversion helpers: + + pango_units_from_double() + pango_units_to_double() + pango_extents_to_pixels() + + The first two just convert between Pango units (fixed precision) and + double floating-point numbers. The current implementations are as simple + as "(int)floor (d * PANGO_SCALE + 0.5)" and "(double)i / PANGO_SCALE", but + the idea is to have optimized versions of these that do not use the FPU in + the future. That will be appreciated by embedded devices without FPU + units. Since the functionality can be generally useful, the API is made + public. + + The pango_extents_to_pixels() function in conjunction with + pango_matrix_transform_rectangle() makes it possible to convert extents to + device space and round then, instead of having to transform rounded + user-space extents. + +- Bugs fixed in this release: + Bug 351496 – PangoAnalysis::gravity breaks binary compatibility + Bug 388702 – Crash when there's no Hangul glyph in the font. + Bug 384543 – FcFontMatch misuse + Bug 392789 – vpath build fails in basic module + Patch from J. Ali Harlow + Bug 390877 – Don't feed pango-features.h to glib-mkenums + Patch from Yevgen Muntyan + + +Overview of changes between 1.15.1 and 1.15.2 +============================================== +* Engines: + - Improved Hangul shaper engine + - Improved Indic shaper and language engines + - Require libthai >= 0.1.7 for the Thai language engine + +* Optimizations: + - Avoid some floating-point operations. Should cut the number of float + ops per expose event in pangocairo to a half. + - Cache ink and logical extents for PangoLayout + +* New Public API: + + - New, generated, public header file pango-features.h. Included by + pango.h. Currently contains the version information. In the future, + can be expanded to define which backends have been enabled, etc. + + - Public macros and functions for compile- and run-time version checking: + + PANGO_VERSION_ENCODE() + PANGO_VERSION_MAJOR + PANGO_VERSION_MINOR + PANGO_VERSION_MICRO + PANGO_VERSION + PANGO_VERSION_STRING + PANGO_VERSION_CHECK() + pango_version() + pango_version_string() + pango_version_check() + + The scheme chosen here is a mixture of approaches taken by glib and cairo. + The advantage over the glib model is that there are no public variables, + but it still gives access to a string and numerical representation of the + version number at compile- and run-time. + + The macros enable conditional compilation of code depending on newer Pango + APIs, while the runtime functions allow refusing to run against old + versions of the library. + + - New, readonly, version of methods that give read/write access to the + internals of PangoLayout: + + pango_layout_get_line_readonly() + pango_layout_get_lines_readonly() + pango_layout_iter_get_line_readonly() + pango_layout_iter_get_run_readonly() + + These should be used when you do not intend to modify the run/line, + which is most of the time the case. The only exception known to me + is Firefox that adjusts glyph widths to do justification. Most other + uses that do not write to the returned structs (or structs accessible from + them) should be ported to the new readonly API to benefit from major + optimizations (in this case, line extents caching). The list includes, + but is not limited to, Gtk+, SWT, ClassPath, gnome-applets, libgnomeprint, + xmlroff, GtkMathView, Conglomerate, Dia, Anjuta, wxWindows, The Gimp, + and various other applications/libraries: + + http://www.google.com/codesearch?hl=en&q=+pango_layout_(iter_)%3Fget_(lines%3F%7Crun)%5B%5E_%5D&start=50&sa=N + + Worth noting here is that, many uses of pango_layout_get_lines() can be + replaced by a pango_layout_get_iter() that works both more elegantly and + more efficiently. The versioning macros introduced in this release can be + used to make code use these new symbols without breaking compilation + against older Pango (though, such code compiled with the new Pango cannot + be run against an older Pango). + + - pango_language_get_default(): Note that, this does not make Pango + fallback to the default language automatically (yet), but the user can + use this function to set the default language of the locale on a context: + + pango_context_set_language (context, pango_language_get_default()); + + This essentially deprecates gtk_get_default_language(). The pango-view + tool has been updated to use this feature, so it now respects $LANG when + choosing fonts. + + - pango_color_to_string(). + +* Bugs fixed in this release: + Bug 326099 – Setting width, indentation and ellipsizing doesn't work + as I would expect + Bug 385478 – Fix tests on OPD platform + Bug 319808 – Patch to let pango support artifical italic, bold and + bold italic styles for the fonts which don't have these styles. + Patch from James Su + Bug 385321 – Worst case expansion for Sinhala + Patch from Harshula + Red Hat Bug 211574: [hi/ml/si_LK] cursor naviation is wrong when + using ZWJ (200d) + Patch from LingNing Zhang + Red Hat Bug 216424: [te_IN] pango - consonant + dependent vowel (ai) + Composed char is not rendering properly + Patch from LingNing Zhang + Bug 373856 – Wish: Function to convert a GdkColor to a string + Patch from Matthew Barnes + Red Hat Bug 216850: Issue in combination with vowels (ml_IN) + Patch from LingNing Zhang + Bug 382437 – tests/testboundaries fails + Bug 333982 – Fallback to $LANG whenever NULL PangoLanguage is used + Patch from LingNing Zhang + +Overview of changes between 1.15.0 and 1.15.1 +============================================== +* Add Thai langauage engine. (currently makes tests/testboundary fail.) +* Add Lao and improved Thai sample text. +* Improved Indic module. +* Output correct path for hexboxes in pango_cairo_layout_path(). +* Implement get_resolution method for the FT2 fontmap. Shouldn't make + any difference whatsoever. Open a bug if it does. +* Misc small fixes. + +* Optimizations: + - Rework PangoLayout algorithms to avoid calling a recursive call to + pango_layout_get_extents(). Avoids one pango_font_get_glyph_extents() + call per glyph per layout rendering. We now make 2 such calls. + - Don't cache run_logical_rect in PangoLayoutIter. + Avoids one pango_font_get_glyph_extents() call per glyph per layout + rendering. We are down to 1 now. + - Cache line extents. This avoids the final pango_font_get_glyph_extents() + call per glyph per layout rendering. Now we don't make any + pango_font_get_glyph_extents() calls when rendering a layout (some + conditions apply)! + - Replace PANGO_IS_RENDERER with PANGO_IS_RENDERER_FAST for most + internal uses, that is, just a NULL-check. + - Use simple, fast, casts instead of PANGO_CAIRO_*() macros where the + object cannot have reached us if it wasn't of the right type. + +* Bugs fixed in this release: + Bug 135683 – Cache glyphstring extents + Red Hat Bug 211964: [ta] Rendering issue with Tamil + Patch from LingNing Zhang + Red Hat Bug 213632: ZWJ (200d) and ZWNJ (200c) showing same output + Patch from LingNing Zhang + Bug 371388 – Add Thai langauage engine + Patch from Theppitak Karoonboonyanan + Bug 377975 – bug in _pango_glyph_item_iter_next_cluster + Bug 369670 – Checked g_free calls + +Changes that also appeared between 1.14.7 and 1.14.8 +===================================================== +* Improved thread-safety. Pango is still NOT thread-safe, but this fixes + lots of crashes using pangocairo from multiple threads. +* Fix out-of-bounds array access. +* Improved Indic shaper. +* Improved Arabic language engine. +* Choose shaper/font for unassigned Unicode codepoints. +* Build fixes. +* Bugs fixed in this release: + Bug 356666 – pango is not thread-safe, nautilus does not honour that + Bug 352795 – configure.in: Bug in "checking Whether to write + dependencies into .pc files" + Bug 350132 – backspacing doesn't work properly for Arabic + Bug 330407 – Multiple dependant vowel signs (indic) displayed as one + Patch from LingNing Zhang + +Overview of changes between 1.14.7 and 1.15.0 +============================================== +* Add basic support for vertical text. (PangoGravity and related API) +* New PangoCairo example (examples/cairotwisted) to lay text out on a path +* Fix various bugs in the way language engines are used. Add simple Arabic + and Indic language engines. (Backported to 1.14.6) +* Step module interface version up to 1.6.0 +* Misc small cleanups. +* Bugs fixed in this release: + Bug 330407 – Multiple dependant vowel signs (indic) displayed as one + Bug 359043 – PangoRenderer does not show in API docs + Bug 359046 – renderdemo.c unconditionally use GLib 2.12 + Bug 357228 – Remove aix specific hack from configure.in + Part of Bug 350132 – backspacing doesn't work properly for Arabic + Bug 356194 – more pango_get_log_attrs problems + Bug 355820 – pango_get_log_attrs broken + Bug 352811 – SIGSEGV with pango(cairo)-view on HP-UX + Bug 351496 – PangoAnalysis::gravity breaks binary compatibility + Bug 351585 – API documentation issues with 2.15 release + +Overview of changes between 1.14.6 and 1.14.7 +============================================== +* Fixed broken build with included lang modules. +* Bugs fixed in this release: + Bug 361938 – Can't include *-lang modules (./configure + --with-included-modules fails) + +Overview of changes between 1.14.5 and 1.14.6 +============================================== +* Backport language-engine handling fixes from HEAD. +* Add simple Arabic and Indic language engines. +* Indic shaper fixes. +* Bugs fixed in this release: + Bug 353877 – Sinhala is_cursor_position and + backspace_deletes_character issues + Patch from Akira TAGOH + Bug 358224 – Telugu Character U+0C31 does not render its below-base + form. + Patch from Rahul Bhalerao + Bug 358174 – Reph and Vattu forms of Assamese character RA(U+09F0) + are not rendered. + Patch from Rahul Bhalerao + +Overview of changes between 1.14.4 and 1.14.5 +============================================== +* Indic shaper fixes. +* Misc bug fixes. +* Bugs fixed in this release: + Bug 356685 – [or_IN] Rendering of consonant+0x0B4D+0x0B2F is wrong + Patch from Rahul Bhalerao + Bug 357790 – Rendering problem for malayalam consonant RA (U+0D30) + Patch from Rahul Bhalerao + Bug 349813 – typo in docs for pango_layout_move_cursor_visually + Bug 357686 – pangocairo-font.c: illegal g_object_unref in + pango_cairo_font_get_hex_box_info + +Overview of changes between 1.14.3 and 1.14.4 +============================================== +* Indic shaper fixes. +* Misc bug fixes. +* Bugs fixed in this release: + Bug 351223 – the conjuction of Con + 0x0d4d +0x0d31 of Malayalam is + wrong + Patch from LingNing Zhang + Bug 355750 – The glyphs of the conjuctions about Cons+0x0d4d+0x0d32 of + Malayalm are wrong. + Patch from LingNing Zhang + Bug 349876 – U+0x0904 of Devanagari need be "independent vowel", but + it is "reserved" in Pango + Patch from LingNing Zhang + Bug 355550 – Miscalculation of logical attributes in + pango_get_log_attrs() + Patch from Theppitak Karoonboonyanan + Bug 355697 – The IndicOTClassTable of Oriya has a error. + Bug 355782 – Misaligned extents in pango + Bug 355605 – hexbox with 0000 in it + Bug 355435 – Invalid calls to pango_map_get_engine() + Patch from Theppitak Karoonboonyanan + Bug 347146 – underline/overstrike spaces + Bug 352535 – Ink extents of empty glyph + +Overview of changes between 1.14.2 and 1.14.3 +============================================== +* Win32 build improvement. [Tor Lillqist] +* Bugs fixed in this release: + Bug 353525 – libpangoft2-1.0.so.0: undefined reference to + `pango_font_description_get_gravity' + Bug 349813 – typo in docs for pango_layout_move_cursor_visually + +Overview of changes between 1.14.1 and 1.14.2 +============================================== +* Find shaper/font for Private Use and space characters. + Part of Bug 145275 – Font selection for space characters + +Overview of changes between 1.14.0 and 1.14.1 +============================================== +* Increased fontset cache size from 16 to 64. This should make + firefox+pango A LOT faster. +* Bugs fixed in this release: + Bug 352114 – pango-1.14: generated docs still contain old example code + Part of Bug 348825 – pango should optimize away calls to FcFontSort as + much as possible + Bug 351585 – API documentation issues with 2.15 release + + +Overview of changes between 1.13.5 and 1.14.0 +============================================== +* Make pango-view accept non-ASCII --text. +* Require cairo-1.2.2 for the important bug fixes it has. + +Overview of changes between 1.13.4 and 1.13.5 +============================================== +* Indic shaper improvements. +* Misc fixes. +* Bugs fixed in this release: + Bug 121672 – Ra (vattu) not rendered properly in Malayalam + Patch from LingNing Zhang + Bug 335811 – Some conjugates of Malayalam are wrong. + Patch from LingNing Zhang + +Overview of changes between 1.13.3 and 1.13.4 +============================================== +* Update to Unicode Character Database 5.0.0. +* Misc fixes. +* Bugs fixed in this release: + Bug 336282 – Update to Unicode Character Database 5.0.0 + Bug 347073 – Allow empty GPOS table + Bug 347021 – atsui crash when a matching font cannot be found. + Patch from Brian Tarricone. + +Overview of changes between 1.13.2 and 1.13.3 +============================================== +* Improved build system. Using gnome-autogen.sh now. + (gnome-common needed for bootstrapping) +* Improved documentation. Docs now include list of new API for + each stable version of Pango. +* New public API: + - pango_glyph_string_get_width +* Little performance improvement. +* Misc fixes. +* Bugs fixed in this release: + Bug 330603 – pango_scan_int invokes undefined behaviour + Bug 315599 – PangoAttribute remains in wrong context. + Bug 163677 – pango_attr_list_splice: inconsistent docs + Patch from Morten Welinder + Bug 345070 – [ml_IN] not render for combination with ZWJ + Patch from LingNing Zhang + Bug 345274 – list of new symbols for each version is missing in docs + Patch from Priit Laes + Bug 346297 – autogen doesn't work with automake-1.6 + Patch from Priit Laes + Bug 135683 – Cache glyphstring extents + Bug 344766 – Memory leak in get_ruleset() in modules/basic/basic-fc.c + Bug 345600 – cvs build error in pango/opentype/Makefile + Bug 345511 – -no-undefined problem with new libtool + +Overview of changes between 1.13.1 and 1.13.2 +============================================== +* Improved hexbox drawing, and font metrics calculations. +* Synthesize italic variants on win32 [Hans Breuer] +* New public API: + - pango_cairo_show_error_underline + - pango_cairo_error_underline_path + - pango_font_describe_with_absolute_size +* Misc fixes. +* Bugs fixed in this release: + Bug 326960 – hex box drawing for win32 and atsui backends of cairo + Bug 343717 – License information in unclear. + Bug 343355 – Add pango_cairo_show_error_underline & + pango_cairo_error_underline_path + Bug 343966 – pango Cygwin build fixes + Patch from Cygwin Ports maintainer. + Bug 343796 – Italic Chinese character can't be show correctly in + Win32. + Bug 314114 – max_x_advance not appropriate for + approximate_(char|digit)_width + Bug 341138 – Using TTC font, Gtk2 programs begin to eating big memory + and have many cpu usage. + Patch from Yong Li. + Bug 336153 – Mark to mark positioning (Lookup Type 6) isn't correct + when using MarkAttchmentType + Patch from Tin Myo Htet. + Bug 333984 – pango_language_from_string improvements + Bug 125378 – Better underline thickness handling + Bug 339730 – Pango needlessly falls back away from a Type 1 font into + a TTF font + Bug 342562 – Support absolute sizes in + pango_font_description_to/from_string + Bug 341922 – pango should handle more characters as zero width + Patch from Roozbeh Pournader + Bug 342525 – With PangoFc and PangoWin32, approximate digit width is + not what it says + Bug 342079 – pangoatsui-private.h missing from release + +Overview of changes between 1.13.0 and 1.13.1 +============================================== +* Increased robustness against broken pango.modules +* Improved build infrastructure: + - Remove CAIRO_CFLAGS from pangocairo.pc.in, as it Require's cairo already. + - Use -no-undefined on Unix too. +* Improved documentation. +* Misc fixes. +* Bugs fixed in this release: + Bug 307196 – Unhinted fonts are measured incorrectly and drawing + problems occur as a result + Bug 329547 – pango_layout_get_pixel_extents and + pango_layout_get_pixel_size cause off-by-one metrics + Bug 339747 – pango_font_metrics_get_approximate_digit_width docs + Bug 339749 – pango_language_from_string issues + Patch from Morten Welinder. + Bug 333771 – Use gmodule-no-export-2.0 instead of gmodule-2.0 in + pango-uninstalled.pc.in + Bug 337594 – pango_glyph_string_extents_range possible bug + Bug 329664 – Move gunichar_to_glyph cache from PangoCairoFcFont to + PangoFcFont + Patch from LingNing Zhang. + Bug 322374 – Examples does not build on MacOS X + Bug 340229 – pango_font_description_from_string does not do bound + checking + Bug 329483 – hinting hexbox in cairo backend doesn't handle absolute + font size + Bug 340040 – pangocairo hex box hinting falls apart with PS/PDF + backends + Bug 71033 – make size 0 fonts work + +Overview of changes between 1.12.0 and 1.13.0 +============================================== +* Fix incorrect rendering when in x86 64-bit precision mode + https://bugs.freedesktop.org/show_bug.cgi?id=5200 +* Fix non-OpenType fonts losing kerning in 1.12.0 [#336026, Denis Jacquerye] +* Fix blurred underlines on Win32 [#332656, Tor Lillqvist] +* Build fix when having both Win32 and FreeType cairo backends available + [#337502, Alexander Larsson] +* Moved the OpenType Layout code into a new project called HarfBuzz: + http://www.freedesktop.org/wiki/Software/HarfBuzz +* Improved documentation. +* Misc bug fixes. +* Fixed many compiler warnings. +* Bugs fixed in this release: + 332656,335840,334802,337029,337821,338343 + +Overview of changes between 1.11.99 and 1.12.0 +============================================== +* Compilations fixes for MSVC. [#333115, Tor Lillqvist] +* More NULL-check against unusable fonts, helps with Win32 fonts without + a Unicode cmap. [Tor] +* Use g_print instead of printf for debugging output in Win32 backend. + [#332855, Tor] + +Overview of changes between 1.11.6 and 1.11.99 +============================================== +* Fix problem recently introduced that made Win32 backend render boxes + only. [#332538, Hans Breuer] +* Insert '?' chars instead of invalid UTF-8 sequences in + pango_layout_set_text [#33195] +* Bugs fixed in this release: + 332167,332538,331995 + +Overview of changes between 1.11.5 and 1.11.6 +============================================= +* Do not export macros PANGO_GLYPH_EMPTY, PANGO_GLYPH_UNKNOWN_FLAG and + PANGO_GET_UNKNOWN_GLYPH publicly; just in the engine/backend interface. +* Fix a few crashers, especially when a font cannot be read. [#314239] +* Change some g_critical's to g_warning, where it's not application's + fault. [#331723] +* Bugs fixed in this release: + 330795,331038,329148,331994,331995,331996,314239,331723 + +Overview of changes between 1.11.4 and 1.11.5 +============================================= +* Cleanup work on the win32 backend. Families are not listed all + in lower case anymore. +* New public function: pango_win32_font_description_from_logfont. +* pango-view accepts --wrap now, and lists backends in --help output. +* A couple minor bug fixes. + +Overview of changes between 1.11.3 and 1.11.4 +============================================= +* Major change in the low-level interface of Pango. The special value + PANGO_GLYPH_EMPTY is now defined to mean a "draw nothing" glyph. This + was what glyph 0 was used for previously. As a result, bumped up the + Pango module version, meaning that modules compiled against earlier + versions are probably not compatible with this release. [#73147] +* New framework in examples for building a binary called pango-view, + that can be used to render a text file using any of the available + backends. This is installed into bindir now. +* Enhancements to the FT2 backend, to draw boxes on missing glyphs. +* Better hexbox drawing for cairo backend: Hinting hexbox, and + drawing a single-row hexbox for very small font sizes. +* Improved documentation. + +Overview of changes between 1.11.2 and 1.11.3 +============================================= +* Do not crash if the shapers fail. +* Use g_slice for various struct allocations. +* 100% symbol coverage in docs. +* Misc bug fixes and documentation improvements. +* Janitory works, like removing unneeded files. + +Overview of changes between 1.11.1 and 1.11.2 +============================================= +* Draw hex box on missing glyphs for cairo-fc backend. +* New --with-dynamic-modules option added to configure. +* Use g_slice for various small memory allocations [Matthias Clasen] +* Misc bug fixes, optimizations, and documentation improvements. + +Overview of changes between 1.11.0 and 1.11.1 +============================================= +* ATSUI support for the cairo backend. [Anders Carlsson] +* Fixed a couple of regressions with font size and scaling. +* Draw a dashed empty box on missing glyphs for cairo-fc backend. +* Support OpenType features for basic (Latin/Greek/...) module. +* Support swash feature in Arabic module. +* Misc bug fixes. +* Misc documentation improvements. + +Optimizations: + +* Cache GObject private data in PangoFcFont.priv [Federico Mena Quintero] +* Add a constant-sized light-weight cache for glyph extents. +* Use g_slice_* instead of GMemChunk in mini-fribidi. + + +Overview of changes between 1.10.1 and 1.11.0 +============================================= +* Line-breaking algorithm updated to Unicode 4.1. +* Code borrowed from GNU FriBidi resynched to version 1.0.7. +* New improved Tibetan shaper module. [Pema Geyleg] +* Bug fix in Khmer shaper module. [Jens Herden] +* Respect fontconfig reassignment of font pixelsize. [Funda Wang] +* Make OpenType GPOS handling more robust/correct. [Greg Aumann] +* Various documentation fixes and improvements. +* Various gcc warning fixes. +* Misc bug fixes. + +Optimizations: + +* Add a lazy fixed-size per-font cache to map characters to glyphs, + in the cairo backend. [Federico Mena Quintero] +* Optimize character to script mapping by adding a linear table for + characters < U+2000, and also caching the last mid point in + bsearch. [Federico, Matthias Clasen] +* Enabled mini-fribidi's trashstack instead of direct mallocs. +* Short circuit the bidi algorithm for provably unidirectional text. +* Make mini-fribidi process UTF-8 directly. +* Several strlen and g_utf8_strlen calls removed. [Owen Taylor, Billy Biggs] +* Use call tables in the OpenType layout code. +* Use quarks for accessing GObject data. [Federico] +* Open Pango modules with lazy-bind flags. [John Rice] +* Use new negative offsets in g_utf8_pointer_to_offset to avoid + scanning from the beginning of line on cursor movement. +* Avoid redundant PANGO_IS_FC_FONT checks. + +Overview of changes between 1.10.0 and 1.10.1 +============================================= +* Add various forms of caching to the Win32 backend, greatly + improving performance [Tor Lillqvist] +* Fix problem with colors leaking from a Pango item to + subsequently drawn strings. [Choe Hwanjin] +* Fix bug where error underlines would be drawn 1024 times + too big in the Cairo backend. [Luis Villa] +* Misc bug and build fixes [Jean Brefort, Matthias Clasen, + Behdad Esfahbod, Kazuki Iwamoto] + +Overview of changes between 1.9.1 and 1.10.0 +============================================ +* Update script tables, bidi tables, and Arabic joining tables for Unicode 4.1 + [Roozbeh Pournader, Behdad Esfahbod] +* Misc bug and build fixes [Sebastien Bacher, Hans Breuer, Behdad, + J. Ali Harlow, Tor Lillqvist, Keith Packard, Vittorio Palmisano, Manish Singh] + +Overview of changes between 1.9.0 and 1.9.1 +========================================== +* Support setting of font options and DPI on PangoContext for + the Cairo backend. +* Adapt to recent Cairo API changes +* Win32 build improvements [Tor Lillqvist] +* Misc bug fixes [Hans Breuer, Thomas Fitzsimmons, Kazuki IWAMOTO] + +Overview of changes between 1.8.x and 1.9.x +=========================================== +* Add Cairo support; PangoCairoFontmap is an interface with + implementations for Fontconfig fonts and Win32 fonts +* Extend PangoFcFontmap to allow more customization by subclasses +* Handle NULL language better for pango_context_get_metrics() +* misc optimization [Paolo Borelli, Behdad Esfahbod] +* Misc bug and build fixes [Hans Breuer, Damien Carbery, + Keith Packard, Manish Singh] +* Doc fixes [Tim Janik] + +============================================================ + +Overview of changes between 1.8.1 and 1.8.2 +=========================================== +* Add Khmer support [Jens Herden, Javier Sola] +* Fix bugs and crashes in the operation of PangoLayoutIter [Amit Aronovitch] +* Increase sharing of data between different copies of Pango + [Tommi Komulainen, Ross Burton] +* Remove dependence of opentype code on FreeType internals [David Turner, + Behdad Esfahbod] +* Cache metrics for the Win32 backend [Tor Lillqvist] +* Improve handling of RTL text when passing it to Uniscribe [Tor] +* Support for TrueType fonts on Win32 with characters outside the BMP [Tor] +* Handle alpha in XftColors again. [Mikael Magnusson] +* Better handling of MacThai encoded fonts [Theppitak Karoonboonyanan] +* Handle zero width chars properly in Hangul backend + [Young-Ho Cha, Changwoo Ryu] +* Fix Oriya character classification [Gora Mohanty, Gautam Sengupta] +* PangoAttrIterator bug fixes [Morten Welinder] +* Clean up copyright/licensing information [William N. Ray] +* Misc bug and build fixes [Sebastien Bacher, Brandon Bergren, + Chris Blizzard, Paolo Borelli, Behdad, Harshula, Alex Jones, Aivars Kalvans, + Stepan Kasal, Karel Kulhavy, Ryan Lortie, Ben Maurer, Sukhjinder Sidhu, + Manish Singh, Emil Soleyman-Zomalan, Morten] + +Overview of changes between 1.8.0 and 1.8.1 +=========================================== +* Fix several problems with conjuct formation in Sinhala [Harshula] +* Fix problems that were causing fonts to be missized and + not print in GtkHTML [Ross Burton] +* Fix compilation with old fontconfig [Vincent Noel] and + old FreeType [Andrew P. Lentvorski, Jr] +* Work around problem with glyphs in monospace fonts being truncated + by Xft [Billy Biggs] +* Misc bug fixes [Damon Chaplin, Matthias Clasen, Kees Cook, Nick Lamb, + Adam Sampson,Manish Singh, Morten Welinder] +* Misc build fixes [Sebastien Bacher, Matthias Clasen, Tor Lillquist] +* Doc improvements [Torsten Schoenfeld, Billy Biggs, Morten Welinder] + +Overview of changes between 1.7.0 and 1.8.0 +=========================================== +* Add Sinhala support to the Indic module [Anuradha Ratnaweera] +* Add Tibetan module [G Karunakar, Pema Geyleg] +* Support pixel sizes for fonts [Chris Lahey] +* Add pango_layout_get_font_description() [Morten Welinder] +* Add PANGO_WEIGHT_SEMIBOLD [Lars Clausen] +* Report underline metrics on Win32 [Tor] +* Handle GLib-2.6.0 win32 filename encoding changes [Tor Lillqvist, + Robert Ögren] +* Fix crash when drawing long strings +* Misc fixes [Matthias Clasen, Dan Winship] + +Overview of changes between 1.6.x and 1.7.0 +=========================================== + +* Add PangoRenderer, a subclassable driver object holding the + logic for rendering PangoLayout. +* Support transformed rendering for the Xft backend +* Add Lao support in Thai Module [Theppitak Karoonboonyanan] +* Support Thai OpenType fonts [Theppitak] +* Add Syriac module [Emil Soleyman-Zomalan] +* Add underline-color and strikethrough-color attributes + [Morten Welinder] +* Add pango_win32_render_transformed() [Hans Breuer] +* Misc fixes [Hans Breuer, Matthias Clasen, Manish Singh, + Morten Welinder] +* Documentation improvements + +============================================================ + +Overview of changes since 1.6.0 +=============================== +* Fix several problem when computing font and selecting fonts + metrics for CJK [Felipe Heidrich, Federic Zhang] +* Win32 bug fixes [Tor Lillqvist, Kazuki Iwamoto, Ivan Wong] +* Misc bug fixes [Vincent Berger, Paolo Borelli, Behdad Esfahbod, + Leon Ho, Arun M, Kjartan Maraas, Vincent Noel, Christian Persch, + Enrico Scholz, Sukhjinder Sidhu, Morten Welinder] + +Overview of changes between 1.5.2 and 1.6.0 +=========================================== +* Add OpenType support for Hebrew [Dov Grobgeld] +* Win32 bug and build fixes [Tor Lillqvist, Hans Breuer, John Ehresman] +* Misc bug fixes [Behdad Esfahbod, Jatin Nansi] + +Overview of changes between 1.5.1 and 1.5.2 +=========================================== +* Support 'init' feature for Bengali [Sayamindu Dasgupta] +* Allow 32-bit property fields in OpenType code +* Optimize repeated property lookups in OpenType code +* Misc bug fixes [Behdad, Keith Sharp, Morten Welinder] + +Overview of changes between 1.5.0 and 1.5.1 +=========================================== +* Add ellipsization support to PangoLayout +* Add pango_context_get_font_map(). +* Fix metrics for the Xft backend when a transform is in effect +* Separate out backend-independent parts of pangoft2topgm for + future rendering testbeds. +* Code cleanups (use G_DEFINE_TYPE, make PangoMatrix parameters const) +* Add a GType for PangoMatrix [Torsten Schoenfeld] +* Misc bug fixes [Morten Welinder] + +Overview of changes between 1.4.x and 1.5.0 +=========================================== +* Allow applications to provide custom font decoders [Chris Blizzard] +* Add support for setting a transformation matrix on a PangoContext +* Add support for rotated rendering to the FT2 backend +* Add metrics for underline and strikethrough position and thickness. +* Add letter-spacing attribute and implement in PangoLayout +* OpenType support in Thai Module [Theppitak Karoonboonyanan] +* Add Add PANGO_TYPE_LAYOUT_ITER [Johan Dahlin] + +============================================================ + +Overview of changes between 1.4.0 and 1.4.1 +=========================================== +* Win32 bug fixes [Tor Lillqvist, John Ehresman] +* Thai rendering improvements including OpenType support + [Theppitak Karoonboonyanan] +* Fix common crash in Hangul shaper [Changwoo Ryu] +* Fix various problems with language tag selection [Frederic Zhang] +* Documentation improvements [Felipe Heidrich, Doug Quale] +* Fix crash in line break code [Jeroen Zwartepoorte, Billy Biggs] +* Build fixes [J. Ali Harlow, Noah Misch] +* OpenType engine fixes [Kailash C. Chowksey, Sayamindu Dasgupta, Aamir Wali, + Masatake YAMATO, Soheil Hassas Yeganeh] +* Indic module bug fixes [Chris Blizzard, Rajkumar S, Taneem Ahmed, + Jungshik Shin] +* Misc bug fixes [Stanislav Brabec, Anders Carlsson, Behdad Esfahbod, + Jody Goldberg, Theppitak, Sven Neumann, Manish Singh, Morten Welinder] + +Overview of changes between 1.3.6 and 1.4.0 +=========================================== +* Use FC_WIDTH when available so that multiple width fonts are + selected properly [Manish Singh] + +Overview of changes between 1.3.5 and 1.3.6 +=========================================== +* Improve handling of some Kannada vowels [Kailash C. Chowksey] +* Fix problem with excess symbol exports on Linux [James Henstridge] +* Win32 build fixes [Hans Breuer, John Ehresman, Tor Lillqvist, Cedric Gustin, + J. Ali Harlow] + +Overview of changes between 1.3.3 and 1.3.5 +=========================================== +* Add support for automatically determining the base direction for + PangoLayout from the contained text [Dov Grobgeld] +* Major rework of internal opentype interfaces to fix + problems with GPOS. Turn on GPOS handling for Arabic. +* Add a PangoAttribute to turn off font fallback [Noah Levitt] +* Add wavy error-indication underlines [Nicolas Setton] +* Improve handling of BENGALI LETTER A/E [Sayamindu Dasgupta] +* Win32 bug fixes and improvements [J. Ali Harlow, Hans Breuer] +* Misc bug fixes [Noah, Roozbeh Pournader] + +Overview of changes between 1.3.2 and 1.3.3 +=========================================== +* Add pango_font_face_list_sizes() [Noah Levitt] +* Add pango_font_family_is_monospace [Noah] +* Do OpenType processing for CFF fonts [Manjunath Sripadarao] +* Fix wrong sign for GPOS vertical positioning +* Fix up -uninstalled .pc files [Laszlo Peter] +* Misc bug and build fixes fixes [Rodney Dawes, Theppitak Karoonboonyanan, + Noah, Kjartan Maraas, Julio M. Merino Vidal, Christian Persch, + Torsten Schoenfeld, Manish Singh, Mariano Suárez-Alvarez, Morten Welinder, + Masatake YAMATO] + +Overview of changes between 1.3.1 and 1.3.2 +=========================================== +* Correct a mixup between ZWJ and ZWNJ in the Arabic + engine [Roozbeh Pournader] +* Build and bug fixes for Win32 [Hans Breuer] +* Fix a problem with RTL scripts on Win32 [Tor Lillqvist, Shoshannah Forbes] +* Documentation improvements [Ross Burton, Matthias Clasen] + +Overview of changes between 1.3.0 and 1.3.1 +=========================================== +* Support non-Unicode font encodings when supported by fontconfig + [Sven Neumann] +* Draw 6-digit hex boxes for > U+FFFF [Noah Levitt] +* Update to latest fribidi [Noah] +* Honor U+2028 LINE SEPARATOR [Noah] +* Fix a problem with iteration by chars [Mariano Suárez-Alvarez] +* Misc bug and build fixes [Jeff Bonggren, Martin Kretzschmar, + Noah, Sven Neumann, Padraig O'Briain, Manish Singh, + Morten Welinder] +* Fix header file includes to work with recent FreeType. + +Overview of changes between 1.2.x and 1.3.0 +=========================================== +* Share modules between the FT2 and Xft backend. Export PangoFcFont + and PangoFcFontMap base classes so that other fontconfig based + backends can be written and use these same modules. +* Redo module system to use GTypeModule and work much like GTK+ theme + engines and input method modules. +* Change modules to declare coverage by script, rather than by code + point. Add a ->covers callback so that modules can dynamically + decide whether they can cover a particular codepoint with a given + font. (This will allow multiple modules to handle a script for + different types fonts.) +* Complete rewrite of itemization pass. Now uses script information to + improve language tags. This solves problems with incorrect language + tags resulting in drastically wrong fonts being selected by + fontconfig. +* Add backspace-deletes-character PangoLogAttr; will allow proper + deletion behavior for non-Western scripts. [Noah Levitt] +* Add pango_fc_font_kern_glyphs(), which speeds up kerning a lot over + doing it pair-by-pair. [Soeren Sandmann]. Kern in the Xft backend as + well as the FT2 backend. +* Remove the X font backend, except a minimal set of stubs to maintain + binary compatibility. +* Many improvements to pangoft2topgm to allow displaying PangoMarkup, + saving to different file formats, etc. +* Convert build system to automake-1.7; many cleanups and + improvements. [James Henstridge] +* Documentation additions and improvements [Matthias Clasen, Martin + Pool]; add man pages for the included binaries. [Matthias] +* Misc bug and build fixes [Josh Beam, Tony Graham, Kaushal Kumar, + Noah, Mehran Mehr, Soeren, Morten Welinder] +* Win32 build fixes [Tor Lillqvist, Hans Breuer] + +============================================================ + +Overview of Changes in Pango 1.2.5 +================================== +* Fix a problem where the indic-xft shaper didn't get linked + against all necessary files. + +Overview of Changes in Pango 1.2.4 +================================== +* Win32 [Tor Lillqvist] + - Avoid calling Uniscribe when not necessary [Hans Breuer] + - Build fixes +* Indic shaper + - Add pre-base-matra fixup code from ICU [Sivaraj Doddannan] + - Port of Bengali rendering fix from ICU [Taneem Ahmed] +* OpenType + - Port various fixes by Werner Lemberg from FreeType version + - Port various fixes by Lars Knoll from Qt version + - Many other bug fixes [Kailash C. Chowksey, Me] +* Fix bugs in FT2 rendering code [Sven Neumann] +* Remove Qt-based example program; was causing compilation problems + for a lot of people. +* Doc fixes [Noah Levitt] +* Misc bug fixes [Dave Cuthbert, Damon Chaplin, Christophe Fergeau, + Tony Graham, Morten Welinder] +* Build fixes [Sven Neumann, Benedikt Spranger] + +Overview of Changes in Pango 1.2.3 +================================== +* Fix operation with --disable-debug [Jeff Waugh] +* Improve handling of ink rectangle extents for empty runs +* Fix problem with keynav at line boundaries for RTL text [Matthias Clasen] + +Overview of Changes in Pango 1.2.2 +================================== +* Cache fontsets for the Xft and FT2 backends, a large speedup for short + strings [Owen Taylor, Soeren Sandmann] +* Make built in rendering functions, especially the FT2 one, + work more like the GDK implementation [Sven Neumann] +* Add an indic-ft2 module [Kapil Chowskey], + Add a thai-ft2 module [Theppitak Karoonboonyanan] +* Optimize pango_x_render() by drawing multiple character with + a single request when possible [Morten Welinder] +* Change the handling of attributes that cover only partial glyphs + [Owen, Taneem Ahmed, Sunil Mohan Adapa] +* Fix problems with Arial Unicode and the Opentype code [Owen, Noah Levitt] +* Fix common crash for fonts missing a GDEF table +* Fix common portability problem with informative output at end + of configure. +* Build cleanups and fixes [Tim Mooney, Chris Ross, Akira Tagoh, + Will Partain, James Su] +* Miscellaneous bug fixes and cleanups [Simon Budig, Rick Jones, + Noah, Padraig O'Briain, Benjamin Otte, Andrey Panov, Federic Zhang] +* Documentation fixes [Tim, Sven] + +Overview of Changes in Pango 1.2.1 +================================== +* Handle older TrueType Open Arabic fonts. +* Make Win32 backend handle a common TrueType font bug [Tor Lillqvist] +* Fix crash with some non-BMP characters [Morten Welinder] +* Avoid crashing on font descriptions like " 12" [Padraig O'Briain] +* Minor build fixes [Rich Burridge, Sven Neumann] + +============================================================ + +Changes between 1.1.6 and 1.2.0 + +* Documentation fixes + +Changes between 1.1.5 and 1.1.6 + +* Fix crash with isolated Hangul tone marks. +* Improve font solection for Hangul tone marks +* Improve range definitions for basic-xft [Jungshik Shin] +* Docs improvements [Matthias Clasen] + +Changes between 1.1.4 and 1.1.5 + +* Fix wrap-around coordinate problems for X, Xt. +* Draw unknown character boxes with X primitives for the + X backend instead of hoping for a suitable glyph [Morten Welinder] +* Fix crash with FT2 arabic shaper from using face->generic.data + for two things. +* For Xft/FT2, give an informative error mesage when no fonts are found. +* Support shape modules with ranges beyond the BMP [Federic Zhang] +* Use octal escapes rather than literal UTF-8 [Arnaud Charlet] +* Use g_[sf]printf where appropriate [Matthias Clasen] +* Doc improvements [Matthias] +* Misc build and bug fixes [Tony Graham, Kjartan Maraas] + +Changes between 1.1.3 and 1.1.4 + +* Fix the Arabic-words-broken-by-underlines problem by + stripping out non-shape affecting attributes then adding them + back after shaping. +* Hangul shaper fixes [Changwoo Ryu, Jungshik Shin] +* Handle compatability ideographs in basic-x shaper [Federic Zhang] +* Rename function parameters to avoid shadowing system headres + [Soeren Sandmann] +* Fix memory leak in Win32 backend [Tor Lillqvist] +* Fix crasher problem with non-BMP characters [He Qiangqiang] +* Implement pango_ft2_font_map_set_default_substitute() [Matthias Clasen] +* Doc improvements [Matthias Clasen, Michael R. Walton, Jungshik Shin] +* Misc bug and build fixes [Dagfinn I. Mannsåker, Tony Graham, + Dan Mills, Sebastian Wilhelmi] + +Changes between 1.1.2 and 1.1.3 + +* Hangul module bug fixes and improvements [Changwoo Ryu, Jungshik Shin] + - Move rendering of precomposed characters to hangul-xft shaper + - Handle Hangul tone marks +* Win32 improvements [Tor Lillqvist] + - Use Uniscribe when present +* Some doc build fixes [Matthias Clasen] +* Code cleanup [Manish Singh] +* Fix assertion failure in PangoLayout [Alex Larsson] +* Fix memory leak when freeing fontmaps [Sven Neumann] + +Changes between 1.1.1 and 1.1.2 + +* Add a new wrap mode for PangoLayout - PANGO_WRAP_WORD_CHAR [Alex Larsson] +* Win32 work [Tor Lillqvist] + - Handle choosing the right font for CJK languages based on language tags. + - Fix boxes showing up for tabs [Florent Duguet] + - Better handling of finding ASCII font names. + - Cygwin compilation fix [Masahiro Sakai] + - Fix --with-included-modules on win32 [Arnaud Charlet] + - Various build fixes and cleanups +* Indic module improvements [Eric Mader] +* Fixes to generic OpenType handling [Eric] +* Improve language specific charset ordering basic-x11 [James Su, Brian Yuan] +* Some merges of fixes by Werner Lemberg to the original + FreeType OpenType code. +* Robustify and otherwise improve pango_color_parse() [Matthias Clasen] +* Some cross-compiling fixes [J. Ali Harlow] +* Bug fix for pango_scan_int() needed for recent GTK+. + +Changes between 1.1.0 and 1.1.1 + +* Merge a lot of the code between the Xft and FT2 backend, + so that the FT2 backend gets the recent improvements to Xft. +* Add proper language tag support to the Xft/FT2 backends. +* Various effienciency fixes for the Xft/FT2 backends. + +Changes between 1.0.x and 1.1.0 + +* Support for version 2 of the Xft library. [Keith Packard] +* Convert the freetype backend over to using fontconfig, + instead of MiniXft for font cataloging. +* A port of the Indic OpenType code from ICU to Pango. [Eric Mader] +* A new hangul-xft [Changwoo Ryu] +* Bug-fixes to the OpenType handling code. +* Various cleanups to the PangoXft and PangoFT2 public APIs. +* Docs switched over to DocBook XML. [Matthias Clasen] + +============================================================ + +Changes between 1.0.3 and 1.0.4 + +* Add Thai shaper for Xft [Theppitak Karoonboonyanan] +* Support GB-18030, BIG5-HKSCS, CNS-11643, GBK encodings for + basic-x shaper [Qingjiang (Brian) Yuan] +* Support ksc5601.1992-3 fonts in hangul-x shpaer + [Qingjiang (Brian) Yuan, Changwoo Ryu] +* Support new Arabic characters in Unicode 3.2 [Roozbeh Pournader] +* Bug fixes [Jacob Berkman, Arnaud Charlet, David L. Cooper II, + Choe Hwangjin, Alex Larsson, Sven Neumann, Matthias Warkus, Yao Zhang] + +Changes between 1.0.2 and 1.0.3 + +* Change algorithm for mapping points to pixels on + Windows to match the system method. [Joaquin Cuenca Abela, + Tor Lillqvist] +* Fix family listing for the FT2 backend. [Sven Neumann] +* Fix memory leak in pango_font_real_get_metrics() [Matthias Clasen] +* Some compilation warning fixes. [David L. Cooper II] +* Fix passing attr_list == NULL to pango_parse_markip [Andreas J. Guelzow] + +Changes between 1.0.1 and 1.0.2 + +* Support building with FreeType 2.1.0 +* List Sans,Serif,Monospace when listing fonts for the + Xft and FT2 backends. (Xavier Cho) +* Portability fixes. (David L. Cooper II, Jacob Berkman) +* Fix problem with pango-querymodules using g_print(). + +Changes between 1.0.0 and 1.0.1 + +* Documentation improvements [Matthias Clasen] +* Use new API in FreeType 2.0.9 to greatly speed up coverage + calculation for Xft and FT2 backends. +* Some fixes for reading of OpenType tables. +* Add -D_REENTRANT to compilation when necessary. [Sven Neumann] +* Try and enable ClearType for Win32 backend. [Tor Lillqvist] +* Fixes for Korean glyphs in the basic-x shaper [Changwoo Ryu] +* Improvements for computation of average char/digit width [Sven Neumann] +* Bug and error reporting fixes + [Arnaud Charlet, Erwann Chenede, Mikael Hallendal, Stefan Israelsson, + Alex Larsson, Soeren Sandmann, Dan Winship] + +============================================================ + +Changes between 1.0.0 rc2 and 1.0.0 + +* Updated README files. +* Minor build fixes [Tor Lillqvist, Jacob Berkman] + +Changes between 1.0.0 rc1 and 1.0.0 rc2 + +* Fix missing weight names when parsing font names [Arnaud Charlet] +* Build fixes [Martin Gansser, Manish Singh] + +Changes between 0.26 and 1.0.0 rc1 + +* Try to build libraries with only shared library dependencies + on Xft to deal with transition to Xft2. +* Efficiency improvements for Xft backend +* Bug, build and portability fixes + +Contributors: Jacob Berkman, Abel Cheung, David L. Cooper II, + Miroslaw Dobrzanski-Neumann, , Dov Grobgeld, Alex Larsson, Tor Lillqvist, + Sven Neumann, Gediminas Paulauskas, Manish Singh, Raymond Wan, + Richard Warren. + +Changes between 0.25 and 0.26 + +* Fixes for AIX compilation [Miroslaw Dobrzanski-Neumann] +* Fix zero-width characters being displayed [Sven Neumann] +* Add some padding to class structures [Owen Taylor] + +Changes between 0.24 and 0.25 + +* Win32 fixes [Tor Lillqvist, Hans Breuer] +* Cleanup of [Darin Adler] +* Bug and build fixes [Anders Carlsson, Sven Neumann, Havoc Pennington, + Morten Welinder] + +Changes between 0.23 and 0.24 + +* Win32 backend improvements [Tor Lillqvist] +* Doc improvements [Havoc Pennington, Dennis Bjorklund] +* Fix problem where "foo\n" was treated as one paragraph by pango-layout, + not two. [Arjan J. Molenaar, Owen Taylor] +* Add glyph caching to FT2 backend [Alex Larsson] +* Try to make configure checks for Qt-based example more robust [Owen] +* New example program for FT2 backend [Dov Grobgeld] +* Arabic shaper for FT2 backend [Andreas Bogk, Sven Neumann] +* Bug fixes + +Other contributors: Mikael Hermansson, Darin Adler, Hidetoshi Tajima, Zack Rusin, + Jacob Berkman, Jason Tackaberry, Evan Martin, Matthias Clasen + +Changes between 0.22 and 0.23 + +* Documentation improvements [Matthias Clasen] +* Win32 fixes [Hans Breuer] +* Improve search for XftConfig [Manish Singh] +* Fixes for crashes in Hangul shaper [Owen Taylor] +* Improvements to Arabic shapers for X and Xft [Roozbeh Pournader] +* Add jisx0212, jisx0201, Big5 support to basic shaper [HideToshi Tajima] +* Many bug fixes + +Other contributors: Darin Adler, Dennis Dementiev, Sebastian Klemke, + Alex Larsson, Sven Neumann, Joshua Pritikin, Padraig O'Briain, + Kristian Rietveld, Sebastian Wilhelmi + +Changes between 0.21 and 0.22 + +* Documentation improvements [Matthias Clasen] +* Win32 fixes [Tor Lillqvist, Hans Breuer] +* Improve line-breaking algorithm to not be O(n^2) [Alex Larsson] +* API addition to render to Xrender drawable +* Restructure so that "font sets" are handled by the core + for all backends [Alex] +* Use the Xft font configuration scheme for the FT2 backend as well [Alex] + +Other Contributors: Darin Alder, Sven Neumann, Raymond Wan + +Changes between 0.20 and 0.21 + +* Documentation improvements. [Matthias Clasen, Sven Neumann] +* pango_break() now reports n + 1 attributes for n characters, not n. [Havoc Pennington] +* Win32 fixes, including support for configure.in on Win32. [Tor Lillqvist] +* Bug fixes [Tony Graham, Eric Lemings, Manish Singh, Sven Neumann, Matt Wilson, + Frank Belew] + +Changes between 0.19 and 0.20 + +* Change PangoFontDescription to save values for unset fields +* Fix for compilation with FreeType 2.0.4 [Havoc Pennington] +* Add PANGO_TYPE_FONT_METRICS [James Henstridge] +* Win32 fixes and updates [Hans Breuer +* PangoLayout bug fixes [Alex Larsson, Padraig O'Briain] +* Misc fixes and cleanups. + +Other contributors: Matthias Clasen, Tony Graham, Mario Motta, Sven Neumann + +Changes between 0.18 and 0.19 + +* Change font listing API to be more extensible. Instead of + using family names and +* Make PangoMetrics and PangoFontDescription opaque heap-allocated + structures to allow extension going forward. +* Allow for PangoFontDescription structures with unspecified + style/variant/stretch/weight. +* Add PANGO_ENABLE_BACKEND and PANGO_ENABLE_ENGINE #defines to + protect parts of the API where we don't want to guarantee + source binary compatibility for 1.x. +* Bug fixes. + +Changes between 0.17 and 0.18 + +* Add PangoLanguage type for language tags, use consistently. +* Add support for different font orderings for different lanuages to + basic shaper. +* Win32 fixes [Alex,Hans] +* Add pango_context_get_metrics() to get metrics for a font description +* Add GTypes for various types [James] +* Lots of warning fixes [Darin] +* Fix to PangoLayout for lines with only tabs on them [Matthias] +* Improve compositing of glyphs for pangoft2 backend [Sven] +* Export pango_color_parse(). +* Adapt to changes in GLib. +* Build and bug fixes. + +Changes between 0.16 and 0.17 + +* Build/bug fixes +* Cursor motion is now by graphemes (logical editing units) rather than + by characters +* Optionally support jumping cursor instead of split cursor + +Changes between 0.15 and 0.16 + +* Ability to make newlines in a PangoLayout display as regular characters + (useful for, e.g., having an entry widget with embedded newlines.) +* Build fixes +* Bug fixes + +Changes between 0.14 and 0.15 + +* New version of Tamil shaper from Vikram Subramanian +* Update mini-fribidi to correspond to the latest FriBidi CVS +* Win32 fixes +* More documentation +* Various minor bug and build fixes. + + +Changes between 0.13 and 0.14 + +* Win32 improvements [Tor] +* Much better boundary resolution using algorithms from the Unicode + standard [Havoc] +* Initial support for anti-aliased TrueType and OpenType fonts + using the Xft and Xrender libraries from XFree86 4. [Owen] +* Fix the FreeType support on Unix so it can be used for the frame-buffer + port of GTK+. [Alex] +* Fix up module building [Alex] +* Add average-character-width font metric [Havoc] +* Bug fixes + + +Changes between 0.12 and 0.13 + +* Win32 Support [Tor] +* Per-display caching of font coverage on the root window [Owen] +* Handling of embedded non-characters in PangoLayout [Elliot] +* Mapping table fixes and improvements [KUSANO Takayuki, Abigail, Owen] +* Adjustable tab handling in PangoLayout [Havoc] +* Add relative font-scaling attribute [Havoc] +* Add function to convert XML/GMarkup description to a PangoAttrList [Havoc] +* New version of Arabic shaper [Karl] +* Enhanced Indic support with ligature tables from the font and + many more languages [Abigail] +* Include FriBidi core that provides the features that Pango needs and + can be used instead of separately installed fribidi. [Owen] +* Add PangoLayoutIterator that abstracts the geometry operations for + iterating over the lines/items/clusters/chars in a layout [Havoc] +* Bug fixes, and more bug fixes + + +What is new in GScript 0.1: + +* Initial release diff --git a/README b/README new file mode 100644 index 0000000..fedd147 --- /dev/null +++ b/README @@ -0,0 +1,67 @@ +Pango is a library for layout and rendering of text, with an emphasis +on internationalization. Pango can be used anywhere that text layout +is needed; however, most of the work on Pango so far has been done using +the GTK+ widget toolkit as a test platform. Pango forms the core of text +and font handling for GTK+-2.x. + +Pango is designed to be modular; the core Pango layout can be used +with different font backends. There are three basic backends, with +multiple options for rendering with each. + + - Client side fonts using the FreeType and FontConfig libraries. + Rendering can be with with Cairo or Xft libraries, or directly + to an in-memory buffer with no additional libraries. + + - Native fonts on Microsoft Windows using Uniscribe for complex + script handling. Rendering can be done via Cairo or directly + using the native Win32 API. + + - Native fonts on MacOS X with the CoreText framework, rendering via + Cairo. + +The integration of Pango with Cairo (http://cairographics.org) +provides a complete solution with high quality text handling +and graphics rendering. + +As well as the low level layout rendering routines, Pango includes +PangoLayout, a high level driver for laying out entire blocks of text, +and routines to assist in editing internationalized text. + +For more information about Pango, see: + + http://www.pango.org/ + +Dependencies +============ + +Pango depends on the GLib library; more information about GLib can +be found at http://www.gtk.org/. + +To use the Free Software stack backend, Pango depends on the following +libraries: + + * FontConfig for font discovery (http://www.fontconfig.org), + + * FreeType for font access (http://www.freetype.org), + + * HarfBuzz for complex text shaping (http://www.harfbuzz.org/) + +Cairo support depends on the Cairo library (http://cairographics.org). +The Cairo backend is the preferred backend to use Pango with and is +subject of most of the development in the future. It has the +advantage that the same code can be used for display and printing. + +We suggest using Pango with Cairo as described above, but you can also +do X-specific rendering using the Xft library. The Xft backend uses +version 2 of the Xft library to manage client side fonts. Version 2 of +Xft is available from http://xlibs.freedesktop.org/release/. You'll +need the libXft package, and possibly the libXrender and renderext +packages as well. You'll also need FontConfig. + +Installation of Pango on Win32 is possible, see README.win32. + +License +======= + +Most of the code of Pango is licensed under the terms of the +GNU Lesser Public License (LGPL) - see the file COPYING for details. diff --git a/README.win32 b/README.win32 new file mode 100644 index 0000000..bce3cb9 --- /dev/null +++ b/README.win32 @@ -0,0 +1,40 @@ +The Pango backends written for Win32 is pangowin32. Pangowin32 uses +the Win32 GDI font API. GTK+ 2.8 and later on Win32 however actually +uses the pangocairo backend (which then uses only small parts of +pangowin32). Much of the GDI font API calls are in cairo. + +The pangoft2 backend was originally written with Win32 in mind, but +its main use nowadays is on other platforms than Win32. + +There are three ways to build Pango for Win32: + +1) Use gcc (mingw), libtool, make, like on Unix. + +If building from git, run the autogen.sh script that runs aclocal, +automake, autoconf and configure to build makefiles etc. This is what +tml@novell.com uses. Pass the same switches to autogen.sh that you +would pass to the configure script. + +If building from a tarball, just running the configure script and then +make should be enough. But, as always, you need to understand what is +happening and follow the progress in case manual intervention is +needed. + +tml ran the configure script like this when building binaries for +Pango 1.10.0: + +PATH=/devel/dist/glib-2.8.0/bin:$PATH ACLOCAL_FLAGS="-I /devel/dist/glib-2.8.0/share/aclocal" PKG_CONFIG_PATH=/devel/dist/glib-2.8.0/lib/pkgconfig:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3' CPPFLAGS='-I/opt/gnu/include' LDFLAGS='-L/opt/gnu/lib' CFLAGS=-O ./configure --disable-gtk-doc --without-x --prefix=c:/devel/target/pango-1.10.0 + +2) Use Visual Studio 2008 or later (Express/Community or above). Use the +solution file in build/win32/vsX, where X corresponds to the numerical +version of your Visual Studio, such as 9 for 2008 and 12 for 2013. +See the README.txt there for more information, or see the following +GNOME Live! page for a more detailed description of building Pango +and its dependencies with Visual Studio: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +3) Use MSVC and nmake. Use the makefile.msc makefiles. These makefiles +are supported by Hans Breuer. They requires manual editing. You need +to have the source code to some suitable version of glib in a sibling +directory. Ask Hans for advice. diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..286f60e --- /dev/null +++ b/THANKS @@ -0,0 +1,13 @@ +Abigail Brady (Indic shapers) +Hans Breuer (Windows backend) +Matthias Clasen (Documentation) +Sivaraj Doddannan (Tamil shaper) +Behdad Esfahbod +Dov Grobgeld (Hebrew shaper) +Karl Koehler (Arabic shaper) +Alex Larsson (FreeType and Windows backends) +Tor Lillqvist (FreeType and Windows backends) +Changwoo Ryu (Hangul shaper) +Havoc Pennington +Roozbeh Pournader (Arabic shaper) +Chookij Vanatham (Hebrew shaper) diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..02501fa --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,55 @@ + +# Checks the location of the XML Catalog +# Usage: +# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# Defines XMLCATALOG and XML_CATALOG_FILE substitutions +AC_DEFUN([JH_PATH_XML_CATALOG], +[ + # check for the presence of the XML catalog + AC_ARG_WITH([xml-catalog], + AC_HELP_STRING([--with-xml-catalog=CATALOG], + [path to xml catalog to use]),, + [with_xml_catalog=/etc/xml/catalog]) + jh_found_xmlcatalog=true + XML_CATALOG_FILE="$with_xml_catalog" + AC_SUBST([XML_CATALOG_FILE]) + AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)]) + if test -f "$XML_CATALOG_FILE"; then + AC_MSG_RESULT([found]) + else + jh_found_xmlcatalog=false + AC_MSG_RESULT([not found]) + fi + + # check for the xmlcatalog program + AC_PATH_PROG(XMLCATALOG, xmlcatalog, no) + if test "x$XMLCATALOG" = xno; then + jh_found_xmlcatalog=false + fi + + if $jh_found_xmlcatalog; then + ifelse([$1],,[:],[$1]) + else + ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2]) + fi +]) + +# Checks if a particular URI appears in the XML catalog +# Usage: +# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([JH_CHECK_XML_CATALOG], +[ + AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl + AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog]) + if $jh_found_xmlcatalog && \ + AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then + AC_MSG_RESULT([found]) + ifelse([$3],,,[$3 +])dnl + else + AC_MSG_RESULT([not found]) + ifelse([$4],, + [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])], + [$4]) + fi +]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..106f6f2 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,10740 @@ +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# -*- mode: autoconf -*- +# +# gtk-doc.m4 - configure macro to check for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2007-2017 Stefan Sauer +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# As a special exception, the above copyright owner gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf when processing the Macro. You need not +# follow the terms of the GNU General Public License when using or +# distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. + +# serial 2 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) + AC_MSG_CHECKING([for gtk-doc]) + PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) + AC_MSG_RESULT($have_gtk_doc) + + if test "$have_gtk_doc" = "no"; then + AC_MSG_WARN([ + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found.]) + fi + + dnl check for tools we added during development + dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that + dnl may not be writable by the user. Currently, automake requires that the + dnl test name must end in '.test'. + dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 + AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) + AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + AC_MSG_ERROR([ + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '[$]0'.]) + fi + + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) + fi + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + AC_SUBST([AM_DEFAULT_VERBOSITY]) + + AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) +]) + +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + dnl Canonicalize enable_introspection + enable_introspection=$found_introspection + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..bc7c59c --- /dev/null +++ b/autogen.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +olddir=`pwd` +cd "$srcdir" + +GTKDOCIZE=`which gtkdocize` +if test -z $GTKDOCIZE; then + echo "*** No GTK-Doc found, please install it ***" + exit 1 +else + gtkdocize || exit $? +fi + +AUTORECONF=`which autoreconf` +if test -z $AUTORECONF; then + echo "*** No autoreconf found, please install it ***" + exit 1 +else + ACLOCAL="aclocal $ACLOCAL_FLAGS" autoreconf --force --install || exit $? +fi + + +cd "$olddir" +test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/compile b/compile new file mode 100755 index 0000000..de0005d --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#!/bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..717b228 --- /dev/null +++ b/config.guess @@ -0,0 +1,1476 @@ +#!/bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-08-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + *:Redox:*:*) + echo ${UNAME_MACHINE}-unknown-redox + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..221aeab --- /dev/null +++ b/config.h.in @@ -0,0 +1,151 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Have usable Cairo library and font backend */ +#undef HAVE_CAIRO + +/* Whether Cairo can use FreeType for fonts */ +#undef HAVE_CAIRO_FREETYPE + +/* Whether Cairo has PDF support */ +#undef HAVE_CAIRO_PDF + +/* Whether Cairo has PNG support */ +#undef HAVE_CAIRO_PNG + +/* Whether Cairo has PS support */ +#undef HAVE_CAIRO_PS + +/* Whether Cairo can use Quartz for fonts */ +#undef HAVE_CAIRO_QUARTZ + +/* Whether Cairo can use the Win32 GDI for fonts */ +#undef HAVE_CAIRO_WIN32 + +/* Whether Cairo has Xlib support */ +#undef HAVE_CAIRO_XLIB + +/* Whether CoreText is available on the system */ +#undef HAVE_CORE_TEXT + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `FcWeightFromOpenTypeDouble' function. */ +#undef HAVE_FCWEIGHTFROMOPENTYPEDOUBLE + +/* Define to 1 if you have the `flockfile' function. */ +#undef HAVE_FLOCKFILE + +/* Have FreeType 2 library */ +#undef HAVE_FREETYPE + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Whether libthai is available */ +#undef HAVE_LIBTHAI + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtok_r' function. */ +#undef HAVE_STRTOK_R + +/* Define to 1 if you have the `sysconf' function. */ +#undef HAVE_SYSCONF + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `th_brk_find_breaks' function. */ +#undef HAVE_TH_BRK_FIND_BREAKS + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Have Xft library */ +#undef HAVE_XFT + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* PANGO binary age */ +#undef PANGO_BINARY_AGE + +/* PANGO interface age */ +#undef PANGO_INTERFACE_AGE + +/* PANGO major version */ +#undef PANGO_VERSION_MAJOR + +/* PANGO micro version */ +#undef PANGO_VERSION_MICRO + +/* PANGO minor version */ +#undef PANGO_VERSION_MINOR + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* defines how to decorate public symbols while building */ +#undef _PANGO_EXTERN diff --git a/config.h.win32 b/config.h.win32 new file mode 100644 index 0000000..588a747 --- /dev/null +++ b/config.h.win32 @@ -0,0 +1,153 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ +/* Actually, this version of config.h is manually edited from the above */ + +/* Have usable Cairo library and font backend */ +#define HAVE_CAIRO 1 + +/* Whether Cairo can use FreeType for fonts */ +/* HAVE_CAIRO_FREETYPE */ + +/* Whether Cairo has PDF support */ +#define HAVE_CAIRO_PDF 1 + +/* Whether Cairo has PNG support */ +#define HAVE_CAIRO_PNG 1 + +/* Whether Cairo has PS support */ +#define HAVE_CAIRO_PS 1 + +/* Whether Cairo can use Quartz for fonts */ +/* #undef HAVE_CAIRO_QUARTZ */ + +/* Whether Cairo can use the Win32 GDI for fonts */ +#define HAVE_CAIRO_WIN32 1 + +/* Whether Cairo has Xlib support */ +/* #undef HAVE_CAIRO_XLIB */ + +/* Whether CoreText is available on the system */ +/* #undef HAVE_CORE_TEXT */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_DIRENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the `flockfile' function. */ +/* #undef HAVE_FLOCKFILE */ + +/* Have FreeType 2 library */ +#ifndef PANGO_VISUALC_NO_FC +#define HAVE_FREETYPE 1 +#endif + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define to 1 if you have the header file. */ +/*#undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#if (!defined (_MSC_VER) || (_MSC_VER >= 1600)) +#define HAVE_STDINT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtok_r' function. */ +/* #undef HAVE_STRTOK_R */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Have Xft library */ +/* #undef HAVE_XFT */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "pango" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=pango" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pango" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pango 1.42.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pango" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.42.4" + +/* PANGO binary age */ +#define PANGO_BINARY_AGE 4204 + +/* PANGO interface age */ +#define PANGO_INTERFACE_AGE 4 + +/* PANGO major version */ +#define PANGO_VERSION_MAJOR 1 + +/* PANGO micro version */ +#define PANGO_VERSION_MICRO 4 + +/* PANGO minor version */ +#define PANGO_VERSION_MINOR 42 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.42.4" + +/* defines how to decorate public symbols while building */ +#ifdef _MSC_VER +#define _PANGO_EXTERN __declspec(dllexport) extern +#else +#define _PANGO_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern +#endif diff --git a/config.h.win32.in b/config.h.win32.in new file mode 100644 index 0000000..4f05e11 --- /dev/null +++ b/config.h.win32.in @@ -0,0 +1,153 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ +/* Actually, this version of config.h is manually edited from the above */ + +/* Have usable Cairo library and font backend */ +#define HAVE_CAIRO 1 + +/* Whether Cairo can use FreeType for fonts */ +/* HAVE_CAIRO_FREETYPE */ + +/* Whether Cairo has PDF support */ +#define HAVE_CAIRO_PDF 1 + +/* Whether Cairo has PNG support */ +#define HAVE_CAIRO_PNG 1 + +/* Whether Cairo has PS support */ +#define HAVE_CAIRO_PS 1 + +/* Whether Cairo can use Quartz for fonts */ +/* #undef HAVE_CAIRO_QUARTZ */ + +/* Whether Cairo can use the Win32 GDI for fonts */ +#define HAVE_CAIRO_WIN32 1 + +/* Whether Cairo has Xlib support */ +/* #undef HAVE_CAIRO_XLIB */ + +/* Whether CoreText is available on the system */ +/* #undef HAVE_CORE_TEXT */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_DIRENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the `flockfile' function. */ +/* #undef HAVE_FLOCKFILE */ + +/* Have FreeType 2 library */ +#ifndef PANGO_VISUALC_NO_FC +#define HAVE_FREETYPE 1 +#endif + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define to 1 if you have the header file. */ +/*#undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#if (!defined (_MSC_VER) || (_MSC_VER >= 1600)) +#define HAVE_STDINT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtok_r' function. */ +/* #undef HAVE_STRTOK_R */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Have Xft library */ +/* #undef HAVE_XFT */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "pango" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=pango" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pango" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pango @PANGO_VERSION@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pango" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PANGO_VERSION@" + +/* PANGO binary age */ +#define PANGO_BINARY_AGE @PANGO_BINARY_AGE@ + +/* PANGO interface age */ +#define PANGO_INTERFACE_AGE @PANGO_INTERFACE_AGE@ + +/* PANGO major version */ +#define PANGO_VERSION_MAJOR @PANGO_VERSION_MAJOR@ + +/* PANGO micro version */ +#define PANGO_VERSION_MICRO @PANGO_VERSION_MICRO@ + +/* PANGO minor version */ +#define PANGO_VERSION_MINOR @PANGO_VERSION_MINOR@ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "@PANGO_VERSION@" + +/* defines how to decorate public symbols while building */ +#ifdef _MSC_VER +#define _PANGO_EXTERN __declspec(dllexport) extern +#else +#define _PANGO_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern +#endif diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..f4bafc1 --- /dev/null +++ b/config.sub @@ -0,0 +1,1836 @@ +#!/bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-04-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + wasm32) + basic_machine=wasm32-unknown + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..db9a79b --- /dev/null +++ b/configure @@ -0,0 +1,23139 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for pango 1.42.4. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugzilla.gnome.org/enter_bug.cgi?product=pango +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='pango' +PACKAGE_TARNAME='pango' +PACKAGE_VERSION='1.42.4' +PACKAGE_STRING='pango 1.42.4' +PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pango' +PACKAGE_URL='' + +ac_unique_file="pango.pc.in" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +MSVC_NO_TOOLSET_SET_FALSE +MSVC_NO_TOOLSET_SET_TRUE +MSVC_BASE_NO_TOOLSET_SET_FALSE +MSVC_BASE_NO_TOOLSET_SET_TRUE +PANGO_HIDDEN_VISIBILITY_CFLAGS +BUILDOPT_INSTALL_TESTS_FALSE +BUILDOPT_INSTALL_TESTS_TRUE +LIBRARY_LIBTOOL_OPTIONS +ENABLE_DOC_CROSS_REFERENCES_FALSE +ENABLE_DOC_CROSS_REFERENCES_TRUE +CAIRO_PREFIX +GLIB_PREFIX +GTK_DOC_USE_REBASE_FALSE +GTK_DOC_USE_REBASE_TRUE +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +HAVE_GTK_DOC_FALSE +HAVE_GTK_DOC_TRUE +GTKDOC_DEPS_LIBS +GTKDOC_DEPS_CFLAGS +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK_PATH +GTKDOC_CHECK +HAVE_INTROSPECTION_FALSE +HAVE_INTROSPECTION_TRUE +INTROSPECTION_MAKEFILE +INTROSPECTION_LIBS +INTROSPECTION_CFLAGS +INTROSPECTION_TYPELIBDIR +INTROSPECTION_GIRDIR +INTROSPECTION_GENERATE +INTROSPECTION_COMPILER +INTROSPECTION_SCANNER +LIBTHAI_LIBS +LIBTHAI_CFLAGS +FRIBIDI_LIBS +FRIBIDI_CFLAGS +GLIB_MKENUMS +GLIB_LIBS +GLIB_CFLAGS +HAVE_CAIRO_QUARTZ_FALSE +HAVE_CAIRO_QUARTZ_TRUE +HAVE_CAIRO_FREETYPE_FALSE +HAVE_CAIRO_FREETYPE_TRUE +HAVE_CAIRO_WIN32_FALSE +HAVE_CAIRO_WIN32_TRUE +HAVE_CAIRO_XLIB_FALSE +HAVE_CAIRO_XLIB_TRUE +HAVE_CAIRO_PDF_FALSE +HAVE_CAIRO_PDF_TRUE +HAVE_CAIRO_PS_FALSE +HAVE_CAIRO_PS_TRUE +HAVE_CAIRO_PNG_FALSE +HAVE_CAIRO_PNG_TRUE +HAVE_CAIRO_FALSE +HAVE_CAIRO_TRUE +HARFBUZZ_LIB +FONTCONFIG_LIB +FREETYPE2_LIB +CAIRO_LIB +HARFBUZZ_PC +FONTCONFIG_PC +FREETYPE2_PC +CAIRO_PC +PKGCONFIG_CAIRO_REQUIRES +CAIRO_LIBS +CAIRO_CFLAGS +HAVE_CORE_TEXT_FALSE +HAVE_CORE_TEXT_TRUE +HAVE_WIN32_FALSE +HAVE_WIN32_TRUE +HAVE_XFT_FALSE +HAVE_XFT_TRUE +XFT_LIBS +XFT_CFLAGS +HAVE_FREETYPE_FALSE +HAVE_FREETYPE_TRUE +FREETYPE_LIBS +FREETYPE_CFLAGS +FONTCONFIG_LIBS +FONTCONFIG_CFLAGS +HAVE_HARFBUZZ_FALSE +HAVE_HARFBUZZ_TRUE +HARFBUZZ_LIBS +HARFBUZZ_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +CROSS_COMPILING_FALSE +CROSS_COMPILING_TRUE +PANGO_DEBUG_FLAGS +MS_LIB_AVAILABLE_FALSE +MS_LIB_AVAILABLE_TRUE +ms_librarian +WINDRES +PLATFORM_WIN32_FALSE +PLATFORM_WIN32_TRUE +CXXCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +EGREP +GREP +CPP +HAVE_CXX_FALSE +HAVE_CXX_TRUE +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +CXXFLAGS +ac_ct_CXX +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +OS_WIN32_FALSE +OS_WIN32_TRUE +LIB_EXE_MACHINE_FLAG +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +PANGO_CURRENT_MINUS_AGE +PANGO_BINARY_AGE +PANGO_INTERFACE_AGE +PANGO_API_VERSION +PANGO_VERSION +PANGO_VERSION_MICRO +PANGO_VERSION_MINOR +PANGO_VERSION_MAJOR +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_static +enable_shared +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_debug +enable_rebuilds +with_xft +with_cairo +enable_introspection +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +enable_doc_cross_references +enable_Bsymbolic +enable_installed_tests +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +LT_SYS_LIBRARY_PATH +CXXCPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +HARFBUZZ_CFLAGS +HARFBUZZ_LIBS +FONTCONFIG_CFLAGS +FONTCONFIG_LIBS +FREETYPE_CFLAGS +FREETYPE_LIBS +XFT_CFLAGS +XFT_LIBS +CAIRO_CFLAGS +CAIRO_LIBS +GLIB_CFLAGS +GLIB_LIBS +FRIBIDI_CFLAGS +FRIBIDI_LIBS +LIBTHAI_CFLAGS +LIBTHAI_LIBS +GTKDOC_DEPS_CFLAGS +GTKDOC_DEPS_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures pango 1.42.4 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/pango] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of pango 1.42.4:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-debug=[no/minimum/yes] + turn on debugging [default=minimum] + --disable-rebuilds disable all source autogeneration rules + --enable-introspection=[no/auto/yes] + Enable introspection for this build + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + --disable-doc-cross-references + cross reference glib and cairo symbols [default=yes] + --disable-Bsymbolic avoid linking with -Bsymbolic + --enable-installed-tests + Install test programs (default: no) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-xft build xft backend + --without-cairo Do not use cairo + --with-html-dir=PATH path to installed docs + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + HARFBUZZ_CFLAGS + C compiler flags for HARFBUZZ, overriding pkg-config + HARFBUZZ_LIBS + linker flags for HARFBUZZ, overriding pkg-config + FONTCONFIG_CFLAGS + C compiler flags for FONTCONFIG, overriding pkg-config + FONTCONFIG_LIBS + linker flags for FONTCONFIG, overriding pkg-config + FREETYPE_CFLAGS + C compiler flags for FREETYPE, overriding pkg-config + FREETYPE_LIBS + linker flags for FREETYPE, overriding pkg-config + XFT_CFLAGS C compiler flags for XFT, overriding pkg-config + XFT_LIBS linker flags for XFT, overriding pkg-config + CAIRO_CFLAGS + C compiler flags for CAIRO, overriding pkg-config + CAIRO_LIBS linker flags for CAIRO, overriding pkg-config + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + FRIBIDI_CFLAGS + C compiler flags for FRIBIDI, overriding pkg-config + FRIBIDI_LIBS + linker flags for FRIBIDI, overriding pkg-config + LIBTHAI_CFLAGS + C compiler flags for LIBTHAI, overriding pkg-config + LIBTHAI_LIBS + linker flags for LIBTHAI, overriding pkg-config + GTKDOC_DEPS_CFLAGS + C compiler flags for GTKDOC_DEPS, overriding pkg-config + GTKDOC_DEPS_LIBS + linker flags for GTKDOC_DEPS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +pango configure 1.42.4 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------------------------------------------- ## +## Report this to http://bugzilla.gnome.org/enter_bug.cgi?product=pango ## +## -------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by pango $as_me 1.42.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + +am__api_version='1.15' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='pango' + VERSION='1.42.4' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +ac_config_headers="$ac_config_headers config.h" + + + +PANGO_VERSION_MAJOR=1 +PANGO_VERSION_MINOR=42 +PANGO_VERSION_MICRO=4 +PANGO_VERSION=1.42.4 +PANGO_API_VERSION=1.0 +PANGO_INTERFACE_AGE=4 +PANGO_BINARY_AGE=4204 + + + + + + + + + + +$as_echo "#define PANGO_BINARY_AGE 4204" >>confdefs.h + + +$as_echo "#define PANGO_INTERFACE_AGE 4" >>confdefs.h + + +$as_echo "#define PANGO_VERSION_MAJOR 1" >>confdefs.h + + +$as_echo "#define PANGO_VERSION_MINOR 42" >>confdefs.h + + +$as_echo "#define PANGO_VERSION_MICRO 4" >>confdefs.h + + + + + +VERSION_INFO="4200:4:4200" +PANGO_CURRENT_MINUS_AGE=0 + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native Win32" >&5 +$as_echo_n "checking for native Win32... " >&6; } +case "$host" in + *-*-mingw*) + pango_os_win32=yes + case "$host" in + x86_64-*-*) + LIB_EXE_MACHINE_FLAG=X64 + ;; + *) + LIB_EXE_MACHINE_FLAG=X86 + ;; + esac + ;; + *) + pango_os_win32=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pango_os_win32" >&5 +$as_echo "$pango_os_win32" >&6; } + + + + if test "$pango_os_win32" = "yes"; then + OS_WIN32_TRUE= + OS_WIN32_FALSE='#' +else + OS_WIN32_TRUE='#' + OS_WIN32_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="gcc" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +class a { int b; } c; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + CXX= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$CXX" != ""; then + HAVE_CXX_TRUE= + HAVE_CXX_FALSE='#' +else + HAVE_CXX_TRUE='#' + HAVE_CXX_FALSE= +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +for ac_func in sysconf getpagesize +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in unistd.h sys/mman.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +# +# Win32 stuff +# + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=no +fi + + + + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +: ${CONFIG_LT=./config.lt} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 +$as_echo "$as_me: creating $CONFIG_LT" >&6;} +as_write_fail=0 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $0 [OPTIONS] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +pango config.lt 1.42.4 +configured by $0, generated by GNU Autoconf 2.69. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $# +do + case $1 in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) as_fn_error $? "unrecognized option: $1 +Try '$0 --help' for more information." "$LINENO" 5 ;; + + *) as_fn_error $? "unrecognized argument: $1 +Try '$0 --help' for more information." "$LINENO" 5 ;; + esac + shift +done + +if $lt_cl_silent; then + exec 6>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} + + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + +as_fn_exit 0 +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for some Win32 platform" >&5 +$as_echo_n "checking for some Win32 platform... " >&6; } +case "$host" in + *-*-mingw*|*-*-cygwin*) + pango_platform_win32=yes + ;; + *) + pango_platform_win32=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pango_platform_win32" >&5 +$as_echo "$pango_platform_win32" >&6; } + if test "$pango_platform_win32" = "yes"; then + PLATFORM_WIN32_TRUE= + PLATFORM_WIN32_FALSE='#' +else + PLATFORM_WIN32_TRUE='#' + PLATFORM_WIN32_FALSE= +fi + + +if test "$pango_platform_win32" = "yes"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 +$as_echo "$WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 +$as_echo "$ac_ct_WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_WINDRES" = x; then + WINDRES="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + if test "$WINDRES" = no; then + as_fn_error $? "*** Could not find an implementation of windres in your PATH." "$LINENO" 5 + fi + # Extract the first word of "lib.exe", so it can be a program name with args. +set dummy lib.exe; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ms_librarian+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ms_librarian"; then + ac_cv_prog_ms_librarian="$ms_librarian" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ms_librarian="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ms_librarian" && ac_cv_prog_ms_librarian="no" +fi +fi +ms_librarian=$ac_cv_prog_ms_librarian +if test -n "$ms_librarian"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ms_librarian" >&5 +$as_echo "$ms_librarian" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + if test x$ms_librarian = xyes; then + MS_LIB_AVAILABLE_TRUE= + MS_LIB_AVAILABLE_FALSE='#' +else + MS_LIB_AVAILABLE_TRUE='#' + MS_LIB_AVAILABLE_FALSE= +fi + + +if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[\ \ ]-Wall[\ \ ]*) ;; + *) CFLAGS="$CFLAGS -Wall" ;; + esac +fi + + + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +else + enable_debug=minimum +fi + + +if test "x$enable_debug" = "xyes"; then + PANGO_DEBUG_FLAGS="-DPANGO_ENABLE_DEBUG" +else + PANGO_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS" + + if test "x$enable_debug" = "xno"; then + PANGO_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS $PANGO_DEBUG_FLAGS" + fi +fi + + + +# Check whether --enable-rebuilds was given. +if test "${enable_rebuilds+set}" = set; then : + enableval=$enable_rebuilds; +else + enable_rebuilds=yes +fi + + + if test $cross_compiling = yes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' +else + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= +fi + + + +# +# Checks for HarfBuzz +# +have_harfbuzz=false + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HARFBUZZ" >&5 +$as_echo_n "checking for HARFBUZZ... " >&6; } + +if test -n "$HARFBUZZ_CFLAGS"; then + pkg_cv_HARFBUZZ_CFLAGS="$HARFBUZZ_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz >= 1.4.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "harfbuzz >= 1.4.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_HARFBUZZ_CFLAGS=`$PKG_CONFIG --cflags "harfbuzz >= 1.4.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$HARFBUZZ_LIBS"; then + pkg_cv_HARFBUZZ_LIBS="$HARFBUZZ_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz >= 1.4.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "harfbuzz >= 1.4.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_HARFBUZZ_LIBS=`$PKG_CONFIG --libs "harfbuzz >= 1.4.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + HARFBUZZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "harfbuzz >= 1.4.2" 2>&1` + else + HARFBUZZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "harfbuzz >= 1.4.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$HARFBUZZ_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + HARFBUZZ_CFLAGS=$pkg_cv_HARFBUZZ_CFLAGS + HARFBUZZ_LIBS=$pkg_cv_HARFBUZZ_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_harfbuzz=true +fi + if $have_harfbuzz; then + HAVE_HARFBUZZ_TRUE= + HAVE_HARFBUZZ_FALSE='#' +else + HAVE_HARFBUZZ_TRUE='#' + HAVE_HARFBUZZ_FALSE= +fi + + +# +# Check for fontconfig +# +have_fontconfig=false +if $have_harfbuzz ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FONTCONFIG" >&5 +$as_echo_n "checking for FONTCONFIG... " >&6; } + +if test -n "$FONTCONFIG_CFLAGS"; then + pkg_cv_FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig >= 2.11.91\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fontconfig >= 2.11.91") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig >= 2.11.91" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FONTCONFIG_LIBS"; then + pkg_cv_FONTCONFIG_LIBS="$FONTCONFIG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig >= 2.11.91\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fontconfig >= 2.11.91") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig >= 2.11.91" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig >= 2.11.91" 2>&1` + else + FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig >= 2.11.91" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FONTCONFIG_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + FONTCONFIG_CFLAGS=$pkg_cv_FONTCONFIG_CFLAGS + FONTCONFIG_LIBS=$pkg_cv_FONTCONFIG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_fontconfig=true +fi +fi +if $have_fontconfig ; then + pango_save_libs=$LIBS + LIBS="$LIBS $FONTCONFIG_LIBS" + for ac_func in FcWeightFromOpenTypeDouble +do : + ac_fn_c_check_func "$LINENO" "FcWeightFromOpenTypeDouble" "ac_cv_func_FcWeightFromOpenTypeDouble" +if test "x$ac_cv_func_FcWeightFromOpenTypeDouble" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FCWEIGHTFROMOPENTYPEDOUBLE 1 +_ACEOF + +fi +done + + LIBS=$pango_save_libs +fi + +# +# Checks for FreeType +# +have_freetype=false +if $have_fontconfig ; then + # The first version of freetype with a .pc file is 2.1.5. That's recent + # enough for all the functions we use I guess. No version check needed. + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5 +$as_echo_n "checking for FREETYPE... " >&6; } + +if test -n "$FREETYPE_CFLAGS"; then + pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FREETYPE_LIBS"; then + pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freetype2" 2>&1` + else + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freetype2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FREETYPE_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS + FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_freetype=true +fi +fi +if $have_freetype ; then + +$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h + +fi + if $have_freetype; then + HAVE_FREETYPE_TRUE= + HAVE_FREETYPE_FALSE='#' +else + HAVE_FREETYPE_TRUE='#' + HAVE_FREETYPE_FALSE= +fi + + +# +# Checks for Xft/XRender +# +have_xft=false + +# Check whether --with-xft was given. +if test "${with_xft+set}" = set; then : + withval=$with_xft; +else + with_xft=yes +fi + +if $have_freetype ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFT" >&5 +$as_echo_n "checking for XFT... " >&6; } + +if test -n "$XFT_CFLAGS"; then + pkg_cv_XFT_CFLAGS="$XFT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft >= 2.0.0 xrender\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xft >= 2.0.0 xrender") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XFT_CFLAGS=`$PKG_CONFIG --cflags "xft >= 2.0.0 xrender" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$XFT_LIBS"; then + pkg_cv_XFT_LIBS="$XFT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft >= 2.0.0 xrender\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xft >= 2.0.0 xrender") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XFT_LIBS=`$PKG_CONFIG --libs "xft >= 2.0.0 xrender" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xft >= 2.0.0 xrender" 2>&1` + else + XFT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xft >= 2.0.0 xrender" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$XFT_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + XFT_CFLAGS=$pkg_cv_XFT_CFLAGS + XFT_LIBS=$pkg_cv_XFT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_xft=true +fi +fi +if test "x$with_xft" = xyes && $have_xft ; then + +$as_echo "#define HAVE_XFT 1" >>confdefs.h + +fi + if test "x$with_xft" = xyes && $have_xft ; then + HAVE_XFT_TRUE= + HAVE_XFT_FALSE='#' +else + HAVE_XFT_TRUE='#' + HAVE_XFT_FALSE= +fi + + +# +# Checks for Win32 +# +have_win32=false +# The following doesn't work with autoconf-2.13, so we check $host instead +# AC_CHECK_LIB(gdi32, GetTextMetricsA@8, have_win32=true, : ) +case "$host" in + *-*-mingw*|*-*-cygwin*) have_win32=true ;; +esac + if $have_win32; then + HAVE_WIN32_TRUE= + HAVE_WIN32_FALSE='#' +else + HAVE_WIN32_TRUE='#' + HAVE_WIN32_FALSE= +fi + + +# Ensure MSVC-compatible struct packing convention is used when +# compiling for Win32 with gcc. +# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while +# gcc2 uses "-fnative-struct". +if test "$pango_os_win32" = "yes"; then + if test x"$GCC" = xyes; then + msnative_struct='' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get MSVC-compatible struct packing" >&5 +$as_echo_n "checking how to get MSVC-compatible struct packing... " >&6; } + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in + 2.) + if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then + msnative_struct='-fnative-struct' + fi + ;; + *) + if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then + msnative_struct='-mms-bitfields' + fi + ;; + esac + if test x"$msnative_struct" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no way" >&5 +$as_echo "no way" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&5 +$as_echo "$as_me: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&2;} + else + CFLAGS="$CFLAGS $msnative_struct" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msnative_struct}" >&5 +$as_echo "${msnative_struct}" >&6; } + fi + fi +fi + +# +# Checks for CoreText +# + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CoreText availability" >&5 +$as_echo_n "checking for CoreText availability... " >&6; } +pango_save_libs=$LIBS +LIBS="$LIBS -framework ApplicationServices" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CTGetCoreTextVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_core_text=yes +else + have_core_text=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$pango_save_libs + +if test "$have_core_text" = "yes"; then + +$as_echo "#define HAVE_CORE_TEXT 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_core_text" >&5 +$as_echo "$have_core_text" >&6; } + + if test "$have_core_text" = "yes"; then + HAVE_CORE_TEXT_TRUE= + HAVE_CORE_TEXT_FALSE='#' +else + HAVE_CORE_TEXT_TRUE='#' + HAVE_CORE_TEXT_FALSE= +fi + + +# +# Checks for Cairo +# +have_cairo=false +have_cairo_png=false +have_cairo_ps=false +have_cairo_pdf=false +have_cairo_xlib=false +have_cairo_freetype=false +have_cairo_win32=false +have_cairo_quartz=false +cairo_required=1.12.10 + + +# Check whether --with-cairo was given. +if test "${with_cairo+set}" = set; then : + withval=$with_cairo; : +else + with_cairo=auto +fi + +if test x$with_cairo != xno; then : + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 +$as_echo_n "checking for CAIRO... " >&6; } + +if test -n "$CAIRO_CFLAGS"; then + pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= $cairo_required" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CAIRO_LIBS"; then + pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= $cairo_required" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo >= $cairo_required" 2>&1` + else + CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo >= $cairo_required" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CAIRO_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS + CAIRO_LIBS=$pkg_cv_CAIRO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_cairo=true +fi + +fi + +if $have_cairo ; then + pango_save_libs=$LIBS + LIBS="$LIBS $CAIRO_LIBS" + pango_save_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS $CAIRO_LIBS" + + have_cairo=false + cairo_font_backends="" + + if $have_freetype; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-ft >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-ft >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_freetype=true +else + : +fi + fi + if $have_cairo_freetype; then + +$as_echo "#define HAVE_CAIRO_FREETYPE 1" >>confdefs.h + + cairo_font_backends="freetype $cairo_font_backends" + have_cairo=true + fi + + if $have_win32; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-win32 >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-win32 >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_win32=true +else + : +fi + fi + if $have_cairo_win32; then + +$as_echo "#define HAVE_CAIRO_WIN32 1" >>confdefs.h + + cairo_font_backends="win32 $cairo_font_backends" + have_cairo=true + fi + + if test $have_core_text; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-quartz-font >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-quartz-font >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_quartz=true +else + : +fi + fi + if $have_cairo_quartz; then + +$as_echo "#define HAVE_CAIRO_QUARTZ 1" >>confdefs.h + + cairo_font_backends="quartz $cairo_font_backends" + have_cairo=true + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cairo font backends could be used" >&5 +$as_echo_n "checking which cairo font backends could be used... " >&6; } + if $have_cairo ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cairo_font_backends" >&5 +$as_echo "$cairo_font_backends" >&6; } + else + if test x${with_cairo} != xauto; then + as_fn_error $? "cairo support requested, but not present" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling cairo support" >&5 +$as_echo "$as_me: Disabling cairo support" >&6;} + fi + + if $have_cairo ; then + +$as_echo "#define HAVE_CAIRO 1" >>confdefs.h + + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-png >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-png >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_png=true +else + : +fi + if $have_cairo_png; then + +$as_echo "#define HAVE_CAIRO_PNG 1" >>confdefs.h + + fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-ps >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-ps >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_ps=true +else + : +fi + if $have_cairo_ps; then + +$as_echo "#define HAVE_CAIRO_PS 1" >>confdefs.h + + fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-pdf >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-pdf >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_pdf=true +else + : +fi + if $have_cairo_pdf; then + +$as_echo "#define HAVE_CAIRO_PDF 1" >>confdefs.h + + fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo-xlib >= \$cairo_required\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo-xlib >= $cairo_required") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_cairo_xlib=true +else + : +fi + if $have_cairo_xlib; then + +$as_echo "#define HAVE_CAIRO_XLIB 1" >>confdefs.h + + fi + fi + + LIBS=$pango_save_libs + LDFLAGS=$pango_save_ldflags + + PKGCONFIG_CAIRO_REQUIRES= + if $have_cairo_freetype; then + PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangoft2" + fi + if $have_cairo_win32; then + PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangowin32" + fi + +fi + +# To compensate for Meson builds on MSVC where pkg-config files may well not be +# available for cairo, harfbuzz, freetype2 and fontconfig +CAIRO_PC="cairo" +FREETYPE2_PC="freetype2" +FONTCONFIG_PC="fontconfig" +HARFBUZZ_PC="harfbuzz" + + + + +CAIRO_LIB= +FREETYPE2_LIB= +FONTCONFIG_LIB= +HARFBUZZ_LIB= + + + + + + if $have_cairo; then + HAVE_CAIRO_TRUE= + HAVE_CAIRO_FALSE='#' +else + HAVE_CAIRO_TRUE='#' + HAVE_CAIRO_FALSE= +fi + + if $have_cairo_png; then + HAVE_CAIRO_PNG_TRUE= + HAVE_CAIRO_PNG_FALSE='#' +else + HAVE_CAIRO_PNG_TRUE='#' + HAVE_CAIRO_PNG_FALSE= +fi + + if $have_cairo_ps; then + HAVE_CAIRO_PS_TRUE= + HAVE_CAIRO_PS_FALSE='#' +else + HAVE_CAIRO_PS_TRUE='#' + HAVE_CAIRO_PS_FALSE= +fi + + if $have_cairo_pdf; then + HAVE_CAIRO_PDF_TRUE= + HAVE_CAIRO_PDF_FALSE='#' +else + HAVE_CAIRO_PDF_TRUE='#' + HAVE_CAIRO_PDF_FALSE= +fi + + if $have_cairo_xlib; then + HAVE_CAIRO_XLIB_TRUE= + HAVE_CAIRO_XLIB_FALSE='#' +else + HAVE_CAIRO_XLIB_TRUE='#' + HAVE_CAIRO_XLIB_FALSE= +fi + + if $have_cairo_win32; then + HAVE_CAIRO_WIN32_TRUE= + HAVE_CAIRO_WIN32_FALSE='#' +else + HAVE_CAIRO_WIN32_TRUE='#' + HAVE_CAIRO_WIN32_FALSE= +fi + + if $have_cairo_freetype; then + HAVE_CAIRO_FREETYPE_TRUE= + HAVE_CAIRO_FREETYPE_FALSE='#' +else + HAVE_CAIRO_FREETYPE_TRUE='#' + HAVE_CAIRO_FREETYPE_FALSE= +fi + + if $have_cairo_quartz; then + HAVE_CAIRO_QUARTZ_TRUE= + HAVE_CAIRO_QUARTZ_FALSE='#' +else + HAVE_CAIRO_QUARTZ_TRUE='#' + HAVE_CAIRO_QUARTZ_FALSE= +fi + + + +# +# We must have some backend defined +# +if $have_freetype || `test "x$with_xft" = xyes && $have_xft` || $have_cairo || $have_win32 ; then : ; else + as_fn_error $? "*** Could not enable any backends. +*** Must have at least one backend to build Pango." "$LINENO" 5 +fi + +# +# Checks for GLib +# +GLIB_REQUIRED_VERSION=2.33.12 +GLIB_MODULES="glib-2.0 >= $GLIB_REQUIRED_VERSION gobject-2.0 gthread-2.0" + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLIB_MODULES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GLIB_MODULES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "$GLIB_MODULES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLIB_MODULES\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$GLIB_MODULES") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "$GLIB_MODULES" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$GLIB_MODULES" 2>&1` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GLIB_MODULES" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + as_fn_error $? " +*** Glib $GLIB_REQUIRED_VERSION or better is required. The latest version of +*** Glib is always available from ftp://ftp.gtk.org/." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? " +*** Glib $GLIB_REQUIRED_VERSION or better is required. The latest version of +*** Glib is always available from ftp://ftp.gtk.org/." "$LINENO" 5 +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + +# Setup GLIB_MKENUMS to use glib-mkenums even if GLib is uninstalled. +GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + +# Checks for FriBiDi +FRIBIDI_REQUIRED_VERSION=0.19.7 + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FRIBIDI" >&5 +$as_echo_n "checking for FRIBIDI... " >&6; } + +if test -n "$FRIBIDI_CFLAGS"; then + pkg_cv_FRIBIDI_CFLAGS="$FRIBIDI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi >= \$FRIBIDI_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fribidi >= $FRIBIDI_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FRIBIDI_CFLAGS=`$PKG_CONFIG --cflags "fribidi >= $FRIBIDI_REQUIRED_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FRIBIDI_LIBS"; then + pkg_cv_FRIBIDI_LIBS="$FRIBIDI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi >= \$FRIBIDI_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fribidi >= $FRIBIDI_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FRIBIDI_LIBS=`$PKG_CONFIG --libs "fribidi >= $FRIBIDI_REQUIRED_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fribidi >= $FRIBIDI_REQUIRED_VERSION" 2>&1` + else + FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fribidi >= $FRIBIDI_REQUIRED_VERSION" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FRIBIDI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (fribidi >= $FRIBIDI_REQUIRED_VERSION) were not met: + +$FRIBIDI_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables FRIBIDI_CFLAGS +and FRIBIDI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables FRIBIDI_CFLAGS +and FRIBIDI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + FRIBIDI_CFLAGS=$pkg_cv_FRIBIDI_CFLAGS + FRIBIDI_LIBS=$pkg_cv_FRIBIDI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +# +# Checks for LibThai +# +LIBTHAI_REQUIRED_VERSION=0.1.9 +have_libthai=false + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBTHAI" >&5 +$as_echo_n "checking for LIBTHAI... " >&6; } + +if test -n "$LIBTHAI_CFLAGS"; then + pkg_cv_LIBTHAI_CFLAGS="$LIBTHAI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libthai >= \$LIBTHAI_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libthai >= $LIBTHAI_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBTHAI_CFLAGS=`$PKG_CONFIG --cflags "libthai >= $LIBTHAI_REQUIRED_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBTHAI_LIBS"; then + pkg_cv_LIBTHAI_LIBS="$LIBTHAI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libthai >= \$LIBTHAI_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libthai >= $LIBTHAI_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBTHAI_LIBS=`$PKG_CONFIG --libs "libthai >= $LIBTHAI_REQUIRED_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBTHAI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libthai >= $LIBTHAI_REQUIRED_VERSION" 2>&1` + else + LIBTHAI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libthai >= $LIBTHAI_REQUIRED_VERSION" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBTHAI_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + LIBTHAI_CFLAGS=$pkg_cv_LIBTHAI_CFLAGS + LIBTHAI_LIBS=$pkg_cv_LIBTHAI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_libthai=true +fi +if $have_libthai; then + +$as_echo "#define HAVE_LIBTHAI 1" >>confdefs.h + + pango_save_libs=$LIBS + LIBS="$LIBS $LIBTHAI_LIBS" + for ac_func in th_brk_find_breaks +do : + ac_fn_c_check_func "$LINENO" "th_brk_find_breaks" "ac_cv_func_th_brk_find_breaks" +if test "x$ac_cv_func_th_brk_find_breaks" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TH_BRK_FIND_BREAKS 1 +_ACEOF + +fi +done + + LIBS=$pango_save_libs +fi + +# +# Checks for GObject Introspection +# + + + + + # Check whether --enable-introspection was given. +if test "${enable_introspection+set}" = set; then : + enableval=$enable_introspection; +else + enable_introspection=auto +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 +$as_echo_n "checking for gobject-introspection... " >&6; } + + case $enable_introspection in #( + no) : + found_introspection="no (disabled, use --enable-introspection to enable)" + ;; #( + yes) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 +fi + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.9.5\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.9.5") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + as_fn_error $? "You need to have gobject-introspection >= 0.9.5 installed to build pango" "$LINENO" 5 +fi + ;; #( + auto) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.9.5\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.9.5") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + found_introspection=no +fi + enable_introspection=$found_introspection + ;; #( + *) : + as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5 +$as_echo "$found_introspection" >&6; } + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + + + + + + + + + + if test "x$found_introspection" = "xyes"; then + HAVE_INTROSPECTION_TRUE= + HAVE_INTROSPECTION_FALSE='#' +else + HAVE_INTROSPECTION_TRUE='#' + HAVE_INTROSPECTION_FALSE= +fi + + + + + +# +# We use flockfile to implement pango_getline() - should be moved to GLib +# strtok_r isn't present on some systems +# +for ac_func in flockfile strtok_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +if $have_cairo ; then : ; else + if test x$enable_gtk_doc = xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cairo not present, disabling doc building" >&5 +$as_echo "$as_me: WARNING: Cairo not present, disabling doc building" >&2;} + enable_gtk_doc=no + fi +fi + + + + + gtk_doc_requires="gtk-doc >= 1.15" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 +$as_echo_n "checking for gtk-doc... " >&6; } + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_gtk_doc=yes +else + have_gtk_doc=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 +$as_echo "$have_gtk_doc" >&6; } + + if test "$have_gtk_doc" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&5 +$as_echo "$as_me: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&2;} + fi + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GTKDOC_CHECK"; then + ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH +if test -n "$GTKDOC_CHECK_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 +$as_echo "$GTKDOC_CHECK_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_REBASE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; +else + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + as_fn_error $? " + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 + fi + + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + fi + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; +else + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + + + if test x$have_gtk_doc = xyes; then + HAVE_GTK_DOC_TRUE= + HAVE_GTK_DOC_FALSE='#' +else + HAVE_GTK_DOC_TRUE='#' + HAVE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' +else + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= +fi + + + +# Check whether --enable-doc-cross-references was given. +if test "${enable_doc_cross_references+set}" = set; then : + enableval=$enable_doc_cross_references; enable_doc_cross_references=$enableval +else + enable_doc_cross_references=yes +fi + + +if test "x$enable_doc_cross_references" != xno ; then + GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" + CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`" + + +fi + if test x$enable_doc_cross_references != xno; then + ENABLE_DOC_CROSS_REFERENCES_TRUE= + ENABLE_DOC_CROSS_REFERENCES_FALSE='#' +else + ENABLE_DOC_CROSS_REFERENCES_TRUE='#' + ENABLE_DOC_CROSS_REFERENCES_FALSE= +fi + + + +# Note that -module isn't included here since automake needs to see it to know +# that something like pango-basic-fc.la is a valid libtool archive +# +LIBRARY_LIBTOOL_OPTIONS="-version-info $VERSION_INFO" +if test "$pango_platform_win32" = yes; then + # We currently use .def files on Windows + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS -no-undefined" +else + # libtool option to control which symbols are exported + # right now, symbols starting with '_' are not exported + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS "'-export-symbols-regex "^pango_.*"' +fi + + +# Check whether --enable-Bsymbolic was given. +if test "${enable_Bsymbolic+set}" = set; then : + enableval=$enable_Bsymbolic; +else + SAVED_LDFLAGS="${LDFLAGS}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bsymbolic-functions linker flag" >&5 +$as_echo_n "checking for -Bsymbolic-functions linker flag... " >&6; } + LDFLAGS=-Wl,-Bsymbolic-functions + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int main (void) { return 0; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_Bsymbolic=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + enable_Bsymbolic=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="${SAVED_LDFLAGS}" +fi + + +if test "x${enable_Bsymbolic}" = "xyes"; then + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS -Wl,-Bsymbolic-functions" +fi + + +# Check whether --enable-installed_tests was given. +if test "${enable_installed_tests+set}" = set; then : + enableval=$enable_installed_tests; +else + enable_installed_tests=no +fi + + if test x$enable_installed_tests = xyes; then + BUILDOPT_INSTALL_TESTS_TRUE= + BUILDOPT_INSTALL_TESTS_FALSE='#' +else + BUILDOPT_INSTALL_TESTS_TRUE='#' + BUILDOPT_INSTALL_TESTS_FALSE= +fi + + + + +PANGO_HIDDEN_VISIBILITY_CFLAGS="" +case "$host" in + *-*-mingw*) + +$as_echo "#define _PANGO_EXTERN __attribute__((visibility(\"default\"))) __declspec(dllexport) extern" >>confdefs.h + + CFLAGS="${CFLAGS} -fvisibility=hidden" + ;; + *) + SAVED_CFLAGS="${CFLAGS}" + CFLAGS="-fvisibility=hidden" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden compiler flag" >&5 +$as_echo_n "checking for -fvisibility=hidden compiler flag... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_fvisibility_hidden=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + enable_fvisibility_hidden=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="${SAVED_CFLAGS}" + + if test "${enable_fvisibility_hidden}" = "yes"; then : + + +$as_echo "#define _PANGO_EXTERN __attribute__((visibility(\"default\"))) extern" >>confdefs.h + + PANGO_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden" + +fi + ;; +esac + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +for ac_header in unistd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNISTD_H 1 +_ACEOF + +fi + +done + + +# Check whether MSVC toolset is explicitly set + if test x$MSVC_BASE_TOOLSET = x; then + MSVC_BASE_NO_TOOLSET_SET_TRUE= + MSVC_BASE_NO_TOOLSET_SET_FALSE='#' +else + MSVC_BASE_NO_TOOLSET_SET_TRUE='#' + MSVC_BASE_NO_TOOLSET_SET_FALSE= +fi + + if test x$MSVC_TOOLSET = x; then + MSVC_NO_TOOLSET_SET_TRUE= + MSVC_NO_TOOLSET_SET_FALSE='#' +else + MSVC_NO_TOOLSET_SET_TRUE='#' + MSVC_NO_TOOLSET_SET_FALSE= +fi + + +# Honor aclocal flags +ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" +ac_config_commands="$ac_config_commands pango/pango-features.h" + + +ac_config_files="$ac_config_files Makefile pango/Makefile pango/pango.rc pango/pangoft2.rc pango/pangowin32.rc pango/pangocairo.rc pango/pangoxft.rc utils/Makefile examples/Makefile docs/Makefile docs/version.xml tools/Makefile tests/Makefile win32/Makefile win32/vs9/Makefile win32/vs9/pango-version-paths.vsprops win32/vs10/Makefile win32/vs10/pango-version-paths.props win32/vs11/Makefile win32/vs12/Makefile win32/vs14/Makefile win32/vs15/Makefile pango.pc pangowin32.pc pangoft2.pc pangoxft.pc pangocairo.pc config.h.win32" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then + as_fn_error $? "conditional \"OS_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then + as_fn_error $? "conditional \"PLATFORM_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MS_LIB_AVAILABLE_TRUE}" && test -z "${MS_LIB_AVAILABLE_FALSE}"; then + as_fn_error $? "conditional \"MS_LIB_AVAILABLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then + as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_HARFBUZZ_TRUE}" && test -z "${HAVE_HARFBUZZ_FALSE}"; then + as_fn_error $? "conditional \"HAVE_HARFBUZZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_FREETYPE_TRUE}" && test -z "${HAVE_FREETYPE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_FREETYPE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_XFT_TRUE}" && test -z "${HAVE_XFT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_XFT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_WIN32_TRUE}" && test -z "${HAVE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"HAVE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CORE_TEXT_TRUE}" && test -z "${HAVE_CORE_TEXT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CORE_TEXT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_TRUE}" && test -z "${HAVE_CAIRO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_PNG_TRUE}" && test -z "${HAVE_CAIRO_PNG_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_PNG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_PS_TRUE}" && test -z "${HAVE_CAIRO_PS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_PS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_PDF_TRUE}" && test -z "${HAVE_CAIRO_PDF_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_XLIB_TRUE}" && test -z "${HAVE_CAIRO_XLIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_XLIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_WIN32_TRUE}" && test -z "${HAVE_CAIRO_WIN32_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_FREETYPE_TRUE}" && test -z "${HAVE_CAIRO_FREETYPE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_FREETYPE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CAIRO_QUARTZ_TRUE}" && test -z "${HAVE_CAIRO_QUARTZ_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CAIRO_QUARTZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then + as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_DOC_CROSS_REFERENCES_TRUE}" && test -z "${ENABLE_DOC_CROSS_REFERENCES_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DOC_CROSS_REFERENCES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILDOPT_INSTALL_TESTS_TRUE}" && test -z "${BUILDOPT_INSTALL_TESTS_FALSE}"; then + as_fn_error $? "conditional \"BUILDOPT_INSTALL_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MSVC_BASE_NO_TOOLSET_SET_TRUE}" && test -z "${MSVC_BASE_NO_TOOLSET_SET_FALSE}"; then + as_fn_error $? "conditional \"MSVC_BASE_NO_TOOLSET_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MSVC_NO_TOOLSET_SET_TRUE}" && test -z "${MSVC_NO_TOOLSET_SET_FALSE}"; then + as_fn_error $? "conditional \"MSVC_NO_TOOLSET_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by pango $as_me 1.42.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +pango config.status 1.42.4 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + +ac_aux_dir='$ac_aux_dir' + + + + PANGO_VERSION_MAJOR=$PANGO_VERSION_MAJOR + PANGO_VERSION_MINOR=$PANGO_VERSION_MINOR + PANGO_VERSION_MICRO=$PANGO_VERSION_MICRO + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "pango/pango-features.h") CONFIG_COMMANDS="$CONFIG_COMMANDS pango/pango-features.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "pango/Makefile") CONFIG_FILES="$CONFIG_FILES pango/Makefile" ;; + "pango/pango.rc") CONFIG_FILES="$CONFIG_FILES pango/pango.rc" ;; + "pango/pangoft2.rc") CONFIG_FILES="$CONFIG_FILES pango/pangoft2.rc" ;; + "pango/pangowin32.rc") CONFIG_FILES="$CONFIG_FILES pango/pangowin32.rc" ;; + "pango/pangocairo.rc") CONFIG_FILES="$CONFIG_FILES pango/pangocairo.rc" ;; + "pango/pangoxft.rc") CONFIG_FILES="$CONFIG_FILES pango/pangoxft.rc" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/version.xml") CONFIG_FILES="$CONFIG_FILES docs/version.xml" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + "win32/vs9/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs9/Makefile" ;; + "win32/vs9/pango-version-paths.vsprops") CONFIG_FILES="$CONFIG_FILES win32/vs9/pango-version-paths.vsprops" ;; + "win32/vs10/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs10/Makefile" ;; + "win32/vs10/pango-version-paths.props") CONFIG_FILES="$CONFIG_FILES win32/vs10/pango-version-paths.props" ;; + "win32/vs11/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs11/Makefile" ;; + "win32/vs12/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs12/Makefile" ;; + "win32/vs14/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs14/Makefile" ;; + "win32/vs15/Makefile") CONFIG_FILES="$CONFIG_FILES win32/vs15/Makefile" ;; + "pango.pc") CONFIG_FILES="$CONFIG_FILES pango.pc" ;; + "pangowin32.pc") CONFIG_FILES="$CONFIG_FILES pangowin32.pc" ;; + "pangoft2.pc") CONFIG_FILES="$CONFIG_FILES pangoft2.pc" ;; + "pangoxft.pc") CONFIG_FILES="$CONFIG_FILES pangoxft.pc" ;; + "pangocairo.pc") CONFIG_FILES="$CONFIG_FILES pangocairo.pc" ;; + "config.h.win32") CONFIG_FILES="$CONFIG_FILES config.h.win32" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + "pango/pango-features.h":C) featuresfile=pango/pango-features.h + outfile=$featuresfile.tmp + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $featuresfile" >&5 +$as_echo "$as_me: creating $featuresfile" >&6;} + cat >$outfile <<_EOF +/* Generated by configure. Do not edit */ +#ifndef PANGO_FEATURES_H +#define PANGO_FEATURES_H + +#define PANGO_VERSION_MAJOR $PANGO_VERSION_MAJOR +#define PANGO_VERSION_MINOR $PANGO_VERSION_MINOR +#define PANGO_VERSION_MICRO $PANGO_VERSION_MICRO + +#define PANGO_VERSION_STRING "$PANGO_VERSION_MAJOR.$PANGO_VERSION_MINOR.$PANGO_VERSION_MICRO" + +_EOF + # TODO: define macros for enabled features/backends here + + echo '' >>$outfile + echo '#endif' >>$outfile + + if cmp -s $outfile $featuresfile; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $featuresfile is unchanged" >&5 +$as_echo "$as_me: $featuresfile is unchanged" >&6;} + rm -f $outfile + else + mv $outfile $featuresfile + fi + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +backends="" +if $have_cairo ; then backends="$backends Cairo"; fi +if $have_win32 ; then backends="$backends Win32"; fi +if test "x$with_xft" = xyes && $have_xft ; then backends="$backends Xft"; fi +if $have_freetype && $have_fontconfig ; then backends="$backends FreeType"; fi + +echo "configuration: + backends:$backends" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..609eeed --- /dev/null +++ b/configure.ac @@ -0,0 +1,704 @@ +dnl Process this file with autoconf to create configure. +AC_PREREQ(2.56) + +dnl ========================================================================== +dnl Versioning +dnl ========================================================================== + +dnl Making releases: +dnl PANGO_VERSION_MICRO += 1; +dnl PANGO_INTERFACE_AGE += 1; +dnl PANGO_BINARY_AGE += 1; +dnl if any functions have been added, set PANGO_INTERFACE_AGE to 0. +dnl if backwards compatibility has been broken, +dnl set PANGO_BINARY_AGE _and_ PANGO_INTERFACE_AGE to 0. + +dnl +dnl We do the version number components as m4 macros +dnl so that we can base configure --help output off +dnl of them. +dnl + +dnl The triplet +m4_define([pango_version_major], [1]) +m4_define([pango_version_minor], [42]) +m4_define([pango_version_micro], [4]) + +m4_define([pango_version], + [pango_version_major.pango_version_minor.pango_version_micro]) +dnl The X.Y in -lpango-X.Y line. This is expected to stay 1.0 until Pango 2. +m4_define([pango_api_version], [1.0]) +m4_if(m4_eval(pango_version_minor % 2), [1], + [ + dnl for unstable releases + m4_define([pango_interface_age], [0]) + ], + [ + dnl for stable releases + m4_define([pango_interface_age], pango_version_micro) + ]) +dnl Number of releases since we've broken binary compatibility. +m4_define([pango_binary_age], + [m4_eval(100 * pango_version_minor + pango_version_micro)]) + + +AC_INIT(pango, pango_version(), + [http://bugzilla.gnome.org/enter_bug.cgi?product=pango]) + +AC_CONFIG_SRCDIR([pango.pc.in]) + +dnl -Wno-portability tells automake to stop complaining about the +dnl usage of GNU Make specific features. +AM_INIT_AUTOMAKE(1.9 gnits dist-xz no-dist-gzip -Wno-portability) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +AC_CONFIG_HEADERS([config.h]) + + +PANGO_VERSION_MAJOR=pango_version_major() +PANGO_VERSION_MINOR=pango_version_minor() +PANGO_VERSION_MICRO=pango_version_micro() +PANGO_VERSION=pango_version() +PANGO_API_VERSION=pango_api_version() +PANGO_INTERFACE_AGE=pango_interface_age() +PANGO_BINARY_AGE=pango_binary_age() + +AC_SUBST(PANGO_VERSION_MAJOR) +AC_SUBST(PANGO_VERSION_MINOR) +AC_SUBST(PANGO_VERSION_MICRO) +AC_SUBST(PANGO_VERSION) +AC_SUBST(PANGO_API_VERSION) +AC_SUBST(PANGO_INTERFACE_AGE) +AC_SUBST(PANGO_BINARY_AGE) + +AC_DEFINE(PANGO_BINARY_AGE, pango_binary_age(), [PANGO binary age]) +AC_DEFINE(PANGO_INTERFACE_AGE, pango_interface_age(), [PANGO interface age]) +AC_DEFINE(PANGO_VERSION_MAJOR, pango_version_major(), [PANGO major version]) +AC_DEFINE(PANGO_VERSION_MINOR, pango_version_minor(), [PANGO minor version]) +AC_DEFINE(PANGO_VERSION_MICRO, pango_version_micro(), [PANGO micro version]) + +dnl libtool versioning +m4_define([lt_current], [m4_eval(100 * pango_version_minor + pango_version_micro - pango_interface_age)]) +m4_define([lt_revision], [pango_interface_age]) +m4_define([lt_age], [m4_eval(pango_binary_age - pango_interface_age)]) +VERSION_INFO="lt_current():lt_revision():lt_age()" +PANGO_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age) + +AC_SUBST(PANGO_CURRENT_MINUS_AGE) + +dnl ========================================================================== + +AC_CANONICAL_HOST + +AC_MSG_CHECKING([for native Win32]) +case "$host" in + *-*-mingw*) + pango_os_win32=yes + case "$host" in + x86_64-*-*) + LIB_EXE_MACHINE_FLAG=X64 + ;; + *) + LIB_EXE_MACHINE_FLAG=X86 + ;; + esac + ;; + *) + pango_os_win32=no + ;; +esac +AC_MSG_RESULT([$pango_os_win32]) + +AC_SUBST(LIB_EXE_MACHINE_FLAG) + +AM_CONDITIONAL(OS_WIN32, test "$pango_os_win32" = "yes") + +AC_PROG_CC + +dnl +dnl Check for a working C++ compiler, but do not bail out, if none is found. +dnl We use this for an automated test for C++ header correctness. +dnl +AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=) +AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "") +AC_LANG_RESTORE + + + + +AC_CHECK_FUNCS(sysconf getpagesize) +AC_CHECK_HEADERS(unistd.h sys/mman.h) + + +# +# Win32 stuff +# + +AC_LIBTOOL_WIN32_DLL +AM_DISABLE_STATIC + +AM_PROG_LIBTOOL +dnl when using libtool 2.x create libtool early, because it's used in configure +m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) + +AC_MSG_CHECKING([for some Win32 platform]) +case "$host" in + *-*-mingw*|*-*-cygwin*) + pango_platform_win32=yes + ;; + *) + pango_platform_win32=no + ;; +esac +AC_MSG_RESULT([$pango_platform_win32]) +AM_CONDITIONAL(PLATFORM_WIN32, test "$pango_platform_win32" = "yes") + +if test "$pango_platform_win32" = "yes"; then + AC_CHECK_TOOL(WINDRES, windres, no) + if test "$WINDRES" = no; then + AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.]) + fi + AC_CHECK_PROG(ms_librarian, lib.exe, yes, no) +fi +AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes) + +changequote(,)dnl +if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[\ \ ]-Wall[\ \ ]*) ;; + *) CFLAGS="$CFLAGS -Wall" ;; + esac +fi +changequote([,])dnl + +dnl declare --enable-* args and collect ac_help strings + +m4_define([debug_default], + m4_if(m4_eval(pango_version_minor() % 2), [1], [yes], [minimum])) + +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@], + [turn on debugging @<:@default=debug_default()@:>@]), + , + enable_debug=debug_default()) + +if test "x$enable_debug" = "xyes"; then + PANGO_DEBUG_FLAGS="-DPANGO_ENABLE_DEBUG" +else + PANGO_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS" + + if test "x$enable_debug" = "xno"; then + PANGO_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS $PANGO_DEBUG_FLAGS" + fi +fi + +AC_SUBST(PANGO_DEBUG_FLAGS) + +AC_ARG_ENABLE(rebuilds, + [AC_HELP_STRING([--disable-rebuilds], + [disable all source autogeneration rules])],, + [enable_rebuilds=yes]) + +AM_CONDITIONAL(CROSS_COMPILING, [test $cross_compiling = yes]) + + +# +# Checks for HarfBuzz +# +have_harfbuzz=false +PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= 1.4.2, have_harfbuzz=true, :) +AM_CONDITIONAL(HAVE_HARFBUZZ, $have_harfbuzz) + +# +# Check for fontconfig +# +have_fontconfig=false +if $have_harfbuzz ; then + PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.11.91, have_fontconfig=true, :) +fi +if $have_fontconfig ; then + pango_save_libs=$LIBS + LIBS="$LIBS $FONTCONFIG_LIBS" + AC_CHECK_FUNCS(FcWeightFromOpenTypeDouble) + LIBS=$pango_save_libs +fi + +# +# Checks for FreeType +# +have_freetype=false +if $have_fontconfig ; then + # The first version of freetype with a .pc file is 2.1.5. That's recent + # enough for all the functions we use I guess. No version check needed. + PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, :) +fi +if $have_freetype ; then + AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) +fi +AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) + +# +# Checks for Xft/XRender +# +have_xft=false +AC_ARG_WITH(xft, + AS_HELP_STRING([--with-xft], [build xft backend]), + [], [with_xft=yes]) +if $have_freetype ; then + PKG_CHECK_MODULES(XFT, xft >= 2.0.0 xrender, have_xft=true, :) +fi +if test "x$with_xft" = xyes && $have_xft ; then + AC_DEFINE(HAVE_XFT, 1, [Have Xft library]) +fi +AM_CONDITIONAL(HAVE_XFT, test "x$with_xft" = xyes && $have_xft ) + +# +# Checks for Win32 +# +have_win32=false +# The following doesn't work with autoconf-2.13, so we check $host instead +# AC_CHECK_LIB(gdi32, GetTextMetricsA@8, have_win32=true, : ) +case "$host" in + *-*-mingw*|*-*-cygwin*) have_win32=true ;; +esac +AM_CONDITIONAL(HAVE_WIN32, $have_win32) + +# Ensure MSVC-compatible struct packing convention is used when +# compiling for Win32 with gcc. +# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while +# gcc2 uses "-fnative-struct". +if test "$pango_os_win32" = "yes"; then + if test x"$GCC" = xyes; then + msnative_struct='' + AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in + 2.) + if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then + msnative_struct='-fnative-struct' + fi + ;; + *) + if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then + msnative_struct='-mms-bitfields' + fi + ;; + esac + if test x"$msnative_struct" = x ; then + AC_MSG_RESULT([no way]) + AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code]) + else + CFLAGS="$CFLAGS $msnative_struct" + AC_MSG_RESULT([${msnative_struct}]) + fi + fi +fi + +# +# Checks for CoreText +# + +AC_MSG_CHECKING([for CoreText availability]) +pango_save_libs=$LIBS +LIBS="$LIBS -framework ApplicationServices" +AC_TRY_LINK([#include ], [CTGetCoreTextVersion ();], +[have_core_text=yes], [have_core_text=no]) +LIBS=$pango_save_libs + +if test "$have_core_text" = "yes"; then + AC_DEFINE(HAVE_CORE_TEXT, 1, [Whether CoreText is available on the system]) +fi + +AC_MSG_RESULT([$have_core_text]) + +AM_CONDITIONAL(HAVE_CORE_TEXT, test "$have_core_text" = "yes") + +# +# Checks for Cairo +# +have_cairo=false +have_cairo_png=false +have_cairo_ps=false +have_cairo_pdf=false +have_cairo_xlib=false +have_cairo_freetype=false +have_cairo_win32=false +have_cairo_quartz=false +cairo_required=1.12.10 + +AC_ARG_WITH(cairo, + AS_HELP_STRING([--without-cairo], [Do not use cairo]), + :, with_cairo=auto) +AS_IF([test x$with_cairo != xno], [ + PKG_CHECK_MODULES(CAIRO, cairo >= $cairo_required, have_cairo=true, :) +]) + +if $have_cairo ; then + pango_save_libs=$LIBS + LIBS="$LIBS $CAIRO_LIBS" + pango_save_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS $CAIRO_LIBS" + + have_cairo=false + cairo_font_backends="" + + if $have_freetype; then + PKG_CHECK_EXISTS(cairo-ft >= $cairo_required, have_cairo_freetype=true, :) + fi + if $have_cairo_freetype; then + AC_DEFINE(HAVE_CAIRO_FREETYPE, 1, [Whether Cairo can use FreeType for fonts]) + cairo_font_backends="freetype $cairo_font_backends" + have_cairo=true + fi + + if $have_win32; then + PKG_CHECK_EXISTS(cairo-win32 >= $cairo_required, have_cairo_win32=true, :) + fi + if $have_cairo_win32; then + AC_DEFINE(HAVE_CAIRO_WIN32, 1, [Whether Cairo can use the Win32 GDI for fonts]) + cairo_font_backends="win32 $cairo_font_backends" + have_cairo=true + fi + + if test $have_core_text; then + PKG_CHECK_EXISTS(cairo-quartz-font >= $cairo_required, have_cairo_quartz=true, :) + fi + if $have_cairo_quartz; then + AC_DEFINE(HAVE_CAIRO_QUARTZ, 1, [Whether Cairo can use Quartz for fonts]) + cairo_font_backends="quartz $cairo_font_backends" + have_cairo=true + fi + + AC_MSG_CHECKING([which cairo font backends could be used]) + if $have_cairo ; then + AC_MSG_RESULT([$cairo_font_backends]) + else + if test x${with_cairo} != xauto; then + AC_MSG_ERROR([cairo support requested, but not present]) + fi + AC_MSG_RESULT([none]) + AC_MSG_NOTICE([Disabling cairo support]) + fi + + if $have_cairo ; then + AC_DEFINE(HAVE_CAIRO, 1, [Have usable Cairo library and font backend]) + + PKG_CHECK_EXISTS(cairo-png >= $cairo_required, have_cairo_png=true, :) + if $have_cairo_png; then + AC_DEFINE(HAVE_CAIRO_PNG, 1, [Whether Cairo has PNG support]) + fi + + PKG_CHECK_EXISTS(cairo-ps >= $cairo_required, have_cairo_ps=true, :) + if $have_cairo_ps; then + AC_DEFINE(HAVE_CAIRO_PS, 1, [Whether Cairo has PS support]) + fi + + PKG_CHECK_EXISTS(cairo-pdf >= $cairo_required, have_cairo_pdf=true, :) + if $have_cairo_pdf; then + AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether Cairo has PDF support]) + fi + + PKG_CHECK_EXISTS(cairo-xlib >= $cairo_required, have_cairo_xlib=true, :) + if $have_cairo_xlib; then + AC_DEFINE(HAVE_CAIRO_XLIB, 1, [Whether Cairo has Xlib support]) + fi + fi + + LIBS=$pango_save_libs + LDFLAGS=$pango_save_ldflags + + PKGCONFIG_CAIRO_REQUIRES= + if $have_cairo_freetype; then + PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangoft2" + fi + if $have_cairo_win32; then + PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangowin32" + fi + AC_SUBST(PKGCONFIG_CAIRO_REQUIRES) +fi + +# To compensate for Meson builds on MSVC where pkg-config files may well not be +# available for cairo, harfbuzz, freetype2 and fontconfig +CAIRO_PC="cairo" +FREETYPE2_PC="freetype2" +FONTCONFIG_PC="fontconfig" +HARFBUZZ_PC="harfbuzz" +AC_SUBST(CAIRO_PC) +AC_SUBST(FREETYPE2_PC) +AC_SUBST(FONTCONFIG_PC) +AC_SUBST(HARFBUZZ_PC) +CAIRO_LIB= +FREETYPE2_LIB= +FONTCONFIG_LIB= +HARFBUZZ_LIB= +AC_SUBST(CAIRO_LIB) +AC_SUBST(FREETYPE2_LIB) +AC_SUBST(FONTCONFIG_LIB) +AC_SUBST(HARFBUZZ_LIB) + +AM_CONDITIONAL(HAVE_CAIRO, $have_cairo) +AM_CONDITIONAL(HAVE_CAIRO_PNG, $have_cairo_png) +AM_CONDITIONAL(HAVE_CAIRO_PS, $have_cairo_ps) +AM_CONDITIONAL(HAVE_CAIRO_PDF, $have_cairo_pdf) +AM_CONDITIONAL(HAVE_CAIRO_XLIB, $have_cairo_xlib) +AM_CONDITIONAL(HAVE_CAIRO_WIN32, $have_cairo_win32) +AM_CONDITIONAL(HAVE_CAIRO_FREETYPE, $have_cairo_freetype) +AM_CONDITIONAL(HAVE_CAIRO_QUARTZ, $have_cairo_quartz) + + +# +# We must have some backend defined +# +if $have_freetype || `test "x$with_xft" = xyes && $have_xft` || $have_cairo || $have_win32 ; then : ; else + AC_MSG_ERROR([*** Could not enable any backends. +*** Must have at least one backend to build Pango.]) +fi + +# +# Checks for GLib +# +GLIB_REQUIRED_VERSION=2.33.12 +GLIB_MODULES="glib-2.0 >= $GLIB_REQUIRED_VERSION gobject-2.0 gthread-2.0" + +PKG_CHECK_MODULES(GLIB, $GLIB_MODULES, :, + AC_MSG_ERROR([ +*** Glib $GLIB_REQUIRED_VERSION or better is required. The latest version of +*** Glib is always available from ftp://ftp.gtk.org/.])) + +# Setup GLIB_MKENUMS to use glib-mkenums even if GLib is uninstalled. +GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` +AC_SUBST(GLIB_MKENUMS) + +# Checks for FriBiDi +FRIBIDI_REQUIRED_VERSION=0.19.7 +PKG_CHECK_MODULES(FRIBIDI, fribidi >= $FRIBIDI_REQUIRED_VERSION) + +# +# Checks for LibThai +# +LIBTHAI_REQUIRED_VERSION=0.1.9 +have_libthai=false +PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=true, :) +if $have_libthai; then + AC_DEFINE(HAVE_LIBTHAI, 1, [Whether libthai is available]) + pango_save_libs=$LIBS + LIBS="$LIBS $LIBTHAI_LIBS" + AC_CHECK_FUNCS(th_brk_find_breaks) + LIBS=$pango_save_libs +fi + +# +# Checks for GObject Introspection +# + +GOBJECT_INTROSPECTION_CHECK([0.9.5]) + + +# +# We use flockfile to implement pango_getline() - should be moved to GLib +# strtok_r isn't present on some systems +# +AC_CHECK_FUNCS(flockfile strtok_r) + +dnl ************************** +dnl *** Checks for gtk-doc *** +dnl ************************** + +if $have_cairo ; then : ; else + if test x$enable_gtk_doc = xyes ; then + AC_MSG_WARN([Cairo not present, disabling doc building]) + enable_gtk_doc=no + fi +fi + +GTK_DOC_CHECK([1.15], [--flavour no-tmpl]) + +AC_ARG_ENABLE(doc-cross-references, + AC_HELP_STRING([--disable-doc-cross-references], + [cross reference glib and cairo symbols @<:@default=yes@:>@]), + enable_doc_cross_references=$enableval, + enable_doc_cross_references=yes) + +if test "x$enable_doc_cross_references" != xno ; then + GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" + CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`" + AC_SUBST(GLIB_PREFIX) + AC_SUBST(CAIRO_PREFIX) +fi +AM_CONDITIONAL(ENABLE_DOC_CROSS_REFERENCES, test x$enable_doc_cross_references != xno) + +dnl ******************************************************** +dnl * Options to pass to libtool +dnl ******************************************************** + +# Note that -module isn't included here since automake needs to see it to know +# that something like pango-basic-fc.la is a valid libtool archive +# +LIBRARY_LIBTOOL_OPTIONS="-version-info $VERSION_INFO" +if test "$pango_platform_win32" = yes; then + # We currently use .def files on Windows + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS -no-undefined" +else + # libtool option to control which symbols are exported + # right now, symbols starting with '_' are not exported + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS "'-export-symbols-regex "^pango_.*"' +fi +AC_SUBST(LIBRARY_LIBTOOL_OPTIONS) + +dnl +dnl Check for -Bsymbolic-functions linker flag used to avoid +dnl intra-library PLT jumps, if available. +dnl +AC_ARG_ENABLE(Bsymbolic, + [AS_HELP_STRING([--disable-Bsymbolic], + [avoid linking with -Bsymbolic])],, + [SAVED_LDFLAGS="${LDFLAGS}" + AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) + LDFLAGS=-Wl,-Bsymbolic-functions + AC_TRY_LINK([], [int main (void) { return 0; }], + AC_MSG_RESULT(yes) + enable_Bsymbolic=yes, + AC_MSG_RESULT(no) + enable_Bsymbolic=no) + LDFLAGS="${SAVED_LDFLAGS}"]) + +if test "x${enable_Bsymbolic}" = "xyes"; then + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS -Wl,-Bsymbolic-functions" +fi + +dnl ******************************************************** +dnl * Installed test * +dnl ******************************************************** + +AC_ARG_ENABLE(installed_tests, + AS_HELP_STRING([--enable-installed-tests], + [Install test programs (default: no)]),, + [enable_installed_tests=no]) +AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes) + + +dnl ********************************************************************* +dnl * Check for -fvisibility=hidden to determine if we can do GNU-style * +dnl * visibility attributes for symbol export control * +dnl ********************************************************************* + +PANGO_HIDDEN_VISIBILITY_CFLAGS="" +case "$host" in + *-*-mingw*) + dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport) + AC_DEFINE([_PANGO_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern], + [defines how to decorate public symbols while building]) + CFLAGS="${CFLAGS} -fvisibility=hidden" + ;; + *) + dnl on other compilers, check if we can do -fvisibility=hidden + SAVED_CFLAGS="${CFLAGS}" + CFLAGS="-fvisibility=hidden" + AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) + AC_TRY_COMPILE([], [return 0], + AC_MSG_RESULT(yes) + enable_fvisibility_hidden=yes, + AC_MSG_RESULT(no) + enable_fvisibility_hidden=no) + CFLAGS="${SAVED_CFLAGS}" + + AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [ + AC_DEFINE([_PANGO_EXTERN], [__attribute__((visibility("default"))) extern], + [defines how to decorate public symbols while building]) + PANGO_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden" + ]) + ;; +esac +AC_SUBST(PANGO_HIDDEN_VISIBILITY_CFLAGS) + + +AC_HEADER_DIRENT +AC_CHECK_HEADERS(unistd.h) + +# Check whether MSVC toolset is explicitly set +AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x]) +AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x]) + +# Honor aclocal flags +ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" +dnl =========================================================================== +AC_CONFIG_COMMANDS([pango/pango-features.h], + [featuresfile=pango/pango-features.h + outfile=$featuresfile.tmp + AC_MSG_NOTICE([creating $featuresfile]) + cat >$outfile <<_EOF +/* Generated by configure. Do not edit */ +#ifndef PANGO_FEATURES_H +#define PANGO_FEATURES_H + +#define PANGO_VERSION_MAJOR $PANGO_VERSION_MAJOR +#define PANGO_VERSION_MINOR $PANGO_VERSION_MINOR +#define PANGO_VERSION_MICRO $PANGO_VERSION_MICRO + +#define PANGO_VERSION_STRING "$PANGO_VERSION_MAJOR.$PANGO_VERSION_MINOR.$PANGO_VERSION_MICRO" + +_EOF + # TODO: define macros for enabled features/backends here + + echo '' >>$outfile + echo '#endif' >>$outfile + + if cmp -s $outfile $featuresfile; then + AC_MSG_NOTICE([$featuresfile is unchanged]) + rm -f $outfile + else + mv $outfile $featuresfile + fi +],[ + PANGO_VERSION_MAJOR=$PANGO_VERSION_MAJOR + PANGO_VERSION_MINOR=$PANGO_VERSION_MINOR + PANGO_VERSION_MICRO=$PANGO_VERSION_MICRO +]) + +AC_CONFIG_FILES([ +Makefile +pango/Makefile +pango/pango.rc +pango/pangoft2.rc +pango/pangowin32.rc +pango/pangocairo.rc +pango/pangoxft.rc +utils/Makefile +examples/Makefile +docs/Makefile +docs/version.xml +tools/Makefile +tests/Makefile +win32/Makefile +win32/vs9/Makefile +win32/vs9/pango-version-paths.vsprops +win32/vs10/Makefile +win32/vs10/pango-version-paths.props +win32/vs11/Makefile +win32/vs12/Makefile +win32/vs14/Makefile +win32/vs15/Makefile +pango.pc +pangowin32.pc +pangoft2.pc +pangoxft.pc +pangocairo.pc +config.h.win32 +]) + +AC_OUTPUT + +backends="" +if $have_cairo ; then backends="$backends Cairo"; fi +if $have_win32 ; then backends="$backends Win32"; fi +if test "x$with_xft" = xyes && $have_xft ; then backends="$backends Xft"; fi +if $have_freetype && $have_fontconfig ; then backends="$backends FreeType"; fi + +echo "configuration: + backends:$backends" diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..30379e2 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#!/bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..5826356 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,143 @@ +## Process this file with automake to create Makefile.in. + +# The name of the module. +DOC_MODULE=pango + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=pango-docs.sgml + +# Extra options to supply to gtkdoc-scan +SCAN_OPTIONS=--deprecated-guards="PANGO_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# The directory containing the source code. Relative to $(srcdir) +DOC_SOURCE_DIR=../pango + +# Used for dependencies +HFILE_GLOB=$(top_srcdir)/pango/*.h +CFILE_GLOB=$(top_srcdir)/pango/*.c + +# Headers to ignore +IGNORE_HFILES= \ + pangoatsui-private.h \ + pangocairo-private.h \ + pangocairo-fc.h \ + pangocairo-win32.h \ + pangocairo-atsui.h \ + pango-color-table.h \ + pango-engine-private.h \ + pango-impl-utils.h \ + pango-glyph-item-private.h \ + pango-layout-private.h \ + pango-script-table.h \ + pango-script-private.h \ + pangofc-private.h \ + pangoft2-private.h \ + pangowin32-private.h \ + pangoatsui-private.h \ + pangox-private.h \ + pangoxft-private.h \ + pango-ot-private.h \ + pango-script-lang-table.h \ + pango-language-sample-table.h \ + pangocoretext-private.h \ + pangoatsui-private.h + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +INCLUDES = \ + -DPANGO_ENABLE_BACKEND \ + -DPANGO_ENABLE_ENGINE \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(X_CFLAGS) + +# We're assuming here that we'll only regenerate the +# HTML docs on Unix. We don't get introspection on Win32 +# specific types, but that isn't a big deal. + +GTKDOC_LIBS = $(top_builddir)/pango/libpango-1.0.la + +if HAVE_FREETYPE +GTKDOC_LIBS += $(top_builddir)/pango/libpangoft2-1.0.la +endif + +if HAVE_XFT +GTKDOC_LIBS += $(top_builddir)/pango/libpangoxft-1.0.la +endif + +if HAVE_CAIRO +GTKDOC_LIBS += $(top_builddir)/pango/libpangocairo-1.0.la +endif + +GTKDOC_LIBS += $(GLIB_LIBS) + +# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) +content_files = \ + pango_markup.sgml \ + version.xml + +# Images to copy into HTML directory +HTML_IMAGES = \ + layout.gif \ + rotated-text.png + +if ENABLE_DOC_CROSS_REFERENCES +# Extra options to supply to gtkdoc-fixref +FIXXREF_OPTIONS=--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ + --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo +endif + +include $(top_srcdir)/gtk-doc.make + +# This line really belongs in gtk-doc.mk +$(REPORT_FILES): sgml-build.stamp + +pango.types: + @echo "Rebuilding $@" + @LANG=C; LIST=$$(grep 'pango_[_a-zA-Z0-9]*_get_type' $(HFILE_GLOB) | grep -v '\(private\|atsui\|core_text\|win32\)' | sed 's/\([^:]*:\).*\(pango[_a-zA-Z0-9]*_get_type\).*/\1\2/') && \ + echo "$$LIST" | sed 's/.*\/\(pango\/.*\):.*/#include <\1>/' | sort -u > $@.tmp && \ + echo >> $@.tmp && \ + echo "$$LIST" | cut -d : -f 2 | sort -u >> $@.tmp && \ + mv $@.tmp $@ + +BUILT_SOURCES = pango.types + +######################################################################## + +MAINTAINERCLEANFILES = $(BUILT_SOURCES) +EXTRA_DIST += \ + layout.fig \ + layout.eps \ + version.xml.in \ + check.docs \ + pango.types + +# force doc rebulid after configure +dist-hook-local: dist-local-check-no-cross-references all-local + +# +# Require gtk-doc when making dist +# +if ENABLE_DOC_CROSS_REFERENCES +dist-local-check-no-cross-references: + @echo "*** --disable-doc-cross-references must be used in order to make dist" + @false +else +dist-local-check-no-cross-references: +endif + +.PHONY: dist-local-check-no-cross-references + +if ENABLE_GTK_DOC +TESTS = check.docs +TESTS_ENVIRONMENT = srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" MAKE="$(MAKE) $(AM_MAKEFLAGS)" DOC_MODULE="$(DOC_MODULE)" REPORT_FILES="$(REPORT_FILES)" +endif + +-include $(top_srcdir)/git.mk diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100644 index 0000000..1fb6ae7 --- /dev/null +++ b/docs/Makefile.in @@ -0,0 +1,1299 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_FREETYPE_TRUE@am__append_1 = $(top_builddir)/pango/libpangoft2-1.0.la +@HAVE_XFT_TRUE@am__append_2 = $(top_builddir)/pango/libpangoxft-1.0.la +@HAVE_CAIRO_TRUE@am__append_3 = $(top_builddir)/pango/libpangocairo-1.0.la +subdir = docs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = version.xml +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.xml.in \ + $(top_srcdir)/gtk-doc.make $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# The name of the module. +DOC_MODULE = pango + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = pango-docs.sgml + +# Extra options to supply to gtkdoc-scan +SCAN_OPTIONS = --deprecated-guards="PANGO_DISABLE_DEPRECATED" + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --output-format=xml + +# The directory containing the source code. Relative to $(srcdir) +DOC_SOURCE_DIR = ../pango + +# Used for dependencies +HFILE_GLOB = $(top_srcdir)/pango/*.h +CFILE_GLOB = $(top_srcdir)/pango/*.c + +# Headers to ignore +IGNORE_HFILES = \ + pangoatsui-private.h \ + pangocairo-private.h \ + pangocairo-fc.h \ + pangocairo-win32.h \ + pangocairo-atsui.h \ + pango-color-table.h \ + pango-engine-private.h \ + pango-impl-utils.h \ + pango-glyph-item-private.h \ + pango-layout-private.h \ + pango-script-table.h \ + pango-script-private.h \ + pangofc-private.h \ + pangoft2-private.h \ + pangowin32-private.h \ + pangoatsui-private.h \ + pangox-private.h \ + pangoxft-private.h \ + pango-ot-private.h \ + pango-script-lang-table.h \ + pango-language-sample-table.h \ + pangocoretext-private.h \ + pangoatsui-private.h + + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +INCLUDES = \ + -DPANGO_ENABLE_BACKEND \ + -DPANGO_ENABLE_ENGINE \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(X_CFLAGS) + + +# We're assuming here that we'll only regenerate the +# HTML docs on Unix. We don't get introspection on Win32 +# specific types, but that isn't a big deal. +GTKDOC_LIBS = $(top_builddir)/pango/libpango-1.0.la $(am__append_1) \ + $(am__append_2) $(am__append_3) $(GLIB_LIBS) + +# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) +content_files = \ + pango_markup.sgml \ + version.xml + + +# Images to copy into HTML directory +HTML_IMAGES = \ + layout.gif \ + rotated-text.png + + +# Extra options to supply to gtkdoc-fixref +@ENABLE_DOC_CROSS_REFERENCES_TRUE@FIXXREF_OPTIONS = --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \ +@ENABLE_DOC_CROSS_REFERENCES_TRUE@ --extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo + +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) layout.fig layout.eps \ + version.xml.in check.docs pango.types +DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test +@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp + +#### setup #### +GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) +GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; + +#### scan #### +GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) +GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; +GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) +GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; + +#### xml #### +GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) +GTK_DOC_V_XML_0 = @echo " DOC Building XML"; + +#### html #### +GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) +GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; +GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) +GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; + +#### pdf #### +GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) +GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; +BUILT_SOURCES = pango.types + +######################################################################## +MAINTAINERCLEANFILES = $(BUILT_SOURCES) +@ENABLE_GTK_DOC_TRUE@TESTS = check.docs +@ENABLE_GTK_DOC_TRUE@TESTS_ENVIRONMENT = srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" MAKE="$(MAKE) $(AM_MAKEFLAGS)" DOC_MODULE="$(DOC_MODULE)" REPORT_FILES="$(REPORT_FILES)" +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .log .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits docs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits docs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/gtk-doc.make $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +check.docs.log: check.docs + @p='check.docs'; \ + b='check.docs'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +@ENABLE_GTK_DOC_FALSE@all-local: +all-am: Makefile all-local +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: all check check-am install install-am install-strip + +.PHONY: all all-am all-local check check-TESTS check-am clean \ + clean-generic clean-libtool clean-local cscopelist-am ctags-am \ + dist-hook distclean distclean-generic distclean-libtool \ + distclean-local distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic maintainer-clean-local mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags-am uninstall uninstall-am uninstall-local + +.PRECIOUS: Makefile + + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs +@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" +@HAVE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# This line really belongs in gtk-doc.mk +$(REPORT_FILES): sgml-build.stamp + +pango.types: + @echo "Rebuilding $@" + @LANG=C; LIST=$$(grep 'pango_[_a-zA-Z0-9]*_get_type' $(HFILE_GLOB) | grep -v '\(private\|atsui\|core_text\|win32\)' | sed 's/\([^:]*:\).*\(pango[_a-zA-Z0-9]*_get_type\).*/\1\2/') && \ + echo "$$LIST" | sed 's/.*\/\(pango\/.*\):.*/#include <\1>/' | sort -u > $@.tmp && \ + echo >> $@.tmp && \ + echo "$$LIST" | cut -d : -f 2 | sort -u >> $@.tmp && \ + mv $@.tmp $@ + +# force doc rebulid after configure +dist-hook-local: dist-local-check-no-cross-references all-local + +# +# Require gtk-doc when making dist +# +@ENABLE_DOC_CROSS_REFERENCES_TRUE@dist-local-check-no-cross-references: +@ENABLE_DOC_CROSS_REFERENCES_TRUE@ @echo "*** --disable-doc-cross-references must be used in order to make dist" +@ENABLE_DOC_CROSS_REFERENCES_TRUE@ @false +@ENABLE_DOC_CROSS_REFERENCES_FALSE@dist-local-check-no-cross-references: + +.PHONY: dist-local-check-no-cross-references + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/check.docs b/docs/check.docs new file mode 100755 index 0000000..8eb5fe1 --- /dev/null +++ b/docs/check.docs @@ -0,0 +1,57 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +if test -z "$DOC_MODULE"; then + # extract from Makefile + eval `grep '^DOC_MODULE' Makefile | sed 's/ //g'` + if test -z "$DOC_MODULE"; then + echo Failed extracting DOC_MODULE from Makefile 1>&2 + echo Try setting DOC_MODULE env var manually 1>&2 + exit 1 + fi +fi + +if test -n "$REPORT_FILES"; then + $MAKE $REPORT_FILES || exit 1 +fi + +test -z "$srcdir" && srcdir=. +stat=0 + +if test -f "$DOC_MODULE-undeclared.txt"; then + undeclared=`cat "$DOC_MODULE-undeclared.txt"` + if test -n "$undeclared"; then + echo Undeclared documentation symbols: 1>&2 + cat "$DOC_MODULE-undeclared.txt" 1>&2 + stat=1 + fi +fi >&2 +if test -f "$DOC_MODULE-unused.txt"; then + unused=`cat "$DOC_MODULE-unused.txt"` + if test -n "$unused"; then + echo Unused documentated symbols: 1>&2 + cat "$DOC_MODULE-unused.txt" 1>&2 + stat=1 + fi +fi >&2 +if test -f "$DOC_MODULE-undocumented.txt"; then + if grep '^0 symbols incomplete' "$DOC_MODULE-undocumented.txt" >/dev/null && + grep '^0 not documented' "$DOC_MODULE-undocumented.txt" >/dev/null; then + : + else + echo Incomplete or undocumented symbols: 1>&2 + cat "$DOC_MODULE-undocumented.txt" 1>&2 + stat=1 + fi +fi >&2 + +# Make failure non-critical for now since this is broken +if test $stat == 1; then + echo "**********************************************" + echo "checks.docs failed, but we ignore this for now" + echo "**********************************************" +fi +# exit $stat + diff --git a/docs/html/PangoEngineLang.html b/docs/html/PangoEngineLang.html new file mode 100644 index 0000000..46052f5 --- /dev/null +++ b/docs/html/PangoEngineLang.html @@ -0,0 +1,227 @@ + + + + +PangoEngineLang: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoEngineLang

+

PangoEngineLang — Rendering-system independent script engines

+
+
+

Stability Level

+Unstable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
#define +PANGO_ENGINE_LANG_DEFINE_TYPE() +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
 PangoEngineLang
structPangoEngineLangClass
#definePANGO_ENGINE_TYPE_LANG
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoEngine
+        ╰── PangoEngineLang
+
+
+
+

Description

+

The language engines are rendering-system independent +engines that determine line, word, and character breaks for character strings. +These engines are used in pango_break().

+
+
+

Functions

+
+

PANGO_ENGINE_LANG_DEFINE_TYPE()

+
#define             PANGO_ENGINE_LANG_DEFINE_TYPE(name, prefix, class_init, instance_init)
+

PANGO_ENGINE_LANG_DEFINE_TYPE has been deprecated since version 1.38 and should not be used in newly-written code.

+

Outputs the necessary code for GObject type registration for a +PangoEngineLang class defined in a module. Two static symbols +are defined.

+
+ static GType prefix_type;
+ static void prefix_register_type (GTypeModule module);
+
+

The prefix_register_type() +function should be called in your script_engine_init() function for +each type that your module implements, and then your script_engine_create() +function can create instances of the object as follows:

+
+ + + + + + + +
1
PangoEngine *engine = g_object_new (<em class="replaceable"><code>prefix</code></em>_type, NULL);
+
+ +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

name

Name of the the type to register (for example:, ArabicEngineFc

 

prefix

Prefix for symbols that will be defined (for example:, arabic_engine_fc

 

class_init

Class initialization function for the new type, or NULL.

[nullable]

instance_init

Instance initialization function for the new type, or NULL.

[nullable]
+
+
+
+
+

Types and Values

+
+

PangoEngineLang

+
typedef struct _PangoEngineLang PangoEngineLang;
+

PangoEngineLang has been deprecated since version 1.38 and should not be used in newly-written code.

+

The PangoEngineLang class is implemented by engines that +customize the rendering-system independent part of the +Pango pipeline for a particular script or language. For +instance, a custom PangoEngineLang could be provided for +Thai to implement the dictionary-based word boundary +lookups needed for that language.

+
+
+
+

struct PangoEngineLangClass

+
struct PangoEngineLangClass {
+  void (*script_break) (PangoEngineLang *engine,
+			const char    *text,
+			int            len,
+			PangoAnalysis *analysis,
+			PangoLogAttr  *attrs,
+			int            attrs_len);
+};
+
+

PangoEngineLangClass has been deprecated since version 1.38 and should not be used in newly-written code.

+

Class structure for PangoEngineLang

+
+

Members

+
+++++ + + + + + +

script_break ()

Provides a custom implementation of +pango_break(). If NULL, pango_default_break() is used instead. If +not NULL, for Pango versions before 1.16 (module interface version +before 1.6.0), this was called instead of pango_default_break(), +but in newer versions, pango_default_break() is always called and +this is called after that to allow tailoring the breaking results.

[nullable]
+
+
+
+
+

PANGO_ENGINE_TYPE_LANG

+
#define PANGO_ENGINE_TYPE_LANG "PangoEngineLang"
+
+

PANGO_ENGINE_TYPE_LANG has been deprecated since version 1.38 and should not be used in newly-written code.

+

A string constant defining the engine type for language engines. +These engines derive from PangoEngineLang.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoEngineShape.html b/docs/html/PangoEngineShape.html new file mode 100644 index 0000000..3c9b795 --- /dev/null +++ b/docs/html/PangoEngineShape.html @@ -0,0 +1,258 @@ + + + + +PangoEngineShape: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoEngineShape

+

PangoEngineShape — Rendering-system dependent script engines

+
+
+

Stability Level

+Unstable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + +
#define +PANGO_ENGINE_SHAPE_DEFINE_TYPE() +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
 PangoEngineShape
structPangoEngineShapeClass
#definePANGO_ENGINE_TYPE_SHAPE
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoEngine
+        ╰── PangoEngineShape
+
+
+
+

Description

+

The shape engines are rendering-system dependent +engines that convert character strings into glyph strings. +These engines are used in pango_shape().

+
+
+

Functions

+
+

PANGO_ENGINE_SHAPE_DEFINE_TYPE()

+
#define             PANGO_ENGINE_SHAPE_DEFINE_TYPE(name, prefix, class_init, instance_init)
+

PANGO_ENGINE_SHAPE_DEFINE_TYPE has been deprecated since version 1.38 and should not be used in newly-written code.

+

Outputs the necessary code for GObject type registration for a +PangoEngineShape class defined in a module. Two static symbols +are defined.

+
+ static GType prefix_type;
+ static void prefix_register_type (GTypeModule module);
+
+

The prefix_register_type() +function should be called in your script_engine_init() function for +each type that your module implements, and then your script_engine_create() +function can create instances of the object as follows:

+
+ + + + + + + +
1
PangoEngine *engine = g_object_new (<em class="replaceable"><code>prefix</code></em>_type, NULL);
+
+ +
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

name

Name of the the type to register (for example:, ArabicEngineFc

 

prefix

Prefix for symbols that will be defined (for example:, arabic_engine_fc

 

class_init

Class initialization function for the new type, or NULL.

[nullable]

instance_init

Instance initialization function for the new type, or NULL.

[nullable]
+
+
+
+
+

Types and Values

+
+

PangoEngineShape

+
typedef struct _PangoEngineShape PangoEngineShape;
+

PangoEngineShape has been deprecated since version 1.38 and should not be used in newly-written code.

+

The PangoEngineShape class is implemented by engines that +customize the rendering-system dependent part of the +Pango pipeline for a particular script or language. +A PangoEngineShape implementation is then specific to both +a particular rendering system or group of rendering systems +and to a particular script. For instance, there is one +PangoEngineShape implementation to handle shaping Arabic +for Fontconfig-based backends.

+
+
+
+

struct PangoEngineShapeClass

+
struct PangoEngineShapeClass {
+  void (*script_shape) (PangoEngineShape    *engine,
+			PangoFont           *font,
+			const char          *item_text,
+			unsigned int         item_length,
+			const PangoAnalysis *analysis,
+			PangoGlyphString    *glyphs,
+			const char          *paragraph_text,
+			unsigned int         paragraph_length);
+  PangoCoverageLevel (*covers)   (PangoEngineShape *engine,
+				  PangoFont        *font,
+				  PangoLanguage    *language,
+				  gunichar          wc);
+};
+
+

PangoEngineShapeClass has been deprecated since version 1.38 and should not be used in newly-written code.

+

Class structure for PangoEngineShape

+
+

Members

+
+++++ + + + + + + + + + + + + +

script_shape ()

Given a font, a piece of text, and a PangoAnalysis +structure, converts characters to glyphs and positions the +resulting glyphs. The results are stored in the PangoGlyphString +that is passed in. (The implementation should resize it +appropriately using pango_glyph_string_set_size()). All fields +of the log_clusters +and glyphs +array must be filled in, with +the exception that Pango will automatically generate +glyphs->glyphs[i].attr.is_cluster_start +using the log_clusters +array. Each input character must occur in one +of the output logical clusters; +if no rendering is desired for a character, this may involve +inserting glyphs with the PangoGlyph ID PANGO_GLYPH_EMPTY, which +is guaranteed never to render. If the shaping fails for any reason, +the shaper should return with an empty (zero-size) glyph string. +If the shaper has not set the size on the glyph string yet, simply +returning signals the failure too.

 

covers ()

Returns the characters that this engine can cover +with a given font for a given language. If not overridden, the default +implementation simply returns the coverage information for the +font itself unmodified.

 
+
+
+
+
+

PANGO_ENGINE_TYPE_SHAPE

+
#define PANGO_ENGINE_TYPE_SHAPE "PangoEngineShape"
+
+

PANGO_ENGINE_TYPE_SHAPE has been deprecated since version 1.38 and should not be used in newly-written code.

+

A string constant defining the engine type for shaping engines. +These engines derive from PangoEngineShape.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoFcDecoder.html b/docs/html/PangoFcDecoder.html new file mode 100644 index 0000000..783868b --- /dev/null +++ b/docs/html/PangoFcDecoder.html @@ -0,0 +1,243 @@ + + + + +PangoFcDecoder: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoFcDecoder

+

PangoFcDecoder — Custom font encoding handling

+
+
+

Functions

+
++++ + + + + + + + + + + +
+FcCharSet * + +pango_fc_decoder_get_charset () +
+PangoGlyph + +pango_fc_decoder_get_glyph () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structPangoFcDecoder
structPangoFcDecoderClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoFcDecoder
+
+
+
+

Description

+

PangoFcDecoder represents a decoder that an application provides +for handling a font that is encoded in a custom way.

+
+
+

Functions

+
+

pango_fc_decoder_get_charset ()

+
FcCharSet *
+pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
+                              PangoFcFont *fcfont);
+

Generates an FcCharSet of supported characters for the fcfont +given. The returned FcCharSet will be a reference to an +internal value stored by the PangoFcDecoder and must not +be modified or freed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

decoder

a PangoFcDecoder

 

fcfont

the PangoFcFont to query.

 
+
+
+

Returns

+

the FcCharset for fcfont +; must not be modified +or freed.

+
+

Since: 1.6

+
+
+
+

pango_fc_decoder_get_glyph ()

+
PangoGlyph
+pango_fc_decoder_get_glyph (PangoFcDecoder *decoder,
+                            PangoFcFont *fcfont,
+                            guint32 wc);
+

Generates a PangoGlyph for the given Unicode point using the +custom decoder. For complex scripts where there can be multiple +glyphs for a single character, the decoder will return whatever +glyph is most convenient for it. (Usually whatever glyph is directly +in the fonts character map table.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

decoder

a PangoFcDecoder

 

fcfont

a PangoFcFont to query.

 

wc

the Unicode code point to convert to a single PangoGlyph.

 
+
+
+

Returns

+

the glyph index, or 0 if the glyph isn't +covered by the font.

+
+

Since: 1.6

+
+
+
+

Types and Values

+
+

struct PangoFcDecoder

+
struct PangoFcDecoder;
+

PangoFcDecoder is a virtual base class that implementations will +inherit from. It's the interface that is used to define a custom +encoding for a font. These objects are created in your code from a +function callback that was originally registered with +pango_fc_font_map_add_decoder_find_func(). Pango requires +information about the supported charset for a font as well as the +individual character to glyph conversions. Pango gets that +information via the get_charset and get_glyph callbacks into your +object implementation.

+

Since: 1.6

+
+
+
+

struct PangoFcDecoderClass

+
struct PangoFcDecoderClass {
+  FcCharSet  *(*get_charset) (PangoFcDecoder *decoder,
+			      PangoFcFont    *fcfont);
+  PangoGlyph  (*get_glyph)   (PangoFcDecoder *decoder,
+			      PangoFcFont    *fcfont,
+			      guint32         wc);
+};
+
+

Class structure for PangoFcDecoder.

+
+

Members

+
+++++ + + + + + + + + + + + + +

get_charset ()

This returns an FcCharset given a PangoFcFont that +includes a list of supported characters in the font. The +FcCharSet that is returned should be an internal reference to your +code. Pango will not free this structure. It is important that +you make this callback fast because this callback is called +separately for each character to determine Unicode coverage.

 

get_glyph ()

This returns a single PangoGlyph for a given Unicode +code point.

 
+
+

Since: 1.6

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoFcFont.html b/docs/html/PangoFcFont.html new file mode 100644 index 0000000..423def2 --- /dev/null +++ b/docs/html/PangoFcFont.html @@ -0,0 +1,494 @@ + + + + +PangoFcFont: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoFcFont

+

PangoFcFont — Base font class for Fontconfig-based backends

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+FT_Face + +pango_fc_font_lock_face () +
+void + +pango_fc_font_unlock_face () +
+gboolean + +pango_fc_font_has_char () +
+guint + +pango_fc_font_get_glyph () +
+PangoGlyph + +pango_fc_font_get_unknown_glyph () +
+void + +pango_fc_font_kern_glyphs () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+PangoFcFontMap *fontmapRead / Write
gpointerpatternRead / Write / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
structPangoFcFont
structPangoFcFontClass
#definePANGO_RENDER_TYPE_FC
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoFont
+        ╰── PangoFcFont
+            ╰── PangoXftFont
+
+
+
+

Description

+

PangoFcFont is a base class for font implementation using the +Fontconfig and FreeType libraries. It is used in the

+Xft and +FreeType

backends shipped with Pango, but can also be used when creating +new backends. Any backend deriving from this base class will +take advantage of the wide range of shapers implemented using +FreeType that come with Pango.

+
+
+

Functions

+
+

pango_fc_font_lock_face ()

+
FT_Face
+pango_fc_font_lock_face (PangoFcFont *font);
+

Gets the FreeType FT_Face associated with a font, +This face will be kept around until you call +pango_fc_font_unlock_face().

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFcFont.

 
+
+
+

Returns

+

the FreeType FT_Face associated with font +.

+
+

Since: 1.4

+
+
+
+

pango_fc_font_unlock_face ()

+
void
+pango_fc_font_unlock_face (PangoFcFont *font);
+

Releases a font previously obtained with +pango_fc_font_lock_face().

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFcFont.

 
+
+

Since: 1.4

+
+
+
+

pango_fc_font_has_char ()

+
gboolean
+pango_fc_font_has_char (PangoFcFont *font,
+                        gunichar wc);
+

Determines whether font + has a glyph for the codepoint wc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFcFont

 

wc

Unicode codepoint to look up

 
+
+
+

Returns

+

TRUE if font +has the requested codepoint.

+
+

Since: 1.4

+
+
+
+

pango_fc_font_get_glyph ()

+
guint
+pango_fc_font_get_glyph (PangoFcFont *font,
+                         gunichar wc);
+

Gets the glyph index for a given Unicode character +for font +. If you only want to determine +whether the font has the glyph, use pango_fc_font_has_char().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFcFont

 

wc

Unicode character to look up

 
+
+
+

Returns

+

the glyph index, or 0, if the Unicode +character doesn't exist in the font.

+
+

Since: 1.4

+
+
+
+

pango_fc_font_get_unknown_glyph ()

+
PangoGlyph
+pango_fc_font_get_unknown_glyph (PangoFcFont *font,
+                                 gunichar wc);
+

pango_fc_font_get_unknown_glyph is deprecated and should not be used in newly-written code.

+

Returns the index of a glyph suitable for drawing wc + as an +unknown character.

+

Use PANGO_GET_UNKNOWN_GLYPH() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFcFont

 

wc

the Unicode character for which a glyph is needed.

 
+
+
+

Returns

+

a glyph index into font +.

+
+

Since: 1.4

+
+
+
+

pango_fc_font_kern_glyphs ()

+
void
+pango_fc_font_kern_glyphs (PangoFcFont *font,
+                           PangoGlyphString *glyphs);
+

pango_fc_font_kern_glyphs has been deprecated since version 1.32 and should not be used in newly-written code.

+

Adjust each adjacent pair of glyphs in glyphs + according to +kerning information in font +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFcFont

 

glyphs

a PangoGlyphString

 
+
+

Since: 1.4

+
+
+
+

Types and Values

+
+

struct PangoFcFont

+
struct PangoFcFont;
+

PangoFcFont is a base class for font implementations +using the Fontconfig and FreeType libraries and is used in +conjunction with PangoFcFontMap. When deriving from this +class, you need to implement all of its virtual functions +other than shutdown() along with the get_glyph_extents() +virtual function from PangoFont.

+
+
+
+

struct PangoFcFontClass

+
struct PangoFcFontClass {
+  FT_Face    (*lock_face)         (PangoFcFont      *font);
+  void       (*unlock_face)       (PangoFcFont      *font);
+  gboolean   (*has_char)          (PangoFcFont      *font,
+				   gunichar          wc);
+  guint      (*get_glyph)         (PangoFcFont      *font,
+				   gunichar          wc);
+  PangoGlyph (*get_unknown_glyph) (PangoFcFont      *font,
+				   gunichar          wc);
+  void       (*shutdown)          (PangoFcFont      *font);
+};
+
+

Class structure for PangoFcFont.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

lock_face ()

Returns the FT_Face of the font and increases +the reference count for the face by one.

 

unlock_face ()

Decreases the reference count for the +FT_Face of the font by one. When the count is zero, +the PangoFcFont subclass is allowed to free the +FT_Face.

 

has_char ()

Return TRUE if the the font contains a glyph +corresponding to the specified character.

 

get_glyph ()

Gets the glyph that corresponds to the given +Unicode character.

 

get_unknown_glyph ()

Gets the glyph that +should be used to display an unknown-glyph indication +for the specified Unicode character. May be NULL.

[nullable]

shutdown ()

Performs any font-specific +shutdown code that needs to be done when +pango_fc_font_map_shutdown is called. May be NULL.

[nullable]
+
+
+
+
+

PANGO_RENDER_TYPE_FC

+
#define PANGO_RENDER_TYPE_FC "PangoRenderFc"
+
+

A string constant used to identify shape engines that work +with the fontconfig based backends. See the engine_type + field +of PangoEngineInfo.

+
+
+
+

Property Details

+
+

The “fontmap” property

+
  “fontmap”                  PangoFcFontMap *
+

The PangoFc font map this font is associated with (Since: 1.26).

+

Flags: Read / Write

+
+
+
+

The “pattern” property

+
  “pattern”                  gpointer
+

The fontconfig pattern for this font.

+

Flags: Read / Write / Construct Only

+
+
+
+

See Also

+
++++ + + + + +

PangoFcFontMap

The base class for font maps; creating a new +Fontconfig-based backend involves deriving from both +PangoFcFontMap and PangoFcFont.
+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoFcFontMap.html b/docs/html/PangoFcFontMap.html new file mode 100644 index 0000000..8a9bae2 --- /dev/null +++ b/docs/html/PangoFcFontMap.html @@ -0,0 +1,1110 @@ + + + + +PangoFcFontMap: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoFcFontMap

+

PangoFcFontMap — Base fontmap class for Fontconfig-based backends

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoContext * + +pango_fc_font_map_create_context () +
+PangoFcDecoder * + +(*PangoFcDecoderFindFunc) () +
+void + +pango_fc_font_map_add_decoder_find_func () +
+PangoFcDecoder * + +pango_fc_font_map_find_decoder () +
+void + +pango_fc_font_map_cache_clear () +
+void + +pango_fc_font_map_config_changed () +
+void + +pango_fc_font_map_shutdown () +
+void + +pango_fc_font_map_set_config () +
+FcConfig * + +pango_fc_font_map_get_config () +
+PangoFontDescription * + +pango_fc_font_description_from_pattern () +
+gpointer + +pango_fc_fontset_key_get_context_key () +
const PangoFontDescription * + +pango_fc_fontset_key_get_description () +
+PangoLanguage * + +pango_fc_fontset_key_get_language () +
const PangoMatrix * + +pango_fc_fontset_key_get_matrix () +
+double + +pango_fc_fontset_key_get_absolute_size () +
+double + +pango_fc_fontset_key_get_resolution () +
+gpointer + +pango_fc_font_key_get_context_key () +
const PangoMatrix * + +pango_fc_font_key_get_matrix () +
const FcPattern * + +pango_fc_font_key_get_pattern () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
structPangoFcFontMap
structPangoFcFontMapClass
#definePANGO_FC_FONT_FEATURES
#definePANGO_FC_GRAVITY
#definePANGO_FC_VERSION
#definePANGO_FC_PRGNAME
 PangoFcFontsetKey
 PangoFcFontKey
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoFontMap
+        ╰── PangoFcFontMap
+            ├── PangoFT2FontMap
+            ╰── PangoXftFontMap
+
+
+
+

Description

+

PangoFcFontMap is a base class for font map implementations using the +Fontconfig and FreeType libraries. It is used in the

+Xft and +FreeType

backends shipped with Pango, but can also be used when creating +new backends. Any backend deriving from this base class will +take advantage of the wide range of shapers implemented using +FreeType that come with Pango.

+
+
+

Functions

+
+

pango_fc_font_map_create_context ()

+
PangoContext *
+pango_fc_font_map_create_context (PangoFcFontMap *fcfontmap);
+
+

pango_fc_font_map_create_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_font_map_create_context() instead.

+
+

Creates a new context for this fontmap. This function is intended +only for backend implementations deriving from PangoFcFontMap; +it is possible that a backend will store additional information +needed for correct operation on the PangoContext after calling +this function.

+
+

Parameters

+
+++++ + + + + + +

fcfontmap

a PangoFcFontMap

 
+
+
+

Returns

+

a new PangoContext

+
+

Since: 1.4

+
+
+
+

PangoFcDecoderFindFunc ()

+
PangoFcDecoder *
+(*PangoFcDecoderFindFunc) (FcPattern *pattern,
+                           gpointer user_data);
+

Callback function passed to pango_fc_font_map_add_decoder_find_func().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pattern

a fully resolved FcPattern specifying the font on the system

 

user_data

user data passed to pango_fc_font_map_add_decoder_find_func()

 
+
+
+

Returns

+

a new reference to a custom decoder for this pattern, +or NULL if the default decoder handling should be used.

+
+
+
+
+

pango_fc_font_map_add_decoder_find_func ()

+
void
+pango_fc_font_map_add_decoder_find_func
+                               (PangoFcFontMap *fcfontmap,
+                                PangoFcDecoderFindFunc findfunc,
+                                gpointer user_data,
+                                GDestroyNotify dnotify);
+

This function saves a callback method in the PangoFcFontMap that +will be called whenever new fonts are created. If the +function returns a PangoFcDecoder, that decoder will be used to +determine both coverage via a FcCharSet and a one-to-one mapping of +characters to glyphs. This will allow applications to have +application-specific encodings for various fonts.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

fcfontmap

The PangoFcFontMap to add this method to.

 

findfunc

The PangoFcDecoderFindFunc callback function

 

user_data

User data.

 

dnotify

A GDestroyNotify callback that will be called when the +fontmap is finalized and the decoder is released.

 
+
+

Since: 1.6

+
+
+
+

pango_fc_font_map_find_decoder ()

+
PangoFcDecoder *
+pango_fc_font_map_find_decoder (PangoFcFontMap *fcfontmap,
+                                FcPattern *pattern);
+

Finds the decoder to use for pattern +. Decoders can be added to +a font map using pango_fc_font_map_add_decoder_find_func().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fcfontmap

The PangoFcFontMap to use.

 

pattern

The FcPattern to find the decoder for.

 
+
+
+

Returns

+

a newly created PangoFcDecoder object or +NULL if no decoder is set for pattern +.

+

[nullable]

+
+

Since: 1.26

+
+
+
+

pango_fc_font_map_cache_clear ()

+
void
+pango_fc_font_map_cache_clear (PangoFcFontMap *fcfontmap);
+

Clear all cached information and fontsets for this font map; +this should be called whenever there is a change in the +output of the default_substitute() virtual function of the +font map, or if fontconfig has been reinitialized to new +configuration.

+
+

Parameters

+
+++++ + + + + + +

fcfontmap

a PangoFcFontMap

 
+
+

Since: 1.4

+
+
+
+

pango_fc_font_map_config_changed ()

+
void
+pango_fc_font_map_config_changed (PangoFcFontMap *fcfontmap);
+

Informs font map that the fontconfig configuration (ie, FcConfig object) +used by this font map has changed. This currently calls +pango_fc_font_map_cache_clear() which ensures that list of fonts, etc +will be regenerated using the updated configuration.

+
+

Parameters

+
+++++ + + + + + +

fcfontmap

a PangoFcFontMap

 
+
+

Since: 1.38

+
+
+
+

pango_fc_font_map_shutdown ()

+
void
+pango_fc_font_map_shutdown (PangoFcFontMap *fcfontmap);
+

Clears all cached information for the fontmap and marks +all fonts open for the fontmap as dead. (See the shutdown() +virtual function of PangoFcFont.) This function might be used +by a backend when the underlying windowing system for the font +map exits. This function is only intended to be called +only for backend implementations deriving from PangoFcFontMap.

+
+

Parameters

+
+++++ + + + + + +

fcfontmap

a PangoFcFontMap

 
+
+

Since: 1.4

+
+
+
+

pango_fc_font_map_set_config ()

+
void
+pango_fc_font_map_set_config (PangoFcFontMap *fcfontmap,
+                              FcConfig *fcconfig);
+

Set the FcConfig for this font map to use. The default value +is NULL, which causes Fontconfig to use its global "current config". +You can create a new FcConfig object and use this API to attach it +to a font map.

+

This is particularly useful for example, if you want to use application +fonts with Pango. For that, you would create a fresh FcConfig, add your +app fonts to it, and attach it to a new Pango font map.

+

If fcconfig + is different from the previous config attached to the font map, +pango_fc_font_map_config_changed() is called.

+

This function acquires a reference to the FcConfig object; the caller +does NOT need to retain a reference.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fcfontmap

a PangoFcFontMap

 

fcconfig

a FcConfig, or NULL.

[nullable]
+
+

Since: 1.38

+
+
+
+

pango_fc_font_map_get_config ()

+
FcConfig *
+pango_fc_font_map_get_config (PangoFcFontMap *fcfontmap);
+

Fetches FcConfig attached to a font map. See pango_fc_font_map_set_config().

+
+

Parameters

+
+++++ + + + + + +

fcfontmap

a PangoFcFontMap

 
+
+
+

Returns

+

the FcConfig object attached to fcfontmap +, which +might be NULL.

+

[nullable]

+
+

Since: 1.38

+
+
+
+

pango_fc_font_description_from_pattern ()

+
PangoFontDescription *
+pango_fc_font_description_from_pattern
+                               (FcPattern *pattern,
+                                gboolean include_size);
+

Creates a PangoFontDescription that matches the specified +Fontconfig pattern as closely as possible. Many possible Fontconfig +pattern values, such as FC_RASTERIZER or FC_DPI, don't make sense in +the context of PangoFontDescription, so will be ignored.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pattern

a FcPattern

 

include_size

if TRUE, the pattern will include the size from +the pattern +; otherwise the resulting pattern will be unsized. +(only FC_SIZE is examined, not FC_PIXEL_SIZE)

 
+
+
+

Returns

+

a new PangoFontDescription. Free with +pango_font_description_free().

+
+

Since: 1.4

+
+
+
+

pango_fc_fontset_key_get_context_key ()

+
gpointer
+pango_fc_fontset_key_get_context_key (const PangoFcFontsetKey *key);
+

Gets the context key member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the font key

 
+
+
+

Returns

+

the context key, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

pango_fc_fontset_key_get_description ()

+
const PangoFontDescription *
+pango_fc_fontset_key_get_description (const PangoFcFontsetKey *key);
+

Gets the font description of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the fontset key

 
+
+
+

Returns

+

the font description, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

pango_fc_fontset_key_get_language ()

+
PangoLanguage *
+pango_fc_fontset_key_get_language (const PangoFcFontsetKey *key);
+

Gets the language member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the fontset key

 
+
+
+

Returns

+

the language

+
+

Since: 1.24

+
+
+
+

pango_fc_fontset_key_get_matrix ()

+
const PangoMatrix *
+pango_fc_fontset_key_get_matrix (const PangoFcFontsetKey *key);
+

Gets the matrix member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the fontset key

 
+
+
+

Returns

+

the matrix, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

pango_fc_fontset_key_get_absolute_size ()

+
double
+pango_fc_fontset_key_get_absolute_size
+                               (const PangoFcFontsetKey *key);
+

Gets the absolute font size of key + in Pango units. This is adjusted +for both resolution and transformation matrix.

+
+

Parameters

+
+++++ + + + + + +

key

the fontset key

 
+
+
+

Returns

+

the pixel size of key +.

+
+

Since: 1.24

+
+
+
+

pango_fc_fontset_key_get_resolution ()

+
double
+pango_fc_fontset_key_get_resolution (const PangoFcFontsetKey *key);
+

Gets the resolution of key +

+
+

Parameters

+
+++++ + + + + + +

key

the fontset key

 
+
+
+

Returns

+

the resolution of key +

+
+

Since: 1.24

+
+
+
+

pango_fc_font_key_get_context_key ()

+
gpointer
+pango_fc_font_key_get_context_key (const PangoFcFontKey *key);
+

Gets the context key member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the font key

 
+
+
+

Returns

+

the context key, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

pango_fc_font_key_get_matrix ()

+
const PangoMatrix *
+pango_fc_font_key_get_matrix (const PangoFcFontKey *key);
+

Gets the matrix member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the font key

 
+
+
+

Returns

+

the matrix, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

pango_fc_font_key_get_pattern ()

+
const FcPattern *
+pango_fc_font_key_get_pattern (const PangoFcFontKey *key);
+

Gets the fontconfig pattern member of key +.

+
+

Parameters

+
+++++ + + + + + +

key

the font key

 
+
+
+

Returns

+

the pattern, which is owned by key +and should not be modified.

+
+

Since: 1.24

+
+
+
+

Types and Values

+
+

struct PangoFcFontMap

+
struct PangoFcFontMap;
+

PangoFcFontMap is a base class for font map implementations +using the Fontconfig and FreeType libraries. To create a new +backend using Fontconfig and FreeType, you derive from this class +and implement a new_font() virtual function that creates an +instance deriving from PangoFcFont.

+
+
+
+

struct PangoFcFontMapClass

+
struct PangoFcFontMapClass {
+  /* Deprecated in favor of fontset_key_substitute */
+  void         (*default_substitute) (PangoFcFontMap   *fontmap,
+				      FcPattern        *pattern);
+  /* Deprecated in favor of create_font */
+  PangoFcFont  *(*new_font)          (PangoFcFontMap  *fontmap,
+				      FcPattern       *pattern);
+
+  double       (*get_resolution)     (PangoFcFontMap             *fcfontmap,
+				      PangoContext               *context);
+
+  gconstpointer (*context_key_get)   (PangoFcFontMap             *fcfontmap,
+				      PangoContext               *context);
+  gpointer     (*context_key_copy)   (PangoFcFontMap             *fcfontmap,
+				      gconstpointer               key);
+  void         (*context_key_free)   (PangoFcFontMap             *fcfontmap,
+				      gpointer                    key);
+  guint32      (*context_key_hash)   (PangoFcFontMap             *fcfontmap,
+				      gconstpointer               key);
+  gboolean     (*context_key_equal)  (PangoFcFontMap             *fcfontmap,
+				      gconstpointer               key_a,
+				      gconstpointer               key_b);
+  void         (*fontset_key_substitute)(PangoFcFontMap             *fontmap,
+
+				      PangoFcFontsetKey          *fontsetkey,
+				      FcPattern                  *pattern);
+  PangoFcFont  *(*create_font)       (PangoFcFontMap             *fontmap,
+				      PangoFcFontKey             *fontkey);
+};
+
+

Class structure for PangoFcFontMap.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

default_substitute ()

Substitutes in default +values for unspecified fields in a FcPattern. This will +be called prior to creating a font for the pattern. May be +NULL. Deprecated in favor of font_key_substitute() +.

[nullable]

new_font ()

Creates a new PangoFcFont for the specified +pattern of the appropriate type for this font map. The +pattern +argument must be passed to the "pattern" property +of PangoFcFont when you call g_object_new(). Deprecated +in favor of create_font() +.

 

get_resolution ()

Gets the resolution (the scale factor +between logical and absolute font sizes) that the backend +will use for a particular fontmap and context. context +may be null.

 

context_key_get ()

Gets an opaque key holding backend +specific options for the context that will affect +fonts created by create_font() +. The result must point to +persistant storage owned by the fontmap. This key +is used to index hash tables used to look up fontsets +and fonts.

 

context_key_copy ()

Copies a context key. Pango uses this +to make a persistant copy of the value returned from +context_key_get +.

 

context_key_free ()

Frees a context key copied with +context_key_copy +.

 

context_key_hash ()

Gets a hash value for a context key

 

context_key_equal ()

Compares two context keys for equality.

 

fontset_key_substitute ()

Substitutes in +default values for unspecified fields in a +FcPattern. This will be called prior to creating a font +for the pattern. May be NULL. (Since: 1.24).

[nullable]

create_font ()

Creates a new PangoFcFont for +the specified pattern of the appropriate type for this +font map using information from the font key that is +passed in. The pattern +member of font_key +can be +retrieved using pango_fc_font_key_get_pattern() and must +be passed to the "pattern" property of PangoFcFont when +you call g_object_new(). If NULL, new_font() is used. +(Since: 1.24).

[nullable]
+
+
+
+
+

PANGO_FC_FONT_FEATURES

+
#define PANGO_FC_FONT_FEATURES "fontfeatures"
+
+

String representing a fontconfig property name that Pango reads from font +patterns to populate list of OpenType features to be enabled for the font +by default.

+

The property will have a number of string elements, each of which is the +OpenType feature tag of one feature to enable.

+

This is equivalent to FC_FONT_FEATURES in versions of fontconfig that have that.

+

Since: 1.34

+
+
+
+

PANGO_FC_GRAVITY

+
#define PANGO_FC_GRAVITY "pangogravity"
+
+

String representing a fontconfig property name that Pango sets on any +fontconfig pattern it passes to fontconfig if a PangoGravity other +than PANGO_GRAVITY_SOUTH is desired.

+

The property will have a PangoGravity value as a string, like "east". +This can be used to write fontconfig configuration rules to choose +different fonts for horizontal and vertical writing directions.

+

Since: 1.20

+
+
+
+

PANGO_FC_VERSION

+
#define PANGO_FC_VERSION "pangoversion"
+
+

String representing a fontconfig property name that Pango sets on any +fontconfig pattern it passes to fontconfig.

+

The property will have an integer value equal to what +pango_version() returns. +This can be used to write fontconfig configuration rules that only affect +certain pango versions (or only pango-using applications, or only +non-pango-using applications).

+

Since: 1.20

+
+
+
+

PANGO_FC_PRGNAME

+
#define PANGO_FC_PRGNAME "prgname"
+
+

String representing a fontconfig property name that Pango sets on any +fontconfig pattern it passes to fontconfig.

+

The property will have a string equal to what +g_get_prgname() returns. +This can be used to write fontconfig configuration rules that only affect +certain applications.

+

This is equivalent to FC_PRGNAME in versions of fontconfig that have that.

+

Since: 1.24

+
+
+
+

PangoFcFontsetKey

+
typedef struct _PangoFcFontsetKey PangoFcFontsetKey;
+

An opaque structure containing all the information needed for +loading a fontset with the PangoFc fontmap.

+

Since: 1.24

+
+
+
+

PangoFcFontKey

+
typedef struct _PangoFcFontKey PangoFcFontKey;
+

An opaque structure containing all the information needed for +loading a font with the PangoFc fontmap.

+

Since: 1.24

+
+
+
+

See Also

+
++++ + + + + +

PangoFcFont

The base class for fonts; creating a new +Fontconfig-based backend involves deriving from both +PangoFcFontMap and PangoFcFont.
+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoMarkupFormat.html b/docs/html/PangoMarkupFormat.html new file mode 100644 index 0000000..e716be8 --- /dev/null +++ b/docs/html/PangoMarkupFormat.html @@ -0,0 +1,326 @@ + + + + +Text Attribute Markup: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Text Attribute Markup

+

Text Attribute Markup — Simple +markup language to encode text with attributes

+
+
+

Pango Text Attribute Markup Language

+

+Frequently, you want to display some text to the user with attributes +applied to part of the text (for example, you might want bold or +italicized words). With the base Pango interfaces, you could create a +PangoAttrList and apply it to the +text; the problem is that you'd need to apply attributes to some +numeric range of characters, for example "characters 12-17." This is +broken from an internationalization standpoint; once the text is +translated, the word you wanted to italicize could be in a different +position. +

+

+The solution is to include the text attributes in the string to be +translated. Pango provides this feature with a small markup language. +You can parse a marked-up string into the string text plus a +PangoAttrList using either of +pango_parse_markup() or +pango_markup_parser_new(). +

+

+A simple example of a marked-up string might be: +"<span foreground="blue" size="x-large">Blue text</span> is <i>cool</i>!" +

+

+Pango uses #GMarkup to parse this language, which means that XML features +such as numeric character entities such as &#169; for © can +be used too. +

+

+The root tag of a marked-up document is <markup>, but pango_parse_markup() allows you to +omit this tag, so you will most likely never need to use it. The most +general markup tag is <span>, then there are some convenience +tags. <span> has the following attributes: +

+
+

<span> attributes

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

font[1], font_desc

+A font description string, such as "Sans Italic 12". See +pango_font_description_from_string() +for a description of the format of the string representation . Note that any +other span attributes will override this description. So if you have +"Sans Italic" and also a style="normal" attribute, you will get Sans normal, +not italic.

font_family, face

+A font family name +

font_size[1], size

+Font size in 1024ths of a point, or one of the absolute sizes +'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', +'xx-large', or one of the relative sizes 'smaller' or 'larger'. +If you want to specify a absolute size, it's usually easier +to take advantage of the ability to specify a partial +font description using 'font'; you can use +font='12.5' rather than +size='12800'. +

font_style[1], style

+One of 'normal', 'oblique', 'italic' +

font_weight[1], weight

+One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', +or a numeric weight +

font_variant[1], variant

+One of 'normal' or 'smallcaps' +

font_stretch[1], stretch

+One of 'ultracondensed', 'extracondensed', 'condensed', +'semicondensed', 'normal', 'semiexpanded', 'expanded', +'extraexpanded', 'ultraexpanded' +

font_features[2]

+A comma separated list of OpenType font feature settings, in the same +syntax as accepted by CSS. E.g: font_features='dlig=1, -kern, afrc on' +

foreground, fgcolor[1], color

+An RGB color specification such as '#00FF00' or a color name such as +'red'. +Since 1.38, an RGBA color specification such as '#00FF007F' will +be interpreted as specifying both a foreground color and foreground alpha. +

background, bgcolor[1]

+An RGB color specification such as '#00FF00' or a color name such as +'red'. +Since 1.38, an RGBA color specification such as '#00FF007F' will +be interpreted as specifying both a background color and background alpha. +

alpha, fgalpha[2]

+An alpha value for the foreground color, either a plain integer between 1 and 65536 +or a percentage value like '50%'. +

background_alpha, bgalpha[2]

+An alpha value for the background color, either a plain integer between 1 and 65536 +or a percentage value like '50%'. +

underline

+One of 'none', 'single', 'double', 'low', 'error' +

underline_color

+The color of underlines; an RGB color specification such as '#00FF00' +or a color name such as 'red' +

rise

+Vertical displacement, in Pango units. Can be negative for +subscript, positive for superscript. +

strikethrough

+'true' or 'false' whether to strike through the text +

strikethrough_color

+The color of strikethrough lines; an RGB color specification such as +'#00FF00' or a color name such as 'red' +

fallback

+'true' or 'false' whether to enable fallback. If disabled, then characters +will only be used from the closest matching font on the system. No fallback +will be done to other fonts on the system that might contain the characters +in the text. Fallback is enabled by default. Most applications should not +disable fallback. +

lang

+A language code, indicating the text language +

letter_spacing

+Inter-letter spacing in 1024ths of a point. +

gravity

+One of 'south', 'east', 'north', 'west', 'auto'. +

gravity_hint

+One of 'natural', 'strong', 'line'. +

+
+

+ +

+

+The following convenience tags are provided: + +

+
+

Convenience tags

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

b

+Bold +

big

+Makes font relatively larger, equivalent to <span size="larger"> +

i

+Italic +

s

+Strikethrough +

sub

+Subscript +

sup

+Superscript +

small

+Makes font relatively smaller, equivalent to <span size="smaller"> +

tt

+Monospace font +

u

+Underline +

+
+

+ +

+
+
+

+

[1] Since 1.21

+

[2] Since 1.38

+
+
+ + + \ No newline at end of file diff --git a/docs/html/PangoRenderer.html b/docs/html/PangoRenderer.html new file mode 100644 index 0000000..f431f47 --- /dev/null +++ b/docs/html/PangoRenderer.html @@ -0,0 +1,1312 @@ + + + + +PangoRenderer: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

PangoRenderer

+

PangoRenderer — Rendering driver base class

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +pango_renderer_draw_layout () +
+void + +pango_renderer_draw_layout_line () +
+void + +pango_renderer_draw_glyphs () +
+void + +pango_renderer_draw_glyph_item () +
+void + +pango_renderer_draw_rectangle () +
+void + +pango_renderer_draw_error_underline () +
+void + +pango_renderer_draw_trapezoid () +
+void + +pango_renderer_draw_glyph () +
+void + +pango_renderer_activate () +
+void + +pango_renderer_deactivate () +
+void + +pango_renderer_part_changed () +
+void + +pango_renderer_set_color () +
+PangoColor * + +pango_renderer_get_color () +
+void + +pango_renderer_set_alpha () +
+guint16 + +pango_renderer_get_alpha () +
+void + +pango_renderer_set_matrix () +
const PangoMatrix * + +pango_renderer_get_matrix () +
+PangoLayout * + +pango_renderer_get_layout () +
+PangoLayoutLine * + +pango_renderer_get_layout_line () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
structPangoRenderer
enumPangoRenderPart
#definePANGO_TYPE_RENDER_PART
structPangoRendererClass
+
+
+

Object Hierarchy

+
    GEnum
+    ╰── PangoRenderPart
+    GObject
+    ╰── PangoRenderer
+        ╰── PangoXftRenderer
+
+
+
+

Description

+

PangoRenderer is a base class that contains the necessary logic for +rendering a PangoLayout or PangoLayoutLine. By subclassing +PangoRenderer and overriding operations such as draw_glyphs + and +draw_rectangle +, renderers for particular font backends and +destinations can be created.

+
+
+

Functions

+
+

pango_renderer_draw_layout ()

+
void
+pango_renderer_draw_layout (PangoRenderer *renderer,
+                            PangoLayout *layout,
+                            int x,
+                            int y);
+

Draws layout + with the specified PangoRenderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

layout

a PangoLayout

 

x

X position of left edge of baseline, in user space coordinates +in Pango units.

 

y

Y position of left edge of baseline, in user space coordinates +in Pango units.

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_layout_line ()

+
void
+pango_renderer_draw_layout_line (PangoRenderer *renderer,
+                                 PangoLayoutLine *line,
+                                 int x,
+                                 int y);
+

Draws line + with the specified PangoRenderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

line

a PangoLayoutLine

 

x

X position of left edge of baseline, in user space coordinates +in Pango units.

 

y

Y position of left edge of baseline, in user space coordinates +in Pango units.

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_glyphs ()

+
void
+pango_renderer_draw_glyphs (PangoRenderer *renderer,
+                            PangoFont *font,
+                            PangoGlyphString *glyphs,
+                            int x,
+                            int y);
+

Draws the glyphs in glyphs + with the specified PangoRenderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

font

a PangoFont

 

glyphs

a PangoGlyphString

 

x

X position of left edge of baseline, in user space coordinates +in Pango units.

 

y

Y position of left edge of baseline, in user space coordinates +in Pango units.

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_glyph_item ()

+
void
+pango_renderer_draw_glyph_item (PangoRenderer *renderer,
+                                const char *text,
+                                PangoGlyphItem *glyph_item,
+                                int x,
+                                int y);
+

Draws the glyphs in glyph_item + with the specified PangoRenderer, +embedding the text associated with the glyphs in the output if the +output format supports it (PDF for example).

+

Note that text + is the start of the text for layout, which is then +indexed by glyph_item->item->offset +.

+

If text + is NULL, this simply calls pango_renderer_draw_glyphs().

+

The default implementation of this method simply falls back to +pango_renderer_draw_glyphs().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

text

the UTF-8 text that glyph_item +refers to, or NULL.

[allow-none]

glyph_item

a PangoGlyphItem

 

x

X position of left edge of baseline, in user space coordinates +in Pango units.

 

y

Y position of left edge of baseline, in user space coordinates +in Pango units.

 
+
+

Since: 1.22

+
+
+
+

pango_renderer_draw_rectangle ()

+
void
+pango_renderer_draw_rectangle (PangoRenderer *renderer,
+                               PangoRenderPart part,
+                               int x,
+                               int y,
+                               int width,
+                               int height);
+

Draws an axis-aligned rectangle in user space coordinates with the +specified PangoRenderer.

+

This should be called while renderer + is already active. Use +pango_renderer_activate() to activate a renderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

type of object this rectangle is part of

 

x

X position at which to draw rectangle, in user space coordinates in Pango units

 

y

Y position at which to draw rectangle, in user space coordinates in Pango units

 

width

width of rectangle in Pango units in user space coordinates

 

height

height of rectangle in Pango units in user space coordinates

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_error_underline ()

+
void
+pango_renderer_draw_error_underline (PangoRenderer *renderer,
+                                     int x,
+                                     int y,
+                                     int width,
+                                     int height);
+

Draw a squiggly line that approximately covers the given rectangle +in the style of an underline used to indicate a spelling error. +(The width of the underline is rounded to an integer number +of up/down segments and the resulting rectangle is centered +in the original rectangle)

+

This should be called while renderer + is already active. Use +pango_renderer_activate() to activate a renderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

x

X coordinate of underline, in Pango units in user coordinate system

 

y

Y coordinate of underline, in Pango units in user coordinate system

 

width

width of underline, in Pango units in user coordinate system

 

height

height of underline, in Pango units in user coordinate system

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_trapezoid ()

+
void
+pango_renderer_draw_trapezoid (PangoRenderer *renderer,
+                               PangoRenderPart part,
+                               double y1_,
+                               double x11,
+                               double x21,
+                               double y2,
+                               double x12,
+                               double x22);
+

Draws a trapezoid with the parallel sides aligned with the X axis +using the given PangoRenderer; coordinates are in device space.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

type of object this trapezoid is part of

 

y1_

Y coordinate of top of trapezoid

 

x11

X coordinate of left end of top of trapezoid

 

x21

X coordinate of right end of top of trapezoid

 

y2

Y coordinate of bottom of trapezoid

 

x12

X coordinate of left end of bottom of trapezoid

 

x22

X coordinate of right end of bottom of trapezoid

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_draw_glyph ()

+
void
+pango_renderer_draw_glyph (PangoRenderer *renderer,
+                           PangoFont *font,
+                           PangoGlyph glyph,
+                           double x,
+                           double y);
+

Draws a single glyph with coordinates in device space.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

font

a PangoFont

 

glyph

the glyph index of a single glyph

 

x

X coordinate of left edge of baseline of glyph

 

y

Y coordinate of left edge of baseline of glyph

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_activate ()

+
void
+pango_renderer_activate (PangoRenderer *renderer);
+

Does initial setup before rendering operations on renderer +. +pango_renderer_deactivate() should be called when done drawing. +Calls such as pango_renderer_draw_layout() automatically +activate the layout before drawing on it. Calls to +pango_renderer_activate() and pango_renderer_deactivate() can +be nested and the renderer will only be initialized and +deinitialized once.

+
+

Parameters

+
+++++ + + + + + +

renderer

a PangoRenderer

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_deactivate ()

+
void
+pango_renderer_deactivate (PangoRenderer *renderer);
+

Cleans up after rendering operations on renderer +. See +docs for pango_renderer_activate().

+
+

Parameters

+
+++++ + + + + + +

renderer

a PangoRenderer

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_part_changed ()

+
void
+pango_renderer_part_changed (PangoRenderer *renderer,
+                             PangoRenderPart part);
+

Informs Pango that the way that the rendering is done +for part + has changed in a way that would prevent multiple +pieces being joined together into one drawing call. For +instance, if a subclass of PangoRenderer was to add a stipple +option for drawing underlines, it needs to call

+ + +

When the stipple changes or underlines with different stipples +might be joined together. Pango automatically calls this for +changes to colors. (See pango_renderer_set_color())

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

the part for which rendering has changed.

 
+
+

Since: 1.8

+
+
+
+

pango_renderer_set_color ()

+
void
+pango_renderer_set_color (PangoRenderer *renderer,
+                          PangoRenderPart part,
+                          const PangoColor *color);
+

Sets the color for part of the rendering. +Also see pango_renderer_set_alpha().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

the part to change the color of

 

color

the new color or NULL to unset the current color.

[allow-none]
+
+

Since: 1.8

+
+
+
+

pango_renderer_get_color ()

+
PangoColor *
+pango_renderer_get_color (PangoRenderer *renderer,
+                          PangoRenderPart part);
+

Gets the current rendering color for the specified part.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

the part to get the color for

 
+
+
+

Returns

+

the color for the +specified part, or NULL if it hasn't been set and should be +inherited from the environment.

+

[transfer none][nullable]

+
+

Since: 1.8

+
+
+
+

pango_renderer_set_alpha ()

+
void
+pango_renderer_set_alpha (PangoRenderer *renderer,
+                          PangoRenderPart part,
+                          guint16 alpha);
+

Sets the alpha for part of the rendering. +Note that the alpha may only be used if a color is +specified for part + as well.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

the part to set the alpha for

 

alpha

an alpha value between 1 and 65536, or 0 to unset the alpha

 
+
+

Since: 1.38

+
+
+
+

pango_renderer_get_alpha ()

+
guint16
+pango_renderer_get_alpha (PangoRenderer *renderer,
+                          PangoRenderPart part);
+

Gets the current alpha for the specified part.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

renderer

a PangoRenderer

 

part

the part to get the alpha for

 
+
+
+

Returns

+

the alpha for the specified part, +or 0 if it hasn't been set and should be +inherited from the environment.

+
+

Since: 1.38

+
+
+
+

pango_renderer_set_matrix ()

+
void
+pango_renderer_set_matrix (PangoRenderer *renderer,
+                           const PangoMatrix *matrix);
+

Sets the transformation matrix that will be applied when rendering.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

renderer

a PangoRenderer

 

matrix

a PangoMatrix, or NULL to unset any existing matrix. +(No matrix set is the same as setting the identity matrix.).

[allow-none]
+
+

Since: 1.8

+
+
+
+

pango_renderer_get_matrix ()

+
const PangoMatrix *
+pango_renderer_get_matrix (PangoRenderer *renderer);
+

Gets the transformation matrix that will be applied when +rendering. See pango_renderer_set_matrix().

+
+

Parameters

+
+++++ + + + + + +

renderer

a PangoRenderer

 
+
+
+

Returns

+

the matrix, or NULL if no matrix has +been set (which is the same as the identity matrix). The returned +matrix is owned by Pango and must not be modified or freed.

+

[nullable]

+
+

Since: 1.8

+
+
+
+

pango_renderer_get_layout ()

+
PangoLayout *
+pango_renderer_get_layout (PangoRenderer *renderer);
+

Gets the layout currently being rendered using renderer +. +Calling this function only makes sense from inside a subclass's +methods, like in its draw_shape() for example.

+

The returned layout should not be modified while still being +rendered.

+
+

Parameters

+
+++++ + + + + + +

renderer

a PangoRenderer

 
+
+
+

Returns

+

the layout, or NULL if +no layout is being rendered using renderer +at this time.

+

[transfer none][nullable]

+
+

Since: 1.20

+
+
+
+

pango_renderer_get_layout_line ()

+
PangoLayoutLine *
+pango_renderer_get_layout_line (PangoRenderer *renderer);
+

Gets the layout line currently being rendered using renderer +. +Calling this function only makes sense from inside a subclass's +methods, like in its draw_shape() for example.

+

The returned layout line should not be modified while still being +rendered.

+
+

Parameters

+
+++++ + + + + + +

renderer

a PangoRenderer

 
+
+
+

Returns

+

the layout line, or NULL +if no layout line is being rendered using renderer +at this time.

+

[transfer none][nullable]

+
+

Since: 1.20

+
+
+
+

Types and Values

+
+

struct PangoRenderer

+
struct PangoRenderer {
+  PangoMatrix *matrix;		/* May be NULL */
+};
+
+

PangoRenderer is a base class for objects that are used to +render Pango objects such as PangoGlyphString and +PangoLayout.

+
+

Members

+
+++++ + + + + + +

PangoMatrix *matrix;

the current transformation matrix for +the Renderer; may be NULL, which should be treated the +same as the identity matrix.

[nullable]
+
+

Since: 1.8

+
+
+
+

enum PangoRenderPart

+

PangoRenderPart defines different items to render for such +purposes as setting colors.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

PANGO_RENDER_PART_FOREGROUND

+

the text itself

+
 

PANGO_RENDER_PART_BACKGROUND

+

the area behind the text

+
 

PANGO_RENDER_PART_UNDERLINE

+

underlines

+
 

PANGO_RENDER_PART_STRIKETHROUGH

+

strikethrough lines

+
 
+
+

Since: 1.8

+
+
+
+

PANGO_TYPE_RENDER_PART

+
#define PANGO_TYPE_RENDER_PART (pango_render_part_get_type ())
+
+
+
+
+

struct PangoRendererClass

+
struct PangoRendererClass {
+  /* All of the following have default implementations
+   * and take as coordinates user coordinates in Pango units
+   */
+  void (*draw_glyphs) (PangoRenderer     *renderer,
+		       PangoFont         *font,
+		       PangoGlyphString  *glyphs,
+		       int                x,
+		       int                y);
+  void (*draw_rectangle) (PangoRenderer     *renderer,
+			  PangoRenderPart    part,
+			  int                x,
+			  int                y,
+			  int                width,
+			  int                height);
+  void (*draw_error_underline) (PangoRenderer     *renderer,
+				int                x,
+				int                y,
+				int                width,
+				int                height);
+
+  /* Nothing is drawn for shaped glyphs unless this is implemented */
+  void (*draw_shape) (PangoRenderer  *renderer,
+		      PangoAttrShape *attr,
+		      int             x,
+		      int             y);
+
+  /* These two must be implemented and take coordinates in
+   * device space as doubles.
+   */
+  void (*draw_trapezoid) (PangoRenderer  *renderer,
+			  PangoRenderPart part,
+			  double          y1_,
+			  double          x11,
+			  double          x21,
+			  double          y2,
+			  double          x12,
+			  double          x22);
+  void (*draw_glyph) (PangoRenderer *renderer,
+		      PangoFont     *font,
+		      PangoGlyph     glyph,
+		      double         x,
+		      double         y);
+
+  /* Notification of change in rendering attributes
+   */
+  void (*part_changed) (PangoRenderer   *renderer,
+			PangoRenderPart  part);
+
+  /* Paired around drawing operations
+   */
+  void (*begin) (PangoRenderer *renderer);
+  void (*end)   (PangoRenderer *renderer);
+
+  /* Hooks into the details of layout rendering
+   */
+  void (*prepare_run) (PangoRenderer  *renderer,
+		       PangoLayoutRun *run);
+
+  /* All of the following have default implementations
+   * and take as coordinates user coordinates in Pango units
+   */
+  void (*draw_glyph_item) (PangoRenderer     *renderer,
+			   const char        *text,
+			   PangoGlyphItem    *glyph_item,
+			   int                x,
+			   int                y);
+};
+
+

Class structure for PangoRenderer.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

draw_glyphs ()

draws a PangoGlyphString

 

draw_rectangle ()

draws a rectangle

 

draw_error_underline ()

draws a squiggly line that approximately +covers the given rectangle in the style of an underline used to +indicate a spelling error.

 

draw_shape ()

draw content for a glyph shaped with PangoAttrShape. +x +, y +are the coordinates of the left edge of the baseline, +in user coordinates.

 

draw_trapezoid ()

draws a trapezoidal filled area

 

draw_glyph ()

draws a single glyph

 

part_changed ()

do renderer specific processing when rendering +attributes change

 

begin ()

Do renderer-specific initialization before drawing

 

end ()

Do renderer-specific cleanup after drawing

 

prepare_run ()

updates the renderer for a new run

 

draw_glyph_item ()

draws a PangoGlyphItem

 
+
+

Since: 1.8

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/annotation-glossary.html b/docs/html/annotation-glossary.html new file mode 100644 index 0000000..d107d8f --- /dev/null +++ b/docs/html/annotation-glossary.html @@ -0,0 +1,97 @@ + + + + +Annotation Glossary: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Annotation Glossary

+

A

+
allow-none
+

NULL is OK, both for passing and for returning.

+
array
+

Parameter points to an array of items.

+

C

+
closure
+

This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.

+

E

+
element-type
+

Generics and defining elements of containers and arrays.

+

I

+
inout
+

Parameter for input and for returning results. Default is transfer full.

+

N

+
nullable
+

NULL may be passed as the value in, out, in-out; or as a return value.

+

O

+
optional
+

NULL may be passed instead of a pointer to a location.

+
out
+

Parameter for returning results. Default is transfer full.

+
out caller-allocates
+

Out parameter, where caller must allocate storage.

+

S

+
scope call
+

The callback is valid only during the call to the method.

+
skip
+

Exposed in C code, not necessarily available in other languages.

+

T

+
transfer container
+

Free data container after the code is done.

+
transfer full
+

Free data after the code is done.

+
transfer none
+

Don't free data after the code is done.

+

U

+
Unstable
+

Unstable interfaces are experimental or transitional. They are typically used to +give outside developers early access to new or rapidly changing technology, or +to provide an interim solution to a problem where a more general solution is +anticipated. No claims are made about either source or binary compatibility from +one minor release to the next. + +The Unstable interface level is a warning that these interfaces are subject to +change without warning and should not be used in unbundled products. + +Given such caveats, customer impact need not be a factor when considering +incompatible changes to an Unstable interface in a major or minor release. +Nonetheless, when such changes are introduced, the changes should still be +mentioned in the release notes for the affected release. +

+
+ + + \ No newline at end of file diff --git a/docs/html/api-index-full.html b/docs/html/api-index-full.html new file mode 100644 index 0000000..37e6445 --- /dev/null +++ b/docs/html/api-index-full.html @@ -0,0 +1,3107 @@ + + + + +Index of all symbols: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Index of all symbols

+

A

+
+PangoAlignment, enum in Layout Objects +
+
+
+PangoAnalysis, struct in Text Processing +
+
+
+PANGO_ANALYSIS_FLAG_CENTERED_BASELINE, macro in Text Processing +
+
+
+PANGO_ANALYSIS_FLAG_IS_ELLIPSIS, macro in Text Processing +
+
+
+PANGO_ASCENT, macro in Glyph Storage +
+
+
+PangoAttrClass, struct in Text Attributes +
+
+
+PangoAttrColor, struct in Text Attributes +
+
+
+PangoAttrDataCopyFunc, user_function in Text Attributes +
+
+
+PangoAttrFilterFunc, user_function in Text Attributes +
+
+
+PangoAttrFloat, struct in Text Attributes +
+
+
+PangoAttrFontDesc, struct in Text Attributes +
+
+
+PangoAttrFontFeatures, struct in Text Attributes +
+
+
+PangoAttribute, struct in Text Attributes +
+
+
+pango_attribute_copy, function in Text Attributes +
+
+
+pango_attribute_destroy, function in Text Attributes +
+
+
+pango_attribute_equal, function in Text Attributes +
+
+
+pango_attribute_init, function in Text Attributes +
+
+
+PangoAttrInt, struct in Text Attributes +
+
+
+PangoAttrIterator, struct in Text Attributes +
+
+
+PangoAttrLanguage, struct in Text Attributes +
+
+
+PangoAttrList, struct in Text Attributes +
+
+
+PangoAttrShape, struct in Text Attributes +
+
+
+PangoAttrSize, struct in Text Attributes +
+
+
+PangoAttrString, struct in Text Attributes +
+
+
+PangoAttrType, enum in Text Attributes +
+
+
+pango_attr_background_alpha_new, function in Text Attributes +
+
+
+pango_attr_background_new, function in Text Attributes +
+
+
+pango_attr_fallback_new, function in Text Attributes +
+
+
+pango_attr_family_new, function in Text Attributes +
+
+
+pango_attr_font_desc_new, function in Text Attributes +
+
+
+pango_attr_font_features_new, function in Text Attributes +
+
+
+pango_attr_foreground_alpha_new, function in Text Attributes +
+
+
+pango_attr_foreground_new, function in Text Attributes +
+
+
+pango_attr_gravity_hint_new, function in Text Attributes +
+
+
+pango_attr_gravity_new, function in Text Attributes +
+
+
+PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING, macro in Text Attributes +
+
+
+PANGO_ATTR_INDEX_TO_TEXT_END, macro in Text Attributes +
+
+
+pango_attr_iterator_copy, function in Text Attributes +
+
+
+pango_attr_iterator_destroy, function in Text Attributes +
+
+
+pango_attr_iterator_get, function in Text Attributes +
+
+
+pango_attr_iterator_get_attrs, function in Text Attributes +
+
+
+pango_attr_iterator_get_font, function in Text Attributes +
+
+
+pango_attr_iterator_next, function in Text Attributes +
+
+
+pango_attr_iterator_range, function in Text Attributes +
+
+
+pango_attr_language_new, function in Text Attributes +
+
+
+pango_attr_letter_spacing_new, function in Text Attributes +
+
+
+pango_attr_list_change, function in Text Attributes +
+
+
+pango_attr_list_copy, function in Text Attributes +
+
+
+pango_attr_list_filter, function in Text Attributes +
+
+
+pango_attr_list_get_iterator, function in Text Attributes +
+
+
+pango_attr_list_insert, function in Text Attributes +
+
+
+pango_attr_list_insert_before, function in Text Attributes +
+
+
+pango_attr_list_new, function in Text Attributes +
+
+
+pango_attr_list_ref, function in Text Attributes +
+
+
+pango_attr_list_splice, function in Text Attributes +
+
+
+pango_attr_list_unref, function in Text Attributes +
+
+
+pango_attr_rise_new, function in Text Attributes +
+
+
+pango_attr_scale_new, function in Text Attributes +
+
+
+pango_attr_shape_new, function in Text Attributes +
+
+
+pango_attr_shape_new_with_data, function in Text Attributes +
+
+
+pango_attr_size_new, function in Text Attributes +
+
+
+pango_attr_size_new_absolute, function in Text Attributes +
+
+
+pango_attr_stretch_new, function in Text Attributes +
+
+
+pango_attr_strikethrough_color_new, function in Text Attributes +
+
+
+pango_attr_strikethrough_new, function in Text Attributes +
+
+
+pango_attr_style_new, function in Text Attributes +
+
+
+pango_attr_type_get_name, function in Text Attributes +
+
+
+pango_attr_type_register, function in Text Attributes +
+
+
+pango_attr_underline_color_new, function in Text Attributes +
+
+
+pango_attr_underline_new, function in Text Attributes +
+
+
+pango_attr_variant_new, function in Text Attributes +
+
+
+pango_attr_weight_new, function in Text Attributes +
+
+

B

+
+PangoBidiType, enum in Bidirectional Text +
+
+
+pango_bidi_type_for_unichar, function in Bidirectional Text +
+
+
+pango_break, function in Text Processing +
+
+

C

+
+PangoCairoFont, struct in Cairo Rendering +
+
+
+PangoCairoFontMap, struct in Cairo Rendering +
+
+
+PangoCairoShapeRendererFunc, user_function in Cairo Rendering +
+
+
+pango_cairo_context_get_font_options, function in Cairo Rendering +
+
+
+pango_cairo_context_get_resolution, function in Cairo Rendering +
+
+
+pango_cairo_context_get_shape_renderer, function in Cairo Rendering +
+
+
+pango_cairo_context_set_font_options, function in Cairo Rendering +
+
+
+pango_cairo_context_set_resolution, function in Cairo Rendering +
+
+
+pango_cairo_context_set_shape_renderer, function in Cairo Rendering +
+
+
+pango_cairo_create_context, function in Cairo Rendering +
+
+
+pango_cairo_create_layout, function in Cairo Rendering +
+
+
+pango_cairo_error_underline_path, function in Cairo Rendering +
+
+
+pango_cairo_font_get_scaled_font, function in Cairo Rendering +
+
+
+pango_cairo_font_map_create_context, function in Cairo Rendering +
+
+
+pango_cairo_font_map_get_default, function in Cairo Rendering +
+
+
+pango_cairo_font_map_get_font_type, function in Cairo Rendering +
+
+
+pango_cairo_font_map_get_resolution, function in Cairo Rendering +
+
+
+pango_cairo_font_map_new, function in Cairo Rendering +
+
+
+pango_cairo_font_map_new_for_font_type, function in Cairo Rendering +
+
+
+pango_cairo_font_map_set_default, function in Cairo Rendering +
+
+
+pango_cairo_font_map_set_resolution, function in Cairo Rendering +
+
+
+pango_cairo_glyph_string_path, function in Cairo Rendering +
+
+
+pango_cairo_layout_line_path, function in Cairo Rendering +
+
+
+pango_cairo_layout_path, function in Cairo Rendering +
+
+
+pango_cairo_show_error_underline, function in Cairo Rendering +
+
+
+pango_cairo_show_glyph_item, function in Cairo Rendering +
+
+
+pango_cairo_show_glyph_string, function in Cairo Rendering +
+
+
+pango_cairo_show_layout, function in Cairo Rendering +
+
+
+pango_cairo_show_layout_line, function in Cairo Rendering +
+
+
+pango_cairo_update_context, function in Cairo Rendering +
+
+
+pango_cairo_update_layout, function in Cairo Rendering +
+
+
+PangoColor, struct in Text Attributes +
+
+
+pango_color_copy, function in Text Attributes +
+
+
+pango_color_free, function in Text Attributes +
+
+
+pango_color_parse, function in Text Attributes +
+
+
+pango_color_to_string, function in Text Attributes +
+
+
+pango_config_key_get, function in Miscellaneous Utilities +
+
+
+pango_config_key_get_system, function in Miscellaneous Utilities +
+
+
+PangoContext, struct in Text Processing +
+
+
+pango_context_changed, function in Text Processing +
+
+
+pango_context_get_base_dir, function in Text Processing +
+
+
+pango_context_get_base_gravity, function in Text Processing +
+
+
+pango_context_get_font_description, function in Text Processing +
+
+
+pango_context_get_font_map, function in Text Processing +
+
+
+pango_context_get_gravity, function in Text Processing +
+
+
+pango_context_get_gravity_hint, function in Text Processing +
+
+
+pango_context_get_language, function in Text Processing +
+
+
+pango_context_get_matrix, function in Text Processing +
+
+
+pango_context_get_metrics, function in Text Processing +
+
+
+pango_context_get_serial, function in Text Processing +
+
+
+pango_context_list_families, function in Text Processing +
+
+
+pango_context_load_font, function in Text Processing +
+
+
+pango_context_load_fontset, function in Text Processing +
+
+
+pango_context_new, function in Text Processing +
+
+
+pango_context_set_base_dir, function in Text Processing +
+
+
+pango_context_set_base_gravity, function in Text Processing +
+
+
+pango_context_set_font_description, function in Text Processing +
+
+
+pango_context_set_font_map, function in Text Processing +
+
+
+pango_context_set_gravity_hint, function in Text Processing +
+
+
+pango_context_set_language, function in Text Processing +
+
+
+pango_context_set_matrix, function in Text Processing +
+
+
+pango_core_text_font_get_ctfont, function in CoreText Fonts +
+
+
+PangoCoverage, struct in Coverage Maps +
+
+
+PangoCoverageLevel, enum in Coverage Maps +
+
+
+pango_coverage_copy, function in Coverage Maps +
+
+
+pango_coverage_from_bytes, function in Coverage Maps +
+
+
+pango_coverage_get, function in Coverage Maps +
+
+
+pango_coverage_max, function in Coverage Maps +
+
+
+pango_coverage_new, function in Coverage Maps +
+
+
+pango_coverage_ref, function in Coverage Maps +
+
+
+pango_coverage_set, function in Coverage Maps +
+
+
+pango_coverage_to_bytes, function in Coverage Maps +
+
+
+pango_coverage_unref, function in Coverage Maps +
+
+

D

+
+pango_default_break, function in Text Processing +
+
+
+PANGO_DESCENT, macro in Glyph Storage +
+
+
+PangoDirection, enum in Bidirectional Text +
+
+

E

+
+PangoEllipsizeMode, enum in Layout Objects +
+
+
+PangoEngine, struct in Engines +
+
+
+PangoEngineClass, struct in Engines +
+
+
+PangoEngineInfo, struct in Engines +
+
+
+PangoEngineLang, struct in PangoEngineLang +
+
+
+PangoEngineLangClass, struct in PangoEngineLang +
+
+
+PangoEngineScriptInfo, struct in Engines +
+
+
+PangoEngineShape, struct in PangoEngineShape +
+
+
+PangoEngineShapeClass, struct in PangoEngineShape +
+
+
+PANGO_ENGINE_LANG_DEFINE_TYPE, macro in PangoEngineLang +
+
+
+PANGO_ENGINE_SHAPE_DEFINE_TYPE, macro in PangoEngineShape +
+
+
+PANGO_ENGINE_TYPE_LANG, macro in PangoEngineLang +
+
+
+PANGO_ENGINE_TYPE_SHAPE, macro in PangoEngineShape +
+
+
+pango_extents_to_pixels, function in Glyph Storage +
+
+

F

+
+PangoFcDecoder, struct in PangoFcDecoder +
+
+
+PangoFcDecoderClass, struct in PangoFcDecoder +
+
+
+PangoFcDecoderFindFunc, user_function in PangoFcFontMap +
+
+
+PangoFcFont, struct in PangoFcFont +
+
+
+PangoFcFont:fontmap, object property in PangoFcFont +
+
+
+PangoFcFont:pattern, object property in PangoFcFont +
+
+
+PangoFcFontClass, struct in PangoFcFont +
+
+
+PangoFcFontKey, struct in PangoFcFontMap +
+
+
+PangoFcFontMap, struct in PangoFcFontMap +
+
+
+PangoFcFontMapClass, struct in PangoFcFontMap +
+
+
+PangoFcFontsetKey, struct in PangoFcFontMap +
+
+
+pango_fc_decoder_get_charset, function in PangoFcDecoder +
+
+
+pango_fc_decoder_get_glyph, function in PangoFcDecoder +
+
+
+pango_fc_fontset_key_get_absolute_size, function in PangoFcFontMap +
+
+
+pango_fc_fontset_key_get_context_key, function in PangoFcFontMap +
+
+
+pango_fc_fontset_key_get_description, function in PangoFcFontMap +
+
+
+pango_fc_fontset_key_get_language, function in PangoFcFontMap +
+
+
+pango_fc_fontset_key_get_matrix, function in PangoFcFontMap +
+
+
+pango_fc_fontset_key_get_resolution, function in PangoFcFontMap +
+
+
+pango_fc_font_description_from_pattern, function in PangoFcFontMap +
+
+
+PANGO_FC_FONT_FEATURES, macro in PangoFcFontMap +
+
+
+pango_fc_font_get_glyph, function in PangoFcFont +
+
+
+pango_fc_font_get_unknown_glyph, function in PangoFcFont +
+
+
+pango_fc_font_has_char, function in PangoFcFont +
+
+
+pango_fc_font_kern_glyphs, function in PangoFcFont +
+
+
+pango_fc_font_key_get_context_key, function in PangoFcFontMap +
+
+
+pango_fc_font_key_get_matrix, function in PangoFcFontMap +
+
+
+pango_fc_font_key_get_pattern, function in PangoFcFontMap +
+
+
+pango_fc_font_lock_face, function in PangoFcFont +
+
+
+pango_fc_font_map_add_decoder_find_func, function in PangoFcFontMap +
+
+
+pango_fc_font_map_cache_clear, function in PangoFcFontMap +
+
+
+pango_fc_font_map_config_changed, function in PangoFcFontMap +
+
+
+pango_fc_font_map_create_context, function in PangoFcFontMap +
+
+
+pango_fc_font_map_find_decoder, function in PangoFcFontMap +
+
+
+pango_fc_font_map_get_config, function in PangoFcFontMap +
+
+
+pango_fc_font_map_set_config, function in PangoFcFontMap +
+
+
+pango_fc_font_map_shutdown, function in PangoFcFontMap +
+
+
+pango_fc_font_unlock_face, function in PangoFcFont +
+
+
+PANGO_FC_GRAVITY, macro in PangoFcFontMap +
+
+
+PANGO_FC_PRGNAME, macro in PangoFcFontMap +
+
+
+PANGO_FC_VERSION, macro in PangoFcFontMap +
+
+
+pango_find_base_dir, function in Bidirectional Text +
+
+
+pango_find_map, function in Modules +
+
+
+pango_find_paragraph_boundary, function in Text Processing +
+
+
+PANGO_FONT, macro in Fonts +
+
+
+PangoFont, struct in Fonts +
+
+
+PangoFontDescription, struct in Fonts +
+
+
+PangoFontFace, struct in Fonts +
+
+
+PangoFontFamily, struct in Fonts +
+
+
+PangoFontMap, struct in Fonts +
+
+
+PangoFontMapClass, struct in Fonts +
+
+
+PangoFontMask, enum in Fonts +
+
+
+PangoFontMetrics, struct in Fonts +
+
+
+PangoFontset, struct in Fonts +
+
+
+PangoFontsetClass, struct in Fonts +
+
+
+PangoFontsetForeachFunc, user_function in Fonts +
+
+
+PangoFontsetSimple, struct in Fonts +
+
+
+pango_fontset_foreach, function in Fonts +
+
+
+pango_fontset_get_font, function in Fonts +
+
+
+pango_fontset_get_metrics, function in Fonts +
+
+
+pango_fontset_simple_append, function in Fonts +
+
+
+pango_fontset_simple_new, function in Fonts +
+
+
+pango_fontset_simple_size, function in Fonts +
+
+
+pango_font_describe, function in Fonts +
+
+
+pango_font_describe_with_absolute_size, function in Fonts +
+
+
+pango_font_descriptions_free, function in Fonts +
+
+
+pango_font_description_better_match, function in Fonts +
+
+
+pango_font_description_copy, function in Fonts +
+
+
+pango_font_description_copy_static, function in Fonts +
+
+
+pango_font_description_equal, function in Fonts +
+
+
+pango_font_description_free, function in Fonts +
+
+
+pango_font_description_from_string, function in Fonts +
+
+
+pango_font_description_get_family, function in Fonts +
+
+
+pango_font_description_get_gravity, function in Fonts +
+
+
+pango_font_description_get_set_fields, function in Fonts +
+
+
+pango_font_description_get_size, function in Fonts +
+
+
+pango_font_description_get_size_is_absolute, function in Fonts +
+
+
+pango_font_description_get_stretch, function in Fonts +
+
+
+pango_font_description_get_style, function in Fonts +
+
+
+pango_font_description_get_variant, function in Fonts +
+
+
+pango_font_description_get_variations, function in Fonts +
+
+
+pango_font_description_get_weight, function in Fonts +
+
+
+pango_font_description_hash, function in Fonts +
+
+
+pango_font_description_merge, function in Fonts +
+
+
+pango_font_description_merge_static, function in Fonts +
+
+
+pango_font_description_new, function in Fonts +
+
+
+pango_font_description_set_absolute_size, function in Fonts +
+
+
+pango_font_description_set_family, function in Fonts +
+
+
+pango_font_description_set_family_static, function in Fonts +
+
+
+pango_font_description_set_gravity, function in Fonts +
+
+
+pango_font_description_set_size, function in Fonts +
+
+
+pango_font_description_set_stretch, function in Fonts +
+
+
+pango_font_description_set_style, function in Fonts +
+
+
+pango_font_description_set_variant, function in Fonts +
+
+
+pango_font_description_set_variations, function in Fonts +
+
+
+pango_font_description_set_variations_static, function in Fonts +
+
+
+pango_font_description_set_weight, function in Fonts +
+
+
+pango_font_description_to_filename, function in Fonts +
+
+
+pango_font_description_to_string, function in Fonts +
+
+
+pango_font_description_unset_fields, function in Fonts +
+
+
+PANGO_FONT_FACE, macro in Fonts +
+
+
+pango_font_face_describe, function in Fonts +
+
+
+pango_font_face_get_face_name, function in Fonts +
+
+
+pango_font_face_is_synthesized, function in Fonts +
+
+
+pango_font_face_list_sizes, function in Fonts +
+
+
+PANGO_FONT_FAMILY, macro in Fonts +
+
+
+pango_font_family_get_name, function in Fonts +
+
+
+pango_font_family_is_monospace, function in Fonts +
+
+
+pango_font_family_list_faces, function in Fonts +
+
+
+pango_font_find_shaper, function in Fonts +
+
+
+pango_font_get_coverage, function in Fonts +
+
+
+pango_font_get_font_map, function in Fonts +
+
+
+pango_font_get_glyph_extents, function in Fonts +
+
+
+pango_font_get_metrics, function in Fonts +
+
+
+PANGO_FONT_MAP, macro in Fonts +
+
+
+pango_font_map_changed, function in Fonts +
+
+
+PANGO_FONT_MAP_CLASS, macro in Fonts +
+
+
+pango_font_map_create_context, function in Fonts +
+
+
+PANGO_FONT_MAP_GET_CLASS, macro in Fonts +
+
+
+pango_font_map_get_serial, function in Fonts +
+
+
+pango_font_map_get_shape_engine_type, function in Fonts +
+
+
+pango_font_map_list_families, function in Fonts +
+
+
+pango_font_map_load_font, function in Fonts +
+
+
+pango_font_map_load_fontset, function in Fonts +
+
+
+pango_font_metrics_get_approximate_char_width, function in Fonts +
+
+
+pango_font_metrics_get_approximate_digit_width, function in Fonts +
+
+
+pango_font_metrics_get_ascent, function in Fonts +
+
+
+pango_font_metrics_get_descent, function in Fonts +
+
+
+pango_font_metrics_get_strikethrough_position, function in Fonts +
+
+
+pango_font_metrics_get_strikethrough_thickness, function in Fonts +
+
+
+pango_font_metrics_get_underline_position, function in Fonts +
+
+
+pango_font_metrics_get_underline_thickness, function in Fonts +
+
+
+pango_font_metrics_ref, function in Fonts +
+
+
+pango_font_metrics_unref, function in Fonts +
+
+
+PangoFT2FontMap, struct in FreeType Fonts and Rendering +
+
+
+PangoFT2SubstituteFunc, user_function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_get_coverage, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_get_face, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_get_kerning, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_create_context, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_for_display, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_new, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_set_default_substitute, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_set_resolution, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_font_map_substitute_changed, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_get_context, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_get_unknown_glyph, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render_layout, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render_layout_line, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render_layout_line_subpixel, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render_layout_subpixel, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_render_transformed, function in FreeType Fonts and Rendering +
+
+
+pango_ft2_shutdown_display, function in FreeType Fonts and Rendering +
+
+

G

+
+pango_get_lib_subdirectory, function in Miscellaneous Utilities +
+
+
+pango_get_log_attrs, function in Text Processing +
+
+
+pango_get_mirror_char, function in Bidirectional Text +
+
+
+pango_get_sysconf_subdirectory, function in Miscellaneous Utilities +
+
+
+PANGO_GET_UNKNOWN_GLYPH, macro in Glyph Storage +
+
+
+PangoGlyph, typedef in Glyph Storage +
+
+
+PangoGlyphGeometry, struct in Glyph Storage +
+
+
+PangoGlyphInfo, struct in Glyph Storage +
+
+
+PangoGlyphItem, struct in Glyph Storage +
+
+
+PangoGlyphItemIter, struct in Glyph Storage +
+
+
+PangoGlyphString, struct in Glyph Storage +
+
+
+PangoGlyphUnit, typedef in Glyph Storage +
+
+
+PangoGlyphVisAttr, struct in Glyph Storage +
+
+
+PANGO_GLYPH_EMPTY, macro in Glyph Storage +
+
+
+PANGO_GLYPH_INVALID_INPUT, macro in Glyph Storage +
+
+
+pango_glyph_item_apply_attrs, function in Glyph Storage +
+
+
+pango_glyph_item_copy, function in Glyph Storage +
+
+
+pango_glyph_item_free, function in Glyph Storage +
+
+
+pango_glyph_item_get_logical_widths, function in Glyph Storage +
+
+
+pango_glyph_item_iter_copy, function in Glyph Storage +
+
+
+pango_glyph_item_iter_free, function in Glyph Storage +
+
+
+pango_glyph_item_iter_init_end, function in Glyph Storage +
+
+
+pango_glyph_item_iter_init_start, function in Glyph Storage +
+
+
+pango_glyph_item_iter_next_cluster, function in Glyph Storage +
+
+
+pango_glyph_item_iter_prev_cluster, function in Glyph Storage +
+
+
+pango_glyph_item_letter_space, function in Glyph Storage +
+
+
+pango_glyph_item_split, function in Glyph Storage +
+
+
+pango_glyph_string_copy, function in Glyph Storage +
+
+
+pango_glyph_string_extents, function in Glyph Storage +
+
+
+pango_glyph_string_extents_range, function in Glyph Storage +
+
+
+pango_glyph_string_free, function in Glyph Storage +
+
+
+pango_glyph_string_get_logical_widths, function in Glyph Storage +
+
+
+pango_glyph_string_get_width, function in Glyph Storage +
+
+
+pango_glyph_string_index_to_x, function in Glyph Storage +
+
+
+pango_glyph_string_new, function in Glyph Storage +
+
+
+pango_glyph_string_set_size, function in Glyph Storage +
+
+
+pango_glyph_string_x_to_index, function in Glyph Storage +
+
+
+PANGO_GLYPH_UNKNOWN_FLAG, macro in Glyph Storage +
+
+
+PangoGravity, enum in Vertical Text +
+
+
+PangoGravityHint, enum in Vertical Text +
+
+
+pango_gravity_get_for_matrix, function in Vertical Text +
+
+
+pango_gravity_get_for_script, function in Vertical Text +
+
+
+pango_gravity_get_for_script_and_width, function in Vertical Text +
+
+
+PANGO_GRAVITY_IS_IMPROPER, macro in Vertical Text +
+
+
+PANGO_GRAVITY_IS_VERTICAL, macro in Vertical Text +
+
+
+pango_gravity_to_rotation, function in Vertical Text +
+
+

I

+
+PangoIncludedModule, struct in Modules +
+
+
+PANGO_IS_FONT, macro in Fonts +
+
+
+PANGO_IS_FONT_FACE, macro in Fonts +
+
+
+PANGO_IS_FONT_FAMILY, macro in Fonts +
+
+
+PANGO_IS_FONT_MAP, macro in Fonts +
+
+
+PANGO_IS_FONT_MAP_CLASS, macro in Fonts +
+
+
+pango_is_zero_width, function in Miscellaneous Utilities +
+
+
+PangoItem, struct in Text Processing +
+
+
+pango_itemize, function in Text Processing +
+
+
+pango_itemize_with_base_dir, function in Text Processing +
+
+
+pango_item_copy, function in Text Processing +
+
+
+pango_item_free, function in Text Processing +
+
+
+pango_item_new, function in Text Processing +
+
+
+pango_item_split, function in Text Processing +
+
+

L

+
+PangoLanguage, struct in Scripts and Languages +
+
+
+pango_language_from_string, function in Scripts and Languages +
+
+
+pango_language_get_default, function in Scripts and Languages +
+
+
+pango_language_get_sample_string, function in Scripts and Languages +
+
+
+pango_language_get_scripts, function in Scripts and Languages +
+
+
+pango_language_includes_script, function in Scripts and Languages +
+
+
+pango_language_matches, function in Scripts and Languages +
+
+
+pango_language_to_string, function in Scripts and Languages +
+
+
+PangoLayout, struct in Layout Objects +
+
+
+PangoLayoutIter, struct in Layout Objects +
+
+
+PangoLayoutLine, struct in Layout Objects +
+
+
+PangoLayoutRun, typedef in Layout Objects +
+
+
+pango_layout_context_changed, function in Layout Objects +
+
+
+pango_layout_copy, function in Layout Objects +
+
+
+pango_layout_get_alignment, function in Layout Objects +
+
+
+pango_layout_get_attributes, function in Layout Objects +
+
+
+pango_layout_get_auto_dir, function in Layout Objects +
+
+
+pango_layout_get_baseline, function in Layout Objects +
+
+
+pango_layout_get_character_count, function in Layout Objects +
+
+
+pango_layout_get_context, function in Layout Objects +
+
+
+pango_layout_get_cursor_pos, function in Layout Objects +
+
+
+pango_layout_get_ellipsize, function in Layout Objects +
+
+
+pango_layout_get_extents, function in Layout Objects +
+
+
+pango_layout_get_font_description, function in Layout Objects +
+
+
+pango_layout_get_height, function in Layout Objects +
+
+
+pango_layout_get_indent, function in Layout Objects +
+
+
+pango_layout_get_iter, function in Layout Objects +
+
+
+pango_layout_get_justify, function in Layout Objects +
+
+
+pango_layout_get_line, function in Layout Objects +
+
+
+pango_layout_get_lines, function in Layout Objects +
+
+
+pango_layout_get_lines_readonly, function in Layout Objects +
+
+
+pango_layout_get_line_count, function in Layout Objects +
+
+
+pango_layout_get_line_readonly, function in Layout Objects +
+
+
+pango_layout_get_log_attrs, function in Layout Objects +
+
+
+pango_layout_get_log_attrs_readonly, function in Layout Objects +
+
+
+pango_layout_get_pixel_extents, function in Layout Objects +
+
+
+pango_layout_get_pixel_size, function in Layout Objects +
+
+
+pango_layout_get_serial, function in Layout Objects +
+
+
+pango_layout_get_single_paragraph_mode, function in Layout Objects +
+
+
+pango_layout_get_size, function in Layout Objects +
+
+
+pango_layout_get_spacing, function in Layout Objects +
+
+
+pango_layout_get_tabs, function in Layout Objects +
+
+
+pango_layout_get_text, function in Layout Objects +
+
+
+pango_layout_get_unknown_glyphs_count, function in Layout Objects +
+
+
+pango_layout_get_width, function in Layout Objects +
+
+
+pango_layout_get_wrap, function in Layout Objects +
+
+
+pango_layout_index_to_line_x, function in Layout Objects +
+
+
+pango_layout_index_to_pos, function in Layout Objects +
+
+
+pango_layout_is_ellipsized, function in Layout Objects +
+
+
+pango_layout_is_wrapped, function in Layout Objects +
+
+
+pango_layout_iter_at_last_line, function in Layout Objects +
+
+
+pango_layout_iter_copy, function in Layout Objects +
+
+
+pango_layout_iter_free, function in Layout Objects +
+
+
+pango_layout_iter_get_baseline, function in Layout Objects +
+
+
+pango_layout_iter_get_char_extents, function in Layout Objects +
+
+
+pango_layout_iter_get_cluster_extents, function in Layout Objects +
+
+
+pango_layout_iter_get_index, function in Layout Objects +
+
+
+pango_layout_iter_get_layout, function in Layout Objects +
+
+
+pango_layout_iter_get_layout_extents, function in Layout Objects +
+
+
+pango_layout_iter_get_line, function in Layout Objects +
+
+
+pango_layout_iter_get_line_extents, function in Layout Objects +
+
+
+pango_layout_iter_get_line_readonly, function in Layout Objects +
+
+
+pango_layout_iter_get_line_yrange, function in Layout Objects +
+
+
+pango_layout_iter_get_run, function in Layout Objects +
+
+
+pango_layout_iter_get_run_extents, function in Layout Objects +
+
+
+pango_layout_iter_get_run_readonly, function in Layout Objects +
+
+
+pango_layout_iter_next_char, function in Layout Objects +
+
+
+pango_layout_iter_next_cluster, function in Layout Objects +
+
+
+pango_layout_iter_next_line, function in Layout Objects +
+
+
+pango_layout_iter_next_run, function in Layout Objects +
+
+
+pango_layout_line_get_extents, function in Layout Objects +
+
+
+pango_layout_line_get_pixel_extents, function in Layout Objects +
+
+
+pango_layout_line_get_x_ranges, function in Layout Objects +
+
+
+pango_layout_line_index_to_x, function in Layout Objects +
+
+
+pango_layout_line_ref, function in Layout Objects +
+
+
+pango_layout_line_unref, function in Layout Objects +
+
+
+pango_layout_line_x_to_index, function in Layout Objects +
+
+
+pango_layout_move_cursor_visually, function in Layout Objects +
+
+
+pango_layout_new, function in Layout Objects +
+
+
+pango_layout_set_alignment, function in Layout Objects +
+
+
+pango_layout_set_attributes, function in Layout Objects +
+
+
+pango_layout_set_auto_dir, function in Layout Objects +
+
+
+pango_layout_set_ellipsize, function in Layout Objects +
+
+
+pango_layout_set_font_description, function in Layout Objects +
+
+
+pango_layout_set_height, function in Layout Objects +
+
+
+pango_layout_set_indent, function in Layout Objects +
+
+
+pango_layout_set_justify, function in Layout Objects +
+
+
+pango_layout_set_markup, function in Layout Objects +
+
+
+pango_layout_set_markup_with_accel, function in Layout Objects +
+
+
+pango_layout_set_single_paragraph_mode, function in Layout Objects +
+
+
+pango_layout_set_spacing, function in Layout Objects +
+
+
+pango_layout_set_tabs, function in Layout Objects +
+
+
+pango_layout_set_text, function in Layout Objects +
+
+
+pango_layout_set_width, function in Layout Objects +
+
+
+pango_layout_set_wrap, function in Layout Objects +
+
+
+pango_layout_xy_to_index, function in Layout Objects +
+
+
+PANGO_LBEARING, macro in Glyph Storage +
+
+
+pango_log2vis_get_embedding_levels, function in Miscellaneous Utilities +
+
+
+PangoLogAttr, struct in Text Processing +
+
+
+pango_lookup_aliases, function in Miscellaneous Utilities +
+
+

M

+
+PangoMap, struct in Modules +
+
+
+PangoMapEntry, struct in Modules +
+
+
+pango_map_get_engine, function in Modules +
+
+
+pango_map_get_engines, function in Modules +
+
+
+pango_markup_parser_finish, function in Text Attributes +
+
+
+pango_markup_parser_new, function in Text Attributes +
+
+
+PangoMatrix, struct in Glyph Storage +
+
+
+pango_matrix_concat, function in Glyph Storage +
+
+
+pango_matrix_copy, function in Glyph Storage +
+
+
+pango_matrix_free, function in Glyph Storage +
+
+
+pango_matrix_get_font_scale_factor, function in Glyph Storage +
+
+
+pango_matrix_get_font_scale_factors, function in Glyph Storage +
+
+
+PANGO_MATRIX_INIT, macro in Glyph Storage +
+
+
+pango_matrix_rotate, function in Glyph Storage +
+
+
+pango_matrix_scale, function in Glyph Storage +
+
+
+pango_matrix_transform_distance, function in Glyph Storage +
+
+
+pango_matrix_transform_pixel_rectangle, function in Glyph Storage +
+
+
+pango_matrix_transform_point, function in Glyph Storage +
+
+
+pango_matrix_transform_rectangle, function in Glyph Storage +
+
+
+pango_matrix_translate, function in Glyph Storage +
+
+
+pango_module_register, function in Modules +
+
+

O

+
+PangoOTBuffer, struct in OpenType Font Handling +
+
+
+PangoOTFeatureMap, struct in OpenType Font Handling +
+
+
+PangoOTGlyph, struct in OpenType Font Handling +
+
+
+PangoOTInfo, struct in OpenType Font Handling +
+
+
+PangoOTRuleset, struct in OpenType Font Handling +
+
+
+PangoOTRulesetDescription, struct in OpenType Font Handling +
+
+
+PangoOTTableType, enum in OpenType Font Handling +
+
+
+PangoOTTag, typedef in OpenType Font Handling +
+
+
+PANGO_OT_ALL_GLYPHS, macro in OpenType Font Handling +
+
+
+pango_ot_buffer_add_glyph, function in OpenType Font Handling +
+
+
+pango_ot_buffer_clear, function in OpenType Font Handling +
+
+
+pango_ot_buffer_destroy, function in OpenType Font Handling +
+
+
+pango_ot_buffer_get_glyphs, function in OpenType Font Handling +
+
+
+pango_ot_buffer_new, function in OpenType Font Handling +
+
+
+pango_ot_buffer_output, function in OpenType Font Handling +
+
+
+pango_ot_buffer_set_rtl, function in OpenType Font Handling +
+
+
+pango_ot_buffer_set_zero_width_marks, function in OpenType Font Handling +
+
+
+PANGO_OT_DEFAULT_LANGUAGE, macro in OpenType Font Handling +
+
+
+pango_ot_info_find_feature, function in OpenType Font Handling +
+
+
+pango_ot_info_find_language, function in OpenType Font Handling +
+
+
+pango_ot_info_find_script, function in OpenType Font Handling +
+
+
+pango_ot_info_get, function in OpenType Font Handling +
+
+
+pango_ot_info_list_features, function in OpenType Font Handling +
+
+
+pango_ot_info_list_languages, function in OpenType Font Handling +
+
+
+pango_ot_info_list_scripts, function in OpenType Font Handling +
+
+
+PANGO_OT_NO_FEATURE, macro in OpenType Font Handling +
+
+
+PANGO_OT_NO_SCRIPT, macro in OpenType Font Handling +
+
+
+pango_ot_ruleset_add_feature, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_description_copy, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_description_equal, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_description_free, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_description_hash, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_get_feature_count, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_get_for_description, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_maybe_add_feature, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_maybe_add_features, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_new, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_new_for, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_new_from_description, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_position, function in OpenType Font Handling +
+
+
+pango_ot_ruleset_substitute, function in OpenType Font Handling +
+
+
+PANGO_OT_TAG_DEFAULT_LANGUAGE, macro in OpenType Font Handling +
+
+
+PANGO_OT_TAG_DEFAULT_SCRIPT, macro in OpenType Font Handling +
+
+
+pango_ot_tag_from_language, function in OpenType Font Handling +
+
+
+pango_ot_tag_from_script, function in OpenType Font Handling +
+
+
+PANGO_OT_TAG_MAKE, macro in OpenType Font Handling +
+
+
+PANGO_OT_TAG_MAKE_FROM_STRING, macro in OpenType Font Handling +
+
+
+pango_ot_tag_to_language, function in OpenType Font Handling +
+
+
+pango_ot_tag_to_script, function in OpenType Font Handling +
+
+

P

+
+pango_parse_enum, function in Miscellaneous Utilities +
+
+
+pango_parse_markup, function in Text Attributes +
+
+
+pango_parse_stretch, function in Miscellaneous Utilities +
+
+
+pango_parse_style, function in Miscellaneous Utilities +
+
+
+pango_parse_variant, function in Miscellaneous Utilities +
+
+
+pango_parse_weight, function in Miscellaneous Utilities +
+
+
+PANGO_PIXELS, macro in Glyph Storage +
+
+
+PANGO_PIXELS_CEIL, macro in Glyph Storage +
+
+
+PANGO_PIXELS_FLOOR, macro in Glyph Storage +
+
+

Q

+
+pango_quantize_line_geometry, function in Miscellaneous Utilities +
+
+

R

+
+PANGO_RBEARING, macro in Glyph Storage +
+
+
+pango_read_line, function in Miscellaneous Utilities +
+
+
+PangoRectangle, struct in Glyph Storage +
+
+
+PangoRenderer, struct in PangoRenderer +
+
+
+PangoRendererClass, struct in PangoRenderer +
+
+
+pango_renderer_activate, function in PangoRenderer +
+
+
+pango_renderer_deactivate, function in PangoRenderer +
+
+
+pango_renderer_draw_error_underline, function in PangoRenderer +
+
+
+pango_renderer_draw_glyph, function in PangoRenderer +
+
+
+pango_renderer_draw_glyphs, function in PangoRenderer +
+
+
+pango_renderer_draw_glyph_item, function in PangoRenderer +
+
+
+pango_renderer_draw_layout, function in PangoRenderer +
+
+
+pango_renderer_draw_layout_line, function in PangoRenderer +
+
+
+pango_renderer_draw_rectangle, function in PangoRenderer +
+
+
+pango_renderer_draw_trapezoid, function in PangoRenderer +
+
+
+pango_renderer_get_alpha, function in PangoRenderer +
+
+
+pango_renderer_get_color, function in PangoRenderer +
+
+
+pango_renderer_get_layout, function in PangoRenderer +
+
+
+pango_renderer_get_layout_line, function in PangoRenderer +
+
+
+pango_renderer_get_matrix, function in PangoRenderer +
+
+
+pango_renderer_part_changed, function in PangoRenderer +
+
+
+pango_renderer_set_alpha, function in PangoRenderer +
+
+
+pango_renderer_set_color, function in PangoRenderer +
+
+
+pango_renderer_set_matrix, function in PangoRenderer +
+
+
+PangoRenderPart, enum in PangoRenderer +
+
+
+PANGO_RENDER_TYPE_CORE_TEXT, macro in CoreText Fonts +
+
+
+PANGO_RENDER_TYPE_FC, macro in PangoFcFont +
+
+
+PANGO_RENDER_TYPE_FT2, macro in FreeType Fonts and Rendering +
+
+
+PANGO_RENDER_TYPE_NONE, macro in Engines +
+
+
+PANGO_RENDER_TYPE_WIN32, macro in Win32 Fonts and Rendering +
+
+
+PANGO_RENDER_TYPE_XFT, macro in Xft Fonts and Rendering +
+
+
+pango_reorder_items, function in Text Processing +
+
+

S

+
+PANGO_SCALE, macro in Glyph Storage +
+
+
+PANGO_SCALE_LARGE, macro in Text Attributes +
+
+
+PANGO_SCALE_MEDIUM, macro in Text Attributes +
+
+
+PANGO_SCALE_SMALL, macro in Text Attributes +
+
+
+PANGO_SCALE_XX_LARGE, macro in Text Attributes +
+
+
+PANGO_SCALE_XX_SMALL, macro in Text Attributes +
+
+
+PANGO_SCALE_X_LARGE, macro in Text Attributes +
+
+
+PANGO_SCALE_X_SMALL, macro in Text Attributes +
+
+
+pango_scan_int, function in Miscellaneous Utilities +
+
+
+pango_scan_string, function in Miscellaneous Utilities +
+
+
+pango_scan_word, function in Miscellaneous Utilities +
+
+
+PangoScript, enum in Scripts and Languages +
+
+
+PangoScriptIter, struct in Scripts and Languages +
+
+
+script_engine_create, function in Engines +
+
+
+script_engine_exit, function in Engines +
+
+
+script_engine_init, function in Engines +
+
+
+script_engine_list, function in Engines +
+
+
+pango_script_for_unichar, function in Scripts and Languages +
+
+
+pango_script_get_sample_language, function in Scripts and Languages +
+
+
+pango_script_iter_free, function in Scripts and Languages +
+
+
+pango_script_iter_get_range, function in Scripts and Languages +
+
+
+pango_script_iter_new, function in Scripts and Languages +
+
+
+pango_script_iter_next, function in Scripts and Languages +
+
+
+pango_shape, function in Text Processing +
+
+
+pango_shape_full, function in Text Processing +
+
+
+pango_skip_space, function in Miscellaneous Utilities +
+
+
+pango_split_file_list, function in Miscellaneous Utilities +
+
+
+PangoStretch, enum in Fonts +
+
+
+PangoStyle, enum in Fonts +
+
+

T

+
+PangoTabAlign, enum in Tab Stops +
+
+
+PangoTabArray, struct in Tab Stops +
+
+
+pango_tab_array_copy, function in Tab Stops +
+
+
+pango_tab_array_free, function in Tab Stops +
+
+
+pango_tab_array_get_positions_in_pixels, function in Tab Stops +
+
+
+pango_tab_array_get_size, function in Tab Stops +
+
+
+pango_tab_array_get_tab, function in Tab Stops +
+
+
+pango_tab_array_get_tabs, function in Tab Stops +
+
+
+pango_tab_array_new, function in Tab Stops +
+
+
+pango_tab_array_new_with_positions, function in Tab Stops +
+
+
+pango_tab_array_resize, function in Tab Stops +
+
+
+pango_tab_array_set_tab, function in Tab Stops +
+
+
+pango_trim_string, function in Miscellaneous Utilities +
+
+
+PANGO_TYPE_ALIGNMENT, macro in Layout Objects +
+
+
+PANGO_TYPE_ATTR_LIST, macro in Text Attributes +
+
+
+PANGO_TYPE_ATTR_TYPE, macro in Text Attributes +
+
+
+PANGO_TYPE_COLOR, macro in Text Attributes +
+
+
+PANGO_TYPE_COVERAGE_LEVEL, macro in Coverage Maps +
+
+
+PANGO_TYPE_DIRECTION, macro in Text Processing +
+
+
+PANGO_TYPE_ELLIPSIZE_MODE, macro in Layout Objects +
+
+
+PANGO_TYPE_FONT, macro in Fonts +
+
+
+PANGO_TYPE_FONTSET, macro in Fonts +
+
+
+PANGO_TYPE_FONTSET_SIMPLE, macro in Fonts +
+
+
+PANGO_TYPE_FONT_DESCRIPTION, macro in Fonts +
+
+
+PANGO_TYPE_FONT_FACE, macro in Fonts +
+
+
+PANGO_TYPE_FONT_FAMILY, macro in Fonts +
+
+
+PANGO_TYPE_FONT_MAP, macro in Fonts +
+
+
+PANGO_TYPE_FONT_MASK, macro in Fonts +
+
+
+PANGO_TYPE_FONT_METRICS, macro in Fonts +
+
+
+PANGO_TYPE_GLYPH_ITEM, macro in Glyph Storage +
+
+
+PANGO_TYPE_GLYPH_ITEM_ITER, macro in Glyph Storage +
+
+
+PANGO_TYPE_GLYPH_STRING, macro in Glyph Storage +
+
+
+PANGO_TYPE_LANGUAGE, macro in Scripts and Languages +
+
+
+PANGO_TYPE_MATRIX, macro in Glyph Storage +
+
+
+PANGO_TYPE_RENDER_PART, macro in PangoRenderer +
+
+
+PANGO_TYPE_SCRIPT, macro in Scripts and Languages +
+
+
+PANGO_TYPE_STRETCH, macro in Fonts +
+
+
+PANGO_TYPE_STYLE, macro in Fonts +
+
+
+PANGO_TYPE_TAB_ALIGN, macro in Tab Stops +
+
+
+PANGO_TYPE_TAB_ARRAY, macro in Tab Stops +
+
+
+PANGO_TYPE_UNDERLINE, macro in Text Attributes +
+
+
+PANGO_TYPE_VARIANT, macro in Fonts +
+
+
+PANGO_TYPE_WEIGHT, macro in Fonts +
+
+
+PANGO_TYPE_WRAP_MODE, macro in Layout Objects +
+
+

U

+
+PangoUnderline, enum in Text Attributes +
+
+
+pango_unichar_direction, function in Bidirectional Text +
+
+
+pango_units_from_double, function in Glyph Storage +
+
+
+PANGO_UNITS_ROUND, macro in Glyph Storage +
+
+
+pango_units_to_double, function in Glyph Storage +
+
+

V

+
+PangoVariant, enum in Fonts +
+
+
+PANGO_VERSION, macro in Version Checking +
+
+
+pango_version, function in Version Checking +
+
+
+PANGO_VERSION_1_10, macro in Version Checking +
+
+
+PANGO_VERSION_1_12, macro in Version Checking +
+
+
+PANGO_VERSION_1_14, macro in Version Checking +
+
+
+PANGO_VERSION_1_16, macro in Version Checking +
+
+
+PANGO_VERSION_1_18, macro in Version Checking +
+
+
+PANGO_VERSION_1_2, macro in Version Checking +
+
+
+PANGO_VERSION_1_20, macro in Version Checking +
+
+
+PANGO_VERSION_1_22, macro in Version Checking +
+
+
+PANGO_VERSION_1_24, macro in Version Checking +
+
+
+PANGO_VERSION_1_26, macro in Version Checking +
+
+
+PANGO_VERSION_1_28, macro in Version Checking +
+
+
+PANGO_VERSION_1_30, macro in Version Checking +
+
+
+PANGO_VERSION_1_32, macro in Version Checking +
+
+
+PANGO_VERSION_1_34, macro in Version Checking +
+
+
+PANGO_VERSION_1_36, macro in Version Checking +
+
+
+PANGO_VERSION_1_38, macro in Version Checking +
+
+
+PANGO_VERSION_1_4, macro in Version Checking +
+
+
+PANGO_VERSION_1_40, macro in Version Checking +
+
+
+PANGO_VERSION_1_42, macro in Version Checking +
+
+
+PANGO_VERSION_1_6, macro in Version Checking +
+
+
+PANGO_VERSION_1_8, macro in Version Checking +
+
+
+PANGO_VERSION_CHECK, macro in Version Checking +
+
+
+pango_version_check, function in Version Checking +
+
+
+PANGO_VERSION_ENCODE, macro in Version Checking +
+
+
+PANGO_VERSION_MAJOR, macro in Version Checking +
+
+
+PANGO_VERSION_MICRO, macro in Version Checking +
+
+
+PANGO_VERSION_MINOR, macro in Version Checking +
+
+
+PANGO_VERSION_STRING, macro in Version Checking +
+
+
+pango_version_string, function in Version Checking +
+
+

W

+
+PangoWeight, enum in Fonts +
+
+
+PangoWin32FontCache, struct in Win32 Fonts and Rendering +
+
+
+pango_win32_font_cache_free, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_cache_load, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_cache_loadw, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_cache_new, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_cache_unload, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_description_from_logfont, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_description_from_logfontw, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_done_font, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_get_glyph_index, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_get_metrics_factor, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_logfont, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_logfontw, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_map_for_display, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_map_get_font_cache, function in Win32 Fonts and Rendering +
+
+
+pango_win32_font_select_font, function in Win32 Fonts and Rendering +
+
+
+pango_win32_get_context, function in Win32 Fonts and Rendering +
+
+
+pango_win32_get_dc, function in Win32 Fonts and Rendering +
+
+
+pango_win32_get_debug_flag, function in Win32 Fonts and Rendering +
+
+
+pango_win32_get_unknown_glyph, function in Win32 Fonts and Rendering +
+
+
+pango_win32_render, function in Win32 Fonts and Rendering +
+
+
+pango_win32_render_layout, function in Win32 Fonts and Rendering +
+
+
+pango_win32_render_layout_line, function in Win32 Fonts and Rendering +
+
+
+pango_win32_render_transformed, function in Win32 Fonts and Rendering +
+
+
+pango_win32_shutdown_display, function in Win32 Fonts and Rendering +
+
+
+PangoWrapMode, enum in Layout Objects +
+
+

X

+
+PangoXftFont, struct in Xft Fonts and Rendering +
+
+
+PangoXftFontMap, struct in Xft Fonts and Rendering +
+
+
+PangoXftRenderer, struct in Xft Fonts and Rendering +
+
+
+PangoXftRenderer:display, object property in Xft Fonts and Rendering +
+
+
+PangoXftRenderer:screen, object property in Xft Fonts and Rendering +
+
+
+PangoXftRendererClass, struct in Xft Fonts and Rendering +
+
+
+PangoXftSubstituteFunc, user_function in Xft Fonts and Rendering +
+
+
+pango_xft_font_get_display, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_get_font, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_get_glyph, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_get_unknown_glyph, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_has_char, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_lock_face, function in Xft Fonts and Rendering +
+
+
+pango_xft_font_unlock_face, function in Xft Fonts and Rendering +
+
+
+pango_xft_get_context, function in Xft Fonts and Rendering +
+
+
+pango_xft_get_font_map, function in Xft Fonts and Rendering +
+
+
+pango_xft_picture_render, function in Xft Fonts and Rendering +
+
+
+pango_xft_render, function in Xft Fonts and Rendering +
+
+
+pango_xft_renderer_new, function in Xft Fonts and Rendering +
+
+
+pango_xft_renderer_set_default_color, function in Xft Fonts and Rendering +
+
+
+pango_xft_renderer_set_draw, function in Xft Fonts and Rendering +
+
+
+pango_xft_render_layout, function in Xft Fonts and Rendering +
+
+
+pango_xft_render_layout_line, function in Xft Fonts and Rendering +
+
+
+pango_xft_render_transformed, function in Xft Fonts and Rendering +
+
+
+pango_xft_set_default_substitute, function in Xft Fonts and Rendering +
+
+
+pango_xft_shutdown_display, function in Xft Fonts and Rendering +
+
+
+pango_xft_substitute_changed, function in Xft Fonts and Rendering +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/home.png b/docs/html/home.png new file mode 100644 index 0000000..9346b33 Binary files /dev/null and b/docs/html/home.png differ diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 0000000..76434e6 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,122 @@ + + + + +Pango Reference Manual: Pango Reference Manual + + + + + + + +
+
+
+
+

for Pango 1.42.4 +

+
+
+
+
+
Basic Pango Interfaces
+
+
+Rendering — Functions to run the rendering pipeline +
+
+Glyph Storage — Structures for storing information about glyphs +
+
+Fonts — Structures representing abstract fonts +
+
+Text Attributes — Font and other attributes for annotating text +
+
+Tab Stops — Structures for storing tab stops +
+
+Text Attribute Markup — Simple +markup language to encode text with attributes +
+
+Layout Objects — High-level layout driver objects +
+
+Scripts and Languages — Identifying writing systems and languages +
+
+Bidirectional Text — Types and functions to help with handling bidirectional text +
+
+Vertical Text — Laying text out in vertical directions +
+
+
Rendering with Pango
+
+
+Win32 Fonts and Rendering — Functions for shape engines to manipulate Win32 fonts +
+
+FreeType Fonts and Rendering — Functions for shape engines to manipulate FreeType fonts +
+
+Xft Fonts and Rendering — Font handling and rendering with the Xft backend +
+
+Cairo Rendering — Rendering with the Cairo backend +
+
+CoreText Fonts — Font handling with CoreText fonts +
+
+
Low Level Functionality
+
+
+PangoRenderer — Rendering driver base class +
+
+PangoFcFontMap — Base fontmap class for Fontconfig-based backends +
+
+PangoFcFont — Base font class for Fontconfig-based backends +
+
+PangoFcDecoder — Custom font encoding handling +
+
+OpenType Font Handling — Obtaining information from OpenType tables +
+
+Coverage Maps — Unicode character range coverage storage +
+
+Engines — Language-specific and rendering-system-specific processing +
+
+PangoEngineLang — Rendering-system independent script engines +
+
+PangoEngineShape — Rendering-system dependent script engines +
+
+Modules — Support for loadable modules +
+
+Miscellaneous Utilities — Various convenience and utility functions +
+
+Version Checking — Tools for checking Pango version at compile- and run-time. +
+
+
Object Hierarchy
+
Annotation Glossary
+
Index of all symbols
+
+
+ + + \ No newline at end of file diff --git a/docs/html/layout.gif b/docs/html/layout.gif new file mode 100644 index 0000000..96bde1f Binary files /dev/null and b/docs/html/layout.gif differ diff --git a/docs/html/left-insensitive.png b/docs/html/left-insensitive.png new file mode 100644 index 0000000..3269393 Binary files /dev/null and b/docs/html/left-insensitive.png differ diff --git a/docs/html/left.png b/docs/html/left.png new file mode 100644 index 0000000..2abde03 Binary files /dev/null and b/docs/html/left.png differ diff --git a/docs/html/lowlevel.html b/docs/html/lowlevel.html new file mode 100644 index 0000000..2a8a141 --- /dev/null +++ b/docs/html/lowlevel.html @@ -0,0 +1,67 @@ + + + + +Low Level Functionality: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Low Level Functionality

+
+
+PangoRenderer — Rendering driver base class +
+
+PangoFcFontMap — Base fontmap class for Fontconfig-based backends +
+
+PangoFcFont — Base font class for Fontconfig-based backends +
+
+PangoFcDecoder — Custom font encoding handling +
+
+OpenType Font Handling — Obtaining information from OpenType tables +
+
+Coverage Maps — Unicode character range coverage storage +
+
+Engines — Language-specific and rendering-system-specific processing +
+
+PangoEngineLang — Rendering-system independent script engines +
+
+PangoEngineShape — Rendering-system dependent script engines +
+
+Modules — Support for loadable modules +
+
+Miscellaneous Utilities — Various convenience and utility functions +
+
+Version Checking — Tools for checking Pango version at compile- and run-time. +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Bidirectional-Text.html b/docs/html/pango-Bidirectional-Text.html new file mode 100644 index 0000000..de62a3b --- /dev/null +++ b/docs/html/pango-Bidirectional-Text.html @@ -0,0 +1,509 @@ + + + + +Bidirectional Text: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Bidirectional Text

+

Bidirectional Text — Types and functions to help with handling bidirectional text

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+PangoDirection + +pango_unichar_direction () +
+PangoDirection + +pango_find_base_dir () +
+gboolean + +pango_get_mirror_char () +
+PangoBidiType + +pango_bidi_type_for_unichar () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
enumPangoDirection
enumPangoBidiType
+
+
+

Object Hierarchy

+
    GEnum
+    ├── PangoBidiType
+    ╰── PangoDirection
+
+
+
+

Description

+

Pango supports bidirectional text (like Arabic and Hebrew) automatically. +Some applications however, need some help to correctly handle bidirectional text.

+

The PangoDirection type can be used with pango_context_set_base_dir() to +instruct Pango about direction of text, though in most cases Pango detects +that correctly and automatically. The rest of the facilities in this section +are used internally by Pango already, and are provided to help applications +that need more direct control over bidirectional setting of text.

+
+
+

Functions

+
+

pango_unichar_direction ()

+
PangoDirection
+pango_unichar_direction (gunichar ch);
+

Determines the inherent direction of a character; either +PANGO_DIRECTION_LTR, PANGO_DIRECTION_RTL, or +PANGO_DIRECTION_NEUTRAL.

+

This function is useful to categorize characters into left-to-right +letters, right-to-left letters, and everything else. If full +Unicode bidirectional type of a character is needed, +pango_bidi_type_for_unichar() can be used instead.

+
+

Parameters

+
+++++ + + + + + +

ch

a Unicode character

 
+
+
+

Returns

+

the direction of the character.

+
+
+
+
+

pango_find_base_dir ()

+
PangoDirection
+pango_find_base_dir (const gchar *text,
+                     gint length);
+

Searches a string the first character that has a strong +direction, according to the Unicode bidirectional algorithm.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

text

the text to process

 

length

length of text +in bytes (may be -1 if text +is nul-terminated)

 
+
+
+

Returns

+

The direction corresponding to the first strong character. +If no such character is found, then PANGO_DIRECTION_NEUTRAL is returned.

+
+

Since: 1.4

+
+
+
+

pango_get_mirror_char ()

+
gboolean
+pango_get_mirror_char (gunichar ch,
+                       gunichar *mirrored_ch);
+

pango_get_mirror_char is deprecated and should not be used in newly-written code.

+

If ch + has the Unicode mirrored property and there is another Unicode +character that typically has a glyph that is the mirror image of ch +'s +glyph, puts that character in the address pointed to by mirrored_ch +.

+

Use g_unichar_get_mirror_char() instead; the docs for that function +provide full details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ch

a Unicode character

 

mirrored_ch

location to store the mirrored character

 
+
+
+

Returns

+

TRUE if ch +has a mirrored character and mirrored_ch +is +filled in, FALSE otherwise

+
+
+
+
+

pango_bidi_type_for_unichar ()

+
PangoBidiType
+pango_bidi_type_for_unichar (gunichar ch);
+

Determines the normative bidirectional character type of a +character, as specified in the Unicode Character Database.

+

A simplified version of this function is available as +pango_unichar_direction().

+
+

Parameters

+
+++++ + + + + + +

ch

a Unicode character

 
+
+
+

Returns

+

the bidirectional character type, as used in the +Unicode bidirectional algorithm.

+
+

Since: 1.22

+
+
+
+

Types and Values

+
+

enum PangoDirection

+

The PangoDirection type represents a direction in the +Unicode bidirectional algorithm; not every value in this +enumeration makes sense for every usage of PangoDirection; +for example, the return value of pango_unichar_direction() +and pango_find_base_dir() cannot be PANGO_DIRECTION_WEAK_LTR +or PANGO_DIRECTION_WEAK_RTL, since every character is either +neutral or has a strong direction; on the other hand +PANGO_DIRECTION_NEUTRAL doesn't make sense to pass +to pango_itemize_with_base_dir().

+

The PANGO_DIRECTION_TTB_LTR, PANGO_DIRECTION_TTB_RTL +values come from an earlier interpretation of this +enumeration as the writing direction of a block of +text and are no longer used; See PangoGravity for how +vertical text is handled in Pango.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_DIRECTION_LTR

+

A strong left-to-right direction

+
 

PANGO_DIRECTION_RTL

+

A strong right-to-left direction

+
 

PANGO_DIRECTION_TTB_LTR

+

Deprecated value; treated the + same as PANGO_DIRECTION_RTL.

+
 

PANGO_DIRECTION_TTB_RTL

+

Deprecated value; treated the + same as PANGO_DIRECTION_LTR

+
 

PANGO_DIRECTION_WEAK_LTR

+

A weak left-to-right direction

+
 

PANGO_DIRECTION_WEAK_RTL

+

A weak right-to-left direction

+
 

PANGO_DIRECTION_NEUTRAL

+

No direction specified

+
 
+
+
+
+
+

enum PangoBidiType

+

The PangoBidiType type represents the bidirectional character +type of a Unicode character as specified by the

+Unicode bidirectional algorithm. +
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_BIDI_TYPE_L

+

Left-to-Right

+
 

PANGO_BIDI_TYPE_LRE

+

Left-to-Right Embedding

+
 

PANGO_BIDI_TYPE_LRO

+

Left-to-Right Override

+
 

PANGO_BIDI_TYPE_R

+

Right-to-Left

+
 

PANGO_BIDI_TYPE_AL

+

Right-to-Left Arabic

+
 

PANGO_BIDI_TYPE_RLE

+

Right-to-Left Embedding

+
 

PANGO_BIDI_TYPE_RLO

+

Right-to-Left Override

+
 

PANGO_BIDI_TYPE_PDF

+

Pop Directional Format

+
 

PANGO_BIDI_TYPE_EN

+

European Number

+
 

PANGO_BIDI_TYPE_ES

+

European Number Separator

+
 

PANGO_BIDI_TYPE_ET

+

European Number Terminator

+
 

PANGO_BIDI_TYPE_AN

+

Arabic Number

+
 

PANGO_BIDI_TYPE_CS

+

Common Number Separator

+
 

PANGO_BIDI_TYPE_NSM

+

Nonspacing Mark

+
 

PANGO_BIDI_TYPE_BN

+

Boundary Neutral

+
 

PANGO_BIDI_TYPE_B

+

Paragraph Separator

+
 

PANGO_BIDI_TYPE_S

+

Segment Separator

+
 

PANGO_BIDI_TYPE_WS

+

Whitespace

+
 

PANGO_BIDI_TYPE_ON

+

Other Neutrals

+
 
+
+

Since: 1.22

+
+
+
+

See Also

+

pango_context_get_base_dir(), +pango_context_set_base_dir(), +pango_itemize_with_base_dir()

+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Cairo-Rendering.html b/docs/html/pango-Cairo-Rendering.html new file mode 100644 index 0000000..001e16e --- /dev/null +++ b/docs/html/pango-Cairo-Rendering.html @@ -0,0 +1,1629 @@ + + + + +Cairo Rendering: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Cairo Rendering

+

Cairo Rendering — Rendering with the Cairo backend

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoFontMap * + +pango_cairo_font_map_get_default () +
+void + +pango_cairo_font_map_set_default () +
+PangoFontMap * + +pango_cairo_font_map_new () +
+PangoFontMap * + +pango_cairo_font_map_new_for_font_type () +
+cairo_font_type_t + +pango_cairo_font_map_get_font_type () +
+void + +pango_cairo_font_map_set_resolution () +
+double + +pango_cairo_font_map_get_resolution () +
+PangoContext * + +pango_cairo_font_map_create_context () +
+cairo_scaled_font_t * + +pango_cairo_font_get_scaled_font () +
+void + +pango_cairo_context_set_resolution () +
+double + +pango_cairo_context_get_resolution () +
+void + +pango_cairo_context_set_font_options () +
const cairo_font_options_t * + +pango_cairo_context_get_font_options () +
+void + +(*PangoCairoShapeRendererFunc) () +
+void + +pango_cairo_context_set_shape_renderer () +
+PangoCairoShapeRendererFunc + +pango_cairo_context_get_shape_renderer () +
+PangoContext * + +pango_cairo_create_context () +
+void + +pango_cairo_update_context () +
+PangoLayout * + +pango_cairo_create_layout () +
+void + +pango_cairo_update_layout () +
+void + +pango_cairo_show_glyph_string () +
+void + +pango_cairo_show_glyph_item () +
+void + +pango_cairo_show_layout_line () +
+void + +pango_cairo_show_layout () +
+void + +pango_cairo_show_error_underline () +
+void + +pango_cairo_glyph_string_path () +
+void + +pango_cairo_layout_line_path () +
+void + +pango_cairo_layout_path () +
+void + +pango_cairo_error_underline_path () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 PangoCairoFont
 PangoCairoFontMap
+
+
+

Object Hierarchy

+
    GInterface
+    ├── PangoCairoFont
+    ╰── PangoCairoFontMap
+
+
+
+

Prerequisites

+

+PangoCairoFont requires + PangoFont.

+

+PangoCairoFontMap requires + PangoFontMap.

+
+
+

Description

+

The Cairo library is a +vector graphics library with a powerful rendering model. It has such +features as anti-aliased primitives, alpha-compositing, and +gradients. Multiple backends for Cairo are available, to allow +rendering to images, to PDF files, and to the screen on X and on other +windowing systems. The functions in this section allow using Pango +to render to Cairo surfaces.

+

Using Pango with Cairo is straightforward. A PangoContext created +with pango_cairo_font_map_create_context() can be used on any +Cairo context (cairo_t), but needs to be updated to match the +current transformation matrix and target surface of the Cairo context +using pango_cairo_update_context(). The convenience functions +pango_cairo_create_layout() and pango_cairo_update_layout() handle +the common case where the program doesn't need to manipulate the +properties of the PangoContext.

+

When you get the metrics of a layout or of a piece of a layout using +functions such as pango_layout_get_extents(), the reported metrics +are in user-space coordinates. If a piece of text is 10 units long, +and you call cairo_scale (cr, 2.0), it still is more-or-less 10 +units long. However, the results will be affected by hinting +(that is, the process of adjusting the text to look good on the +pixel grid), so you shouldn't assume they are completely independent +of the current transformation matrix. Note that the basic metrics +functions in Pango report results in integer Pango units. To get +to the floating point units used in Cairo divide by PANGO_SCALE.

+
+

Using Pango with Cairo

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
#include <math.h>
+#include <pango/pangocairo.h>
+
+static void
+draw_text (cairo_t *cr)
+{
+#define RADIUS 150
+#define N_WORDS 10
+#define FONT "Sans Bold 27"
+
+  PangoLayout *layout;
+  PangoFontDescription *desc;
+  int i;
+
+  /* Center coordinates on the middle of the region we are drawing
+   */
+  cairo_translate (cr, RADIUS, RADIUS);
+
+  /* Create a PangoLayout, set the font and text */
+  layout = pango_cairo_create_layout (cr);
+
+  pango_layout_set_text (layout, "Text", -1);
+  desc = pango_font_description_from_string (FONT);
+  pango_layout_set_font_description (layout, desc);
+  pango_font_description_free (desc);
+
+  /* Draw the layout N_WORDS times in a circle */
+  for (i = 0; i < N_WORDS; i++)
+    {
+      int width, height;
+      double angle = (360. * i) / N_WORDS;
+      double red;
+
+      cairo_save (cr);
+
+      /* Gradient from red at angle == 60 to blue at angle == 240 */
+      red   = (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
+      cairo_set_source_rgb (cr, red, 0, 1.0 - red);
+
+      cairo_rotate (cr, angle * G_PI / 180.);
+
+      /* Inform Pango to re-layout the text with the new transformation */
+      pango_cairo_update_layout (cr, layout);
+
+      pango_layout_get_size (layout, &width, &height);
+      cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
+      pango_cairo_show_layout (cr, layout);
+
+      cairo_restore (cr);
+    }
+
+  /* free the layout object */
+  g_object_unref (layout);
+}
+
+int main (int argc, char **argv)
+{
+  cairo_t *cr;
+  char *filename;
+  cairo_status_t status;
+  cairo_surface_t *surface;
+
+  if (argc != 2)
+    {
+      g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n");
+      return 1;
+    }
+
+     filename = argv[1];
+
+  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+                                        2 * RADIUS, 2 * RADIUS);
+  cr = cairo_create (surface);
+
+  cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+  cairo_paint (cr);
+  draw_text (cr);
+  cairo_destroy (cr);
+
+  status = cairo_surface_write_to_png (surface, filename);
+  cairo_surface_destroy (surface);
+
+  if (status != CAIRO_STATUS_SUCCESS)
+    {
+      g_printerr ("Could not save png to '%s'\n", filename);
+      return 1;
+    }
+
+  return 0;
+}
+
+ +

+

Once you build and run the example code above, you should see the +following result:

+

Output of rotated-example

+
+
+
+

Functions

+
+

pango_cairo_font_map_get_default ()

+
PangoFontMap *
+pango_cairo_font_map_get_default (void);
+

Gets a default PangoCairoFontMap to use with Cairo.

+

Note that the type of the returned object will depend +on the particular font backend Cairo was compiled to use; +You generally should only use the PangoFontMap and +PangoCairoFontMap interfaces on the returned object.

+

The default Cairo fontmap can be changed by using +pango_cairo_font_map_set_default(). This can be used to +change the Cairo font backend that the default fontmap +uses for example.

+

Note that since Pango 1.32.6, the default fontmap is per-thread. +Each thread gets its own default fontmap. In this way, +PangoCairo can be used safely from multiple threads.

+
+

Returns

+

the default PangoCairo fontmap +for the current thread. This object is owned by Pango and must not be freed.

+

[transfer none]

+
+

Since: 1.10

+
+
+
+

pango_cairo_font_map_set_default ()

+
void
+pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap);
+

Sets a default PangoCairoFontMap to use with Cairo.

+

This can be used to change the Cairo font backend that the +default fontmap uses for example. The old default font map +is unreffed and the new font map referenced.

+

Note that since Pango 1.32.6, the default fontmap is per-thread. +This function only changes the default fontmap for +the current thread. Default fontmaps of exisiting threads +are not changed. Default fontmaps of any new threads will +still be created using pango_cairo_font_map_new().

+

A value of NULL for fontmap + will cause the current default +font map to be released and a new default font +map to be created on demand, using pango_cairo_font_map_new().

+
+

Parameters

+
+++++ + + + + + +

fontmap

The new default font map, or NULL.

[nullable]
+
+

Since: 1.22

+
+
+
+

pango_cairo_font_map_new ()

+
PangoFontMap *
+pango_cairo_font_map_new (void);
+

Creates a new PangoCairoFontMap object; a fontmap is used +to cache information about available fonts, and holds +certain global parameters such as the resolution. +In most cases, you can use pango_cairo_font_map_get_default() +instead.

+

Note that the type of the returned object will depend +on the particular font backend Cairo was compiled to use; +You generally should only use the PangoFontMap and +PangoCairoFontMap interfaces on the returned object.

+

You can override the type of backend returned by using an +environment variable PANGOCAIRO_BACKEND. Supported types, +based on your build, are fc (fontconfig), win32, and coretext. +If requested type is not available, NULL is returned. Ie. +this is only useful for testing, when at least two backends +are compiled in.

+
+

Returns

+

the newly allocated PangoFontMap, +which should be freed with g_object_unref().

+

[transfer full]

+
+

Since: 1.10

+
+
+
+

pango_cairo_font_map_new_for_font_type ()

+
PangoFontMap *
+pango_cairo_font_map_new_for_font_type
+                               (cairo_font_type_t fonttype);
+

Creates a new PangoCairoFontMap object of the type suitable +to be used with cairo font backend of type fonttype +.

+

In most cases one should simply use pango_cairo_font_map_new() +, +or in fact in most of those cases, just use +pango_cairo_font_map_get_default() +.

+
+

Parameters

+
+++++ + + + + + +

fonttype

desired cairo_font_type_t

 
+
+
+

Returns

+

the newly allocated +PangoFontMap of suitable type which should be freed +with g_object_unref(), or NULL if the requested +cairo font backend is not supported / compiled in.

+

[transfer full][nullable]

+
+

Since: 1.18

+
+
+
+

pango_cairo_font_map_get_font_type ()

+
cairo_font_type_t
+pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap);
+

Gets the type of Cairo font backend that fontmap + uses.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoCairoFontMap

 
+
+
+

Returns

+

the cairo_font_type_t cairo font backend type

+
+

Since: 1.18

+
+
+
+

pango_cairo_font_map_set_resolution ()

+
void
+pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap,
+                                     double dpi);
+

Sets the resolution for the fontmap. This is a scale factor between +points specified in a PangoFontDescription and Cairo units. The +default value is 96, meaning that a 10 point font will be 13 +units high. (10 * 96. / 72. = 13.3).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fontmap

a PangoCairoFontMap

 

dpi

the resolution in "dots per inch". (Physical inches aren't actually +involved; the terminology is conventional.)

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_font_map_get_resolution ()

+
double
+pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
+

Gets the resolution for the fontmap. See pango_cairo_font_map_set_resolution()

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoCairoFontMap

 
+
+
+

Returns

+

the resolution in "dots per inch"

+
+

Since: 1.10

+
+
+
+

pango_cairo_font_map_create_context ()

+
PangoContext *
+pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
+
+

pango_cairo_font_map_create_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_font_map_create_context() instead.

+
+

Create a PangoContext for the given fontmap.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoCairoFontMap

 
+
+
+

Returns

+

the newly created context; free with g_object_unref().

+
+

Since: 1.10

+
+
+
+

pango_cairo_font_get_scaled_font ()

+
cairo_scaled_font_t *
+pango_cairo_font_get_scaled_font (PangoCairoFont *font);
+

Gets the cairo_scaled_font_t used by font +. +The scaled font can be referenced and kept using +cairo_scaled_font_reference().

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont from a PangoCairoFontMap

 
+
+
+

Returns

+

the cairo_scaled_font_t used by font +, +or NULL if font +is NULL.

+

[nullable]

+
+

Since: 1.18

+
+
+
+

pango_cairo_context_set_resolution ()

+
void
+pango_cairo_context_set_resolution (PangoContext *context,
+                                    double dpi);
+

Sets the resolution for the context. This is a scale factor between +points specified in a PangoFontDescription and Cairo units. The +default value is 96, meaning that a 10 point font will be 13 +units high. (10 * 96. / 72. = 13.3).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext, from a pangocairo font map

 

dpi

the resolution in "dots per inch". (Physical inches aren't actually +involved; the terminology is conventional.) A 0 or negative value +means to use the resolution from the font map.

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_context_get_resolution ()

+
double
+pango_cairo_context_get_resolution (PangoContext *context);
+

Gets the resolution for the context. See pango_cairo_context_set_resolution()

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext, from a pangocairo font map

 
+
+
+

Returns

+

the resolution in "dots per inch". A negative value will +be returned if no resolution has previously been set.

+
+

Since: 1.10

+
+
+
+

pango_cairo_context_set_font_options ()

+
void
+pango_cairo_context_set_font_options (PangoContext *context,
+                                      const cairo_font_options_t *options);
+

Sets the font options used when rendering text with this context. +These options override any options that pango_cairo_update_context() +derives from the target surface.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext, from a pangocairo font map

 

options

a cairo_font_options_t, or NULL to unset +any previously set options. A copy is made.

[nullable]
+
+

Since: 1.10

+
+
+
+

pango_cairo_context_get_font_options ()

+
const cairo_font_options_t *
+pango_cairo_context_get_font_options (PangoContext *context);
+

Retrieves any font rendering options previously set with +pango_cairo_context_set_font_options(). This function does not report options +that are derived from the target surface by pango_cairo_update_context()

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext, from a pangocairo font map

 
+
+
+

Returns

+

the font options previously set on the +context, or NULL if no options have been set. This value is +owned by the context and must not be modified or freed.

+

[nullable]

+
+

Since: 1.10

+
+
+
+

PangoCairoShapeRendererFunc ()

+
void
+(*PangoCairoShapeRendererFunc) (cairo_t *cr,
+                                PangoAttrShape *attr,
+                                gboolean do_path,
+                                gpointer data);
+

Function type for rendering attributes of type PANGO_ATTR_SHAPE +with Pango's Cairo renderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

cr

a Cairo context with current point set to where the shape should +be rendered

 

attr

the PANGO_ATTR_SHAPE to render

 

do_path

whether only the shape path should be appended to current +path of cr +and no filling/stroking done. This will be set +to TRUE when called from pango_cairo_layout_path() and +pango_cairo_layout_line_path() rendering functions.

 

data

user data passed to pango_cairo_context_set_shape_renderer()

 
+
+
+
+
+

pango_cairo_context_set_shape_renderer ()

+
void
+pango_cairo_context_set_shape_renderer
+                               (PangoContext *context,
+                                PangoCairoShapeRendererFunc func,
+                                gpointer data,
+                                GDestroyNotify dnotify);
+

Sets callback function for context to use for rendering attributes +of type PANGO_ATTR_SHAPE. See PangoCairoShapeRendererFunc for +details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

context

a PangoContext, from a pangocairo font map

 

func

Callback function for rendering attributes of +type PANGO_ATTR_SHAPE, or NULL to disable shape rendering.

[nullable]

data

User data that will be passed to func +.

 

dnotify

Callback that will be called when the +context is freed to release data +, or NULL.

 
+
+

Since: 1.18

+
+
+
+

pango_cairo_context_get_shape_renderer ()

+
PangoCairoShapeRendererFunc
+pango_cairo_context_get_shape_renderer
+                               (PangoContext *context,
+                                gpointer *data);
+

Sets callback function for context to use for rendering attributes +of type PANGO_ATTR_SHAPE. See PangoCairoShapeRendererFunc for +details.

+

Retrieves callback function and associated user data for rendering +attributes of type PANGO_ATTR_SHAPE as set by +pango_cairo_context_set_shape_renderer(), if any.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext, from a pangocairo font map

 

data

Pointer to gpointer to return user data

 
+
+
+

Returns

+

the shape rendering callback previously +set on the context, or NULL if no shape rendering callback have +been set.

+

[nullable]

+
+

Since: 1.18

+
+
+
+

pango_cairo_create_context ()

+
PangoContext *
+pango_cairo_create_context (cairo_t *cr);
+

Creates a context object set up to match the current transformation +and target surface of the Cairo context. This context can then be +used to create a layout using pango_layout_new().

+

This function is a convenience function that creates a context using +the default font map, then updates it to cr +. If you just need to +create a layout for use with cr + and do not need to access PangoContext +directly, you can use pango_cairo_create_layout() instead.

+
+

Parameters

+
+++++ + + + + + +

cr

a Cairo context

 
+
+
+

Returns

+

the newly created PangoContext. Free with +g_object_unref().

+

[transfer full]

+
+

Since: 1.22

+
+
+
+

pango_cairo_update_context ()

+
void
+pango_cairo_update_context (cairo_t *cr,
+                            PangoContext *context);
+

Updates a PangoContext previously created for use with Cairo to +match the current transformation and target surface of a Cairo +context. If any layouts have been created for the context, +it's necessary to call pango_layout_context_changed() on those +layouts.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

context

a PangoContext, from a pangocairo font map

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_create_layout ()

+
PangoLayout *
+pango_cairo_create_layout (cairo_t *cr);
+

Creates a layout object set up to match the current transformation +and target surface of the Cairo context. This layout can then be +used for text measurement with functions like +pango_layout_get_size() or drawing with functions like +pango_cairo_show_layout(). If you change the transformation +or target surface for cr +, you need to call pango_cairo_update_layout()

+

This function is the most convenient way to use Cairo with Pango, +however it is slightly inefficient since it creates a separate +PangoContext object for each layout. This might matter in an +application that was laying out large amounts of text.

+
+

Parameters

+
+++++ + + + + + +

cr

a Cairo context

 
+
+
+

Returns

+

the newly created PangoLayout. Free with +g_object_unref().

+

[transfer full]

+
+

Since: 1.10

+
+
+
+

pango_cairo_update_layout ()

+
void
+pango_cairo_update_layout (cairo_t *cr,
+                           PangoLayout *layout);
+

Updates the private PangoContext of a PangoLayout created with +pango_cairo_create_layout() to match the current transformation +and target surface of a Cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

layout

a PangoLayout, from pango_cairo_create_layout()

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_show_glyph_string ()

+
void
+pango_cairo_show_glyph_string (cairo_t *cr,
+                               PangoFont *font,
+                               PangoGlyphString *glyphs);
+

Draws the glyphs in glyphs + in the specified cairo context. +The origin of the glyphs (the left edge of the baseline) will +be drawn at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

cr

a Cairo context

 

font

a PangoFont from a PangoCairoFontMap

 

glyphs

a PangoGlyphString

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_show_glyph_item ()

+
void
+pango_cairo_show_glyph_item (cairo_t *cr,
+                             const char *text,
+                             PangoGlyphItem *glyph_item);
+

Draws the glyphs in glyph_item + in the specified cairo context, +embedding the text associated with the glyphs in the output if the +output format supports it (PDF for example), otherwise it acts +similar to pango_cairo_show_glyph_string().

+

The origin of the glyphs (the left edge of the baseline) will +be drawn at the current point of the cairo context.

+

Note that text + is the start of the text for layout, which is then +indexed by glyph_item->item->offset +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

cr

a Cairo context

 

text

the UTF-8 text that glyph_item +refers to

 

glyph_item

a PangoGlyphItem

 
+
+

Since: 1.22

+
+
+
+

pango_cairo_show_layout_line ()

+
void
+pango_cairo_show_layout_line (cairo_t *cr,
+                              PangoLayoutLine *line);
+

Draws a PangoLayoutLine in the specified cairo context. +The origin of the glyphs (the left edge of the line) will +be drawn at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

line

a PangoLayoutLine

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_show_layout ()

+
void
+pango_cairo_show_layout (cairo_t *cr,
+                         PangoLayout *layout);
+

Draws a PangoLayout in the specified cairo context. +The top-left corner of the PangoLayout will be drawn +at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

layout

a Pango layout

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_show_error_underline ()

+
void
+pango_cairo_show_error_underline (cairo_t *cr,
+                                  double x,
+                                  double y,
+                                  double width,
+                                  double height);
+

Draw a squiggly line in the specified cairo context that approximately +covers the given rectangle in the style of an underline used to indicate a +spelling error. (The width of the underline is rounded to an integer +number of up/down segments and the resulting rectangle is centered in the +original rectangle)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

cr

a Cairo context

 

x

The X coordinate of one corner of the rectangle

 

y

The Y coordinate of one corner of the rectangle

 

width

Non-negative width of the rectangle

 

height

Non-negative height of the rectangle

 
+
+

Since: 1.14

+
+
+
+

pango_cairo_glyph_string_path ()

+
void
+pango_cairo_glyph_string_path (cairo_t *cr,
+                               PangoFont *font,
+                               PangoGlyphString *glyphs);
+

Adds the glyphs in glyphs + to the current path in the specified +cairo context. The origin of the glyphs (the left edge of the baseline) +will be at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

cr

a Cairo context

 

font

a PangoFont from a PangoCairoFontMap

 

glyphs

a PangoGlyphString

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_layout_line_path ()

+
void
+pango_cairo_layout_line_path (cairo_t *cr,
+                              PangoLayoutLine *line);
+

Adds the text in PangoLayoutLine to the current path in the +specified cairo context. The origin of the glyphs (the left edge +of the line) will be at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

line

a PangoLayoutLine

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_layout_path ()

+
void
+pango_cairo_layout_path (cairo_t *cr,
+                         PangoLayout *layout);
+

Adds the text in a PangoLayout to the current path in the +specified cairo context. The top-left corner of the PangoLayout +will be at the current point of the cairo context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cr

a Cairo context

 

layout

a Pango layout

 
+
+

Since: 1.10

+
+
+
+

pango_cairo_error_underline_path ()

+
void
+pango_cairo_error_underline_path (cairo_t *cr,
+                                  double x,
+                                  double y,
+                                  double width,
+                                  double height);
+

Add a squiggly line to the current path in the specified cairo context that +approximately covers the given rectangle in the style of an underline used +to indicate a spelling error. (The width of the underline is rounded to an +integer number of up/down segments and the resulting rectangle is centered +in the original rectangle)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

cr

a Cairo context

 

x

The X coordinate of one corner of the rectangle

 

y

The Y coordinate of one corner of the rectangle

 

width

Non-negative width of the rectangle

 

height

Non-negative height of the rectangle

 
+
+

Since: 1.14

+
+
+
+

Types and Values

+
+

PangoCairoFont

+
typedef struct _PangoCairoFont PangoCairoFont;
+

PangoCairoFont is an interface exported by fonts for +use with Cairo. The actual type of the font will depend +on the particular font technology Cairo was compiled to use.

+

Since: 1.18

+
+
+
+

PangoCairoFontMap

+
typedef struct _PangoCairoFontMap PangoCairoFontMap;
+

PangoCairoFontMap is an interface exported by font maps for +use with Cairo. The actual type of the font map will depend +on the particular font technology Cairo was compiled to use.

+

Since: 1.10

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-CoreText-Fonts.html b/docs/html/pango-CoreText-Fonts.html new file mode 100644 index 0000000..4e5a019 --- /dev/null +++ b/docs/html/pango-CoreText-Fonts.html @@ -0,0 +1,113 @@ + + + + +CoreText Fonts: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

CoreText Fonts

+

CoreText Fonts — Font handling with CoreText fonts

+
+
+

Functions

+
++++ + + + + +
+CTFontRef + +pango_core_text_font_get_ctfont () +
+
+
+

Types and Values

+
++++ + + + + +
#definePANGO_RENDER_TYPE_CORE_TEXT
+
+
+

Description

+

The macros and functions in this section are used to access fonts natively on +OS X using the CoreText text rendering subsystem.

+
+
+

Functions

+
+

pango_core_text_font_get_ctfont ()

+
CTFontRef
+pango_core_text_font_get_ctfont (PangoCoreTextFont *font);
+

Returns the CTFontRef of a font.

+
+

Parameters

+
+++++ + + + + + +

font

A PangoCoreTextFont

 
+
+
+

Returns

+

the CTFontRef associated to font +.

+
+

Since: 1.24

+
+
+
+

Types and Values

+
+

PANGO_RENDER_TYPE_CORE_TEXT

+
#define PANGO_RENDER_TYPE_CORE_TEXT "PangoRenderCoreText"
+
+

A string constant identifying the CoreText renderer. The associated quark (see +g_quark_from_string()) is used to identify the renderer in pango_find_map().

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Coverage-Maps.html b/docs/html/pango-Coverage-Maps.html new file mode 100644 index 0000000..68d8e8b --- /dev/null +++ b/docs/html/pango-Coverage-Maps.html @@ -0,0 +1,504 @@ + + + + +Coverage Maps: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Coverage Maps

+

Coverage Maps — Unicode character range coverage storage

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoCoverage * + +pango_coverage_new () +
+PangoCoverage * + +pango_coverage_ref () +
+void + +pango_coverage_unref () +
+PangoCoverage * + +pango_coverage_copy () +
+PangoCoverageLevel + +pango_coverage_get () +
+void + +pango_coverage_max () +
+void + +pango_coverage_set () +
+void + +pango_coverage_to_bytes () +
+PangoCoverage * + +pango_coverage_from_bytes () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
enumPangoCoverageLevel
#definePANGO_TYPE_COVERAGE_LEVEL
 PangoCoverage
+
+
+

Object Hierarchy

+
    GEnum
+    ╰── PangoCoverageLevel
+
+
+
+

Description

+

It is often necessary in Pango to determine if a particular font can +represent a particular character, and also how well it can represent +that character. The PangoCoverage is a data structure that is used +to represent that information.

+
+
+

Functions

+
+

pango_coverage_new ()

+
PangoCoverage *
+pango_coverage_new (void);
+

Create a new PangoCoverage

+
+

Returns

+

the newly allocated PangoCoverage, +initialized to PANGO_COVERAGE_NONE +with a reference count of one, which +should be freed with pango_coverage_unref().

+
+
+
+
+

pango_coverage_ref ()

+
PangoCoverage *
+pango_coverage_ref (PangoCoverage *coverage);
+

Increase the reference count on the PangoCoverage by one

+
+

Parameters

+
+++++ + + + + + +

coverage

a PangoCoverage

 
+
+
+

Returns

+

coverage +

+
+
+
+
+

pango_coverage_unref ()

+
void
+pango_coverage_unref (PangoCoverage *coverage);
+

Decrease the reference count on the PangoCoverage by one. +If the result is zero, free the coverage and all associated memory.

+
+

Parameters

+
+++++ + + + + + +

coverage

a PangoCoverage

 
+
+
+
+
+

pango_coverage_copy ()

+
PangoCoverage *
+pango_coverage_copy (PangoCoverage *coverage);
+

Copy an existing PangoCoverage. (This function may now be unnecessary +since we refcount the structure. File a bug if you use it.)

+
+

Parameters

+
+++++ + + + + + +

coverage

a PangoCoverage

 
+
+
+

Returns

+

the newly allocated PangoCoverage, +with a reference count of one, which should be freed +with pango_coverage_unref().

+

[transfer full]

+
+
+
+
+

pango_coverage_get ()

+
PangoCoverageLevel
+pango_coverage_get (PangoCoverage *coverage,
+                    int index_);
+

Determine whether a particular index is covered by coverage +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

coverage

a PangoCoverage

 

index_

the index to check

 
+
+
+

Returns

+

the coverage level of coverage +for character index_ +.

+
+
+
+
+

pango_coverage_max ()

+
void
+pango_coverage_max (PangoCoverage *coverage,
+                    PangoCoverage *other);
+

Set the coverage for each index in coverage + to be the max (better) +value of the current coverage for the index and the coverage for +the corresponding index in other +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

coverage

a PangoCoverage

 

other

another PangoCoverage

 
+
+
+
+
+

pango_coverage_set ()

+
void
+pango_coverage_set (PangoCoverage *coverage,
+                    int index_,
+                    PangoCoverageLevel level);
+

Modify a particular index within coverage +

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

coverage

a PangoCoverage

 

index_

the index to modify

 

level

the new level for index_ +

 
+
+
+
+
+

pango_coverage_to_bytes ()

+
void
+pango_coverage_to_bytes (PangoCoverage *coverage,
+                         guchar **bytes,
+                         int *n_bytes);
+

Convert a PangoCoverage structure into a flat binary format

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

coverage

a PangoCoverage

 

bytes

location to store result (must be freed with g_free()).

[out][array length=n_bytes][element-type guint8]

n_bytes

location to store size of result.

[out]
+
+
+
+
+

pango_coverage_from_bytes ()

+
PangoCoverage *
+pango_coverage_from_bytes (guchar *bytes,
+                           int n_bytes);
+

Convert data generated from pango_coverage_to_bytes() back +to a PangoCoverage

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

bytes

binary data +representing a PangoCoverage.

[array length=n_bytes][element-type guint8]

n_bytes

the size of bytes +in bytes

 
+
+
+

Returns

+

a newly allocated +PangoCoverage, or NULL if the data was invalid.

+

[transfer full][nullable]

+
+
+
+
+

Types and Values

+
+

enum PangoCoverageLevel

+

Used to indicate how well a font can represent a particular Unicode +character point for a particular script.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

PANGO_COVERAGE_NONE

+

The character is not representable with the font.

+
 

PANGO_COVERAGE_FALLBACK

+

The character is represented in a way that may be +comprehensible but is not the correct graphical form. +For instance, a Hangul character represented as a +a sequence of Jamos, or a Latin transliteration of a Cyrillic word.

+
 

PANGO_COVERAGE_APPROXIMATE

+

The character is represented as basically the correct +graphical form, but with a stylistic variant inappropriate for +the current script.

+
 

PANGO_COVERAGE_EXACT

+

The character is represented as the correct graphical form.

+
 
+
+
+
+
+

PANGO_TYPE_COVERAGE_LEVEL

+
#define PANGO_TYPE_COVERAGE_LEVEL (pango_coverage_level_get_type ())
+
+
+
+
+

PangoCoverage

+
typedef struct _PangoCoverage PangoCoverage;
+

The PangoCoverage structure represents a map from Unicode characters +to PangoCoverageLevel. It is an opaque structure with no public fields.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Engines.html b/docs/html/pango-Engines.html new file mode 100644 index 0000000..43c629e --- /dev/null +++ b/docs/html/pango-Engines.html @@ -0,0 +1,353 @@ + + + + +Engines: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Engines

+

Engines — Language-specific and rendering-system-specific processing

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+void + +script_engine_list () +
+void + +script_engine_init () +
+void + +script_engine_exit () +
+PangoEngine * + +script_engine_create () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
structPangoEngineInfo
structPangoEngineScriptInfo
structPangoEngine
structPangoEngineClass
#definePANGO_RENDER_TYPE_NONE
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoEngine
+        ├── PangoEngineLang
+        ╰── PangoEngineShape
+
+
+
+

Description

+

Pango utilizes a module architecture in which the language-specific +and render-system-specific components are provided by loadable +modules. Each loadable module supplies one or more +engines. Each engine +has an associated engine type and +render type. These two types are represented by strings.

+

Each dynamically-loaded module exports several functions which provide +the public API. These functions are script_engine_list(), +script_engine_init() and script_engine_exit, and +script_engine_create(). The latter three functions are used when +creating engines from the module at run time, while the first +function is used when building a catalog of all available modules.

+
+
+

Functions

+
+

script_engine_list ()

+
void
+script_engine_list (PangoEngineInfo **engines,
+                    int *n_engines);
+

script_engine_list has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

engines

location to store a pointer to an array of engines.

 

n_engines

location to store the number of elements in engines +.

 
+
+
+
+
+

script_engine_init ()

+
void
+script_engine_init (GTypeModule *module);
+

script_engine_init has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

module

a GTypeModule structure used to associate any +GObject types created in this module with the module.

 
+
+
+
+
+

script_engine_exit ()

+
void
+script_engine_exit (void);
+

script_engine_exit has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use.

+

[skip]

+
+
+
+

script_engine_create ()

+
PangoEngine *
+script_engine_create (const char *id);
+

script_engine_create has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

id

the ID of an engine as reported by script_engine_list.

 
+
+
+
+
+

Types and Values

+
+

struct PangoEngineInfo

+
struct PangoEngineInfo {
+  const gchar *id;
+  const gchar *engine_type;
+  const gchar *render_type;
+  PangoEngineScriptInfo *scripts;
+  gint n_scripts;
+};
+
+

PangoEngineInfo has been deprecated since version 1.38 and should not be used in newly-written code.

+

The PangoEngineInfo structure contains information about a particular +engine. It contains the following fields:

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

const gchar *id;

a unique string ID for the engine.

 

const gchar *engine_type;

a string identifying the engine type.

 

const gchar *render_type;

a string identifying the render type.

 

PangoEngineScriptInfo *scripts;

array of scripts this engine supports.

 

gint n_scripts;

number of items in scripts +.

 
+
+
+
+
+

struct PangoEngineScriptInfo

+
struct PangoEngineScriptInfo {
+  PangoScript script;
+  const gchar *langs;
+};
+
+

PangoEngineScriptInfo has been deprecated since version 1.38 and should not be used in newly-written code.

+

The PangoEngineScriptInfo structure contains +information about how the shaper covers a particular script.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoScript script;

a PangoScript. The value PANGO_SCRIPT_COMMON has +the special meaning here of "all scripts"

 

const gchar *langs;

a semicolon separated list of languages that this +engine handles for this script. This may be empty, +in which case the engine is saying that it is a +fallback choice for all languages for this range, +but should not be used if another engine +indicates that it is specific for the language for +a given code point. An entry in this list of "*" +indicates that this engine is specific to all +languages for this range.

 
+
+
+
+
+

struct PangoEngine

+
struct PangoEngine;
+

PangoEngine has been deprecated since version 1.38 and should not be used in newly-written code.

+

PangoEngine is the base class for all types of language and +script specific engines. It has no functionality by itself.

+
+
+
+

struct PangoEngineClass

+
struct PangoEngineClass {
+};
+
+

PangoEngineClass has been deprecated since version 1.38 and should not be used in newly-written code.

+

Class structure for PangoEngine

+
+
+
+

PANGO_RENDER_TYPE_NONE

+
#define PANGO_RENDER_TYPE_NONE "PangoRenderNone"
+
+

PANGO_RENDER_TYPE_NONE has been deprecated since version 1.38 and should not be used in newly-written code.

+

A string constant defining the render type +for engines that are not rendering-system specific.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Fonts.html b/docs/html/pango-Fonts.html new file mode 100644 index 0000000..d018c4d --- /dev/null +++ b/docs/html/pango-Fonts.html @@ -0,0 +1,4233 @@ + + + + +Fonts: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Fonts

+

Fonts — Structures representing abstract fonts

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoFontDescription * + +pango_font_description_new () +
+PangoFontDescription * + +pango_font_description_copy () +
+PangoFontDescription * + +pango_font_description_copy_static () +
+guint + +pango_font_description_hash () +
+gboolean + +pango_font_description_equal () +
+void + +pango_font_description_free () +
+void + +pango_font_descriptions_free () +
+void + +pango_font_description_set_family () +
+void + +pango_font_description_set_family_static () +
const char * + +pango_font_description_get_family () +
+void + +pango_font_description_set_style () +
+PangoStyle + +pango_font_description_get_style () +
+void + +pango_font_description_set_variant () +
+PangoVariant + +pango_font_description_get_variant () +
+void + +pango_font_description_set_weight () +
+PangoWeight + +pango_font_description_get_weight () +
+void + +pango_font_description_set_stretch () +
+PangoStretch + +pango_font_description_get_stretch () +
+void + +pango_font_description_set_size () +
+gint + +pango_font_description_get_size () +
+void + +pango_font_description_set_absolute_size () +
+gboolean + +pango_font_description_get_size_is_absolute () +
+void + +pango_font_description_set_gravity () +
+PangoGravity + +pango_font_description_get_gravity () +
+void + +pango_font_description_set_variations () +
+void + +pango_font_description_set_variations_static () +
const char * + +pango_font_description_get_variations () +
+PangoFontMask + +pango_font_description_get_set_fields () +
+void + +pango_font_description_unset_fields () +
+void + +pango_font_description_merge () +
+void + +pango_font_description_merge_static () +
+gboolean + +pango_font_description_better_match () +
+PangoFontDescription * + +pango_font_description_from_string () +
+char * + +pango_font_description_to_string () +
+char * + +pango_font_description_to_filename () +
+PangoFontMetrics * + +pango_font_metrics_ref () +
+void + +pango_font_metrics_unref () +
+int + +pango_font_metrics_get_ascent () +
+int + +pango_font_metrics_get_descent () +
+int + +pango_font_metrics_get_approximate_char_width () +
+int + +pango_font_metrics_get_approximate_digit_width () +
+int + +pango_font_metrics_get_underline_thickness () +
+int + +pango_font_metrics_get_underline_position () +
+int + +pango_font_metrics_get_strikethrough_thickness () +
+int + +pango_font_metrics_get_strikethrough_position () +
#define +PANGO_FONT() +
#define +PANGO_IS_FONT() +
+PangoEngineShape * + +pango_font_find_shaper () +
+PangoFontDescription * + +pango_font_describe () +
+PangoFontDescription * + +pango_font_describe_with_absolute_size () +
+PangoCoverage * + +pango_font_get_coverage () +
+void + +pango_font_get_glyph_extents () +
+PangoFontMetrics * + +pango_font_get_metrics () +
+PangoFontMap * + +pango_font_get_font_map () +
#define +PANGO_FONT_FAMILY() +
#define +PANGO_IS_FONT_FAMILY() +
const char * + +pango_font_family_get_name () +
+gboolean + +pango_font_family_is_monospace () +
+void + +pango_font_family_list_faces () +
#define +PANGO_FONT_FACE() +
#define +PANGO_IS_FONT_FACE() +
const char * + +pango_font_face_get_face_name () +
+void + +pango_font_face_list_sizes () +
+PangoFontDescription * + +pango_font_face_describe () +
+gboolean + +pango_font_face_is_synthesized () +
#define +PANGO_FONT_MAP() +
#define +PANGO_IS_FONT_MAP() +
#define +PANGO_FONT_MAP_CLASS() +
#define +PANGO_IS_FONT_MAP_CLASS() +
#define +PANGO_FONT_MAP_GET_CLASS() +
+PangoContext * + +pango_font_map_create_context () +
+PangoFont * + +pango_font_map_load_font () +
+PangoFontset * + +pango_font_map_load_fontset () +
+void + +pango_font_map_list_families () +
const char * + +pango_font_map_get_shape_engine_type () +
+guint + +pango_font_map_get_serial () +
+void + +pango_font_map_changed () +
+PangoFont * + +pango_fontset_get_font () +
+PangoFontMetrics * + +pango_fontset_get_metrics () +
+gboolean + +(*PangoFontsetForeachFunc) () +
+void + +pango_fontset_foreach () +
+PangoFontsetSimple * + +pango_fontset_simple_new () +
+void + +pango_fontset_simple_append () +
+int + +pango_fontset_simple_size () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 PangoFontDescription
#definePANGO_TYPE_FONT_DESCRIPTION
enumPangoStyle
#definePANGO_TYPE_STYLE
enumPangoWeight
#definePANGO_TYPE_WEIGHT
enumPangoVariant
#definePANGO_TYPE_VARIANT
enumPangoStretch
#definePANGO_TYPE_STRETCH
enumPangoFontMask
#definePANGO_TYPE_FONT_MASK
structPangoFontMetrics
#definePANGO_TYPE_FONT_METRICS
 PangoFont
#definePANGO_TYPE_FONT
structPangoFontFamily
#definePANGO_TYPE_FONT_FAMILY
structPangoFontFace
#definePANGO_TYPE_FONT_FACE
 PangoFontMap
#definePANGO_TYPE_FONT_MAP
structPangoFontMapClass
structPangoFontset
#definePANGO_TYPE_FONTSET
structPangoFontsetClass
 PangoFontsetSimple
#definePANGO_TYPE_FONTSET_SIMPLE
+
+
+

Object Hierarchy

+
    GBoxed
+    ├── PangoFontDescription
+    ╰── PangoFontMetrics
+    GEnum
+    ├── PangoStretch
+    ├── PangoStyle
+    ├── PangoVariant
+    ╰── PangoWeight
+    GFlags
+    ╰── PangoFontMask
+    GObject
+    ├── PangoFont
+       ╰── PangoFcFont
+    ├── PangoFontFace
+    ├── PangoFontFamily
+    ├── PangoFontMap
+       ╰── PangoFcFontMap
+    ╰── PangoFontset
+        ╰── PangoFontsetSimple
+
+
+
+

Known Derived Interfaces

+

+PangoFont is required by + PangoCairoFont.

+

+PangoFontMap is required by + PangoCairoFontMap.

+
+
+

Description

+

Pango supports a flexible architecture where a +particular rendering architecture can supply an +implementation of fonts. The PangoFont structure +represents an abstract rendering-system-independent font. +Pango provides routines to list available fonts, and +to load a font of a given description.

+
+
+

Functions

+
+

pango_font_description_new ()

+
PangoFontDescription *
+pango_font_description_new (void);
+

Creates a new font description structure with all fields unset.

+
+

Returns

+

the newly allocated PangoFontDescription, which +should be freed using pango_font_description_free().

+
+
+
+
+

pango_font_description_copy ()

+
PangoFontDescription *
+pango_font_description_copy (const PangoFontDescription *desc);
+

Make a copy of a PangoFontDescription.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated +PangoFontDescription, which should be freed with +pango_font_description_free(), or NULL if desc +was +NULL.

+

[nullable]

+
+
+
+
+

pango_font_description_copy_static ()

+
PangoFontDescription *
+pango_font_description_copy_static (const PangoFontDescription *desc);
+

Like pango_font_description_copy(), but only a shallow copy is made +of the family name and other allocated fields. The result can only +be used until desc + is modified or freed. This is meant to be used +when the copy is only needed temporarily.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated +PangoFontDescription, which should be freed with +pango_font_description_free(), or NULL if desc +was +NULL.

+

[nullable]

+
+
+
+
+

pango_font_description_hash ()

+
guint
+pango_font_description_hash (const PangoFontDescription *desc);
+

Computes a hash of a PangoFontDescription structure suitable +to be used, for example, as an argument to g_hash_table_new(). +The hash value is independent of desc->mask +.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the hash value.

+
+
+
+
+

pango_font_description_equal ()

+
gboolean
+pango_font_description_equal (const PangoFontDescription *desc1,
+                              const PangoFontDescription *desc2);
+

Compares two font descriptions for equality. Two font descriptions +are considered equal if the fonts they describe are provably identical. +This means that their masks do not have to match, as long as other fields +are all the same. (Two font descriptions may result in identical fonts +being loaded, but still compare FALSE.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc1

a PangoFontDescription

 

desc2

another PangoFontDescription

 
+
+
+

Returns

+

TRUE if the two font descriptions are identical, +FALSE otherwise.

+
+
+
+
+

pango_font_description_free ()

+
void
+pango_font_description_free (PangoFontDescription *desc);
+

Frees a font description.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription, may be NULL.

[nullable]
+
+
+
+
+

pango_font_descriptions_free ()

+
void
+pango_font_descriptions_free (PangoFontDescription **descs,
+                              int n_descs);
+

Frees an array of font descriptions.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

descs

a pointer +to an array of PangoFontDescription, may be NULL.

[allow-none][array length=n_descs][transfer full]

n_descs

number of font descriptions in descs +

 
+
+
+
+
+

pango_font_description_set_family ()

+
void
+pango_font_description_set_family (PangoFontDescription *desc,
+                                   const char *family);
+

Sets the family name field of a font description. The family +name represents a family of related font styles, and will +resolve to a particular PangoFontFamily. In some uses of +PangoFontDescription, it is also possible to use a comma +separated list of family names for this field.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription.

 

family

a string representing the family name.

 
+
+
+
+
+

pango_font_description_set_family_static ()

+
void
+pango_font_description_set_family_static
+                               (PangoFontDescription *desc,
+                                const char *family);
+

Like pango_font_description_set_family(), except that no +copy of family + is made. The caller must make sure that the +string passed in stays around until desc + has been freed +or the name is set again. This function can be used if +family + is a static string such as a C string literal, or +if desc + is only needed temporarily.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

family

a string representing the family name.

 
+
+
+
+
+

pango_font_description_get_family ()

+
const char *
+pango_font_description_get_family (const PangoFontDescription *desc);
+

Gets the family name field of a font description. See +pango_font_description_set_family().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription.

 
+
+
+

Returns

+

the family name field for the font +description, or NULL if not previously set. This +has the same life-time as the font description itself +and should not be freed.

+

[nullable]

+
+
+
+
+

pango_font_description_set_style ()

+
void
+pango_font_description_set_style (PangoFontDescription *desc,
+                                  PangoStyle style);
+

Sets the style field of a PangoFontDescription. The +PangoStyle enumeration describes whether the font is slanted and +the manner in which it is slanted; it can be either +PANGO_STYLE_NORMAL, PANGO_STYLE_ITALIC, or PANGO_STYLE_OBLIQUE. +Most fonts will either have a italic style or an oblique +style, but not both, and font matching in Pango will +match italic specifications with oblique fonts and vice-versa +if an exact match is not found.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

style

the style for the font description

 
+
+
+
+
+

pango_font_description_get_style ()

+
PangoStyle
+pango_font_description_get_style (const PangoFontDescription *desc);
+

Gets the style field of a PangoFontDescription. See +pango_font_description_set_style().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the style field for the font description. +Use pango_font_description_get_set_fields() to find out if +the field was explicitly set or not.

+
+
+
+
+

pango_font_description_set_variant ()

+
void
+pango_font_description_set_variant (PangoFontDescription *desc,
+                                    PangoVariant variant);
+

Sets the variant field of a font description. The PangoVariant +can either be PANGO_VARIANT_NORMAL or PANGO_VARIANT_SMALL_CAPS.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

variant

the variant type for the font description.

 
+
+
+
+
+

pango_font_description_get_variant ()

+
PangoVariant
+pango_font_description_get_variant (const PangoFontDescription *desc);
+

Gets the variant field of a PangoFontDescription. See +pango_font_description_set_variant().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription.

 
+
+
+

Returns

+

the variant field for the font description. Use +pango_font_description_get_set_fields() to find out if +the field was explicitly set or not.

+
+
+
+
+

pango_font_description_set_weight ()

+
void
+pango_font_description_set_weight (PangoFontDescription *desc,
+                                   PangoWeight weight);
+

Sets the weight field of a font description. The weight field +specifies how bold or light the font should be. In addition +to the values of the PangoWeight enumeration, other intermediate +numeric values are possible.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

weight

the weight for the font description.

 
+
+
+
+
+

pango_font_description_get_weight ()

+
PangoWeight
+pango_font_description_get_weight (const PangoFontDescription *desc);
+

Gets the weight field of a font description. See +pango_font_description_set_weight().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the weight field for the font description. Use +pango_font_description_get_set_fields() to find out if +the field was explicitly set or not.

+
+
+
+
+

pango_font_description_set_stretch ()

+
void
+pango_font_description_set_stretch (PangoFontDescription *desc,
+                                    PangoStretch stretch);
+

Sets the stretch field of a font description. The stretch field +specifies how narrow or wide the font should be.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

stretch

the stretch for the font description

 
+
+
+
+
+

pango_font_description_get_stretch ()

+
PangoStretch
+pango_font_description_get_stretch (const PangoFontDescription *desc);
+

Gets the stretch field of a font description. +See pango_font_description_set_stretch().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription.

 
+
+
+

Returns

+

the stretch field for the font description. Use +pango_font_description_get_set_fields() to find out if +the field was explicitly set or not.

+
+
+
+
+

pango_font_description_set_size ()

+
void
+pango_font_description_set_size (PangoFontDescription *desc,
+                                 gint size);
+

Sets the size field of a font description in fractional points. This is mutually +exclusive with pango_font_description_set_absolute_size().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

size

the size of the font in points, scaled by PANGO_SCALE. (That is, +a size +value of 10 * PANGO_SCALE is a 10 point font. The conversion +factor between points and device units depends on system configuration +and the output device. For screen display, a logical DPI of 96 is +common, in which case a 10 point font corresponds to a 10 * (96 / 72) = 13.3 +pixel font. Use pango_font_description_set_absolute_size() if you need +a particular size in device units.

 
+
+
+
+
+

pango_font_description_get_size ()

+
gint
+pango_font_description_get_size (const PangoFontDescription *desc);
+

Gets the size field of a font description. +See pango_font_description_set_size().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the size field for the font description in points or device units. +You must call pango_font_description_get_size_is_absolute() +to find out which is the case. Returns 0 if the size field has not +previously been set or it has been set to 0 explicitly. +Use pango_font_description_get_set_fields() to +find out if the field was explicitly set or not.

+
+
+
+
+

pango_font_description_set_absolute_size ()

+
void
+pango_font_description_set_absolute_size
+                               (PangoFontDescription *desc,
+                                double size);
+

Sets the size field of a font description, in device units. This is mutually +exclusive with pango_font_description_set_size() which sets the font size +in points.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

size

the new size, in Pango units. There are PANGO_SCALE Pango units in one +device unit. For an output backend where a device unit is a pixel, a size +value of 10 * PANGO_SCALE gives a 10 pixel font.

 
+
+

Since: 1.8

+
+
+
+

pango_font_description_get_size_is_absolute ()

+
gboolean
+pango_font_description_get_size_is_absolute
+                               (const PangoFontDescription *desc);
+

Determines whether the size of the font is in points (not absolute) or device units (absolute). +See pango_font_description_set_size() and pango_font_description_set_absolute_size().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

whether the size for the font description is in +points or device units. Use pango_font_description_get_set_fields() to +find out if the size field of the font description was explicitly set or not.

+
+

Since: 1.8

+
+
+
+

pango_font_description_set_gravity ()

+
void
+pango_font_description_set_gravity (PangoFontDescription *desc,
+                                    PangoGravity gravity);
+

Sets the gravity field of a font description. The gravity field +specifies how the glyphs should be rotated. If gravity + is +PANGO_GRAVITY_AUTO, this actually unsets the gravity mask on +the font description.

+

This function is seldom useful to the user. Gravity should normally +be set on a PangoContext.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

gravity

the gravity for the font description.

 
+
+

Since: 1.16

+
+
+
+

pango_font_description_get_gravity ()

+
PangoGravity
+pango_font_description_get_gravity (const PangoFontDescription *desc);
+

Gets the gravity field of a font description. See +pango_font_description_set_gravity().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the gravity field for the font description. Use +pango_font_description_get_set_fields() to find out if +the field was explicitly set or not.

+
+

Since: 1.16

+
+
+
+

pango_font_description_set_variations ()

+
void
+pango_font_description_set_variations (PangoFontDescription *desc,
+                                       const char *settings);
+

Sets the variations field of a font description. OpenType +font variations allow to select a font instance by specifying +values for a number of axes, such as width or weight.

+

The format of the variations string is AXIS1=VALUE,AXIS2=VALUE..., +with each AXIS a 4 character tag that identifies a font axis, +and each VALUE a floating point number. Unknown axes are ignored, +and values are clamped to their allowed range.

+

Pango does not currently have a way to find supported axes of +a font. Both harfbuzz or freetype have API for this.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription.

 

variations

a string representing the variations

 
+
+

Since: 1.42

+
+
+
+

pango_font_description_set_variations_static ()

+
void
+pango_font_description_set_variations_static
+                               (PangoFontDescription *desc,
+                                const char *settings);
+

Like pango_font_description_set_variations(), except that no +copy of variations + is made. The caller must make sure that the +string passed in stays around until desc + has been freed +or the name is set again. This function can be used if +variations + is a static string such as a C string literal, or +if desc + is only needed temporarily.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

variations

a string representing the variations

 
+
+

Since: 1.42

+
+
+
+

pango_font_description_get_variations ()

+
const char *
+pango_font_description_get_variations (const PangoFontDescription *desc);
+

Gets the variations field of a font description. See +pango_font_description_set_variations().

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

the varitions field for the font +description, or NULL if not previously set. This +has the same life-time as the font description itself +and should not be freed.

+

[nullable]

+
+

Since: 1.42

+
+
+
+

pango_font_description_get_set_fields ()

+
PangoFontMask
+pango_font_description_get_set_fields (const PangoFontDescription *desc);
+

Determines which fields in a font description have been set.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

a bitmask with bits set corresponding to the +fields in desc +that have been set.

+
+
+
+
+

pango_font_description_unset_fields ()

+
void
+pango_font_description_unset_fields (PangoFontDescription *desc,
+                                     PangoFontMask to_unset);
+

Unsets some of the fields in a PangoFontDescription. The unset +fields will get back to their default values.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc

a PangoFontDescription

 

to_unset

bitmask of fields in the desc +to unset.

 
+
+
+
+
+

pango_font_description_merge ()

+
void
+pango_font_description_merge (PangoFontDescription *desc,
+                              const PangoFontDescription *desc_to_merge,
+                              gboolean replace_existing);
+

Merges the fields that are set in desc_to_merge + into the fields in +desc +. If replace_existing + is FALSE, only fields in desc + that +are not already set are affected. If TRUE, then fields that are +already set will be replaced as well.

+

If desc_to_merge + is NULL, this function performs nothing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

desc

a PangoFontDescription

 

desc_to_merge

the PangoFontDescription to merge from, or NULL.

[allow-none]

replace_existing

if TRUE, replace fields in desc +with the +corresponding values from desc_to_merge +, even if they +are already exist.

 
+
+
+
+
+

pango_font_description_merge_static ()

+
void
+pango_font_description_merge_static (PangoFontDescription *desc,
+                                     const PangoFontDescription *desc_to_merge,
+                                     gboolean replace_existing);
+

Like pango_font_description_merge(), but only a shallow copy is made +of the family name and other allocated fields. desc + can only be +used until desc_to_merge + is modified or freed. This is meant +to be used when the merged font description is only needed temporarily.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

desc

a PangoFontDescription

 

desc_to_merge

the PangoFontDescription to merge from

 

replace_existing

if TRUE, replace fields in desc +with the +corresponding values from desc_to_merge +, even if they +are already exist.

 
+
+
+
+
+

pango_font_description_better_match ()

+
gboolean
+pango_font_description_better_match (const PangoFontDescription *desc,
+                                     const PangoFontDescription *old_match,
+                                     const PangoFontDescription *new_match);
+

Determines if the style attributes of new_match + are a closer match +for desc + than those of old_match + are, or if old_match + is NULL, +determines if new_match + is a match at all. +Approximate matching is done for +weight and style; other style attributes must match exactly. +Style attributes are all attributes other than family and size-related +attributes. Approximate matching for style considers PANGO_STYLE_OBLIQUE +and PANGO_STYLE_ITALIC as matches, but not as good a match as when the +styles are equal.

+

Note that old_match + must match desc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

desc

a PangoFontDescription

 

old_match

a PangoFontDescription, or NULL.

[allow-none]

new_match

a PangoFontDescription

 
+
+
+

Returns

+

TRUE if new_match +is a better match

+
+
+
+
+

pango_font_description_from_string ()

+
PangoFontDescription *
+pango_font_description_from_string (const char *str);
+

Creates a new font description from a string representation in the +form "FAMILY-LIST [SIZE]", where FAMILY-LIST is a +comma separated list of families optionally terminated by a comma, +STYLE_OPTIONS is a whitespace separated list of words where each word +describes one of style, variant, weight, stretch, or gravity, and SIZE +is a decimal number (size in points) or optionally followed by the +unit modifier "px" for absolute size. Any one of the options may +be absent. If FAMILY-LIST is absent, then the family_name field of +the resulting font description will be initialized to NULL. If +STYLE-OPTIONS is missing, then all style options will be set to the +default values. If SIZE is missing, the size in the resulting font +description will be set to 0.

+
+

Parameters

+
+++++ + + + + + +

str

string representation of a font description.

 
+
+
+

Returns

+

a new PangoFontDescription.

+
+
+
+
+

pango_font_description_to_string ()

+
char *
+pango_font_description_to_string (const PangoFontDescription *desc);
+

Creates a string representation of a font description. See +pango_font_description_from_string() for a description of the +format of the string representation. The family list in the +string description will only have a terminating comma if the +last word of the list is a valid style option.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

a new string that must be freed with g_free().

+
+
+
+
+

pango_font_description_to_filename ()

+
char *
+pango_font_description_to_filename (const PangoFontDescription *desc);
+

Creates a filename representation of a font description. The +filename is identical to the result from calling +pango_font_description_to_string(), but with underscores instead of +characters that are untypical in filenames, and in lower case only.

+
+

Parameters

+
+++++ + + + + + +

desc

a PangoFontDescription

 
+
+
+

Returns

+

a new string that must be freed with g_free().

+
+
+
+
+

pango_font_metrics_ref ()

+
PangoFontMetrics *
+pango_font_metrics_ref (PangoFontMetrics *metrics);
+

Increase the reference count of a font metrics structure by one.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure, may be NULL.

[nullable]
+
+
+

Returns

+

metrics +.

+

[nullable]

+
+
+
+
+

pango_font_metrics_unref ()

+
void
+pango_font_metrics_unref (PangoFontMetrics *metrics);
+

Decrease the reference count of a font metrics structure by one. If +the result is zero, frees the structure and any associated +memory.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure, may be NULL.

[nullable]
+
+
+
+
+

pango_font_metrics_get_ascent ()

+
int
+pango_font_metrics_get_ascent (PangoFontMetrics *metrics);
+

Gets the ascent from a font metrics structure. The ascent is +the distance from the baseline to the logical top of a line +of text. (The logical top may be above or below the top of the +actual drawn ink. It is necessary to lay out the text to figure +where the ink will be.)

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the ascent, in Pango units.

+
+
+
+
+

pango_font_metrics_get_descent ()

+
int
+pango_font_metrics_get_descent (PangoFontMetrics *metrics);
+

Gets the descent from a font metrics structure. The descent is +the distance from the baseline to the logical bottom of a line +of text. (The logical bottom may be above or below the bottom of the +actual drawn ink. It is necessary to lay out the text to figure +where the ink will be.)

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the descent, in Pango units.

+
+
+
+
+

pango_font_metrics_get_approximate_char_width ()

+
int
+pango_font_metrics_get_approximate_char_width
+                               (PangoFontMetrics *metrics);
+

Gets the approximate character width for a font metrics structure. +This is merely a representative value useful, for example, for +determining the initial size for a window. Actual characters in +text will be wider and narrower than this.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the character width, in Pango units.

+
+
+
+
+

pango_font_metrics_get_approximate_digit_width ()

+
int
+pango_font_metrics_get_approximate_digit_width
+                               (PangoFontMetrics *metrics);
+

Gets the approximate digit width for a font metrics structure. +This is merely a representative value useful, for example, for +determining the initial size for a window. Actual digits in +text can be wider or narrower than this, though this value +is generally somewhat more accurate than the result of +pango_font_metrics_get_approximate_char_width() for digits.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the digit width, in Pango units.

+
+
+
+
+

pango_font_metrics_get_underline_thickness ()

+
int
+pango_font_metrics_get_underline_thickness
+                               (PangoFontMetrics *metrics);
+

Gets the suggested thickness to draw for the underline.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the suggested underline thickness, in Pango units.

+
+

Since: 1.6

+
+
+
+

pango_font_metrics_get_underline_position ()

+
int
+pango_font_metrics_get_underline_position
+                               (PangoFontMetrics *metrics);
+

Gets the suggested position to draw the underline. +The value returned is the distance above the +baseline of the top of the underline. Since most fonts have +underline positions beneath the baseline, this value is typically +negative.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the suggested underline position, in Pango units.

+
+

Since: 1.6

+
+
+
+

pango_font_metrics_get_strikethrough_thickness ()

+
int
+pango_font_metrics_get_strikethrough_thickness
+                               (PangoFontMetrics *metrics);
+

Gets the suggested thickness to draw for the strikethrough.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the suggested strikethrough thickness, in Pango units.

+
+

Since: 1.6

+
+
+
+

pango_font_metrics_get_strikethrough_position ()

+
int
+pango_font_metrics_get_strikethrough_position
+                               (PangoFontMetrics *metrics);
+

Gets the suggested position to draw the strikethrough. +The value returned is the distance above the +baseline of the top of the strikethrough.

+
+

Parameters

+
+++++ + + + + + +

metrics

a PangoFontMetrics structure

 
+
+
+

Returns

+

the suggested strikethrough position, in Pango units.

+
+

Since: 1.6

+
+
+
+

PANGO_FONT()

+
#define PANGO_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont))
+
+

Casts a GObject to a PangoFont.

+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+
+
+

PANGO_IS_FONT()

+
#define PANGO_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT))
+
+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+

Returns

+

TRUE if object +is a PangoFont.

+
+
+
+
+

pango_font_find_shaper ()

+
PangoEngineShape *
+pango_font_find_shaper (PangoFont *font,
+                        PangoLanguage *language,
+                        guint32 ch);
+

Finds the best matching shaper for a font for a particular +language tag and character point.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

font

a PangoFont

 

language

the language tag

 

ch

a Unicode character.

 
+
+
+

Returns

+

the best matching shaper.

+

[transfer none]

+
+
+
+
+

pango_font_describe ()

+
PangoFontDescription *
+pango_font_describe (PangoFont *font);
+

Returns a description of the font, with font size set in points. +Use pango_font_describe_with_absolute_size() if you want the font +size in device units.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont

 
+
+
+

Returns

+

a newly-allocated PangoFontDescription object.

+
+
+
+
+

pango_font_describe_with_absolute_size ()

+
PangoFontDescription *
+pango_font_describe_with_absolute_size
+                               (PangoFont *font);
+

Returns a description of the font, with absolute font size set +(in device units). Use pango_font_describe() if you want the font +size in points.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont

 
+
+
+

Returns

+

a newly-allocated PangoFontDescription object.

+
+

Since: 1.14

+
+
+
+

pango_font_get_coverage ()

+
PangoCoverage *
+pango_font_get_coverage (PangoFont *font,
+                         PangoLanguage *language);
+

Computes the coverage map for a given font and language tag.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont

 

language

the language tag

 
+
+
+

Returns

+

a newly-allocated PangoCoverage +object.

+

[transfer full]

+
+
+
+
+

pango_font_get_glyph_extents ()

+
void
+pango_font_get_glyph_extents (PangoFont *font,
+                              PangoGlyph glyph,
+                              PangoRectangle *ink_rect,
+                              PangoRectangle *logical_rect);
+

Gets the logical and ink extents of a glyph within a font. The +coordinate system for each rectangle has its origin at the +base line and horizontal origin of the character with increasing +coordinates extending to the right and down. The macros PANGO_ASCENT(), +PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING() can be used to convert +from the extents rectangle to more traditional font metrics. The units +of the rectangles are in 1/PANGO_SCALE of a device unit.

+

If font + is NULL, this function gracefully sets some sane values in the +output variables and returns.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

font

a PangoFont.

[nullable]

glyph

the glyph index

 

ink_rect

rectangle used to store the extents of the glyph +as drawn or NULL to indicate that the result is not needed.

[out][allow-none]

logical_rect

rectangle used to store the logical extents of +the glyph or NULL to indicate that the result is not needed.

[out][allow-none]
+
+
+
+
+

pango_font_get_metrics ()

+
PangoFontMetrics *
+pango_font_get_metrics (PangoFont *font,
+                        PangoLanguage *language);
+

Gets overall metric information for a font. Since the metrics may be +substantially different for different scripts, a language tag can +be provided to indicate that the metrics should be retrieved that +correspond to the script(s) used by that language.

+

If font + is NULL, this function gracefully sets some sane values in the +output variables and returns.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont.

[nullable]

language

language tag used to determine which script to get the metrics +for, or NULL to indicate to get the metrics for the entire font.

[allow-none]
+
+
+

Returns

+

a PangoFontMetrics object. The caller must call pango_font_metrics_unref() +when finished using the object.

+
+
+
+
+

pango_font_get_font_map ()

+
PangoFontMap *
+pango_font_get_font_map (PangoFont *font);
+

Gets the font map for which the font was created.

+

Note that the font maintains a weak reference +to the font map, so if all references to font map are dropped, the font +map will be finalized even if there are fonts created with the font +map that are still alive. In that case this function will return NULL. +It is the responsibility of the user to ensure that the font map is kept +alive. In most uses this is not an issue as a PangoContext holds +a reference to the font map.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont, or NULL.

[nullable]
+
+
+

Returns

+

the PangoFontMap for the +font, or NULL if font +is NULL.

+

[transfer none][nullable]

+
+

Since: 1.10

+
+
+
+

PANGO_FONT_FAMILY()

+
#define PANGO_FONT_FAMILY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
+
+

Casts a GObject to a PangoFontFamily.

+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+
+
+

PANGO_IS_FONT_FAMILY()

+
#define PANGO_IS_FONT_FAMILY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
+
+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+

Returns

+

TRUE if object +is a PangoFontFamily.

+
+
+
+
+

pango_font_family_get_name ()

+
const char *
+pango_font_family_get_name (PangoFontFamily *family);
+

Gets the name of the family. The name is unique among all +fonts for the font backend and can be used in a PangoFontDescription +to specify that a face from this family is desired.

+
+

Parameters

+
+++++ + + + + + +

family

a PangoFontFamily

 
+
+
+

Returns

+

the name of the family. This string is owned +by the family object and must not be modified or freed.

+
+
+
+
+

pango_font_family_is_monospace ()

+
gboolean
+pango_font_family_is_monospace (PangoFontFamily *family);
+

A monospace font is a font designed for text display where the the +characters form a regular grid. For Western languages this would +mean that the advance width of all characters are the same, but +this categorization also includes Asian fonts which include +double-width characters: characters that occupy two grid cells. +g_unichar_iswide() returns a result that indicates whether a +character is typically double-width in a monospace font.

+

The best way to find out the grid-cell size is to call +pango_font_metrics_get_approximate_digit_width(), since the results +of pango_font_metrics_get_approximate_char_width() may be affected +by double-width characters.

+
+

Parameters

+
+++++ + + + + + +

family

a PangoFontFamily

 
+
+
+

Returns

+

TRUE if the family is monospace.

+
+

Since: 1.4

+
+
+
+

pango_font_family_list_faces ()

+
void
+pango_font_family_list_faces (PangoFontFamily *family,
+                              PangoFontFace ***faces,
+                              int *n_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.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

family

a PangoFontFamily

 

faces

location to store an array of pointers to PangoFontFace objects, +or NULL. This array should be freed with g_free() when it is no +longer needed.

[out][allow-none][array length=n_faces][transfer container]

n_faces

location to store number of elements in faces +.

[out]
+
+
+
+
+

PANGO_FONT_FACE()

+
#define PANGO_FONT_FACE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace))
+
+

Casts a GObject to a PangoFontFace.

+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+
+
+

PANGO_IS_FONT_FACE()

+
#define PANGO_IS_FONT_FACE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE))
+
+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+

Returns

+

TRUE if object +is a PangoFontFace.

+
+
+
+
+

pango_font_face_get_face_name ()

+
const char *
+pango_font_face_get_face_name (PangoFontFace *face);
+

Gets a name representing the style of this face among the +different faces in the PangoFontFamily for the face. This +name is unique among all faces in the family and is suitable +for displaying to users.

+
+

Parameters

+
+++++ + + + + + +

face

a PangoFontFace.

 
+
+
+

Returns

+

the face name for the face. This string is +owned by the face object and must not be modified or freed.

+
+
+
+
+

pango_font_face_list_sizes ()

+
void
+pango_font_face_list_sizes (PangoFontFace *face,
+                            int **sizes,
+                            int *n_sizes);
+

List the available sizes for a font. This is only applicable to bitmap +fonts. For scalable fonts, stores NULL at the location pointed to by +sizes + and 0 at the location pointed to by n_sizes +. The sizes returned +are in Pango units and are sorted in ascending order.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

face

a PangoFontFace.

 

sizes

location to store a pointer to an array of int. This array +should be freed with g_free().

[out][array length=n_sizes][nullable][optional]

n_sizes

location to store the number of elements in sizes +

 
+
+

Since: 1.4

+
+
+
+

pango_font_face_describe ()

+
PangoFontDescription *
+pango_font_face_describe (PangoFontFace *face);
+

Returns the family, style, variant, weight and stretch of +a PangoFontFace. The size field of the resulting font description +will be unset.

+
+

Parameters

+
+++++ + + + + + +

face

a PangoFontFace

 
+
+
+

Returns

+

a newly-created PangoFontDescription structure +holding the description of the face. Use pango_font_description_free() +to free the result.

+
+
+
+
+

pango_font_face_is_synthesized ()

+
gboolean
+pango_font_face_is_synthesized (PangoFontFace *face);
+

Returns whether a PangoFontFace is synthesized by the underlying +font rendering engine from another face, perhaps by shearing, emboldening, +or lightening it.

+
+

Parameters

+
+++++ + + + + + +

face

a PangoFontFace

 
+
+
+

Returns

+

whether face +is synthesized.

+
+

Since: 1.18

+
+
+
+

PANGO_FONT_MAP()

+
#define PANGO_FONT_MAP(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap))
+
+

Casts a GObject to a PangoFontMap.

+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+
+
+

PANGO_IS_FONT_MAP()

+
#define PANGO_IS_FONT_MAP(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP))
+
+
+

Parameters

+
+++++ + + + + + +

object

a GObject.

 
+
+
+

Returns

+

TRUE if object +is a PangoFontMap.

+
+
+
+
+

PANGO_FONT_MAP_CLASS()

+
#define PANGO_FONT_MAP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
+
+

Casts a GObject to a PangoFontMapClass.

+
+

Parameters

+
+++++ + + + + + +

klass

a GObject.

 
+
+
+
+
+

PANGO_IS_FONT_MAP_CLASS()

+
#define PANGO_IS_FONT_MAP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP))
+
+
+

Parameters

+
+++++ + + + + + +

klass

a GObject.

 
+
+
+

Returns

+

TRUE if klass +is a subtype of PangoFontMapClass.

+
+
+
+
+

PANGO_FONT_MAP_GET_CLASS()

+
#define PANGO_FONT_MAP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
+
+
+

Parameters

+
+++++ + + + + + +

obj

a PangoFontMap.

 
+
+
+

Returns

+

class of obj +

+
+
+
+
+

pango_font_map_create_context ()

+
PangoContext *
+pango_font_map_create_context (PangoFontMap *fontmap);
+

Creates a PangoContext connected to fontmap +. This is equivalent +to pango_context_new() followed by pango_context_set_font_map().

+

If you are using Pango as part of a higher-level system, +that system may have it's own way of create a PangoContext. +For instance, the GTK+ toolkit has, among others, +gdk_pango_context_get_for_screen(), and +gtk_widget_get_pango_context(). Use those instead.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFontMap

 
+
+
+

Returns

+

the newly allocated PangoContext, +which should be freed with g_object_unref().

+

[transfer full]

+
+

Since: 1.22

+
+
+
+

pango_font_map_load_font ()

+
PangoFont *
+pango_font_map_load_font (PangoFontMap *fontmap,
+                          PangoContext *context,
+                          const PangoFontDescription *desc);
+

Load the font in the fontmap that is the closest match for desc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontmap

a PangoFontMap

 

context

the PangoContext the font will be used with

 

desc

a PangoFontDescription describing the font to load

 
+
+
+

Returns

+

the newly allocated PangoFont +loaded, or NULL if no font matched.

+

[transfer full][nullable]

+
+
+
+
+

pango_font_map_load_fontset ()

+
PangoFontset *
+pango_font_map_load_fontset (PangoFontMap *fontmap,
+                             PangoContext *context,
+                             const PangoFontDescription *desc,
+                             PangoLanguage *language);
+

Load a set of fonts in the fontmap that can be used to render +a font matching desc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

fontmap

a PangoFontMap

 

context

the PangoContext the font will be used with

 

desc

a PangoFontDescription describing the font to load

 

language

a PangoLanguage the fonts will be used for

 
+
+
+

Returns

+

the newly allocated +PangoFontset loaded, or NULL if no font matched.

+

[transfer full][nullable]

+
+
+
+
+

pango_font_map_list_families ()

+
void
+pango_font_map_list_families (PangoFontMap *fontmap,
+                              PangoFontFamily ***families,
+                              int *n_families);
+

List all families for a fontmap.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontmap

a PangoFontMap

 

families

location to store a pointer to an array of PangoFontFamily *. +This array should be freed with g_free().

[out][array length=n_families][transfer container]

n_families

location to store the number of elements in families +.

[out]
+
+
+
+
+

pango_font_map_get_shape_engine_type ()

+
const char *
+pango_font_map_get_shape_engine_type (PangoFontMap *fontmap);
+

pango_font_map_get_shape_engine_type has been deprecated since version 1.38 and should not be used in newly-written code.

+

Returns the render ID for shape engines for this fontmap. +See the render_type field of +PangoEngineInfo.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFontMap

 
+
+
+

Returns

+

the ID string for shape engines for +this fontmap. Owned by Pango, should not be modified +or freed.

+
+

Since: 1.4

+
+
+
+

pango_font_map_get_serial ()

+
guint
+pango_font_map_get_serial (PangoFontMap *fontmap);
+

Returns the current serial number of fontmap +. The serial number is +initialized to an small number larger than zero when a new fontmap +is created and is increased whenever the fontmap is changed. It may +wrap, but will never have the value 0. Since it can wrap, never compare +it with "less than", always use "not equals".

+

The fontmap can only be changed using backend-specific API, like changing +fontmap resolution.

+

This can be used to automatically detect changes to a PangoFontMap, like +in PangoContext.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFontMap

 
+
+
+

Returns

+

The current serial number of fontmap +.

+
+

Since: 1.32.4

+
+
+
+

pango_font_map_changed ()

+
void
+pango_font_map_changed (PangoFontMap *fontmap);
+

Forces a change in the context, which will cause any PangoContext +using this fontmap to change.

+

This function is only useful when implementing a new backend +for Pango, something applications won't do. Backends should +call this function if they have attached extra data to the context +and such data is changed.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFontMap

 
+
+

Since: 1.34

+
+
+
+

pango_fontset_get_font ()

+
PangoFont *
+pango_fontset_get_font (PangoFontset *fontset,
+                        guint wc);
+

Returns the font in the fontset that contains the best glyph for the +Unicode character wc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fontset

a PangoFontset

 

wc

a Unicode character

 
+
+
+

Returns

+

a PangoFont. The caller must call +g_object_unref when finished with the font.

+

[transfer full]

+
+
+
+
+

pango_fontset_get_metrics ()

+
PangoFontMetrics *
+pango_fontset_get_metrics (PangoFontset *fontset);
+

Get overall metric information for the fonts in the fontset.

+
+

Parameters

+
+++++ + + + + + +

fontset

a PangoFontset

 
+
+
+

Returns

+

a PangoFontMetrics object. The caller must call pango_font_metrics_unref() +when finished using the object.

+
+
+
+
+

PangoFontsetForeachFunc ()

+
gboolean
+(*PangoFontsetForeachFunc) (PangoFontset *fontset,
+                            PangoFont *font,
+                            gpointer user_data);
+

A callback function used by pango_fontset_foreach() when enumerating +the fonts in a fontset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontset

a PangoFontset

 

font

a font from fontset +

 

user_data

callback data

 
+
+
+

Returns

+

if TRUE, stop iteration and return immediately.

+
+

Since: 1.4

+
+
+
+

pango_fontset_foreach ()

+
void
+pango_fontset_foreach (PangoFontset *fontset,
+                       PangoFontsetForeachFunc func,
+                       gpointer data);
+

Iterates through all the fonts in a fontset, calling func + for +each one. If func + returns TRUE, that stops the iteration.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontset

a PangoFontset

 

func

Callback function.

[closure data][scope call]

data

data to pass to the callback function.

[closure]
+
+

Since: 1.4

+
+
+
+

pango_fontset_simple_new ()

+
PangoFontsetSimple *
+pango_fontset_simple_new (PangoLanguage *language);
+

Creates a new PangoFontsetSimple for the given language.

+
+

Parameters

+
+++++ + + + + + +

language

a PangoLanguage tag

 
+
+
+

Returns

+

the newly allocated PangoFontsetSimple, which should +be freed with g_object_unref().

+
+
+
+
+

pango_fontset_simple_append ()

+
void
+pango_fontset_simple_append (PangoFontsetSimple *fontset,
+                             PangoFont *font);
+

Adds a font to the fontset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

fontset

a PangoFontsetSimple.

 

font

a PangoFont.

 
+
+
+
+
+

pango_fontset_simple_size ()

+
int
+pango_fontset_simple_size (PangoFontsetSimple *fontset);
+

Returns the number of fonts in the fontset.

+
+

Parameters

+
+++++ + + + + + +

fontset

a PangoFontsetSimple.

 
+
+
+

Returns

+

the size of fontset +.

+
+
+
+
+

Types and Values

+
+

PangoFontDescription

+
typedef struct _PangoFontDescription PangoFontDescription;
+

The PangoFontDescription structure represents the description +of an ideal font. These structures are used both to list +what fonts are available on the system and also for specifying +the characteristics of a font to load.

+
+
+
+

PANGO_TYPE_FONT_DESCRIPTION

+
#define PANGO_TYPE_FONT_DESCRIPTION (pango_font_description_get_type ())
+
+

The GObject type for PangoFontDescription.

+
+
+
+

enum PangoStyle

+

An enumeration specifying the various slant styles possible for a font.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PANGO_STYLE_NORMAL

+

the font is upright.

+
 

PANGO_STYLE_OBLIQUE

+

the font is slanted, but in a roman style.

+
 

PANGO_STYLE_ITALIC

+

the font is slanted in an italic style.

+
 
+
+
+
+
+

PANGO_TYPE_STYLE

+
#define PANGO_TYPE_STYLE (pango_style_get_type ())
+
+
+
+
+

enum PangoWeight

+

An enumeration specifying the weight (boldness) of a font. This is a numerical +value ranging from 100 to 1000, but there are some predefined values:

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_WEIGHT_THIN

+

the thin weight (= 100; Since: 1.24)

+
 

PANGO_WEIGHT_ULTRALIGHT

+

the ultralight weight (= 200)

+
 

PANGO_WEIGHT_LIGHT

+

the light weight (= 300)

+
 

PANGO_WEIGHT_SEMILIGHT

+

the semilight weight (= 350; Since: 1.36.7)

+
 

PANGO_WEIGHT_BOOK

+

the book weight (= 380; Since: 1.24)

+
 

PANGO_WEIGHT_NORMAL

+

the default weight (= 400)

+
 

PANGO_WEIGHT_MEDIUM

+

the normal weight (= 500; Since: 1.24)

+
 

PANGO_WEIGHT_SEMIBOLD

+

the semibold weight (= 600)

+
 

PANGO_WEIGHT_BOLD

+

the bold weight (= 700)

+
 

PANGO_WEIGHT_ULTRABOLD

+

the ultrabold weight (= 800)

+
 

PANGO_WEIGHT_HEAVY

+

the heavy weight (= 900)

+
 

PANGO_WEIGHT_ULTRAHEAVY

+

the ultraheavy weight (= 1000; Since: 1.24)

+
 
+
+
+
+
+

PANGO_TYPE_WEIGHT

+
#define PANGO_TYPE_WEIGHT (pango_weight_get_type ())
+
+
+
+
+

enum PangoVariant

+

An enumeration specifying capitalization variant of the font.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PANGO_VARIANT_NORMAL

+

A normal font.

+
 

PANGO_VARIANT_SMALL_CAPS

+

A font with the lower case characters +replaced by smaller variants of the capital characters.

+
 
+
+
+
+
+

PANGO_TYPE_VARIANT

+
#define PANGO_TYPE_VARIANT (pango_variant_get_type ())
+
+
+
+
+

enum PangoStretch

+

An enumeration specifying the width of the font relative to other designs +within a family.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_STRETCH_ULTRA_CONDENSED

+

ultra condensed width

+
 

PANGO_STRETCH_EXTRA_CONDENSED

+

extra condensed width

+
 

PANGO_STRETCH_CONDENSED

+

condensed width

+
 

PANGO_STRETCH_SEMI_CONDENSED

+

semi condensed width

+
 

PANGO_STRETCH_NORMAL

+

the normal width

+
 

PANGO_STRETCH_SEMI_EXPANDED

+

semi expanded width

+
 

PANGO_STRETCH_EXPANDED

+

expanded width

+
 

PANGO_STRETCH_EXTRA_EXPANDED

+

extra expanded width

+
 

PANGO_STRETCH_ULTRA_EXPANDED

+

ultra expanded width

+
 
+
+
+
+
+

PANGO_TYPE_STRETCH

+
#define PANGO_TYPE_STRETCH (pango_stretch_get_type ())
+
+
+
+
+

enum PangoFontMask

+

The bits in a PangoFontMask correspond to fields in a +PangoFontDescription that have been set.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_FONT_MASK_FAMILY

+

the font family is specified.

+
 

PANGO_FONT_MASK_STYLE

+

the font style is specified.

+
 

PANGO_FONT_MASK_VARIANT

+

the font variant is specified.

+
 

PANGO_FONT_MASK_WEIGHT

+

the font weight is specified.

+
 

PANGO_FONT_MASK_STRETCH

+

the font stretch is specified.

+
 

PANGO_FONT_MASK_SIZE

+

the font size is specified.

+
 

PANGO_FONT_MASK_GRAVITY

+

the font gravity is specified (Since: 1.16.)

+
 

PANGO_FONT_MASK_VARIATIONS

+

OpenType font variations are specified (Since: 1.42)

+
 
+
+
+
+
+

PANGO_TYPE_FONT_MASK

+
#define PANGO_TYPE_FONT_MASK (pango_font_mask_get_type ())
+
+
+
+
+

struct PangoFontMetrics

+
struct PangoFontMetrics {
+};
+
+

A PangoFontMetrics structure holds the overall metric information +for a font (possibly restricted to a script). The fields of this +structure are private to implementations of a font backend. See +the documentation of the corresponding getters for documentation +of their meaning.

+
+
+
+

PANGO_TYPE_FONT_METRICS

+
#define PANGO_TYPE_FONT_METRICS  (pango_font_metrics_get_type ())
+
+

The GObject type for PangoFontMetrics.

+
+
+
+

PangoFont

+
typedef struct _PangoFont PangoFont;
+

The PangoFont structure is used to represent +a font in a rendering-system-independent matter. +To create an implementation of a PangoFont, +the rendering-system specific code should allocate +a larger structure that contains a nested +PangoFont, fill in the klass member of +the nested PangoFont with a pointer to +a appropriate PangoFontClass, then call +pango_font_init() on the structure.

+

The PangoFont structure contains one member +which the implementation fills in.

+
+
+
+

PANGO_TYPE_FONT

+
#define PANGO_TYPE_FONT              (pango_font_get_type ())
+
+

The GObject type for PangoFont.

+
+
+
+

struct PangoFontFamily

+
struct PangoFontFamily;
+

The PangoFontFamily structure is used to represent a family of related +font faces. The faces in a family share a common design, but differ in +slant, weight, width and other aspects.

+
+
+
+

PANGO_TYPE_FONT_FAMILY

+
#define PANGO_TYPE_FONT_FAMILY              (pango_font_family_get_type ())
+
+

The GObject type for PangoFontFamily.

+
+
+
+

struct PangoFontFace

+
struct PangoFontFace;
+

The PangoFontFace structure is used to represent a group of fonts with +the same family, slant, weight, width, but varying sizes.

+
+
+
+

PANGO_TYPE_FONT_FACE

+
#define PANGO_TYPE_FONT_FACE              (pango_font_face_get_type ())
+
+

The GObject type for PangoFontFace.

+
+
+
+

PangoFontMap

+
typedef struct _PangoFontMap PangoFontMap;
+

The PangoFontMap represents the set of fonts available for a +particular rendering system. This is a virtual object with +implementations being specific to particular rendering systems. To +create an implementation of a PangoFontMap, the rendering-system +specific code should allocate a larger structure that contains a nested +PangoFontMap, fill in the klass member of the nested PangoFontMap with a +pointer to a appropriate PangoFontMapClass, then call +pango_font_map_init() on the structure.

+

The PangoFontMap structure contains one member which the implementation +fills in.

+
+
+
+

PANGO_TYPE_FONT_MAP

+
#define PANGO_TYPE_FONT_MAP              (pango_font_map_get_type ())
+
+

The GObject type for PangoFontMap.

+
+
+
+

struct PangoFontMapClass

+
struct PangoFontMapClass {
+  GObjectClass parent_class;
+
+
+  PangoFont *   (*load_font)     (PangoFontMap               *fontmap,
+				  PangoContext               *context,
+				  const PangoFontDescription *desc);
+  void          (*list_families) (PangoFontMap               *fontmap,
+				  PangoFontFamily          ***families,
+				  int                        *n_families);
+  PangoFontset *(*load_fontset)  (PangoFontMap               *fontmap,
+				  PangoContext               *context,
+				  const PangoFontDescription *desc,
+				  PangoLanguage              *language);
+
+  const char     *shape_engine_type;
+
+  guint         (*get_serial)    (PangoFontMap               *fontmap);
+  void          (*changed)       (PangoFontMap               *fontmap);
+};
+
+

The PangoFontMapClass structure holds the virtual functions for +a particular PangoFontMap implementation.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

load_font ()

a function to load a font with a given description. See +pango_font_map_load_font().

 

list_families ()

A function to list available font families. See +pango_font_map_list_families().

 

load_fontset ()

a function to load a fontset with a given given description +suitable for a particular language. See pango_font_map_load_fontset().

 

const char *shape_engine_type;

the type of rendering-system-dependent engines that +can handle fonts of this fonts loaded with this fontmap.

 

get_serial ()

a function to get the serial number of the fontmap. +See pango_font_map_get_serial().

 

changed ()

See pango_font_map_changed()

 
+
+
+
+
+

struct PangoFontset

+
struct PangoFontset;
+

A PangoFontset represents a set of PangoFont to use +when rendering text. It is the result of resolving a +PangoFontDescription against a particular PangoContext. +It has operations for finding the component font for +a particular Unicode character, and for finding a composite +set of metrics for the entire fontset.

+
+
+
+

PANGO_TYPE_FONTSET

+
#define PANGO_TYPE_FONTSET              (pango_fontset_get_type ())
+
+

The GObject type for PangoFontset.

+
+
+
+

struct PangoFontsetClass

+
struct PangoFontsetClass {
+  GObjectClass parent_class;
+
+
+  PangoFont *       (*get_font)     (PangoFontset     *fontset,
+				     guint             wc);
+
+  PangoFontMetrics *(*get_metrics)  (PangoFontset     *fontset);
+  PangoLanguage *   (*get_language) (PangoFontset     *fontset);
+  void              (*foreach)      (PangoFontset           *fontset,
+				     PangoFontsetForeachFunc func,
+				     gpointer                data);
+};
+
+

The PangoFontsetClass structure holds the virtual functions for +a particular PangoFontset implementation.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

get_font ()

a function to get the font in the fontset that contains the +best glyph for the given Unicode character; see pango_fontset_get_font().

 

get_metrics ()

a function to get overall metric information for the fonts +in the fontset; see pango_fontset_get_metrics().

 

get_language ()

a function to get the language of the fontset.

 

foreach ()

a function to loop over the fonts in the fontset. See +pango_fontset_foreach().

 
+
+
+
+
+

PangoFontsetSimple

+
typedef struct _PangoFontsetSimple PangoFontsetSimple;
+

PangoFontsetSimple is a implementation of the abstract +PangoFontset base class in terms of an array of fonts, +which the creator provides when constructing the +PangoFontsetSimple.

+
+
+
+

PANGO_TYPE_FONTSET_SIMPLE

+
#define PANGO_TYPE_FONTSET_SIMPLE       (pango_fontset_simple_get_type ())
+
+

The GObject type for PangoFontsetSimple.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-FreeType-Fonts-and-Rendering.html b/docs/html/pango-FreeType-Fonts-and-Rendering.html new file mode 100644 index 0000000..d3154cc --- /dev/null +++ b/docs/html/pango-FreeType-Fonts-and-Rendering.html @@ -0,0 +1,957 @@ + + + + +FreeType Fonts and Rendering: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

FreeType Fonts and Rendering

+

FreeType Fonts and Rendering — Functions for shape engines to manipulate FreeType fonts

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoFontMap * + +pango_ft2_font_map_new () +
+void + +pango_ft2_font_map_set_resolution () +
+PangoContext * + +pango_ft2_font_map_create_context () +
+void + +(*PangoFT2SubstituteFunc) () +
+void + +pango_ft2_font_map_set_default_substitute () +
+void + +pango_ft2_font_map_substitute_changed () +
+PangoContext * + +pango_ft2_get_context () +
+void + +pango_ft2_render () +
+void + +pango_ft2_render_transformed () +
+void + +pango_ft2_render_layout_line () +
+void + +pango_ft2_render_layout_line_subpixel () +
+void + +pango_ft2_render_layout () +
+void + +pango_ft2_render_layout_subpixel () +
+PangoGlyph + +pango_ft2_get_unknown_glyph () +
+int + +pango_ft2_font_get_kerning () +
+FT_Face + +pango_ft2_font_get_face () +
+PangoCoverage * + +pango_ft2_font_get_coverage () +
+PangoFontMap * + +pango_ft2_font_map_for_display () +
+void + +pango_ft2_shutdown_display () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
 PangoFT2FontMap
#definePANGO_RENDER_TYPE_FT2
+
+
+

Object Hierarchy

+
    GObject
+    ╰── PangoFontMap
+        ╰── PangoFcFontMap
+            ╰── PangoFT2FontMap
+
+
+
+

Description

+

The macros and functions in this section are used to access fonts and render +text to bitmaps using the FreeType 2 library.

+
+
+

Functions

+
+

pango_ft2_font_map_new ()

+
PangoFontMap *
+pango_ft2_font_map_new (void);
+

Create a new PangoFT2FontMap object; a fontmap is used +to cache information about available fonts, and holds +certain global parameters such as the resolution and +the default substitute function (see +pango_ft2_font_map_set_default_substitute()).

+
+

Returns

+

the newly created fontmap object. Unref +with g_object_unref() when you are finished with it.

+
+

Since: 1.2

+
+
+
+

pango_ft2_font_map_set_resolution ()

+
void
+pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap,
+                                   double dpi_x,
+                                   double dpi_y);
+

Sets the horizontal and vertical resolutions for the fontmap.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontmap

a PangoFT2FontMap

 

dpi_x

dots per inch in the X direction

 

dpi_y

dots per inch in the Y direction

 
+
+

Since: 1.2

+
+
+
+

pango_ft2_font_map_create_context ()

+
PangoContext *
+pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap);
+
+

pango_ft2_font_map_create_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_font_map_create_context() instead.

+
+

Create a PangoContext for the given fontmap.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFT2FontMap

 
+
+
+

Returns

+

the newly created context; free with +g_object_unref().

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

PangoFT2SubstituteFunc ()

+
void
+(*PangoFT2SubstituteFunc) (FcPattern *pattern,
+                           gpointer data);
+

Function type for doing final config tweaking on prepared FcPatterns.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pattern

the FcPattern to tweak.

 

data

user data.

 
+
+
+
+
+

pango_ft2_font_map_set_default_substitute ()

+
void
+pango_ft2_font_map_set_default_substitute
+                               (PangoFT2FontMap *fontmap,
+                                PangoFT2SubstituteFunc func,
+                                gpointer data,
+                                GDestroyNotify notify);
+

Sets a function that will be called to do final configuration +substitution on a FcPattern before it is used to load +the font. This function can be used to do things like set +hinting and antialiasing options.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

fontmap

a PangoFT2FontMap

 

func

function to call to to do final config tweaking +on FcPattern objects.

 

data

data to pass to func +

 

notify

function to call when data +is no longer used.

 
+
+

Since: 1.2

+
+
+
+

pango_ft2_font_map_substitute_changed ()

+
void
+pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap);
+

Call this function any time the results of the +default substitution function set with +pango_ft2_font_map_set_default_substitute() change. +That is, if your substitution function will return different +results for the same input pattern, you must call this function.

+
+

Parameters

+
+++++ + + + + + +

fontmap

a PangoFT2FontMap

 
+
+

Since: 1.2

+
+
+
+

pango_ft2_get_context ()

+
PangoContext *
+pango_ft2_get_context (double dpi_x,
+                       double dpi_y);
+
+

pango_ft2_get_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_font_map_create_context() instead.

+
+

Retrieves a PangoContext for the default PangoFT2 fontmap +(see pango_ft2_font_map_for_display()) and sets the resolution +for the default fontmap to dpi_x + by dpi_y +.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

dpi_x

the horizontal DPI of the target device

 

dpi_y

the vertical DPI of the target device

 
+
+
+

Returns

+

the new PangoContext.

+

[transfer full]

+
+
+
+
+

pango_ft2_render ()

+
void
+pango_ft2_render (FT_Bitmap *bitmap,
+                  PangoFont *font,
+                  PangoGlyphString *glyphs,
+                  gint x,
+                  gint y);
+

Renders a PangoGlyphString onto a FreeType2 bitmap.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bitmap

the FreeType2 bitmap onto which to draw the string

 

font

the font in which to draw the string

 

glyphs

the glyph string to draw

 

x

the x position of the start of the string (in pixels)

 

y

the y position of the baseline (in pixels)

 
+
+
+
+
+

pango_ft2_render_transformed ()

+
void
+pango_ft2_render_transformed (FT_Bitmap *bitmap,
+                              const PangoMatrix *matrix,
+                              PangoFont *font,
+                              PangoGlyphString *glyphs,
+                              int x,
+                              int y);
+

Renders a PangoGlyphString onto a FreeType2 bitmap, possibly +transforming the layed-out coordinates through a transformation +matrix. Note that the transformation matrix for font + is not +changed, so to produce correct rendering results, the font + +must have been loaded using a PangoContext with an identical +transformation matrix to that passed in to this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bitmap

the FreeType2 bitmap onto which to draw the string

 

font

the font in which to draw the string

 

matrix

a PangoMatrix, or NULL to use an identity +transformation.

[nullable]

glyphs

the glyph string to draw

 

x

the x position of the start of the string (in Pango +units in user space coordinates)

 

y

the y position of the baseline (in Pango units +in user space coordinates)

 
+
+

Since: 1.6

+
+
+
+

pango_ft2_render_layout_line ()

+
void
+pango_ft2_render_layout_line (FT_Bitmap *bitmap,
+                              PangoLayoutLine *line,
+                              int x,
+                              int y);
+

Render a PangoLayoutLine onto a FreeType2 bitmap

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

bitmap

a FT_Bitmap to render the line onto

 

line

a PangoLayoutLine

 

x

the x position of start of string (in pixels)

 

y

the y position of baseline (in pixels)

 
+
+
+
+
+

pango_ft2_render_layout_line_subpixel ()

+
void
+pango_ft2_render_layout_line_subpixel (FT_Bitmap *bitmap,
+                                       PangoLayoutLine *line,
+                                       int x,
+                                       int y);
+

Render a PangoLayoutLine onto a FreeType2 bitmap, with he +location specified in fixed-point Pango units rather than +pixels. (Using this will avoid extra inaccuracies from +rounding to integer pixels multiple times, even if the +final glyph positions are integers.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

bitmap

a FT_Bitmap to render the line onto

 

line

a PangoLayoutLine

 

x

the x position of start of string (in Pango units)

 

y

the y position of baseline (in Pango units)

 
+
+

Since: 1.6

+
+
+
+

pango_ft2_render_layout ()

+
void
+pango_ft2_render_layout (FT_Bitmap *bitmap,
+                         PangoLayout *layout,
+                         int x,
+                         int y);
+

Render a PangoLayout onto a FreeType2 bitmap

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

bitmap

a FT_Bitmap to render the layout onto

 

layout

a PangoLayout

 

x

the X position of the left of the layout (in pixels)

 

y

the Y position of the top of the layout (in pixels)

 
+
+
+
+
+

pango_ft2_render_layout_subpixel ()

+
void
+pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap,
+                                  PangoLayout *layout,
+                                  int x,
+                                  int y);
+

Render a PangoLayout onto a FreeType2 bitmap, with he +location specified in fixed-point Pango units rather than +pixels. (Using this will avoid extra inaccuracies from +rounding to integer pixels multiple times, even if the +final glyph positions are integers.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

bitmap

a FT_Bitmap to render the layout onto

 

layout

a PangoLayout

 

x

the X position of the left of the layout (in Pango units)

 

y

the Y position of the top of the layout (in Pango units)

 
+
+

Since: 1.6

+
+
+
+

pango_ft2_get_unknown_glyph ()

+
PangoGlyph
+pango_ft2_get_unknown_glyph (PangoFont *font);
+

pango_ft2_get_unknown_glyph is deprecated and should not be used in newly-written code.

+

Return the index of a glyph suitable for drawing unknown characters with +font +, or PANGO_GLYPH_EMPTY if no suitable glyph found.

+

If you want to draw an unknown-box for a character that is not covered +by the font, +use PANGO_GET_UNKNOWN_GLYPH() instead.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont

 
+
+
+

Returns

+

a glyph index into font +, or PANGO_GLYPH_EMPTY

+
+
+
+
+

pango_ft2_font_get_kerning ()

+
int
+pango_ft2_font_get_kerning (PangoFont *font,
+                            PangoGlyph left,
+                            PangoGlyph right);
+

pango_ft2_font_get_kerning is deprecated and should not be used in newly-written code.

+

Retrieves kerning information for a combination of two glyphs.

+

Use pango_fc_font_kern_glyphs() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

font

a PangoFont

 

left

the left PangoGlyph

 

right

the right PangoGlyph

 
+
+
+

Returns

+

The amount of kerning (in Pango units) to apply for +the given combination of glyphs.

+
+
+
+
+

pango_ft2_font_get_face ()

+
FT_Face
+pango_ft2_font_get_face (PangoFont *font);
+

pango_ft2_font_get_face is deprecated and should not be used in newly-written code.

+

Returns the native FreeType2 FT_Face structure used for this PangoFont. +This may be useful if you want to use FreeType2 functions directly.

+

Use pango_fc_font_lock_face() instead; when you are done with a +face from pango_fc_font_lock_face() you must call +pango_fc_font_unlock_face().

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont

 
+
+
+

Returns

+

a pointer to a FT_Face +structure, with the size set correctly, or NULL if +font +is NULL.

+

[nullable]

+
+
+
+
+

pango_ft2_font_get_coverage ()

+
PangoCoverage *
+pango_ft2_font_get_coverage (PangoFont *font,
+                             PangoLanguage *language);
+

pango_ft2_font_get_coverage is deprecated and should not be used in newly-written code.

+

Gets the PangoCoverage for a PangoFT2Font. Use +pango_font_get_coverage() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFT2Font.

 

language

a language tag.

 
+
+
+

Returns

+

a PangoCoverage.

+
+
+
+
+

pango_ft2_font_map_for_display ()

+
PangoFontMap *
+pango_ft2_font_map_for_display (void);
+

pango_ft2_font_map_for_display is deprecated and should not be used in newly-written code.

+

Returns a PangoFT2FontMap. This font map is cached and should +not be freed. If the font map is no longer needed, it can +be released with pango_ft2_shutdown_display(). Use of the +global PangoFT2 fontmap is deprecated; use pango_ft2_font_map_new() +instead.

+

[skip]

+
+

Returns

+

a PangoFT2FontMap.

+

[transfer none]

+
+
+
+
+

pango_ft2_shutdown_display ()

+
void
+pango_ft2_shutdown_display (void);
+

pango_ft2_shutdown_display is deprecated and should not be used in newly-written code.

+

Free the global fontmap. (See pango_ft2_font_map_for_display()) +Use of the global PangoFT2 fontmap is deprecated.

+
+
+
+

Types and Values

+
+

PangoFT2FontMap

+
typedef struct _PangoFT2FontMap PangoFT2FontMap;
+

The PangoFT2FontMap is the PangoFontMap implementation for FreeType fonts.

+
+
+
+

PANGO_RENDER_TYPE_FT2

+
#define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2"
+
+

PANGO_RENDER_TYPE_FT2 is deprecated and should not be used in newly-written code.

+

A string constant that was used to identify shape engines that work +with the FreeType backend. See PANGO_RENDER_TYPE_FC for the replacement.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Glyph-Storage.html b/docs/html/pango-Glyph-Storage.html new file mode 100644 index 0000000..04560d0 --- /dev/null +++ b/docs/html/pango-Glyph-Storage.html @@ -0,0 +1,2714 @@ + + + + +Glyph Storage: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Glyph Storage

+

Glyph Storage — Structures for storing information about glyphs

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define +PANGO_PIXELS() +
#define +PANGO_PIXELS_FLOOR() +
#define +PANGO_PIXELS_CEIL() +
#define +PANGO_UNITS_ROUND() +
+double + +pango_units_to_double () +
+int + +pango_units_from_double () +
#define +PANGO_ASCENT() +
#define +PANGO_DESCENT() +
#define +PANGO_LBEARING() +
#define +PANGO_RBEARING() +
+void + +pango_extents_to_pixels () +
+PangoMatrix * + +pango_matrix_copy () +
+void + +pango_matrix_free () +
+void + +pango_matrix_translate () +
+void + +pango_matrix_scale () +
+void + +pango_matrix_rotate () +
+void + +pango_matrix_concat () +
+void + +pango_matrix_transform_point () +
+void + +pango_matrix_transform_distance () +
+void + +pango_matrix_transform_rectangle () +
+void + +pango_matrix_transform_pixel_rectangle () +
+double + +pango_matrix_get_font_scale_factor () +
+void + +pango_matrix_get_font_scale_factors () +
#define +PANGO_GET_UNKNOWN_GLYPH() +
+PangoGlyphString * + +pango_glyph_string_new () +
+PangoGlyphString * + +pango_glyph_string_copy () +
+void + +pango_glyph_string_set_size () +
+void + +pango_glyph_string_free () +
+void + +pango_glyph_string_extents () +
+void + +pango_glyph_string_extents_range () +
+int + +pango_glyph_string_get_width () +
+void + +pango_glyph_string_index_to_x () +
+void + +pango_glyph_string_x_to_index () +
+void + +pango_glyph_string_get_logical_widths () +
+PangoGlyphItem * + +pango_glyph_item_copy () +
+void + +pango_glyph_item_free () +
+PangoGlyphItem * + +pango_glyph_item_split () +
+GSList * + +pango_glyph_item_apply_attrs () +
+void + +pango_glyph_item_letter_space () +
+void + +pango_glyph_item_get_logical_widths () +
+PangoGlyphItemIter * + +pango_glyph_item_iter_copy () +
+void + +pango_glyph_item_iter_free () +
+gboolean + +pango_glyph_item_iter_init_start () +
+gboolean + +pango_glyph_item_iter_init_end () +
+gboolean + +pango_glyph_item_iter_next_cluster () +
+gboolean + +pango_glyph_item_iter_prev_cluster () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#definePANGO_SCALE
structPangoRectangle
structPangoMatrix
#definePANGO_TYPE_MATRIX
#definePANGO_MATRIX_INIT
typedefPangoGlyph
#definePANGO_GLYPH_EMPTY
#definePANGO_GLYPH_INVALID_INPUT
#definePANGO_GLYPH_UNKNOWN_FLAG
structPangoGlyphInfo
structPangoGlyphGeometry
typedefPangoGlyphUnit
structPangoGlyphVisAttr
structPangoGlyphString
structPangoGlyphItem
structPangoGlyphItemIter
#definePANGO_TYPE_GLYPH_STRING
#definePANGO_TYPE_GLYPH_ITEM
#definePANGO_TYPE_GLYPH_ITEM_ITER
+
+
+

Object Hierarchy

+
    GBoxed
+    ├── PangoGlyphItem
+    ├── PangoGlyphItemIter
+    ├── PangoGlyphString
+    ╰── PangoMatrix
+
+
+
+

Description

+

pango_shape() produces a string of glyphs which +can be measured or drawn to the screen. The following +structures are used to store information about +glyphs.

+
+
+

Functions

+
+

PANGO_PIXELS()

+
#define PANGO_PIXELS(d) (((int)(d) + 512) >> 10)
+
+

Converts a dimension to device units by rounding.

+
+

Parameters

+
+++++ + + + + + +

d

a dimension in Pango units.

 
+
+
+

Returns

+

rounded dimension in device units.

+
+
+
+
+

PANGO_PIXELS_FLOOR()

+
#define PANGO_PIXELS_FLOOR(d) (((int)(d)) >> 10)
+
+

Converts a dimension to device units by flooring.

+
+

Parameters

+
+++++ + + + + + +

d

a dimension in Pango units.

 
+
+
+

Returns

+

floored dimension in device units.

+
+

Since: 1.14

+
+
+
+

PANGO_PIXELS_CEIL()

+
#define PANGO_PIXELS_CEIL(d) (((int)(d) + 1023) >> 10)
+
+

Converts a dimension to device units by ceiling.

+
+

Parameters

+
+++++ + + + + + +

d

a dimension in Pango units.

 
+
+
+

Returns

+

ceiled dimension in device units.

+
+

Since: 1.14

+
+
+
+

PANGO_UNITS_ROUND()

+
#define             PANGO_UNITS_ROUND(d)
+

Rounds a dimension to whole device units, but does not +convert it to device units.

+
+

Parameters

+
+++++ + + + + + +

d

a dimension in Pango units.

 
+
+
+

Returns

+

rounded dimension in Pango units.

+
+

Since: 1.18

+
+
+
+

pango_units_to_double ()

+
double
+pango_units_to_double (int i);
+

Converts a number in Pango units to floating-point: divides +it by PANGO_SCALE.

+
+

Parameters

+
+++++ + + + + + +

i

value in Pango units

 
+
+
+

Returns

+

the double value.

+
+

Since: 1.16

+
+
+
+

pango_units_from_double ()

+
int
+pango_units_from_double (double d);
+

Converts a floating-point number to Pango units: multiplies +it by PANGO_SCALE and rounds to nearest integer.

+
+

Parameters

+
+++++ + + + + + +

d

double floating-point value

 
+
+
+

Returns

+

the value in Pango units.

+
+

Since: 1.16

+
+
+
+

PANGO_ASCENT()

+
#define PANGO_ASCENT(rect) (-(rect).y)
+
+

Extracts the ascent from a PangoRectangle +representing glyph extents. The ascent is the distance from the +baseline to the highest point of the character. This is positive if the +glyph ascends above the baseline.

+
+

Parameters

+
+++++ + + + + + +

rect

a PangoRectangle

 
+
+
+
+
+

PANGO_DESCENT()

+
#define PANGO_DESCENT(rect) ((rect).y + (rect).height)
+
+

Extracts the descent from a PangoRectangle +representing glyph extents. The descent is the distance from the +baseline to the lowest point of the character. This is positive if the +glyph descends below the baseline.

+
+

Parameters

+
+++++ + + + + + +

rect

a PangoRectangle

 
+
+
+
+
+

PANGO_LBEARING()

+
#define PANGO_LBEARING(rect) ((rect).x)
+
+

Extracts the left bearing from a PangoRectangle +representing glyph extents. The left bearing is the distance from the +horizontal origin to the farthest left point of the character. +This is positive for characters drawn completely to the right of the +glyph origin.

+
+

Parameters

+
+++++ + + + + + +

rect

a PangoRectangle

 
+
+
+
+
+

PANGO_RBEARING()

+
#define PANGO_RBEARING(rect) ((rect).x + (rect).width)
+
+

Extracts the right bearing from a PangoRectangle +representing glyph extents. The right bearing is the distance from the +horizontal origin to the farthest right point of the character. +This is positive except for characters drawn completely to the left of the +horizontal origin.

+
+

Parameters

+
+++++ + + + + + +

rect

a PangoRectangle

 
+
+
+
+
+

pango_extents_to_pixels ()

+
void
+pango_extents_to_pixels (PangoRectangle *inclusive,
+                         PangoRectangle *nearest);
+

Converts extents from Pango units to device units, dividing by the +PANGO_SCALE factor and performing rounding.

+

The inclusive + rectangle is converted by flooring the x/y coordinates and extending +width/height, such that the final rectangle completely includes the original +rectangle.

+

The nearest + rectangle is converted by rounding the coordinates +of the rectangle to the nearest device unit (pixel).

+

The rule to which argument to use is: if you want the resulting device-space +rectangle to completely contain the original rectangle, pass it in as inclusive +. +If you want two touching-but-not-overlapping rectangles stay +touching-but-not-overlapping after rounding to device units, pass them in +as nearest +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

inclusive

rectangle to round to pixels inclusively, or NULL.

[allow-none]

nearest

rectangle to round to nearest pixels, or NULL.

[allow-none]
+
+

Since: 1.16

+
+
+
+

pango_matrix_copy ()

+
PangoMatrix *
+pango_matrix_copy (const PangoMatrix *matrix);
+

Copies a PangoMatrix.

+
+

Parameters

+
+++++ + + + + + +

matrix

a PangoMatrix, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoMatrix, which +should be freed with pango_matrix_free(), or NULL if +matrix +was NULL.

+

[nullable]

+
+

Since: 1.6

+
+
+
+

pango_matrix_free ()

+
void
+pango_matrix_free (PangoMatrix *matrix);
+

Free a PangoMatrix created with pango_matrix_copy().

+
+

Parameters

+
+++++ + + + + + +

matrix

a PangoMatrix, may be NULL.

[nullable]
+
+

Since: 1.6

+
+
+
+

pango_matrix_translate ()

+
void
+pango_matrix_translate (PangoMatrix *matrix,
+                        double tx,
+                        double ty);
+

Changes the transformation represented by matrix + to be the +transformation given by first translating by (tx +, ty +) +then applying the original transformation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

matrix

a PangoMatrix

 

tx

amount to translate in the X direction

 

ty

amount to translate in the Y direction

 
+
+

Since: 1.6

+
+
+
+

pango_matrix_scale ()

+
void
+pango_matrix_scale (PangoMatrix *matrix,
+                    double scale_x,
+                    double scale_y);
+

Changes the transformation represented by matrix + to be the +transformation given by first scaling by sx + in the X direction +and sy + in the Y direction then applying the original +transformation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

matrix

a PangoMatrix

 

scale_x

amount to scale by in X direction

 

scale_y

amount to scale by in Y direction

 
+
+

Since: 1.6

+
+
+
+

pango_matrix_rotate ()

+
void
+pango_matrix_rotate (PangoMatrix *matrix,
+                     double degrees);
+

Changes the transformation represented by matrix + to be the +transformation given by first rotating by degrees + degrees +counter-clockwise then applying the original transformation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

matrix

a PangoMatrix

 

degrees

degrees to rotate counter-clockwise

 
+
+

Since: 1.6

+
+
+
+

pango_matrix_concat ()

+
void
+pango_matrix_concat (PangoMatrix *matrix,
+                     const PangoMatrix *new_matrix);
+

Changes the transformation represented by matrix + to be the +transformation given by first applying transformation +given by new_matrix + then applying the original transformation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

matrix

a PangoMatrix

 

new_matrix

a PangoMatrix

 
+
+

Since: 1.6

+
+
+
+

pango_matrix_transform_point ()

+
void
+pango_matrix_transform_point (const PangoMatrix *matrix,
+                              double *x,
+                              double *y);
+

Transforms the point (x +, y +) by matrix +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

matrix

a PangoMatrix, or NULL.

[nullable]

x

in/out X position.

[inout]

y

in/out Y position.

[inout]
+
+

Since: 1.16

+
+
+
+

pango_matrix_transform_distance ()

+
void
+pango_matrix_transform_distance (const PangoMatrix *matrix,
+                                 double *dx,
+                                 double *dy);
+

Transforms the distance vector (dx +,dy +) by matrix +. This is +similar to pango_matrix_transform_point() except that the translation +components of the transformation are ignored. The calculation of +the returned vector is as follows:

+
+dx2 = dx1 * xx + dy1 * xy;
+dy2 = dx1 * yx + dy1 * yy;
+
+

Affine transformations are position invariant, so the same vector +always transforms to the same vector. If (x1 +,y1 +) transforms +to (x2 +,y2 +) then (x1 ++dx1 +,y1 ++dy1 +) will transform to +(x1 ++dx2 +,y1 ++dy2 +) for all values of x1 + and x2 +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

matrix

a PangoMatrix, or NULL.

[nullable]

dx

in/out X component of a distance vector.

[inout]

dy

in/out Y component of a distance vector.

[inout]
+
+

Since: 1.16

+
+
+
+

pango_matrix_transform_rectangle ()

+
void
+pango_matrix_transform_rectangle (const PangoMatrix *matrix,
+                                  PangoRectangle *rect);
+

First transforms rect + using matrix +, then calculates the bounding box +of the transformed rectangle. The rectangle should be in Pango units.

+

This function is useful for example when you want to draw a rotated +PangoLayout + to an image buffer, and want to know how large the image +should be and how much you should shift the layout when rendering.

+

If you have a rectangle in device units (pixels), use +pango_matrix_transform_pixel_rectangle().

+

If you have the rectangle in Pango units and want to convert to +transformed pixel bounding box, it is more accurate to transform it first +(using this function) and pass the result to pango_extents_to_pixels(), +first argument, for an inclusive rounded rectangle. +However, there are valid reasons that you may want to convert +to pixels first and then transform, for example when the transformed +coordinates may overflow in Pango units (large matrix translation for +example).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

matrix

a PangoMatrix, or NULL.

[nullable]

rect

in/out bounding box in Pango units, or NULL.

[inout][allow-none]
+
+

Since: 1.16

+
+
+
+

pango_matrix_transform_pixel_rectangle ()

+
void
+pango_matrix_transform_pixel_rectangle
+                               (const PangoMatrix *matrix,
+                                PangoRectangle *rect);
+

First transforms the rect + using matrix +, then calculates the bounding box +of the transformed rectangle. The rectangle should be in device units +(pixels).

+

This function is useful for example when you want to draw a rotated +PangoLayout + to an image buffer, and want to know how large the image +should be and how much you should shift the layout when rendering.

+

For better accuracy, you should use pango_matrix_transform_rectangle() on +original rectangle in Pango units and convert to pixels afterward +using pango_extents_to_pixels()'s first argument.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

matrix

a PangoMatrix, or NULL.

[nullable]

rect

in/out bounding box in device units, or NULL.

[inout][allow-none]
+
+

Since: 1.16

+
+
+
+

pango_matrix_get_font_scale_factor ()

+
double
+pango_matrix_get_font_scale_factor (const PangoMatrix *matrix);
+

Returns the scale factor of a matrix on the height of the font. +That is, the scale factor in the direction perpendicular to the +vector that the X coordinate is mapped to. If the scale in the X +coordinate is needed as well, use pango_matrix_get_font_scale_factors().

+
+

Parameters

+
+++++ + + + + + +

matrix

a PangoMatrix, may be NULL.

[allow-none]
+
+
+

Returns

+

the scale factor of matrix +on the height of the font, +or 1.0 if matrix +is NULL.

+
+

Since: 1.12

+
+
+
+

pango_matrix_get_font_scale_factors ()

+
void
+pango_matrix_get_font_scale_factors (const PangoMatrix *matrix,
+                                     double *xscale,
+                                     double *yscale);
+

Calculates the scale factor of a matrix on the width and height of the font. +That is, xscale + is the scale factor in the direction of the X coordinate, +and yscale + is the scale factor in the direction perpendicular to the +vector that the X coordinate is mapped to.

+

Note that output numbers will always be non-negative.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

matrix

a PangoMatrix, or NULL.

[nullable]

xscale

output scale factor in the x direction, or NULL.

[out][allow-none]

yscale

output scale factor perpendicular to the x direction, or NULL.

[out][allow-none]
+
+

Since: 1.38

+
+
+
+

PANGO_GET_UNKNOWN_GLYPH()

+
#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)
+
+

The way this unknown glyphs are rendered is backend specific. For example, +a box with the hexadecimal Unicode code-point of the character written in it +is what is done in the most common backends.

+
+

Parameters

+
+++++ + + + + + +

wc

a Unicode character

 
+
+
+

Returns

+

a PangoGlyph value that means no glyph was found for wc +.

+
+
+
+
+

pango_glyph_string_new ()

+
PangoGlyphString *
+pango_glyph_string_new (void);
+

Create a new PangoGlyphString.

+
+

Returns

+

the newly allocated PangoGlyphString, which +should be freed with pango_glyph_string_free().

+
+
+
+
+

pango_glyph_string_copy ()

+
PangoGlyphString *
+pango_glyph_string_copy (PangoGlyphString *string);
+

Copy a glyph string and associated storage.

+
+

Parameters

+
+++++ + + + + + +

string

a PangoGlyphString, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoGlyphString, +which should be freed with pango_glyph_string_free(), +or NULL if string +was NULL.

+

[nullable]

+
+
+
+
+

pango_glyph_string_set_size ()

+
void
+pango_glyph_string_set_size (PangoGlyphString *string,
+                             gint new_len);
+

Resize a glyph string to the given length.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

string

a PangoGlyphString.

 

new_len

the new length of the string.

 
+
+
+
+
+

pango_glyph_string_free ()

+
void
+pango_glyph_string_free (PangoGlyphString *string);
+

Free a glyph string and associated storage.

+
+

Parameters

+
+++++ + + + + + +

string

a PangoGlyphString, may be NULL.

[nullable]
+
+
+
+
+

pango_glyph_string_extents ()

+
void
+pango_glyph_string_extents (PangoGlyphString *glyphs,
+                            PangoFont *font,
+                            PangoRectangle *ink_rect,
+                            PangoRectangle *logical_rect);
+

Compute the logical and ink extents of a glyph string. See the documentation +for pango_font_get_glyph_extents() for details about the interpretation +of the rectangles.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

glyphs

a PangoGlyphString

 

font

a PangoFont

 

ink_rect

rectangle used to store the extents of the glyph string +as drawn or NULL to indicate that the result is not needed.

[out][allow-none]

logical_rect

rectangle used to store the logical extents of the +glyph string or NULL to indicate that the result is not needed.

[out][allow-none]
+
+
+
+
+

pango_glyph_string_extents_range ()

+
void
+pango_glyph_string_extents_range (PangoGlyphString *glyphs,
+                                  int start,
+                                  int end,
+                                  PangoFont *font,
+                                  PangoRectangle *ink_rect,
+                                  PangoRectangle *logical_rect);
+

Computes the extents of a sub-portion of a glyph string. The extents are +relative to the start of the glyph string range (the origin of their +coordinate system is at the start of the range, not at the start of the entire +glyph string).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

glyphs

a PangoGlyphString

 

start

start index

 

end

end index (the range is the set of bytes with +indices such that start <= index < end)

 

font

a PangoFont

 

ink_rect

rectangle used to +store the extents of the glyph string range as drawn or +NULL to indicate that the result is not needed.

[out caller-allocates][optional]

logical_rect

rectangle used to +store the logical extents of the glyph string range or +NULL to indicate that the result is not needed.

[out caller-allocates][optional]
+
+
+
+
+

pango_glyph_string_get_width ()

+
int
+pango_glyph_string_get_width (PangoGlyphString *glyphs);
+

Computes the logical width of the glyph string as can also be computed +using pango_glyph_string_extents(). However, since this only computes the +width, it's much faster. This is in fact only a convenience function that +computes the sum of geometry.width for each glyph in the glyphs +.

+
+

Parameters

+
+++++ + + + + + +

glyphs

a PangoGlyphString

 
+
+
+

Returns

+

the logical width of the glyph string.

+
+

Since: 1.14

+
+
+
+

pango_glyph_string_index_to_x ()

+
void
+pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
+                               char *text,
+                               int length,
+                               PangoAnalysis *analysis,
+                               int index_,
+                               gboolean trailing,
+                               int *x_pos);
+

Converts from character position to x position. (X position +is measured from the left edge of the run). Character positions +are computed by dividing up each cluster into equal portions.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

glyphs

the glyphs return from pango_shape()

 

text

the text for the run

 

length

the number of bytes (not characters) in text +.

 

analysis

the analysis information return from pango_itemize()

 

index_

the byte index within text +

 

trailing

whether we should compute the result for the beginning (FALSE) +or end (TRUE) of the character.

 

x_pos

location to store result.

[out]
+
+
+
+
+

pango_glyph_string_x_to_index ()

+
void
+pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
+                               char *text,
+                               int length,
+                               PangoAnalysis *analysis,
+                               int x_pos,
+                               int *index_,
+                               int *trailing);
+

Convert from x offset to character position. Character positions +are computed by dividing up each cluster into equal portions. +In scripts where positioning within a cluster is not allowed +(such as Thai), the returned value may not be a valid cursor +position; the caller must combine the result with the logical +attributes for the text to compute the valid cursor position.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

glyphs

the glyphs returned from pango_shape()

 

text

the text for the run

 

length

the number of bytes (not characters) in text.

 

analysis

the analysis information return from pango_itemize()

 

x_pos

the x offset (in Pango units)

 

index_

location to store calculated byte index within text +.

[out]

trailing

location to store a boolean indicating +whether the user clicked on the leading or trailing +edge of the character.

[out]
+
+
+
+
+

pango_glyph_string_get_logical_widths ()

+
void
+pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
+                                       const char *text,
+                                       int length,
+                                       int embedding_level,
+                                       int *logical_widths);
+

Given a PangoGlyphString resulting from pango_shape() and the corresponding +text, determine the screen width corresponding to each character. When +multiple characters compose a single cluster, the width of the entire +cluster is divided equally among the characters.

+

See also pango_glyph_item_get_logical_widths().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

glyphs

a PangoGlyphString

 

text

the text corresponding to the glyphs

 

length

the length of text +, in bytes

 

embedding_level

the embedding level of the string

 

logical_widths

an array whose length is the number of +characters in text (equal to g_utf8_strlen (text, +length) unless text has NUL bytes) to be filled in +with the resulting character widths.

[array]
+
+
+
+
+

pango_glyph_item_copy ()

+
PangoGlyphItem *
+pango_glyph_item_copy (PangoGlyphItem *orig);
+

Make a deep copy of an existing PangoGlyphItem structure.

+
+

Parameters

+
+++++ + + + + + +

orig

a PangoGlyphItem, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoGlyphItem, which should +be freed with pango_glyph_item_free(), or NULL +if orig +was NULL.

+

[nullable]

+
+

Since: 1.20

+
+
+
+

pango_glyph_item_free ()

+
void
+pango_glyph_item_free (PangoGlyphItem *glyph_item);
+

Frees a PangoGlyphItem and resources to which it points.

+
+

Parameters

+
+++++ + + + + + +

glyph_item

a PangoGlyphItem, may be NULL.

[nullable]
+
+

Since: 1.6

+
+
+
+

pango_glyph_item_split ()

+
PangoGlyphItem *
+pango_glyph_item_split (PangoGlyphItem *orig,
+                        const char *text,
+                        int split_index);
+

Modifies orig + to cover only the text after split_index +, and +returns a new item that covers the text before split_index + that +used to be in orig +. You can think of split_index + as the length of +the returned item. split_index + may not be 0, and it may not be +greater than or equal to the length of orig + (that is, there must +be at least one byte assigned to each item, you can't create a +zero-length item).

+

This function is similar in function to pango_item_split() (and uses +it internally.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

orig

a PangoItem

 

text

text to which positions in orig +apply

 

split_index

byte index of position to split item, relative to the start of the item

 
+
+
+

Returns

+

the newly allocated item representing text before +split_index +, which should be freed +with pango_glyph_item_free().

+
+

Since: 1.2

+
+
+
+

pango_glyph_item_apply_attrs ()

+
GSList *
+pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item,
+                              const char *text,
+                              PangoAttrList *list);
+

Splits a shaped item (PangoGlyphItem) into multiple items based +on an attribute list. The idea is that if you have attributes +that don't affect shaping, such as color or underline, to avoid +affecting shaping, you filter them out (pango_attr_list_filter()), +apply the shaping process and then reapply them to the result using +this function.

+

All attributes that start or end inside a cluster are applied +to that cluster; for instance, if half of a cluster is underlined +and the other-half strikethrough, then the cluster will end +up with both underline and strikethrough attributes. In these +cases, it may happen that item->extra_attrs for some of the +result items can have multiple attributes of the same type.

+

This function takes ownership of glyph_item +; it will be reused +as one of the elements in the list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

glyph_item

a shaped item

 

text

text that list +applies to

 

list

a PangoAttrList

 
+
+
+

Returns

+

a +list of glyph items resulting from splitting glyph_item +. Free +the elements using pango_glyph_item_free(), the list using +g_slist_free().

+

[transfer full][element-type Pango.GlyphItem]

+
+

Since: 1.2

+
+
+
+

pango_glyph_item_letter_space ()

+
void
+pango_glyph_item_letter_space (PangoGlyphItem *glyph_item,
+                               const char *text,
+                               PangoLogAttr *log_attrs,
+                               int letter_spacing);
+

Adds spacing between the graphemes of glyph_item + to +give the effect of typographic letter spacing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

glyph_item

a PangoGlyphItem

 

text

text that glyph_item +corresponds to +(glyph_item->item->offset is an offset from the +start of text +)

 

log_attrs

logical attributes for the item +(the first logical attribute refers to the position +before the first character in the item).

[array]

letter_spacing

amount of letter spacing to add +in Pango units. May be negative, though too large +negative values will give ugly results.

 
+
+

Since: 1.6

+
+
+
+

pango_glyph_item_get_logical_widths ()

+
void
+pango_glyph_item_get_logical_widths (PangoGlyphItem *glyph_item,
+                                     const char *text,
+                                     int *logical_widths);
+

Given a PangoGlyphItem and the corresponding +text, determine the screen width corresponding to each character. When +multiple characters compose a single cluster, the width of the entire +cluster is divided equally among the characters.

+

See also pango_glyph_string_get_logical_widths().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

glyph_item

a PangoGlyphItem

 

text

text that glyph_item +corresponds to +(glyph_item->item->offset is an offset from the +start of text +)

 

logical_widths

an array whose length is the number of +characters in glyph_item (equal to +glyph_item->item->num_chars) to be filled in with +the resulting character widths.

[array]
+
+

Since: 1.26

+
+
+
+

pango_glyph_item_iter_copy ()

+
PangoGlyphItemIter *
+pango_glyph_item_iter_copy (PangoGlyphItemIter *orig);
+

Make a shallow copy of an existing PangoGlyphItemIter structure.

+
+

Parameters

+
+++++ + + + + + +

orig

a PangoGlyphItemIter, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoGlyphItemIter, which should +be freed with pango_glyph_item_iter_free(), or NULL +if orig +was NULL.

+

[nullable]

+
+

Since: 1.22

+
+
+
+

pango_glyph_item_iter_free ()

+
void
+pango_glyph_item_iter_free (PangoGlyphItemIter *iter);
+

Frees a PangoGlyphItemIter created by pango_glyph_item_iter_copy().

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoGlyphItemIter, may be NULL.

[nullable]
+
+

Since: 1.22

+
+
+
+

pango_glyph_item_iter_init_start ()

+
gboolean
+pango_glyph_item_iter_init_start (PangoGlyphItemIter *iter,
+                                  PangoGlyphItem *glyph_item,
+                                  const char *text);
+

Initializes a PangoGlyphItemIter structure to point to the +first cluster in a glyph item. +See PangoGlyphItemIter for details of cluster orders.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoGlyphItemIter

 

glyph_item

the glyph item to iterate over

 

text

text corresponding to the glyph item

 
+
+
+

Returns

+

FALSE if there are no clusters in the glyph item

+
+

Since: 1.22

+
+
+
+

pango_glyph_item_iter_init_end ()

+
gboolean
+pango_glyph_item_iter_init_end (PangoGlyphItemIter *iter,
+                                PangoGlyphItem *glyph_item,
+                                const char *text);
+

Initializes a PangoGlyphItemIter structure to point to the +last cluster in a glyph item. +See PangoGlyphItemIter for details of cluster orders.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoGlyphItemIter

 

glyph_item

the glyph item to iterate over

 

text

text corresponding to the glyph item

 
+
+
+

Returns

+

FALSE if there are no clusters in the glyph item

+
+

Since: 1.22

+
+
+
+

pango_glyph_item_iter_next_cluster ()

+
gboolean
+pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter);
+

Advances the iterator to the next cluster in the glyph item. +See PangoGlyphItemIter for details of cluster orders.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoGlyphItemIter

 
+
+
+

Returns

+

TRUE if the iterator was advanced, FALSE if we were already on the +last cluster.

+
+

Since: 1.22

+
+
+
+

pango_glyph_item_iter_prev_cluster ()

+
gboolean
+pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter);
+

Moves the iterator to the preceding cluster in the glyph item. +See PangoGlyphItemIter for details of cluster orders.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoGlyphItemIter

 
+
+
+

Returns

+

TRUE if the iterator was moved, FALSE if we were already on the +first cluster.

+
+

Since: 1.22

+
+
+
+

Types and Values

+
+

PANGO_SCALE

+
#define PANGO_SCALE 1024
+
+

The PANGO_SCALE macro represents the scale between dimensions used +for Pango distances and device units. (The definition of device +units is dependent on the output device; it will typically be pixels +for a screen, and points for a printer.) PANGO_SCALE is currently +1024, but this may be changed in the future.

+

When setting font sizes, device units are always considered to be +points (as in "12 point font"), rather than pixels.

+
+
+
+

struct PangoRectangle

+
struct PangoRectangle {
+  int x;
+  int y;
+  int width;
+  int height;
+};
+
+

The PangoRectangle structure represents a rectangle. It is frequently +used to represent the logical or ink extents of a single glyph or section +of text. (See, for instance, pango_font_get_glyph_extents())

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

int x;

X coordinate of the left side of the rectangle.

 

int y;

Y coordinate of the the top side of the rectangle.

 

int width;

width of the rectangle.

 

int height;

height of the rectangle.

 
+
+
+
+
+

struct PangoMatrix

+
struct PangoMatrix {
+  double xx;
+  double xy;
+  double yx;
+  double yy;
+  double x0;
+  double y0;
+};
+
+

A structure specifying a transformation between user-space +coordinates and device coordinates. The transformation +is given by

+
+x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
+y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
+
+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

double xx;

1st component of the transformation matrix

 

double xy;

2nd component of the transformation matrix

 

double yx;

3rd component of the transformation matrix

 

double yy;

4th component of the transformation matrix

 

double x0;

x translation

 

double y0;

y translation

 
+
+

Since: 1.6

+
+
+
+

PANGO_TYPE_MATRIX

+
#define PANGO_TYPE_MATRIX (pango_matrix_get_type ())
+
+

The GObject type for PangoMatrix

+
+
+
+

PANGO_MATRIX_INIT

+
#define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. }
+
+

Constant that can be used to initialize a PangoMatrix to +the identity transform.

+
+ + + + + + + +
1
+2
PangoMatrix matrix = PANGO_MATRIX_INIT;
+pango_matrix_rotate (&matrix, 45.);
+
+ +

Since: 1.6

+
+
+
+

PangoGlyph

+
typedef guint32 PangoGlyph;
+
+

A PangoGlyph represents a single glyph in the output form of a string.

+
+
+
+

PANGO_GLYPH_EMPTY

+
#define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)
+
+

The PANGO_GLYPH_EMPTY macro represents a PangoGlyph value that has a + special meaning, which is a zero-width empty glyph. This is useful for +example in shaper modules, to use as the glyph for various zero-width +Unicode characters (those passing pango_is_zero_width()).

+
+
+
+

PANGO_GLYPH_INVALID_INPUT

+
#define PANGO_GLYPH_INVALID_INPUT   ((PangoGlyph)0xFFFFFFFF)
+
+

The PANGO_GLYPH_INVALID_INPUT macro represents a PangoGlyph value that has a +special meaning of invalid input. PangoLayout produces one such glyph +per invalid input UTF-8 byte and such a glyph is rendered as a crossed +box.

+

Note that this value is defined such that it has the PANGO_GLYPH_UNKNOWN_FLAG +on.

+

Since: 1.20

+
+
+
+

PANGO_GLYPH_UNKNOWN_FLAG

+
#define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
+
+

The PANGO_GLYPH_UNKNOWN_FLAG macro is a flag value that can be added to +a gunichar value of a valid Unicode character, to produce a PangoGlyph +value, representing an unknown-character glyph for the respective gunichar.

+
+
+
+

struct PangoGlyphInfo

+
struct PangoGlyphInfo {
+  PangoGlyph    glyph;
+  PangoGlyphGeometry geometry;
+  PangoGlyphVisAttr  attr;
+};
+
+

The PangoGlyphInfo structure represents a single glyph together with +positioning information and visual attributes. +It contains the following fields.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PangoGlyph glyph;

the glyph itself.

 

PangoGlyphGeometry geometry;

the positional information about the glyph.

 

PangoGlyphVisAttr attr;

the visual attributes of the glyph.

 
+
+
+
+
+

struct PangoGlyphGeometry

+
struct PangoGlyphGeometry {
+  PangoGlyphUnit width;
+  PangoGlyphUnit x_offset;
+  PangoGlyphUnit y_offset;
+};
+
+

The PangoGlyphGeometry structure contains width and positioning +information for a single glyph.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PangoGlyphUnit width;

the logical width to use for the the character.

 

PangoGlyphUnit x_offset;

horizontal offset from nominal character position.

 

PangoGlyphUnit y_offset;

vertical offset from nominal character position.

 
+
+
+
+
+

PangoGlyphUnit

+
typedef gint32 PangoGlyphUnit;
+
+

The PangoGlyphUnit type is used to store dimensions within +Pango. Dimensions are stored in 1/PANGO_SCALE of a device unit. +(A device unit might be a pixel for screen display, or +a point on a printer.) PANGO_SCALE is currently 1024, and +may change in the future (unlikely though), but you should not +depend on its exact value. The PANGO_PIXELS() macro can be used +to convert from glyph units into device units with correct rounding.

+
+
+
+

struct PangoGlyphVisAttr

+
struct PangoGlyphVisAttr {
+  guint is_cluster_start : 1;
+};
+
+

The PangoGlyphVisAttr is used to communicate information between +the shaping phase and the rendering phase. More attributes may be +added in the future.

+
+

Members

+
+++++ + + + + + +

guint is_cluster_start : 1;

set for the first logical glyph in each cluster. (Clusters +are stored in visual order, within the cluster, glyphs +are always ordered in logical order, since visual +order is meaningless; that is, in Arabic text, accent glyphs +follow the glyphs for the base character.)

 
+
+
+
+
+

struct PangoGlyphString

+
struct PangoGlyphString {
+  gint num_glyphs;
+
+  PangoGlyphInfo *glyphs;
+
+  /* This is a memory inefficient way of representing the information
+   * here - each value gives the byte index within the text
+   * corresponding to the glyph string of the start of the cluster to
+   * which the glyph belongs.
+   */
+  gint *log_clusters;
+};
+
+

The PangoGlyphString structure is used to store strings +of glyphs with geometry and visual attribute information. +The storage for the glyph information is owned +by the structure which simplifies memory management.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

gint num_glyphs;

number of the glyphs in this glyph string.

 

PangoGlyphInfo *glyphs;

array of glyph information +for the glyph string.

[array length=num_glyphs]

gint *log_clusters;

logical cluster info, indexed by the byte index +within the text corresponding to the glyph string.

 
+
+
+
+
+

struct PangoGlyphItem

+
struct PangoGlyphItem {
+  PangoItem        *item;
+  PangoGlyphString *glyphs;
+};
+
+

A PangoGlyphItem is a pair of a PangoItem and the glyphs +resulting from shaping the text corresponding to an item. +As an example of the usage of PangoGlyphItem, the results +of shaping text with PangoLayout is a list of PangoLayoutLine, +each of which contains a list of PangoGlyphItem.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoItem *item;

corresponding PangoItem.

 

PangoGlyphString *glyphs;

corresponding PangoGlyphString.

 
+
+
+
+
+

struct PangoGlyphItemIter

+
struct PangoGlyphItemIter {
+  PangoGlyphItem *glyph_item;
+  const gchar *text;
+
+  int start_glyph;
+  int start_index;
+  int start_char;
+
+  int end_glyph;
+  int end_index;
+  int end_char;
+};
+
+

A PangoGlyphItemIter is an iterator over the clusters in a +PangoGlyphItem. The forward direction of the +iterator is the logical direction of text. That is, with increasing +start_index + and start_char + values. If glyph_item + is right-to-left +(that is, if glyph_item->item->analysis.level + is odd), +then start_glyph + decreases as the iterator moves forward. Moreover, +in right-to-left cases, start_glyph + is greater than end_glyph +.

+

An iterator should be initialized using either of +pango_glyph_item_iter_init_start() and +pango_glyph_item_iter_init_end(), for forward and backward iteration +respectively, and walked over using any desired mixture of +pango_glyph_item_iter_next_cluster() and +pango_glyph_item_iter_prev_cluster(). A common idiom for doing a +forward iteration over the clusters is:

+
+PangoGlyphItemIter cluster_iter;
+gboolean have_cluster;
+
+for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter,
+                                                      glyph_item, text);
+     have_cluster;
+     have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter))
+{
+  ...
+}
+
+

Note that text + is the start of the text for layout, which is then +indexed by glyph_item->item->offset + to get to the +text of glyph_item +. The start_index + and end_index + values can directly +index into text +. The start_glyph +, end_glyph +, start_char +, and end_char + +values however are zero-based for the glyph_item +. For each cluster, the +item pointed at by the start variables is included in the cluster while +the one pointed at by end variables is not.

+

None of the members of a PangoGlyphItemIter should be modified manually.

+

Since: 1.22

+
+
+
+

PANGO_TYPE_GLYPH_STRING

+
#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
+
+

The GObject type for PangoGlyphString.

+
+
+
+

PANGO_TYPE_GLYPH_ITEM

+
#define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type ())
+
+

The GObject type for PangoGlyphItem.

+
+
+
+

PANGO_TYPE_GLYPH_ITEM_ITER

+
#define PANGO_TYPE_GLYPH_ITEM_ITER (pango_glyph_item_iter_get_type ())
+
+

The GObject type for PangoGlyphItemIter.

+

Since: 1.22

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Layout-Objects.html b/docs/html/pango-Layout-Objects.html new file mode 100644 index 0000000..ba23966 --- /dev/null +++ b/docs/html/pango-Layout-Objects.html @@ -0,0 +1,4125 @@ + + + + +Layout Objects: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Layout Objects

+

Layout Objects — High-level layout driver objects

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoLayout * + +pango_layout_new () +
+PangoLayout * + +pango_layout_copy () +
+PangoContext * + +pango_layout_get_context () +
+void + +pango_layout_context_changed () +
+guint + +pango_layout_get_serial () +
+void + +pango_layout_set_text () +
const char * + +pango_layout_get_text () +
+gint + +pango_layout_get_character_count () +
+void + +pango_layout_set_markup () +
+void + +pango_layout_set_markup_with_accel () +
+void + +pango_layout_set_attributes () +
+PangoAttrList * + +pango_layout_get_attributes () +
+void + +pango_layout_set_font_description () +
const PangoFontDescription * + +pango_layout_get_font_description () +
+void + +pango_layout_set_width () +
+int + +pango_layout_get_width () +
+void + +pango_layout_set_height () +
+int + +pango_layout_get_height () +
+void + +pango_layout_set_wrap () +
+PangoWrapMode + +pango_layout_get_wrap () +
+gboolean + +pango_layout_is_wrapped () +
+void + +pango_layout_set_ellipsize () +
+PangoEllipsizeMode + +pango_layout_get_ellipsize () +
+gboolean + +pango_layout_is_ellipsized () +
+void + +pango_layout_set_indent () +
+int + +pango_layout_get_indent () +
+int + +pango_layout_get_spacing () +
+void + +pango_layout_set_spacing () +
+void + +pango_layout_set_justify () +
+gboolean + +pango_layout_get_justify () +
+void + +pango_layout_set_auto_dir () +
+gboolean + +pango_layout_get_auto_dir () +
+void + +pango_layout_set_alignment () +
+PangoAlignment + +pango_layout_get_alignment () +
+void + +pango_layout_set_tabs () +
+PangoTabArray * + +pango_layout_get_tabs () +
+void + +pango_layout_set_single_paragraph_mode () +
+gboolean + +pango_layout_get_single_paragraph_mode () +
+int + +pango_layout_get_unknown_glyphs_count () +
+void + +pango_layout_get_log_attrs () +
const PangoLogAttr * + +pango_layout_get_log_attrs_readonly () +
+void + +pango_layout_index_to_pos () +
+void + +pango_layout_index_to_line_x () +
+gboolean + +pango_layout_xy_to_index () +
+void + +pango_layout_get_cursor_pos () +
+void + +pango_layout_move_cursor_visually () +
+void + +pango_layout_get_extents () +
+void + +pango_layout_get_pixel_extents () +
+void + +pango_layout_get_size () +
+void + +pango_layout_get_pixel_size () +
+int + +pango_layout_get_baseline () +
+int + +pango_layout_get_line_count () +
+PangoLayoutLine * + +pango_layout_get_line () +
+PangoLayoutLine * + +pango_layout_get_line_readonly () +
+GSList * + +pango_layout_get_lines () +
+GSList * + +pango_layout_get_lines_readonly () +
+PangoLayoutIter * + +pango_layout_get_iter () +
+PangoLayoutIter * + +pango_layout_iter_copy () +
+void + +pango_layout_iter_free () +
+gboolean + +pango_layout_iter_next_run () +
+gboolean + +pango_layout_iter_next_char () +
+gboolean + +pango_layout_iter_next_cluster () +
+gboolean + +pango_layout_iter_next_line () +
+gboolean + +pango_layout_iter_at_last_line () +
+int + +pango_layout_iter_get_index () +
+int + +pango_layout_iter_get_baseline () +
+PangoLayoutRun * + +pango_layout_iter_get_run () +
+PangoLayoutRun * + +pango_layout_iter_get_run_readonly () +
+PangoLayoutLine * + +pango_layout_iter_get_line () +
+PangoLayoutLine * + +pango_layout_iter_get_line_readonly () +
+PangoLayout * + +pango_layout_iter_get_layout () +
+void + +pango_layout_iter_get_char_extents () +
+void + +pango_layout_iter_get_cluster_extents () +
+void + +pango_layout_iter_get_run_extents () +
+void + +pango_layout_iter_get_line_yrange () +
+void + +pango_layout_iter_get_line_extents () +
+void + +pango_layout_iter_get_layout_extents () +
+PangoLayoutLine * + +pango_layout_line_ref () +
+void + +pango_layout_line_unref () +
+void + +pango_layout_line_get_extents () +
+void + +pango_layout_line_get_pixel_extents () +
+void + +pango_layout_line_index_to_x () +
+gboolean + +pango_layout_line_x_to_index () +
+void + +pango_layout_line_get_x_ranges () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 PangoLayout
 PangoLayoutIter
enumPangoWrapMode
#definePANGO_TYPE_WRAP_MODE
enumPangoEllipsizeMode
#definePANGO_TYPE_ELLIPSIZE_MODE
enumPangoAlignment
#definePANGO_TYPE_ALIGNMENT
structPangoLayoutLine
typedefPangoLayoutRun
+
+
+

Object Hierarchy

+
    GBoxed
+    ├── PangoLayoutIter
+    ╰── PangoLayoutLine
+    GEnum
+    ├── PangoAlignment
+    ├── PangoEllipsizeMode
+    ╰── PangoWrapMode
+    GObject
+    ╰── PangoLayout
+
+
+
+

Description

+

While complete access to the layout capabilities of Pango is provided +using the detailed interfaces for itemization and shaping, using +that functionality directly involves writing a fairly large amount +of code. The objects and functions in this section provide a +high-level driver for formatting entire paragraphs of text +at once.

+
+
+

Functions

+
+

pango_layout_new ()

+
PangoLayout *
+pango_layout_new (PangoContext *context);
+

Create a new PangoLayout object with attributes initialized to +default values for a particular PangoContext.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the newly allocated PangoLayout, with a reference +count of one, which should be freed with +g_object_unref().

+
+
+
+
+

pango_layout_copy ()

+
PangoLayout *
+pango_layout_copy (PangoLayout *src);
+

Does a deep copy-by-value of the src + layout. The attribute list, +tab array, and text from the original layout are all copied by +value.

+
+

Parameters

+
+++++ + + + + + +

src

a PangoLayout

 
+
+
+

Returns

+

the newly allocated PangoLayout, +with a reference count of one, which should be freed +with g_object_unref().

+

[transfer full]

+
+
+
+
+

pango_layout_get_context ()

+
PangoContext *
+pango_layout_get_context (PangoLayout *layout);
+

Retrieves the PangoContext used for this layout.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the PangoContext for the layout. +This does not have an additional refcount added, so if you want to +keep a copy of this around, you must reference it yourself.

+

[transfer none]

+
+
+
+
+

pango_layout_context_changed ()

+
void
+pango_layout_context_changed (PangoLayout *layout);
+

Forces recomputation of any state in the PangoLayout that +might depend on the layout's context. This function should +be called if you make changes to the context subsequent +to creating the layout.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+
+
+

pango_layout_get_serial ()

+
guint
+pango_layout_get_serial (PangoLayout *layout);
+

Returns the current serial number of layout +. The serial number is +initialized to an small number larger than zero when a new layout +is created and is increased whenever the layout is changed using any +of the setter functions, or the PangoContext it uses has changed. +The serial may wrap, but will never have the value 0. Since it +can wrap, never compare it with "less than", always use "not equals".

+

This can be used to automatically detect changes to a PangoLayout, and +is useful for example to decide whether a layout needs redrawing. +To force the serial to be increased, use pango_layout_context_changed().

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

The current serial number of layout +.

+
+

Since: 1.32.4

+
+
+
+

pango_layout_set_text ()

+
void
+pango_layout_set_text (PangoLayout *layout,
+                       const char *text,
+                       int length);
+

Sets the text of the layout.

+

Note that if you have used +pango_layout_set_markup() or pango_layout_set_markup_with_accel() on +layout + before, you may want to call pango_layout_set_attributes() to clear +the attributes set on the layout from the markup as this function does not +clear attributes.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

text

a valid UTF-8 string

 

length

maximum length of text +, in bytes. -1 indicates that +the string is nul-terminated and the length should be +calculated. The text will also be truncated on +encountering a nul-termination even when length +is +positive.

 
+
+
+
+
+

pango_layout_get_text ()

+
const char *
+pango_layout_get_text (PangoLayout *layout);
+

Gets the text in the layout. The returned text should not +be freed or modified.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the text in the layout +.

+
+
+
+
+

pango_layout_get_character_count ()

+
gint
+pango_layout_get_character_count (PangoLayout *layout);
+

Returns the number of Unicode characters in the +the text of layout +.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the number of Unicode characters +in the text of layout +

+
+

Since: 1.30

+
+
+
+

pango_layout_set_markup ()

+
void
+pango_layout_set_markup (PangoLayout *layout,
+                         const char *markup,
+                         int length);
+

Same as pango_layout_set_markup_with_accel(), but +the markup text isn't scanned for accelerators.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

markup

marked-up text

 

length

length of marked-up text in bytes, or -1 if markup +is +null-terminated

 
+
+
+
+
+

pango_layout_set_markup_with_accel ()

+
void
+pango_layout_set_markup_with_accel (PangoLayout *layout,
+                                    const char *markup,
+                                    int length,
+                                    gunichar accel_marker,
+                                    gunichar *accel_char);
+

Sets the layout text and attribute list from marked-up text (see

+markup format). Replaces +

the current text and attribute list.

+

If accel_marker + is nonzero, the given character will mark the +character following it as an accelerator. For example, accel_marker + +might be an ampersand or underscore. All characters marked +as an accelerator will receive a PANGO_UNDERLINE_LOW attribute, +and the first character so marked will be returned in accel_char +. +Two accel_marker + characters following each other produce a single +literal accel_marker + character.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

markup

marked-up text +(see markup format)

 

length

length of marked-up text in bytes, or -1 if markup +is +null-terminated

 

accel_marker

marker for accelerators in the text

 

accel_char

return location +for first located accelerator, or NULL.

[out caller-allocates][allow-none]
+
+
+
+
+

pango_layout_set_attributes ()

+
void
+pango_layout_set_attributes (PangoLayout *layout,
+                             PangoAttrList *attrs);
+

Sets the text attributes for a layout object. +References attrs +, so the caller can unref its reference.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

attrs

a PangoAttrList, can be NULL.

[allow-none][transfer none]
+
+
+
+
+

pango_layout_get_attributes ()

+
PangoAttrList *
+pango_layout_get_attributes (PangoLayout *layout);
+

Gets the attribute list for the layout, if any.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

a PangoAttrList.

+

[transfer none]

+
+
+
+
+

pango_layout_set_font_description ()

+
void
+pango_layout_set_font_description (PangoLayout *layout,
+                                   const PangoFontDescription *desc);
+

Sets the default font description for the layout. If no font +description is set on the layout, the font description from +the layout's context is used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

desc

the new PangoFontDescription, or NULL to unset the +current font description.

[allow-none]
+
+
+
+
+

pango_layout_get_font_description ()

+
const PangoFontDescription *
+pango_layout_get_font_description (PangoLayout *layout);
+

Gets the font description for the layout, if any.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

a pointer to the layout's font +description, or NULL if the font description from the layout's +context is inherited. This value is owned by the layout and must +not be modified or freed.

+

[nullable]

+
+

Since: 1.8

+
+
+
+

pango_layout_set_width ()

+
void
+pango_layout_set_width (PangoLayout *layout,
+                        int width);
+

Sets the width to which the lines of the PangoLayout should wrap or +ellipsized. The default value is -1: no width set.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout.

 

width

the desired width in Pango units, or -1 to indicate that no +wrapping or ellipsization should be performed.

 
+
+
+
+
+

pango_layout_get_width ()

+
int
+pango_layout_get_width (PangoLayout *layout);
+

Gets the width to which the lines of the PangoLayout should wrap.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the width in Pango units, or -1 if no width set.

+
+
+
+
+

pango_layout_set_height ()

+
void
+pango_layout_set_height (PangoLayout *layout,
+                         int height);
+

Sets the height to which the PangoLayout should be ellipsized at. There +are two different behaviors, based on whether height + is positive or +negative.

+

If height + is positive, it will be the maximum height of the layout. Only +lines would be shown that would fit, and if there is any text omitted, +an ellipsis added. At least one line is included in each paragraph regardless +of how small the height value is. A value of zero will render exactly one +line for the entire layout.

+

If height + is negative, it will be the (negative of) maximum number of lines per +paragraph. That is, the total number of lines shown may well be more than +this value if the layout contains multiple paragraphs of text. +The default value of -1 means that first line of each paragraph is ellipsized. +This behvaior may be changed in the future to act per layout instead of per +paragraph. File a bug against pango at http://bugzilla.gnome.org/ if your +code relies on this behavior.

+

Height setting only has effect if a positive width is set on +layout + and ellipsization mode of layout + is not PANGO_ELLIPSIZE_NONE. +The behavior is undefined if a height other than -1 is set and +ellipsization mode is set to PANGO_ELLIPSIZE_NONE, and may change in the +future.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout.

 

height

the desired height of the layout in Pango units if positive, +or desired number of lines if negative.

 
+
+

Since: 1.20

+
+
+
+

pango_layout_get_height ()

+
int
+pango_layout_get_height (PangoLayout *layout);
+

Gets the height of layout used for ellipsization. See +pango_layout_set_height() for details.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the height, in Pango units if positive, or +number of lines if negative.

+
+

Since: 1.20

+
+
+
+

pango_layout_set_wrap ()

+
void
+pango_layout_set_wrap (PangoLayout *layout,
+                       PangoWrapMode wrap);
+

Sets the wrap mode; the wrap mode only has effect if a width +is set on the layout with pango_layout_set_width(). +To turn off wrapping, set the width to -1.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

wrap

the wrap mode

 
+
+
+
+
+

pango_layout_get_wrap ()

+
PangoWrapMode
+pango_layout_get_wrap (PangoLayout *layout);
+

Gets the wrap mode for the layout.

+

Use pango_layout_is_wrapped() to query whether any paragraphs +were actually wrapped.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

active wrap mode.

+
+
+
+
+

pango_layout_is_wrapped ()

+
gboolean
+pango_layout_is_wrapped (PangoLayout *layout);
+

Queries whether the layout had to wrap any paragraphs.

+

This returns TRUE if a positive width is set on layout +, +ellipsization mode of layout + is set to PANGO_ELLIPSIZE_NONE, +and there are paragraphs exceeding the layout width that have +to be wrapped.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

TRUE if any paragraphs had to be wrapped, FALSE +otherwise.

+
+

Since: 1.16

+
+
+
+

pango_layout_set_ellipsize ()

+
void
+pango_layout_set_ellipsize (PangoLayout *layout,
+                            PangoEllipsizeMode ellipsize);
+

Sets the type of ellipsization being performed for layout +. +Depending on the ellipsization mode ellipsize + text is +removed from the start, middle, or end of text so they +fit within the width and height of layout set with +pango_layout_set_width() and pango_layout_set_height().

+

If the layout contains characters such as newlines that +force it to be layed out in multiple paragraphs, then whether +each paragraph is ellipsized separately or the entire layout +is ellipsized as a whole depends on the set height of the layout. +See pango_layout_set_height() for details.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

ellipsize

the new ellipsization mode for layout +

 
+
+

Since: 1.6

+
+
+
+

pango_layout_get_ellipsize ()

+
PangoEllipsizeMode
+pango_layout_get_ellipsize (PangoLayout *layout);
+

Gets the type of ellipsization being performed for layout +. +See pango_layout_set_ellipsize()

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the current ellipsization mode for layout +.

+

Use pango_layout_is_ellipsized() to query whether any paragraphs +were actually ellipsized.

+
+

Since: 1.6

+
+
+
+

pango_layout_is_ellipsized ()

+
gboolean
+pango_layout_is_ellipsized (PangoLayout *layout);
+

Queries whether the layout had to ellipsize any paragraphs.

+

This returns TRUE if the ellipsization mode for layout + +is not PANGO_ELLIPSIZE_NONE, a positive width is set on layout +, +and there are paragraphs exceeding that width that have to be +ellipsized.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

TRUE if any paragraphs had to be ellipsized, FALSE +otherwise.

+
+

Since: 1.16

+
+
+
+

pango_layout_set_indent ()

+
void
+pango_layout_set_indent (PangoLayout *layout,
+                         int indent);
+

Sets the width in Pango units to indent each paragraph. A negative value +of indent + will produce a hanging indentation. That is, the first line will +have the full width, and subsequent lines will be indented by the +absolute value of indent +.

+

The indent setting is ignored if layout alignment is set to +PANGO_ALIGN_CENTER.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout.

 

indent

the amount by which to indent.

 
+
+
+
+
+

pango_layout_get_indent ()

+
int
+pango_layout_get_indent (PangoLayout *layout);
+

Gets the paragraph indent width in Pango units. A negative value +indicates a hanging indentation.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the indent in Pango units.

+
+
+
+
+

pango_layout_get_spacing ()

+
int
+pango_layout_get_spacing (PangoLayout *layout);
+

Gets the amount of spacing between the lines of the layout.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the spacing in Pango units.

+
+
+
+
+

pango_layout_set_spacing ()

+
void
+pango_layout_set_spacing (PangoLayout *layout,
+                          int spacing);
+

Sets the amount of spacing in Pango unit between the lines of the +layout.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout.

 

spacing

the amount of spacing

 
+
+
+
+
+

pango_layout_set_justify ()

+
void
+pango_layout_set_justify (PangoLayout *layout,
+                          gboolean justify);
+

Sets whether each complete line should be stretched to +fill the entire width of the layout. This stretching is typically +done by adding whitespace, but for some scripts (such as Arabic), +the justification may be done in more complex ways, like extending +the characters.

+

Note that this setting is not implemented and so is ignored in Pango +older than 1.18.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

justify

whether the lines in the layout should be justified.

 
+
+
+
+
+

pango_layout_get_justify ()

+
gboolean
+pango_layout_get_justify (PangoLayout *layout);
+

Gets whether each complete line should be stretched to fill the entire +width of the layout.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the justify.

+
+
+
+
+

pango_layout_set_auto_dir ()

+
void
+pango_layout_set_auto_dir (PangoLayout *layout,
+                           gboolean auto_dir);
+

Sets whether to calculate the bidirectional base direction +for the layout according to the contents of the layout; +when this flag is on (the default), then paragraphs in + layout + that begin with strong right-to-left characters +(Arabic and Hebrew principally), will have right-to-left +layout, paragraphs with letters from other scripts will +have left-to-right layout. Paragraphs with only neutral +characters get their direction from the surrounding paragraphs.

+

When FALSE, the choice between left-to-right and +right-to-left layout is done according to the base direction +of the layout's PangoContext. (See pango_context_set_base_dir()).

+

When the auto-computed direction of a paragraph differs from the +base direction of the context, the interpretation of +PANGO_ALIGN_LEFT and PANGO_ALIGN_RIGHT are swapped.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

auto_dir

if TRUE, compute the bidirectional base direction +from the layout's contents.

 
+
+

Since: 1.4

+
+
+
+

pango_layout_get_auto_dir ()

+
gboolean
+pango_layout_get_auto_dir (PangoLayout *layout);
+

Gets whether to calculate the bidirectional base direction +for the layout according to the contents of the layout. +See pango_layout_set_auto_dir().

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

TRUE if the bidirectional base direction +is computed from the layout's contents, FALSE otherwise.

+
+

Since: 1.4

+
+
+
+

pango_layout_set_alignment ()

+
void
+pango_layout_set_alignment (PangoLayout *layout,
+                            PangoAlignment alignment);
+

Sets the alignment for the layout: how partial lines are +positioned within the horizontal space available.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

alignment

the alignment

 
+
+
+
+
+

pango_layout_get_alignment ()

+
PangoAlignment
+pango_layout_get_alignment (PangoLayout *layout);
+

Gets the alignment for the layout: how partial lines are +positioned within the horizontal space available.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the alignment.

+
+
+
+
+

pango_layout_set_tabs ()

+
void
+pango_layout_set_tabs (PangoLayout *layout,
+                       PangoTabArray *tabs);
+

Sets the tabs to use for layout +, overriding the default tabs +(by default, tabs are every 8 spaces). If tabs + is NULL, the default +tabs are reinstated. tabs + is copied into the layout; you must +free your copy of tabs + yourself.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

tabs

a PangoTabArray, or NULL.

[allow-none]
+
+
+
+
+

pango_layout_get_tabs ()

+
PangoTabArray *
+pango_layout_get_tabs (PangoLayout *layout);
+

Gets the current PangoTabArray used by this layout. If no +PangoTabArray has been set, then the default tabs are in use +and NULL is returned. Default tabs are every 8 spaces. +The return value should be freed with pango_tab_array_free().

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

a copy of the tabs for this layout, or +NULL.

+

[nullable]

+
+
+
+
+

pango_layout_set_single_paragraph_mode ()

+
void
+pango_layout_set_single_paragraph_mode
+                               (PangoLayout *layout,
+                                gboolean setting);
+

If setting + is TRUE, do not treat newlines and similar characters +as paragraph separators; instead, keep all text in a single paragraph, +and display a glyph for paragraph separator characters. Used when +you want to allow editing of newlines on a single text line.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

setting

new setting

 
+
+
+
+
+

pango_layout_get_single_paragraph_mode ()

+
gboolean
+pango_layout_get_single_paragraph_mode
+                               (PangoLayout *layout);
+

Obtains the value set by pango_layout_set_single_paragraph_mode().

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

TRUE if the layout does not break paragraphs at +paragraph separator characters, FALSE otherwise.

+
+
+
+
+

pango_layout_get_unknown_glyphs_count ()

+
int
+pango_layout_get_unknown_glyphs_count (PangoLayout *layout);
+

Counts the number unknown glyphs in layout +. That is, zero if +glyphs for all characters in the layout text were found, or more +than zero otherwise.

+

This function can be used to determine if there are any fonts +available to render all characters in a certain string, or when +used in combination with PANGO_ATTR_FALLBACK, to check if a +certain font supports all the characters in the string.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

The number of unknown glyphs in layout +.

+
+

Since: 1.16

+
+
+
+

pango_layout_get_log_attrs ()

+
void
+pango_layout_get_log_attrs (PangoLayout *layout,
+                            PangoLogAttr **attrs,
+                            gint *n_attrs);
+

Retrieves an array of logical attributes for each character in +the layout +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

attrs

location to store a pointer to an array of logical attributes +This value must be freed with g_free().

[out][array length=n_attrs][transfer container]

n_attrs

location to store the number of the attributes in the +array. (The stored value will be one more than the total number +of characters in the layout, since there need to be attributes +corresponding to both the position before the first character +and the position after the last character.).

[out]
+
+
+
+
+

pango_layout_get_log_attrs_readonly ()

+
const PangoLogAttr *
+pango_layout_get_log_attrs_readonly (PangoLayout *layout,
+                                     gint *n_attrs);
+

Retrieves an array of logical attributes for each character in +the layout +.

+

This is a faster alternative to pango_layout_get_log_attrs(). +The returned array is part of layout + and must not be modified. +Modifying the layout will invalidate the returned array.

+

The number of attributes returned in n_attrs + will be one more +than the total number of characters in the layout, since there +need to be attributes corresponding to both the position before +the first character and the position after the last character.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

n_attrs

location to store the number of the attributes in +the array.

[out]
+
+
+

Returns

+

an array of logical attributes.

+

[array length=n_attrs]

+
+

Since: 1.30

+
+
+
+

pango_layout_index_to_pos ()

+
void
+pango_layout_index_to_pos (PangoLayout *layout,
+                           int index_,
+                           PangoRectangle *pos);
+

Converts from an index within a PangoLayout to the onscreen position +corresponding to the grapheme at that index, which is represented +as rectangle. Note that pos->x is always the leading +edge of the grapheme and pos->x + pos->width the trailing +edge of the grapheme. If the directionality of the grapheme is right-to-left, +then pos->width will be negative.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

index_

byte index within layout +

 

pos

rectangle in which to store the position of the grapheme.

[out]
+
+
+
+
+

pango_layout_index_to_line_x ()

+
void
+pango_layout_index_to_line_x (PangoLayout *layout,
+                              int index_,
+                              gboolean trailing,
+                              int *line,
+                              int *x_pos);
+

Converts from byte index_ + within the layout + to line and X position. +(X position is measured from the left edge of the line)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

index_

the byte index of a grapheme within the layout.

 

trailing

an integer indicating the edge of the grapheme to retrieve the +position of. If > 0, the trailing edge of the grapheme, if 0, +the leading of the grapheme.

 

line

location to store resulting line index. (which will +between 0 and pango_layout_get_line_count(layout) - 1), or NULL.

[out][allow-none]

x_pos

location to store resulting position within line +(PANGO_SCALE units per device unit), or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_xy_to_index ()

+
gboolean
+pango_layout_xy_to_index (PangoLayout *layout,
+                          int x,
+                          int y,
+                          int *index_,
+                          int *trailing);
+

Converts from X and Y position within a layout to the byte +index to the character at that logical position. If the +Y position is not inside the layout, the closest position is chosen +(the position will be clamped inside the layout). If the +X position is not within the layout, then the start or the +end of the line is chosen as described for pango_layout_line_x_to_index(). +If either the X or Y positions were not inside the layout, then the +function returns FALSE; on an exact hit, it returns TRUE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

x

the X offset (in Pango units) +from the left edge of the layout.

 

y

the Y offset (in Pango units) +from the top edge of the layout

 

index_

location to store calculated byte index.

[out]

trailing

location to store a integer indicating where +in the grapheme the user clicked. It will either +be zero, or the number of characters in the +grapheme. 0 represents the leading edge of the grapheme.

[out]
+
+
+

Returns

+

TRUE if the coordinates were inside text, FALSE otherwise.

+
+
+
+
+

pango_layout_get_cursor_pos ()

+
void
+pango_layout_get_cursor_pos (PangoLayout *layout,
+                             int index_,
+                             PangoRectangle *strong_pos,
+                             PangoRectangle *weak_pos);
+

Given an index within a layout, determines the positions that of the +strong and weak cursors if the insertion point is at that +index. The position of each cursor is stored as a zero-width +rectangle. The strong cursor location is the location where +characters of the directionality equal to the base direction of the +layout are inserted. The weak cursor location is the location +where characters of the directionality opposite to the base +direction of the layout are inserted.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

index_

the byte index of the cursor

 

strong_pos

location to store the strong cursor position +(may be NULL).

[out][allow-none]

weak_pos

location to store the weak cursor position (may be NULL).

[out][allow-none]
+
+
+
+
+

pango_layout_move_cursor_visually ()

+
void
+pango_layout_move_cursor_visually (PangoLayout *layout,
+                                   gboolean strong,
+                                   int old_index,
+                                   int old_trailing,
+                                   int direction,
+                                   int *new_index,
+                                   int *new_trailing);
+

Computes a new cursor position from an old position and +a count of positions to move visually. If direction + is positive, +then the new strong cursor position will be one position +to the right of the old cursor position. If direction + is negative, +then the new strong cursor position will be one position +to the left of the old cursor position.

+

In the presence of bidirectional text, the correspondence +between logical and visual order will depend on the direction +of the current run, and there may be jumps when the cursor +is moved off of the end of a run.

+

Motion here is in cursor positions, not in characters, so a +single call to pango_layout_move_cursor_visually() may move the +cursor over multiple characters when multiple characters combine +to form a single grapheme.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

layout

a PangoLayout.

 

strong

whether the moving cursor is the strong cursor or the +weak cursor. The strong cursor is the cursor corresponding +to text insertion in the base direction for the layout.

 

old_index

the byte index of the grapheme for the old index

 

old_trailing

if 0, the cursor was at the leading edge of the +grapheme indicated by old_index +, if > 0, the cursor +was at the trailing edge.

 

direction

direction to move cursor. A negative +value indicates motion to the left.

 

new_index

location to store the new cursor byte index. A value of -1 +indicates that the cursor has been moved off the beginning +of the layout. A value of G_MAXINT indicates that +the cursor has been moved off the end of the layout.

[out]

new_trailing

number of characters to move forward from the +location returned for new_index +to get the position +where the cursor should be displayed. This allows +distinguishing the position at the beginning of one +line from the position at the end of the preceding +line. new_index +is always on the line where the +cursor should be displayed.

[out]
+
+
+
+
+

pango_layout_get_extents ()

+
void
+pango_layout_get_extents (PangoLayout *layout,
+                          PangoRectangle *ink_rect,
+                          PangoRectangle *logical_rect);
+

Computes the logical and ink extents of layout +. Logical extents +are usually what you want for positioning things. Note that both extents +may have non-zero x and y. You may want to use those to offset where you +render the layout. Not doing that is a very typical bug that shows up as +right-to-left layouts not being correctly positioned in a layout with +a set width.

+

The extents are given in layout coordinates and in Pango units; layout +coordinates begin at the top left corner of the layout.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

ink_rect

rectangle used to store the extents of the +layout as drawn or NULL to indicate that the result is +not needed.

[out][allow-none]

logical_rect

rectangle used to store the logical +extents of the layout or NULL to indicate that the +result is not needed.

[out][allow-none]
+
+
+
+
+

pango_layout_get_pixel_extents ()

+
void
+pango_layout_get_pixel_extents (PangoLayout *layout,
+                                PangoRectangle *ink_rect,
+                                PangoRectangle *logical_rect);
+

Computes the logical and ink extents of layout + in device units. +This function just calls pango_layout_get_extents() followed by +two pango_extents_to_pixels() calls, rounding ink_rect + and logical_rect + +such that the rounded rectangles fully contain the unrounded one (that is, +passes them as first argument to pango_extents_to_pixels()).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

ink_rect

rectangle used to store the extents of the +layout as drawn or NULL to indicate that the result is +not needed.

[out][allow-none]

logical_rect

rectangle used to store the logical +extents of the layout or NULL to indicate that the +result is not needed.

[out][allow-none]
+
+
+
+
+

pango_layout_get_size ()

+
void
+pango_layout_get_size (PangoLayout *layout,
+                       int *width,
+                       int *height);
+

Determines the logical width and height of a PangoLayout +in Pango units (device units scaled by PANGO_SCALE). This +is simply a convenience function around pango_layout_get_extents().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

width

location to store the logical width, or NULL.

[out][allow-none]

height

location to store the logical height, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_get_pixel_size ()

+
void
+pango_layout_get_pixel_size (PangoLayout *layout,
+                             int *width,
+                             int *height);
+

Determines the logical width and height of a PangoLayout +in device units. (pango_layout_get_size() returns the width +and height scaled by PANGO_SCALE.) This +is simply a convenience function around +pango_layout_get_pixel_extents().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout

a PangoLayout

 

width

location to store the logical width, or NULL.

[out][allow-none]

height

location to store the logical height, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_get_baseline ()

+
int
+pango_layout_get_baseline (PangoLayout *layout);
+

Gets the Y position of baseline of the first line in layout +.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

baseline of first line, from top of layout +.

+
+

Since: 1.22

+
+
+
+

pango_layout_get_line_count ()

+
int
+pango_layout_get_line_count (PangoLayout *layout);
+

Retrieves the count of lines for the layout +.

+
+

Parameters

+
+++++ + + + + + +

layout

PangoLayout

 
+
+
+

Returns

+

the line count.

+
+
+
+
+

pango_layout_get_line ()

+
PangoLayoutLine *
+pango_layout_get_line (PangoLayout *layout,
+                       int line);
+

Retrieves a particular line from a PangoLayout.

+

Use the faster pango_layout_get_line_readonly() if you do not plan +to modify the contents of the line (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

line

the index of a line, which must be between 0 and +pango_layout_get_line_count(layout) - 1, inclusive.

 
+
+
+

Returns

+

the requested +PangoLayoutLine, or NULL if the index is out of +range. This layout line can be ref'ed and retained, +but will become invalid if changes are made to the +PangoLayout.

+

[transfer none][nullable]

+
+
+
+
+

pango_layout_get_line_readonly ()

+
PangoLayoutLine *
+pango_layout_get_line_readonly (PangoLayout *layout,
+                                int line);
+

Retrieves a particular line from a PangoLayout.

+

This is a faster alternative to pango_layout_get_line(), +but the user is not expected +to modify the contents of the line (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

layout

a PangoLayout

 

line

the index of a line, which must be between 0 and +pango_layout_get_line_count(layout) - 1, inclusive.

 
+
+
+

Returns

+

the requested +PangoLayoutLine, or NULL if the index is out of +range. This layout line can be ref'ed and retained, +but will become invalid if changes are made to the +PangoLayout. No changes should be made to the line.

+

[transfer none][nullable]

+
+

Since: 1.16

+
+
+
+

pango_layout_get_lines ()

+
GSList *
+pango_layout_get_lines (PangoLayout *layout);
+

Returns the lines of the layout + as a list.

+

Use the faster pango_layout_get_lines_readonly() if you do not plan +to modify the contents of the lines (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

a GSList containing +the lines in the layout. This points to internal data of the PangoLayout +and must be used with care. It will become invalid on any change to the layout's +text or properties.

+

[element-type Pango.LayoutLine][transfer none]

+
+
+
+
+

pango_layout_get_lines_readonly ()

+
GSList *
+pango_layout_get_lines_readonly (PangoLayout *layout);
+

Returns the lines of the layout + as a list.

+

This is a faster alternative to pango_layout_get_lines(), +but the user is not expected +to modify the contents of the lines (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

a GSList containing +the lines in the layout. This points to internal data of the PangoLayout and +must be used with care. It will become invalid on any change to the layout's +text or properties. No changes should be made to the lines.

+

[element-type Pango.LayoutLine][transfer none]

+
+

Since: 1.16

+
+
+
+

pango_layout_get_iter ()

+
PangoLayoutIter *
+pango_layout_get_iter (PangoLayout *layout);
+

Returns an iterator to iterate over the visual extents of the layout.

+
+

Parameters

+
+++++ + + + + + +

layout

a PangoLayout

 
+
+
+

Returns

+

the new PangoLayoutIter that should be freed using +pango_layout_iter_free().

+
+
+
+
+

pango_layout_iter_copy ()

+
PangoLayoutIter *
+pango_layout_iter_copy (PangoLayoutIter *iter);
+

Copies a PangoLayoutIter.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoLayoutIter, +which should be freed with pango_layout_iter_free(), +or NULL if iter +was NULL.

+

[nullable]

+
+

Since: 1.20

+
+
+
+

pango_layout_iter_free ()

+
void
+pango_layout_iter_free (PangoLayoutIter *iter);
+

Frees an iterator that's no longer in use.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter, may be NULL.

[nullable]
+
+
+
+
+

pango_layout_iter_next_run ()

+
gboolean
+pango_layout_iter_next_run (PangoLayoutIter *iter);
+

Moves iter + forward to the next run in visual order. If iter + was +already at the end of the layout, returns FALSE.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

whether motion was possible.

+
+
+
+
+

pango_layout_iter_next_char ()

+
gboolean
+pango_layout_iter_next_char (PangoLayoutIter *iter);
+

Moves iter + forward to the next character in visual order. If iter + was already at +the end of the layout, returns FALSE.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

whether motion was possible.

+
+
+
+
+

pango_layout_iter_next_cluster ()

+
gboolean
+pango_layout_iter_next_cluster (PangoLayoutIter *iter);
+

Moves iter + forward to the next cluster in visual order. If iter + +was already at the end of the layout, returns FALSE.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

whether motion was possible.

+
+
+
+
+

pango_layout_iter_next_line ()

+
gboolean
+pango_layout_iter_next_line (PangoLayoutIter *iter);
+

Moves iter + forward to the start of the next line. If iter + is +already on the last line, returns FALSE.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

whether motion was possible.

+
+
+
+
+

pango_layout_iter_at_last_line ()

+
gboolean
+pango_layout_iter_at_last_line (PangoLayoutIter *iter);
+

Determines whether iter + is on the last line of the layout.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

TRUE if iter +is on the last line.

+
+
+
+
+

pango_layout_iter_get_index ()

+
int
+pango_layout_iter_get_index (PangoLayoutIter *iter);
+

Gets the current byte index. Note that iterating forward by char +moves in visual order, not logical order, so indexes may not be +sequential. Also, the index may be equal to the length of the text +in the layout, if on the NULL run (see pango_layout_iter_get_run()).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

current byte index.

+
+
+
+
+

pango_layout_iter_get_baseline ()

+
int
+pango_layout_iter_get_baseline (PangoLayoutIter *iter);
+

Gets the Y position of the current line's baseline, in layout +coordinates (origin at top left of the entire layout).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

baseline of current line.

+
+
+
+
+

pango_layout_iter_get_run ()

+
PangoLayoutRun *
+pango_layout_iter_get_run (PangoLayoutIter *iter);
+

Gets the current run. When iterating by run, at the end of each +line, there's a position with a NULL run, so this function can return +NULL. The NULL run at the end of each line ensures that all lines have +at least one run, even lines consisting of only a newline.

+

Use the faster pango_layout_iter_get_run_readonly() if you do not plan +to modify the contents of the run (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

the current run.

+

[transfer none][nullable]

+
+
+
+
+

pango_layout_iter_get_run_readonly ()

+
PangoLayoutRun *
+pango_layout_iter_get_run_readonly (PangoLayoutIter *iter);
+

Gets the current run. When iterating by run, at the end of each +line, there's a position with a NULL run, so this function can return +NULL. The NULL run at the end of each line ensures that all lines have +at least one run, even lines consisting of only a newline.

+

This is a faster alternative to pango_layout_iter_get_run(), +but the user is not expected +to modify the contents of the run (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

the current run, that +should not be modified.

+

[transfer none][nullable]

+
+

Since: 1.16

+
+
+
+

pango_layout_iter_get_line ()

+
PangoLayoutLine *
+pango_layout_iter_get_line (PangoLayoutIter *iter);
+

Gets the current line.

+

Use the faster pango_layout_iter_get_line_readonly() if you do not plan +to modify the contents of the line (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

the current line.

+
+
+
+
+

pango_layout_iter_get_line_readonly ()

+
PangoLayoutLine *
+pango_layout_iter_get_line_readonly (PangoLayoutIter *iter);
+

Gets the current line for read-only access.

+

This is a faster alternative to pango_layout_iter_get_line(), +but the user is not expected +to modify the contents of the line (glyphs, glyph widths, etc.).

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

the current line, that should not be +modified.

+

[transfer none]

+
+

Since: 1.16

+
+
+
+

pango_layout_iter_get_layout ()

+
PangoLayout *
+pango_layout_iter_get_layout (PangoLayoutIter *iter);
+

Gets the layout associated with a PangoLayoutIter.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoLayoutIter

 
+
+
+

Returns

+

the layout associated with iter +.

+

[transfer none]

+
+

Since: 1.20

+
+
+
+

pango_layout_iter_get_char_extents ()

+
void
+pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
+                                    PangoRectangle *logical_rect);
+

Gets the extents of the current character, in layout coordinates +(origin is the top left of the entire layout). Only logical extents +can sensibly be obtained for characters; ink extents make sense only +down to the level of clusters.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

logical_rect

rectangle to fill with +logical extents.

[out caller-allocates]
+
+
+
+
+

pango_layout_iter_get_cluster_extents ()

+
void
+pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
+                                       PangoRectangle *ink_rect,
+                                       PangoRectangle *logical_rect);
+

Gets the extents of the current cluster, in layout coordinates +(origin is the top left of the entire layout).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

ink_rect

rectangle to fill with ink extents, or NULL.

[out][allow-none]

logical_rect

rectangle to fill with logical extents, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_iter_get_run_extents ()

+
void
+pango_layout_iter_get_run_extents (PangoLayoutIter *iter,
+                                   PangoRectangle *ink_rect,
+                                   PangoRectangle *logical_rect);
+

Gets the extents of the current run in layout coordinates +(origin is the top left of the entire layout).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

ink_rect

rectangle to fill with ink extents, or NULL.

[out][allow-none]

logical_rect

rectangle to fill with logical extents, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_iter_get_line_yrange ()

+
void
+pango_layout_iter_get_line_yrange (PangoLayoutIter *iter,
+                                   int *y0_,
+                                   int *y1_);
+

Divides the vertical space in the PangoLayout being iterated over +between the lines in the layout, and returns the space belonging to +the current line. A line's range includes the line's logical +extents, plus half of the spacing above and below the line, if +pango_layout_set_spacing() has been called to set layout spacing. +The Y positions are in layout coordinates (origin at top left of the +entire layout).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

y0_

start of line, or NULL.

[out][allow-none]

y1_

end of line, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_iter_get_line_extents ()

+
void
+pango_layout_iter_get_line_extents (PangoLayoutIter *iter,
+                                    PangoRectangle *ink_rect,
+                                    PangoRectangle *logical_rect);
+

Obtains the extents of the current line. ink_rect + or logical_rect + +can be NULL if you aren't interested in them. Extents are in layout +coordinates (origin is the top-left corner of the entire +PangoLayout). Thus the extents returned by this function will be +the same width/height but not at the same x/y as the extents +returned from pango_layout_line_get_extents().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

ink_rect

rectangle to fill with ink extents, or NULL.

[out][allow-none]

logical_rect

rectangle to fill with logical extents, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_iter_get_layout_extents ()

+
void
+pango_layout_iter_get_layout_extents (PangoLayoutIter *iter,
+                                      PangoRectangle *ink_rect,
+                                      PangoRectangle *logical_rect);
+

Obtains the extents of the PangoLayout being iterated +over. ink_rect + or logical_rect + can be NULL if you +aren't interested in them.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iter

a PangoLayoutIter

 

ink_rect

rectangle to fill with ink extents, +or NULL.

[out][allow-none]

logical_rect

rectangle to fill with logical +extents, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_line_ref ()

+
PangoLayoutLine *
+pango_layout_line_ref (PangoLayoutLine *line);
+

Increase the reference count of a PangoLayoutLine by one.

+
+

Parameters

+
+++++ + + + + + +

line

a PangoLayoutLine, may be NULL.

[nullable]
+
+
+

Returns

+

the line passed in.

+
+

Since: 1.10

+
+
+
+

pango_layout_line_unref ()

+
void
+pango_layout_line_unref (PangoLayoutLine *line);
+

Decrease the reference count of a PangoLayoutLine by one. +If the result is zero, the line and all associated memory +will be freed.

+
+

Parameters

+
+++++ + + + + + +

line

a PangoLayoutLine

 
+
+
+
+
+

pango_layout_line_get_extents ()

+
void
+pango_layout_line_get_extents (PangoLayoutLine *line,
+                               PangoRectangle *ink_rect,
+                               PangoRectangle *logical_rect);
+

Computes the logical and ink extents of a layout line. See +pango_font_get_glyph_extents() for details about the interpretation +of the rectangles.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

line

a PangoLayoutLine

 

ink_rect

rectangle used to store the extents of +the glyph string as drawn, or NULL.

[out][allow-none]

logical_rect

rectangle used to store the logical +extents of the glyph string, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_line_get_pixel_extents ()

+
void
+pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line,
+                                     PangoRectangle *ink_rect,
+                                     PangoRectangle *logical_rect);
+

Computes the logical and ink extents of layout_line + in device units. +This function just calls pango_layout_line_get_extents() followed by +two pango_extents_to_pixels() calls, rounding ink_rect + and logical_rect + +such that the rounded rectangles fully contain the unrounded one (that is, +passes them as first argument to pango_extents_to_pixels()).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

layout_line

a PangoLayoutLine

 

ink_rect

rectangle used to store the extents of +the glyph string as drawn, or NULL.

[out][allow-none]

logical_rect

rectangle used to store the logical +extents of the glyph string, or NULL.

[out][allow-none]
+
+
+
+
+

pango_layout_line_index_to_x ()

+
void
+pango_layout_line_index_to_x (PangoLayoutLine *line,
+                              int index_,
+                              gboolean trailing,
+                              int *x_pos);
+

Converts an index within a line to a X position.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

line

a PangoLayoutLine

 

index_

byte offset of a grapheme within the layout

 

trailing

an integer indicating the edge of the grapheme to retrieve +the position of. If > 0, the trailing edge of the grapheme, +if 0, the leading of the grapheme.

 

x_pos

location to store the x_offset (in Pango unit).

[out]
+
+
+
+
+

pango_layout_line_x_to_index ()

+
gboolean
+pango_layout_line_x_to_index (PangoLayoutLine *line,
+                              int x_pos,
+                              int *index_,
+                              int *trailing);
+

Converts from x offset to the byte index of the corresponding +character within the text of the layout. If x_pos + is outside the line, +index_ + and trailing + will point to the very first or very last position +in the line. This determination is based on the resolved direction +of the paragraph; for example, if the resolved direction is +right-to-left, then an X position to the right of the line (after it) +results in 0 being stored in index_ + and trailing +. An X position to the +left of the line results in index_ + pointing to the (logical) last +grapheme in the line and trailing + being set to the number of characters +in that grapheme. The reverse is true for a left-to-right line.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

line

a PangoLayoutLine

 

x_pos

the X offset (in Pango units) +from the left edge of the line.

 

index_

location to store calculated byte index for +the grapheme in which the user clicked.

[out]

trailing

location to store an integer indicating where +in the grapheme the user clicked. It will either +be zero, or the number of characters in the +grapheme. 0 represents the leading edge of the grapheme.

[out]
+
+
+

Returns

+

FALSE if x_pos +was outside the line, TRUE if inside

+
+
+
+
+

pango_layout_line_get_x_ranges ()

+
void
+pango_layout_line_get_x_ranges (PangoLayoutLine *line,
+                                int start_index,
+                                int end_index,
+                                int **ranges,
+                                int *n_ranges);
+

Gets a list of visual ranges corresponding to a given logical range. +This list is not necessarily minimal - there may be consecutive +ranges which are adjacent. The ranges will be sorted from left to +right. The ranges are with respect to the left edge of the entire +layout, not with respect to the line.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

line

a PangoLayoutLine

 

start_index

Start byte index of the logical range. If this value +is less than the start index for the line, then +the first range will extend all the way to the leading +edge of the layout. Otherwise it will start at the +leading edge of the first character.

 

end_index

Ending byte index of the logical range. If this value +is greater than the end index for the line, then +the last range will extend all the way to the trailing +edge of the layout. Otherwise, it will end at the +trailing edge of the last character.

 

ranges

location to store a pointer to an array of ranges. +The array will be of length 2*n_ranges, +with each range starting at (*ranges)[2*n] +and of width (*ranges)[2*n + 1] - (*ranges)[2*n]. +This array must be freed with g_free(). The coordinates are relative +to the layout and are in Pango units.

[out][array length=n_ranges][transfer full]

n_ranges

The number of ranges stored in ranges +.

 
+
+
+
+
+

Types and Values

+
+

PangoLayout

+
typedef struct _PangoLayout PangoLayout;
+

The PangoLayout structure represents an entire paragraph +of text. It is initialized with a PangoContext, UTF-8 string +and set of attributes for that string. Once that is done, the +set of formatted lines can be extracted from the object, +the layout can be rendered, and conversion between logical +character positions within the layout's text, and the physical +position of the resulting glyphs can be made.

+

There are also a number of parameters to adjust the formatting +of a PangoLayout, which are illustrated in Figure 1, “Adjustable parameters for a PangoLayout”. +It is possible, as well, to ignore the 2-D setup, and simply +treat the results of a PangoLayout as a list of lines.

+
+

Figure 1. Adjustable parameters for a PangoLayout

+
Adjustable parameters for a PangoLayout
+
+

The PangoLayout structure is opaque, and has no user-visible +fields.

+
+
+
+

PangoLayoutIter

+
typedef struct _PangoLayoutIter PangoLayoutIter;
+

A PangoLayoutIter structure can be used to +iterate over the visual extents of a PangoLayout.

+

The PangoLayoutIter structure is opaque, and +has no user-visible fields.

+
+
+
+

enum PangoWrapMode

+

A PangoWrapMode describes how to wrap the lines of a PangoLayout to the desired width.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PANGO_WRAP_WORD

+

wrap lines at word boundaries.

+
 

PANGO_WRAP_CHAR

+

wrap lines at character boundaries.

+
 

PANGO_WRAP_WORD_CHAR

+

wrap lines at word boundaries, but fall back to character boundaries if there is not +enough space for a full word.

+
 
+
+
+
+
+

PANGO_TYPE_WRAP_MODE

+
#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type ())
+
+
+
+
+

enum PangoEllipsizeMode

+

The PangoEllipsizeMode type describes what sort of (if any) +ellipsization should be applied to a line of text. In +the ellipsization process characters are removed from the +text in order to make it fit to a given width and replaced +with an ellipsis.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

PANGO_ELLIPSIZE_NONE

+

No ellipsization

+
 

PANGO_ELLIPSIZE_START

+

Omit characters at the start of the text

+
 

PANGO_ELLIPSIZE_MIDDLE

+

Omit characters in the middle of the text

+
 

PANGO_ELLIPSIZE_END

+

Omit characters at the end of the text

+
 
+
+
+
+
+

PANGO_TYPE_ELLIPSIZE_MODE

+
#define PANGO_TYPE_ELLIPSIZE_MODE (pango_ellipsize_mode_get_type ())
+
+
+
+
+

enum PangoAlignment

+

A PangoAlignment describes how to align the lines of a PangoLayout within the +available space. If the PangoLayout is set to justify +using pango_layout_set_justify(), this only has effect for partial lines.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PANGO_ALIGN_LEFT

+

Put all available space on the right

+
 

PANGO_ALIGN_CENTER

+

Center the line within the available space

+
 

PANGO_ALIGN_RIGHT

+

Put all available space on the left

+
 
+
+
+
+
+

PANGO_TYPE_ALIGNMENT

+
#define PANGO_TYPE_ALIGNMENT (pango_alignment_get_type ())
+
+
+
+
+

struct PangoLayoutLine

+
struct PangoLayoutLine {
+  PangoLayout *layout;
+  gint         start_index;     /* start of line as byte index into layout->text */
+  gint         length;		/* length of line in bytes */
+  GSList      *runs;
+  guint        is_paragraph_start : 1;  /* TRUE if this is the first line of the paragraph */
+  guint        resolved_dir : 3;  /* Resolved PangoDirection of line */
+};
+
+

The PangoLayoutLine structure represents one of the lines resulting +from laying out a paragraph via PangoLayout. PangoLayoutLine +structures are obtained by calling pango_layout_get_line() and +are only valid until the text, attributes, or settings of the +parent PangoLayout are modified.

+

Routines for rendering PangoLayout objects are provided in +code specific to each rendering system.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PangoLayout *layout;

the layout this line belongs to, might be NULL.

[allow-none]

gint start_index;

start of line as byte index into layout->text

 

gint length;

length of line in bytes

 

GSList *runs;

list of runs in the +line, from left to right.

[allow-none][element-type Pango.LayoutRun]

guint is_paragraph_start : 1;

TRUE if this is the first line of the paragraph

 

guint resolved_dir : 3;

Resolved PangoDirection of line

 
+
+
+
+
+

PangoLayoutRun

+
typedef PangoGlyphItem PangoLayoutRun;
+
+

The PangoLayoutRun structure represents a single run within +a PangoLayoutLine; it is simply an alternate name for +PangoGlyphItem. +See the PangoGlyphItem docs for details on the fields.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Miscellaneous-Utilities.html b/docs/html/pango-Miscellaneous-Utilities.html new file mode 100644 index 0000000..4f4ed79 --- /dev/null +++ b/docs/html/pango-Miscellaneous-Utilities.html @@ -0,0 +1,950 @@ + + + + +Miscellaneous Utilities: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Miscellaneous Utilities

+

Miscellaneous Utilities — Various convenience and utility functions

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+char ** + +pango_split_file_list () +
+char * + +pango_trim_string () +
+gint + +pango_read_line () +
+gboolean + +pango_skip_space () +
+gboolean + +pango_scan_word () +
+gboolean + +pango_scan_string () +
+gboolean + +pango_scan_int () +
+char * + +pango_config_key_get () +
+char * + +pango_config_key_get_system () +
+void + +pango_lookup_aliases () +
+gboolean + +pango_parse_enum () +
+gboolean + +pango_parse_style () +
+gboolean + +pango_parse_variant () +
+gboolean + +pango_parse_weight () +
+gboolean + +pango_parse_stretch () +
const char * + +pango_get_sysconf_subdirectory () +
const char * + +pango_get_lib_subdirectory () +
+guint8 * + +pango_log2vis_get_embedding_levels () +
+gboolean + +pango_is_zero_width () +
+void + +pango_quantize_line_geometry () +
+
+
+

Description

+

The functions and utilities in this section are mostly used from Pango +backends and modules, but may be useful for other purposes too.

+
+
+

Functions

+
+

pango_split_file_list ()

+
char **
+pango_split_file_list (const char *str);
+

pango_split_file_list has been deprecated since version 1.38 and should not be used in newly-written code.

+

Splits a G_SEARCHPATH_SEPARATOR-separated list of files, stripping +white space and substituting ~/ with $HOME/.

+
+

Parameters

+
+++++ + + + + + +

str

a G_SEARCHPATH_SEPARATOR separated list of filenames

 
+
+
+

Returns

+

a list of +strings to be freed with g_strfreev().

+

[transfer full][array zero-terminated=1]

+
+
+
+
+

pango_trim_string ()

+
char *
+pango_trim_string (const char *str);
+

pango_trim_string has been deprecated since version 1.38 and should not be used in newly-written code.

+

Trims leading and trailing whitespace from a string.

+
+

Parameters

+
+++++ + + + + + +

str

a string

 
+
+
+

Returns

+

A newly-allocated string that must be freed with g_free()

+
+
+
+
+

pango_read_line ()

+
gint
+pango_read_line (FILE *stream,
+                 GString *str);
+

pango_read_line has been deprecated since version 1.38 and should not be used in newly-written code.

+

Reads an entire line from a file into a buffer. Lines may +be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter +is not written into the buffer. Text after a '#' character is treated as +a comment and skipped. '\' can be used to escape a # character. +'\' proceeding a line delimiter combines adjacent lines. A '\' proceeding +any other character is ignored and written into the output buffer +unmodified.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a stdio stream

 

str

GString buffer into which to write the result.

[out]
+
+
+

Returns

+

0 if the stream was already at an EOF character, otherwise +the number of lines read (this is useful for maintaining +a line number counter which doesn't combine lines with '\')

+
+
+
+
+

pango_skip_space ()

+
gboolean
+pango_skip_space (const char **pos);
+

pango_skip_space has been deprecated since version 1.38 and should not be used in newly-written code.

+

Skips 0 or more characters of white space.

+
+

Parameters

+
+++++ + + + + + +

pos

in/out string position.

[inout]
+
+
+

Returns

+

FALSE if skipping the white space leaves +the position at a '\0' character.

+
+
+
+
+

pango_scan_word ()

+
gboolean
+pango_scan_word (const char **pos,
+                 GString *out);
+

pango_scan_word has been deprecated since version 1.38 and should not be used in newly-written code.

+

Scans a word into a GString buffer. A word consists +of [A-Za-z_] followed by zero or more [A-Za-z_0-9] +Leading white space is skipped.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pos

in/out string position.

[inout]

out

a GString into which to write the result.

[out]
+
+
+

Returns

+

FALSE if a parse error occurred.

+
+
+
+
+

pango_scan_string ()

+
gboolean
+pango_scan_string (const char **pos,
+                   GString *out);
+

pango_scan_string has been deprecated since version 1.38 and should not be used in newly-written code.

+

Scans a string into a GString buffer. The string may either +be a sequence of non-white-space characters, or a quoted +string with '"'. Instead a quoted string, '\"' represents +a literal quote. Leading white space outside of quotes is skipped.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pos

in/out string position.

[inout]

out

a GString into which to write the result.

[out]
+
+
+

Returns

+

FALSE if a parse error occurred.

+
+
+
+
+

pango_scan_int ()

+
gboolean
+pango_scan_int (const char **pos,
+                int *out);
+

pango_scan_int has been deprecated since version 1.38 and should not be used in newly-written code.

+

Scans an integer. +Leading white space is skipped.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pos

in/out string position.

[inout]

out

an int into which to write the result.

[out]
+
+
+

Returns

+

FALSE if a parse error occurred.

+
+
+
+
+

pango_config_key_get ()

+
char *
+pango_config_key_get (const char *key);
+

pango_config_key_get has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+
+

Parameters

+
+++++ + + + + + +

key

Key to look up, in the form "SECTION/KEY".

 
+
+
+

Returns

+

NULL

+
+
+
+
+

pango_config_key_get_system ()

+
char *
+pango_config_key_get_system (const char *key);
+

pango_config_key_get_system has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+
+

Parameters

+
+++++ + + + + + +

key

Key to look up, in the form "SECTION/KEY".

 
+
+
+

Returns

+

NULL

+
+
+
+
+

pango_lookup_aliases ()

+
void
+pango_lookup_aliases (const char *fontname,
+                      char ***families,
+                      int *n_families);
+
+

pango_lookup_aliases has been deprecated since version 1.32 and should not be used in newly-written code.

+

This function is not thread-safe.

+
+

Look up all user defined aliases for the alias fontname +. +The resulting font family names will be stored in families +, +and the number of families in n_families +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

fontname

an ascii string

 

families

will be set to an array of font family names. +this array is owned by pango and should not be freed.

[out][array length=n_families]

n_families

will be set to the length of the families +array.

[out]
+
+
+
+
+

pango_parse_enum ()

+
gboolean
+pango_parse_enum (GType type,
+                  const char *str,
+                  int *value,
+                  gboolean warn,
+                  char **possible_values);
+

pango_parse_enum has been deprecated since version 1.38 and should not be used in newly-written code.

+

Parses an enum type and stores the result in value +.

+

If str + does not match the nick name of any of the possible values for the +enum and is not an integer, FALSE is returned, a warning is issued +if warn + is TRUE, and a +string representing the list of possible values is stored in +possible_values +. The list is slash-separated, eg. +"none/start/middle/end". If failed and possible_values + is not NULL, +returned string should be freed using g_free().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

type

enum type to parse, eg. PANGO_TYPE_ELLIPSIZE_MODE.

 

str

string to parse. May be NULL.

[allow-none]

value

integer to store the result in, or NULL.

[out][allow-none]

warn

if TRUE, issue a g_warning() on bad input.

 

possible_values

place to store list of possible values on failure, or NULL.

[out][allow-none]
+
+
+

Returns

+

TRUE if str +was successfully parsed.

+
+

Since: 1.16

+
+
+
+

pango_parse_style ()

+
gboolean
+pango_parse_style (const char *str,
+                   PangoStyle *style,
+                   gboolean warn);
+

Parses a font style. The allowed values are "normal", +"italic" and "oblique", case variations being +ignored.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

str

a string to parse.

 

style

a PangoStyle to store the result +in.

[out caller-allocates]

warn

if TRUE, issue a g_warning() on bad input.

 
+
+
+

Returns

+

TRUE if str +was successfully parsed.

+
+
+
+
+

pango_parse_variant ()

+
gboolean
+pango_parse_variant (const char *str,
+                     PangoVariant *variant,
+                     gboolean warn);
+

Parses a font variant. The allowed values are "normal" +and "smallcaps" or "small_caps", case variations being +ignored.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

str

a string to parse.

 

variant

a PangoVariant to store the +result in.

[out caller-allocates]

warn

if TRUE, issue a g_warning() on bad input.

 
+
+
+

Returns

+

TRUE if str +was successfully parsed.

+
+
+
+
+

pango_parse_weight ()

+
gboolean
+pango_parse_weight (const char *str,
+                    PangoWeight *weight,
+                    gboolean warn);
+

Parses a font weight. The allowed values are "heavy", +"ultrabold", "bold", "normal", "light", "ultraleight" +and integers. Case variations are ignored.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

str

a string to parse.

 

weight

a PangoWeight to store the result +in.

[out caller-allocates]

warn

if TRUE, issue a g_warning() on bad input.

 
+
+
+

Returns

+

TRUE if str +was successfully parsed.

+
+
+
+
+

pango_parse_stretch ()

+
gboolean
+pango_parse_stretch (const char *str,
+                     PangoStretch *stretch,
+                     gboolean warn);
+

Parses a font stretch. The allowed values are +"ultra_condensed", "extra_condensed", "condensed", +"semi_condensed", "normal", "semi_expanded", "expanded", +"extra_expanded" and "ultra_expanded". Case variations are +ignored and the '_' characters may be omitted.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

str

a string to parse.

 

stretch

a PangoStretch to store the +result in.

[out caller-allocates]

warn

if TRUE, issue a g_warning() on bad input.

 
+
+
+

Returns

+

TRUE if str +was successfully parsed.

+
+
+
+
+

pango_get_sysconf_subdirectory ()

+
const char *
+pango_get_sysconf_subdirectory (void);
+

pango_get_sysconf_subdirectory has been deprecated since version 1.38 and should not be used in newly-written code.

+

Returns the name of the "pango" subdirectory of SYSCONFDIR +(which is set at compile time).

+
+

Returns

+

the Pango sysconf directory. The returned string should +not be freed.

+
+
+
+
+

pango_get_lib_subdirectory ()

+
const char *
+pango_get_lib_subdirectory (void);
+

pango_get_lib_subdirectory has been deprecated since version 1.38 and should not be used in newly-written code.

+

Returns the name of the "pango" subdirectory of LIBDIR +(which is set at compile time).

+
+

Returns

+

the Pango lib directory. The returned string should +not be freed.

+
+
+
+
+

pango_log2vis_get_embedding_levels ()

+
guint8 *
+pango_log2vis_get_embedding_levels (const gchar *text,
+                                    int length,
+                                    PangoDirection *pbase_dir);
+

This will return the bidirectional embedding levels of the input paragraph +as defined by the Unicode Bidirectional Algorithm available at:

+

http://www.unicode.org/reports/tr9/

+

If the input base direction is a weak direction, the direction of the +characters in the text will determine the final resolved direction.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

text

the text to itemize.

 

length

the number of bytes (not characters) to process, or -1 +if text +is nul-terminated and the length should be calculated.

 

pbase_dir

input base direction, and output resolved direction.

 
+
+
+

Returns

+

a newly allocated array of embedding levels, one item per +character (not byte), that should be freed using g_free.

+
+

Since: 1.4

+
+
+
+

pango_is_zero_width ()

+
gboolean
+pango_is_zero_width (gunichar ch);
+

Checks ch + to see if it is a character that should not be +normally rendered on the screen. This includes all Unicode characters +with "ZERO WIDTH" in their name, as well as bidi formatting characters, and +a few other ones. This is totally different from g_unichar_iszerowidth() +and is at best misnamed.

+
+

Parameters

+
+++++ + + + + + +

ch

a Unicode character

 
+
+
+

Returns

+

TRUE if ch +is a zero-width character, FALSE otherwise

+
+

Since: 1.10

+
+
+
+

pango_quantize_line_geometry ()

+
void
+pango_quantize_line_geometry (int *thickness,
+                              int *position);
+

Quantizes the thickness and position of a line, typically an +underline or strikethrough, to whole device pixels, that is integer +multiples of PANGO_SCALE. The purpose of this function is to avoid +such lines looking blurry.

+

Care is taken to make sure thickness + is at least one pixel when this +function returns, but returned position + may become zero as a result +of rounding.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

thickness

pointer to the thickness of a line, in Pango units.

[inout]

position

corresponding position.

[inout]
+
+

Since: 1.12

+
+
+
+

Types and Values

+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Modules.html b/docs/html/pango-Modules.html new file mode 100644 index 0000000..c43c29c --- /dev/null +++ b/docs/html/pango-Modules.html @@ -0,0 +1,318 @@ + + + + +Modules: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Modules

+

Modules — Support for loadable modules

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + +
+PangoMap * + +pango_find_map () +
+PangoEngine * + +pango_map_get_engine () +
+void + +pango_map_get_engines () +
+void + +pango_module_register () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
structPangoIncludedModule
 PangoMap
 PangoMapEntry
+
+
+

Description

+

Functions and macros in this section are used to support loading dynamic +modules that add engines to Pango at run time.

+
+
+

Functions

+
+

pango_find_map ()

+
PangoMap *
+pango_find_map (PangoLanguage *language,
+                guint engine_type_id,
+                guint render_type_id);
+

pango_find_map has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

language

the language tag for which to find the map

 

engine_type_id

the engine type for the map to find

 

render_type_id

the render type for the map to find

 
+
+
+

Returns

+

NULL.

+
+
+
+
+

pango_map_get_engine ()

+
PangoEngine *
+pango_map_get_engine (PangoMap *map,
+                      PangoScript script);
+

pango_map_get_engine has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

map

a PangoMap

 

script

a PangoScript

 
+
+
+

Returns

+

NULL.

+
+
+
+
+

pango_map_get_engines ()

+
void
+pango_map_get_engines (PangoMap *map,
+                       PangoScript script,
+                       GSList **exact_engines,
+                       GSList **fallback_engines);
+

pango_map_get_engines has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

map

a PangoMap

 

script

a PangoScript

 

exact_engines

location to store list of engines that exactly +handle this script.

 

fallback_engines

location to store list of engines that approximately +handle this script.

 
+
+

Since: 1.4

+
+
+
+

pango_module_register ()

+
void
+pango_module_register (PangoIncludedModule *module);
+

pango_module_register has been deprecated since version 1.38 and should not be used in newly-written code.

+

Do not use. Does not do anything.

+
+

Parameters

+
+++++ + + + + + +

module

a PangoIncludedModule

 
+
+
+
+
+

Types and Values

+
+

struct PangoIncludedModule

+
struct PangoIncludedModule {
+  void (*list) (PangoEngineInfo **engines,
+		int              *n_engines);
+  void (*init) (GTypeModule      *module);
+  void (*exit) (void);
+  PangoEngine *(*create) (const char       *id);
+};
+
+

PangoIncludedModule has been deprecated since version 1.38 and should not be used in newly-written code.

+

The PangoIncludedModule structure for a statically linked module +contains the functions that would otherwise be loaded from a dynamically +loaded module.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

list ()

a function that lists the engines defined in this module.

 

init ()

a function to initialize the module.

 

exit ()

a function to finalize the module.

 

create ()

a function to create an engine, given the engine name.

 
+
+
+
+
+

PangoMap

+
typedef struct _PangoMap PangoMap;
+
+
+
+

PangoMapEntry

+
typedef struct _PangoMapEntry PangoMapEntry;
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-OpenType-Font-Handling.html b/docs/html/pango-OpenType-Font-Handling.html new file mode 100644 index 0000000..c2b55cd --- /dev/null +++ b/docs/html/pango-OpenType-Font-Handling.html @@ -0,0 +1,2189 @@ + + + + +OpenType Font Handling: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

OpenType Font Handling

+

OpenType Font Handling — Obtaining information from OpenType tables

+
+
+

Stability Level

+Unstable, unless otherwise indicated +
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define +PANGO_OT_TAG_MAKE() +
#define +PANGO_OT_TAG_MAKE_FROM_STRING() +
+PangoOTInfo * + +pango_ot_info_get () +
+gboolean + +pango_ot_info_find_script () +
+gboolean + +pango_ot_info_find_language () +
+gboolean + +pango_ot_info_find_feature () +
+PangoOTTag * + +pango_ot_info_list_scripts () +
+PangoOTTag * + +pango_ot_info_list_languages () +
+PangoOTTag * + +pango_ot_info_list_features () +
+PangoOTBuffer * + +pango_ot_buffer_new () +
+void + +pango_ot_buffer_destroy () +
+void + +pango_ot_buffer_clear () +
+void + +pango_ot_buffer_add_glyph () +
+void + +pango_ot_buffer_set_rtl () +
+void + +pango_ot_buffer_set_zero_width_marks () +
+void + +pango_ot_buffer_get_glyphs () +
+void + +pango_ot_buffer_output () +
const PangoOTRuleset * + +pango_ot_ruleset_get_for_description () +
+PangoOTRuleset * + +pango_ot_ruleset_new () +
+PangoOTRuleset * + +pango_ot_ruleset_new_for () +
+PangoOTRuleset * + +pango_ot_ruleset_new_from_description () +
+void + +pango_ot_ruleset_add_feature () +
+gboolean + +pango_ot_ruleset_maybe_add_feature () +
+guint + +pango_ot_ruleset_maybe_add_features () +
+guint + +pango_ot_ruleset_get_feature_count () +
+void + +pango_ot_ruleset_substitute () +
+void + +pango_ot_ruleset_position () +
+PangoOTRulesetDescription * + +pango_ot_ruleset_description_copy () +
+gboolean + +pango_ot_ruleset_description_equal () +
+void + +pango_ot_ruleset_description_free () +
+guint + +pango_ot_ruleset_description_hash () +
+PangoOTTag + +pango_ot_tag_from_language () +
+PangoOTTag + +pango_ot_tag_from_script () +
+PangoLanguage * + +pango_ot_tag_to_language () +
+PangoScript + +pango_ot_tag_to_script () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
typedefPangoOTTag
 PangoOTInfo
 PangoOTBuffer
structPangoOTGlyph
 PangoOTRuleset
structPangoOTRulesetDescription
enumPangoOTTableType
structPangoOTFeatureMap
#definePANGO_OT_ALL_GLYPHS
#definePANGO_OT_NO_FEATURE
#definePANGO_OT_NO_SCRIPT
#definePANGO_OT_DEFAULT_LANGUAGE
#definePANGO_OT_TAG_DEFAULT_LANGUAGE
#definePANGO_OT_TAG_DEFAULT_SCRIPT
+
+
+

Object Hierarchy

+
    GObject
+    ├── PangoOTInfo
+    ╰── PangoOTRuleset
+
+
+
+

Description

+

Functions and macros in this section are used to implement the OpenType Layout +features and algorithms. These are mostly useful when writing Fontconfig-based +shaping engines

+
+
+

Functions

+
+

PANGO_OT_TAG_MAKE()

+
#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4)		((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4))
+
+

Creates a PangoOTTag from four characters. This is similar and +compatible with the FT_MAKE_TAG() macro from FreeType.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

c1

First character.

 

c2

Second character.

 

c3

Third character.

 

c4

Fourth character.

 
+
+
+
+
+

PANGO_OT_TAG_MAKE_FROM_STRING()

+
#define             PANGO_OT_TAG_MAKE_FROM_STRING(s)
+

Creates a PangoOTTag from a string. The string should be at least +four characters long (pad with space characters if needed), and need +not be nul-terminated. This is a convenience wrapper around +PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for +example, as a switch expression, as it dereferences pointers.

+
+

Parameters

+
+++++ + + + + + +

s

The string representation of the tag.

 
+
+
+
+
+

pango_ot_info_get ()

+
PangoOTInfo *
+pango_ot_info_get (FT_Face face);
+

pango_ot_info_get is deprecated and should not be used in newly-written code.

+

Returns the PangoOTInfo structure for the given FreeType font face.

+
+

Parameters

+
+++++ + + + + + +

face

a FT_Face.

 
+
+
+

Returns

+

the PangoOTInfo for face +. This object will have +the same lifetime as face +.

+
+

Since: 1.2

+
+
+
+

pango_ot_info_find_script ()

+
gboolean
+pango_ot_info_find_script (PangoOTInfo *info,
+                           PangoOTTableType table_type,
+                           PangoOTTag script_tag,
+                           guint *script_index);
+

pango_ot_info_find_script is deprecated and should not be used in newly-written code.

+

Finds the index of a script. If not found, tries to find the 'DFLT' +and then 'dflt' scripts and return the index of that in script_index +. +If none of those is found either, PANGO_OT_NO_SCRIPT is placed in +script_index +.

+

All other functions taking an input script_index parameter know +how to handle PANGO_OT_NO_SCRIPT, so one can ignore the return +value of this function completely and proceed, to enjoy the automatic +fallback to the 'DFLT'/'dflt' script.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 

script_tag

the tag of the script to find.

 

script_index

location to store the index of the +script, or NULL.

[out][optional]
+
+
+

Returns

+

TRUE if the script was found.

+
+
+
+
+

pango_ot_info_find_language ()

+
gboolean
+pango_ot_info_find_language (PangoOTInfo *info,
+                             PangoOTTableType table_type,
+                             guint script_index,
+                             PangoOTTag language_tag,
+                             guint *language_index,
+                             guint *required_feature_index);
+

pango_ot_info_find_language is deprecated and should not be used in newly-written code.

+

Finds the index of a language and its required feature index. +If the language is not found, sets language_index + to +PANGO_OT_DEFAULT_LANGUAGE and the required feature of the default language +system is returned in required_feature_index. For best compatibility with +some fonts, also searches the language system tag 'dflt' before falling +back to the default language system, but that is transparent to the user. +The user can simply ignore the return value of this function to +automatically fall back to the default language system.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 

script_index

the index of the script whose languages are searched.

 

language_tag

the tag of the language to find.

 

language_index

location to store the index of +the language, or NULL.

[out][optional]

required_feature_index

location to store the +required feature index of the language, or NULL.

[out][optional]
+
+
+

Returns

+

TRUE if the language was found.

+
+
+
+
+

pango_ot_info_find_feature ()

+
gboolean
+pango_ot_info_find_feature (PangoOTInfo *info,
+                            PangoOTTableType table_type,
+                            PangoOTTag feature_tag,
+                            guint script_index,
+                            guint language_index,
+                            guint *feature_index);
+

pango_ot_info_find_feature is deprecated and should not be used in newly-written code.

+

Finds the index of a feature. If the feature is not found, sets +feature_index + to PANGO_OT_NO_FEATURE, which is safe to pass to +pango_ot_ruleset_add_feature() and similar functions.

+

In the future, this may set feature_index + to an special value that if used +in pango_ot_ruleset_add_feature() will ask Pango to synthesize the +requested feature based on Unicode properties and data. However, this +function will still return FALSE in those cases. So, users may want to +ignore the return value of this function in certain cases.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 

feature_tag

the tag of the feature to find.

 

script_index

the index of the script.

 

language_index

the index of the language whose features are searched, +or PANGO_OT_DEFAULT_LANGUAGE to use the default language of the script.

 

feature_index

location to store the index of +the feature, or NULL.

[out][optional]
+
+
+

Returns

+

TRUE if the feature was found.

+
+
+
+
+

pango_ot_info_list_scripts ()

+
PangoOTTag *
+pango_ot_info_list_scripts (PangoOTInfo *info,
+                            PangoOTTableType table_type);
+

pango_ot_info_list_scripts is deprecated and should not be used in newly-written code.

+

Obtains the list of available scripts.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 
+
+
+

Returns

+

a newly-allocated zero-terminated array containing the tags of the +available scripts. Should be freed using g_free().

+
+
+
+
+

pango_ot_info_list_languages ()

+
PangoOTTag *
+pango_ot_info_list_languages (PangoOTInfo *info,
+                              PangoOTTableType table_type,
+                              guint script_index,
+                              PangoOTTag language_tag);
+

pango_ot_info_list_languages is deprecated and should not be used in newly-written code.

+

Obtains the list of available languages for a given script.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 

script_index

the index of the script to list languages for.

 

language_tag

unused parameter.

 
+
+
+

Returns

+

a newly-allocated zero-terminated array containing the tags of the +available languages. Should be freed using g_free().

+
+
+
+
+

pango_ot_info_list_features ()

+
PangoOTTag *
+pango_ot_info_list_features (PangoOTInfo *info,
+                             PangoOTTableType table_type,
+                             PangoOTTag tag,
+                             guint script_index,
+                             guint language_index);
+

pango_ot_info_list_features is deprecated and should not be used in newly-written code.

+

Obtains the list of features for the given language of the given script.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

table_type

the table type to obtain information about.

 

tag

unused parameter.

 

script_index

the index of the script to obtain information about.

 

language_index

the index of the language to list features for, or +PANGO_OT_DEFAULT_LANGUAGE, to list features for the default +language of the script.

 
+
+
+

Returns

+

a newly-allocated zero-terminated array containing the tags of the +available features. Should be freed using g_free().

+
+
+
+
+

pango_ot_buffer_new ()

+
PangoOTBuffer *
+pango_ot_buffer_new (PangoFcFont *font);
+

pango_ot_buffer_new is deprecated and should not be used in newly-written code.

+

Creates a new PangoOTBuffer for the given OpenType font.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFcFont

 
+
+
+

Returns

+

the newly allocated PangoOTBuffer, which should +be freed with pango_ot_buffer_destroy().

+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_destroy ()

+
void
+pango_ot_buffer_destroy (PangoOTBuffer *buffer);
+

pango_ot_buffer_destroy is deprecated and should not be used in newly-written code.

+

Destroys a PangoOTBuffer and free all associated memory.

+
+

Parameters

+
+++++ + + + + + +

buffer

a PangoOTBuffer

 
+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_clear ()

+
void
+pango_ot_buffer_clear (PangoOTBuffer *buffer);
+

pango_ot_buffer_clear is deprecated and should not be used in newly-written code.

+

Empties a PangoOTBuffer, make it ready to add glyphs to.

+
+

Parameters

+
+++++ + + + + + +

buffer

a PangoOTBuffer

 
+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_add_glyph ()

+
void
+pango_ot_buffer_add_glyph (PangoOTBuffer *buffer,
+                           guint glyph,
+                           guint properties,
+                           guint cluster);
+

pango_ot_buffer_add_glyph is deprecated and should not be used in newly-written code.

+

Appends a glyph to a PangoOTBuffer, with properties + identifying which +features should be applied on this glyph. See pango_ot_ruleset_add_feature().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

buffer

a PangoOTBuffer

 

glyph

the glyph index to add, like a PangoGlyph

 

properties

the glyph properties

 

cluster

the cluster that this glyph belongs to

 
+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_set_rtl ()

+
void
+pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
+                         gboolean rtl);
+

pango_ot_buffer_set_rtl is deprecated and should not be used in newly-written code.

+

Sets whether glyphs will be rendered right-to-left. This setting +is needed for proper horizontal positioning of right-to-left scripts.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buffer

a PangoOTBuffer

 

rtl

TRUE for right-to-left text

 
+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_set_zero_width_marks ()

+
void
+pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
+                                      gboolean zero_width_marks);
+

pango_ot_buffer_set_zero_width_marks is deprecated and should not be used in newly-written code.

+

Sets whether characters with a mark class should be forced to zero width. +This setting is needed for proper positioning of Arabic accents, +but will produce incorrect results with standard OpenType Indic +fonts.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buffer

a PangoOTBuffer

 

zero_width_marks

TRUE if characters with a mark class should +be forced to zero width.

 
+
+

Since: 1.6

+
+
+
+

pango_ot_buffer_get_glyphs ()

+
void
+pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer,
+                            PangoOTGlyph **glyphs,
+                            int *n_glyphs);
+

pango_ot_buffer_get_glyphs is deprecated and should not be used in newly-written code.

+

Gets the glyph array contained in a PangoOTBuffer. The glyphs are +owned by the buffer and should not be freed, and are only valid as long +as buffer is not modified.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buffer

a PangoOTBuffer

 

glyphs

location to +store the array of glyphs, or NULL.

[array length=n_glyphs][out][optional]

n_glyphs

location to store the number of +glyphs, or NULL.

[out][optional]
+
+

Since: 1.4

+
+
+
+

pango_ot_buffer_output ()

+
void
+pango_ot_buffer_output (const PangoOTBuffer *buffer,
+                        PangoGlyphString *glyphs);
+

pango_ot_buffer_output is deprecated and should not be used in newly-written code.

+

Exports the glyphs in a PangoOTBuffer into a PangoGlyphString. This is +typically used after the OpenType layout processing is over, to convert the +resulting glyphs into a generic Pango glyph string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

buffer

a PangoOTBuffer

 

glyphs

a PangoGlyphString

 
+
+

Since: 1.4

+
+
+
+

pango_ot_ruleset_get_for_description ()

+
const PangoOTRuleset *
+pango_ot_ruleset_get_for_description (PangoOTInfo *info,
+                                      const PangoOTRulesetDescription *desc);
+

pango_ot_ruleset_get_for_description is deprecated and should not be used in newly-written code.

+

Returns a ruleset for the given OpenType info and ruleset +description. Rulesets are created on demand using +pango_ot_ruleset_new_from_description(). +The returned ruleset should not be modified or destroyed.

+

The static feature map members of desc + should be alive as +long as info + is.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

info

a PangoOTInfo.

 

desc

a PangoOTRulesetDescription.

 
+
+
+

Returns

+

the PangoOTRuleset for desc +. This object will have +the same lifetime as info +.

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_new ()

+
PangoOTRuleset *
+pango_ot_ruleset_new (PangoOTInfo *info);
+

pango_ot_ruleset_new is deprecated and should not be used in newly-written code.

+

Creates a new PangoOTRuleset for the given OpenType info.

+
+

Parameters

+
+++++ + + + + + +

info

a PangoOTInfo.

 
+
+
+

Returns

+

the newly allocated PangoOTRuleset, which +should be freed with g_object_unref().

+
+
+
+
+

pango_ot_ruleset_new_for ()

+
PangoOTRuleset *
+pango_ot_ruleset_new_for (PangoOTInfo *info,
+                          PangoScript script,
+                          PangoLanguage *language);
+

pango_ot_ruleset_new_for is deprecated and should not be used in newly-written code.

+

Creates a new PangoOTRuleset for the given OpenType info, script, and +language.

+

This function is part of a convenience scheme that highly simplifies +using a PangoOTRuleset to represent features for a specific pair of script +and language. So one can use this function passing in the script and +language of interest, and later try to add features to the ruleset by just +specifying the feature name or tag, without having to deal with finding +script, language, or feature indices manually.

+

In excess to what pango_ot_ruleset_new() does, this function will:

+
+

Because of the way return values of pango_ot_info_find_script() and +pango_ot_info_find_language() are ignored, this function automatically +finds and uses the 'DFLT' script and the default language-system.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

info

a PangoOTInfo.

 

script

a PangoScript.

 

language

a PangoLanguage.

 
+
+
+

Returns

+

the newly allocated PangoOTRuleset, which +should be freed with g_object_unref().

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_new_from_description ()

+
PangoOTRuleset *
+pango_ot_ruleset_new_from_description (PangoOTInfo *info,
+                                       const PangoOTRulesetDescription *desc);
+

pango_ot_ruleset_new_from_description is deprecated and should not be used in newly-written code.

+

Creates a new PangoOTRuleset for the given OpenType infor and +matching the given ruleset description.

+

This is a convenience function that calls pango_ot_ruleset_new_for() and +adds the static GSUB/GPOS features to the resulting ruleset, followed by +adding other features to both GSUB and GPOS.

+

The static feature map members of desc + should be alive as +long as info + is.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

info

a PangoOTInfo.

 

desc

a PangoOTRulesetDescription.

 
+
+
+

Returns

+

the newly allocated PangoOTRuleset, which +should be freed with g_object_unref().

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_add_feature ()

+
void
+pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,
+                              PangoOTTableType table_type,
+                              guint feature_index,
+                              gulong property_bit);
+

pango_ot_ruleset_add_feature is deprecated and should not be used in newly-written code.

+

Adds a feature to the ruleset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

table_type

the table type to add a feature to.

 

feature_index

the index of the feature to add.

 

property_bit

the property bit to use for this feature. Used to identify +the glyphs that this feature should be applied to, or +PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs.

 
+
+
+
+
+

pango_ot_ruleset_maybe_add_feature ()

+
gboolean
+pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset,
+                                    PangoOTTableType table_type,
+                                    PangoOTTag feature_tag,
+                                    gulong property_bit);
+

pango_ot_ruleset_maybe_add_feature is deprecated and should not be used in newly-written code.

+

This is a convenience function that first tries to find the feature +using pango_ot_info_find_feature() and the ruleset script and language +passed to pango_ot_ruleset_new_for(), +and if the feature is found, adds it to the ruleset.

+

If ruleset + was not created using pango_ot_ruleset_new_for(), this function +does nothing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

table_type

the table type to add a feature to.

 

feature_tag

the tag of the feature to add.

 

property_bit

the property bit to use for this feature. Used to identify +the glyphs that this feature should be applied to, or +PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs.

 
+
+
+

Returns

+

TRUE if the feature was found and added to ruleset, +FALSE otherwise.

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_maybe_add_features ()

+
guint
+pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset,
+                                     PangoOTTableType table_type,
+                                     const PangoOTFeatureMap *features,
+                                     guint n_features);
+

pango_ot_ruleset_maybe_add_features is deprecated and should not be used in newly-written code.

+

This is a convenience function that +for each feature in the feature map array features + +converts the feature name to a PangoOTTag feature tag using PANGO_OT_TAG_MAKE() +and calls pango_ot_ruleset_maybe_add_feature() on it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

table_type

the table type to add features to.

 

features

array of feature name and property bits to add.

 

n_features

number of feature records in features +array.

 
+
+
+

Returns

+

The number of features in features +that were found +and added to ruleset +.

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_get_feature_count ()

+
guint
+pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset,
+                                    guint *n_gsub_features,
+                                    guint *n_gpos_features);
+

pango_ot_ruleset_get_feature_count is deprecated and should not be used in newly-written code.

+

Gets the number of GSUB and GPOS features in the ruleset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

n_gsub_features

location to store number of +GSUB features, or NULL.

[out][optional]

n_gpos_features

location to store number of +GPOS features, or NULL.

[out][optional]
+
+
+

Returns

+

Total number of features in the ruleset +.

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_substitute ()

+
void
+pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset,
+                             PangoOTBuffer *buffer);
+

pango_ot_ruleset_substitute is deprecated and should not be used in newly-written code.

+

Performs the OpenType GSUB substitution on buffer + using the features +in ruleset +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

buffer

a PangoOTBuffer.

 
+
+

Since: 1.4

+
+
+
+

pango_ot_ruleset_position ()

+
void
+pango_ot_ruleset_position (const PangoOTRuleset *ruleset,
+                           PangoOTBuffer *buffer);
+

pango_ot_ruleset_position is deprecated and should not be used in newly-written code.

+

Performs the OpenType GPOS positioning on buffer + using the features +in ruleset +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ruleset

a PangoOTRuleset.

 

buffer

a PangoOTBuffer.

 
+
+

Since: 1.4

+
+
+
+

pango_ot_ruleset_description_copy ()

+
PangoOTRulesetDescription *
+pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc);
+

pango_ot_ruleset_description_copy is deprecated and should not be used in newly-written code.

+

Creates a copy of desc +, which should be freed with +pango_ot_ruleset_description_free(). Primarily used internally +by pango_ot_ruleset_get_for_description() to cache rulesets for +ruleset descriptions.

+
+

Parameters

+
+++++ + + + + + +

desc

ruleset description to copy

 
+
+
+

Returns

+

the newly allocated PangoOTRulesetDescription, which +should be freed with pango_ot_ruleset_description_free().

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_description_equal ()

+
gboolean
+pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1,
+                                    const PangoOTRulesetDescription *desc2);
+

pango_ot_ruleset_description_equal is deprecated and should not be used in newly-written code.

+

Compares two ruleset descriptions for equality. +Two ruleset descriptions are considered equal if the rulesets +they describe are provably identical. This means that their +script, language, and all feature sets should be equal. For static feature +sets, the array addresses are compared directly, while for other +features, the list of features is compared one by one. +(Two ruleset descriptions may result in identical rulesets +being created, but still compare FALSE.)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

desc1

a ruleset description

 

desc2

a ruleset description

 
+
+
+

Returns

+

TRUE if two ruleset descriptions are identical, +FALSE otherwise.

+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_description_free ()

+
void
+pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc);
+

pango_ot_ruleset_description_free is deprecated and should not be used in newly-written code.

+

Frees a ruleset description allocated by +pango_ot_ruleset_description_copy().

+
+

Parameters

+
+++++ + + + + + +

desc

an allocated PangoOTRulesetDescription

 
+
+

Since: 1.18

+
+
+
+

pango_ot_ruleset_description_hash ()

+
guint
+pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc);
+

pango_ot_ruleset_description_hash is deprecated and should not be used in newly-written code.

+

Computes a hash of a PangoOTRulesetDescription structure suitable +to be used, for example, as an argument to g_hash_table_new().

+
+

Parameters

+
+++++ + + + + + +

desc

a ruleset description

 
+
+
+

Returns

+

the hash value.

+
+

Since: 1.18

+
+
+
+

pango_ot_tag_from_language ()

+
PangoOTTag
+pango_ot_tag_from_language (PangoLanguage *language);
+

pango_ot_tag_from_language is deprecated and should not be used in newly-written code.

+

Finds the OpenType language-system tag best describing language +.

+
+

Parameters

+
+++++ + + + + + +

language

A PangoLanguage, or NULL.

[nullable]
+
+
+

Returns

+

PangoOTTag best matching language +or +PANGO_OT_TAG_DEFAULT_LANGUAGE if none found or if language +is NULL.

+
+

Since: 1.18

+
+
+
+

pango_ot_tag_from_script ()

+
PangoOTTag
+pango_ot_tag_from_script (PangoScript script);
+

pango_ot_tag_from_script is deprecated and should not be used in newly-written code.

+

Finds the OpenType script tag corresponding to script +.

+

The PANGO_SCRIPT_COMMON, PANGO_SCRIPT_INHERITED, and +PANGO_SCRIPT_UNKNOWN scripts are mapped to the OpenType +'DFLT' script tag that is also defined as +PANGO_OT_TAG_DEFAULT_SCRIPT.

+

Note that multiple PangoScript values may map to the same +OpenType script tag. In particular, PANGO_SCRIPT_HIRAGANA +and PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'.

+
+

Parameters

+
+++++ + + + + + +

script

A PangoScript

 
+
+
+

Returns

+

PangoOTTag corresponding to script +or +PANGO_OT_TAG_DEFAULT_SCRIPT if none found.

+
+

Since: 1.18

+
+
+
+

pango_ot_tag_to_language ()

+
PangoLanguage *
+pango_ot_tag_to_language (PangoOTTag language_tag);
+

pango_ot_tag_to_language is deprecated and should not be used in newly-written code.

+

Finds a PangoLanguage corresponding to language_tag +.

+
+

Parameters

+
+++++ + + + + + +

language_tag

A PangoOTTag OpenType language-system tag

 
+
+
+

Returns

+

PangoLanguage best matching language_tag +or +PangoLanguage corresponding to the string "xx" if none found.

+
+

Since: 1.18

+
+
+
+

pango_ot_tag_to_script ()

+
PangoScript
+pango_ot_tag_to_script (PangoOTTag script_tag);
+

pango_ot_tag_to_script is deprecated and should not be used in newly-written code.

+

Finds the PangoScript corresponding to script_tag +.

+

The 'DFLT' script tag is mapped to PANGO_SCRIPT_COMMON.

+

Note that an OpenType script tag may correspond to multiple +PangoScript values. In such cases, the PangoScript value +with the smallest value is returned. +In particular, PANGO_SCRIPT_HIRAGANA +and PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'. +This function will return PANGO_SCRIPT_HIRAGANA for +'kana'.

+
+

Parameters

+
+++++ + + + + + +

script_tag

A PangoOTTag OpenType script tag

 
+
+
+

Returns

+

PangoScript corresponding to script_tag +or +PANGO_SCRIPT_UNKNOWN if none found.

+
+

Since: 1.18

+
+
+
+

Types and Values

+
+

PangoOTTag

+
typedef guint32 PangoOTTag;
+
+

The PangoOTTag typedef is used to represent TrueType and OpenType +four letter tags inside Pango. Use PANGO_OT_TAG_MAKE() +or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create PangoOTTags manually.

+
+
+
+

PangoOTInfo

+
typedef struct _PangoOTInfo PangoOTInfo;
+

The PangoOTInfo struct contains the various +tables associated with an OpenType font. It contains only private fields and +should only be accessed via the pango_ot_info_* functions +which are documented below. To obtain a PangoOTInfo, +use pango_ot_info_get().

+
+
+
+

PangoOTBuffer

+
typedef struct _PangoOTBuffer PangoOTBuffer;
+

The PangoOTBuffer structure is used to store strings of glyphs associated +with a PangoFcFont, suitable for OpenType layout processing. It contains +only private fields and should only be accessed via the +pango_ot_buffer_* functions which are documented below. +To obtain a PangoOTBuffer, use pango_ot_buffer_new().

+
+
+
+

struct PangoOTGlyph

+
struct PangoOTGlyph {
+  guint32  glyph;
+  guint    properties;
+  guint    cluster;
+  gushort  component;
+  gushort  ligID;
+
+  guint    internal;
+};
+
+

The PangoOTGlyph structure represents a single glyph together with +information used for OpenType layout processing of the glyph. +It contains the following fields.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

guint32 glyph;

the glyph itself.

 

guint properties;

the properties value, identifying which features should be +applied on this glyph. See pango_ot_ruleset_add_feature().

 

guint cluster;

the cluster that this glyph belongs to.

 

gushort component;

a component value, set by the OpenType layout engine.

 

gushort ligID;

a ligature index value, set by the OpenType layout engine.

 

guint internal;

for Pango internal use

 
+
+
+
+
+

PangoOTRuleset

+
typedef struct _PangoOTRuleset PangoOTRuleset;
+

The PangoOTRuleset structure holds a +set of features selected from the tables in an OpenType font. +(A feature is an operation such as adjusting glyph positioning +that should be applied to a text feature such as a certain +type of accent.) A PangoOTRuleset +is created with pango_ot_ruleset_new(), features are added +to it with pango_ot_ruleset_add_feature(), then it is +applied to a PangoGlyphString with pango_ot_ruleset_shape().

+
+
+
+

struct PangoOTRulesetDescription

+
struct PangoOTRulesetDescription {
+  PangoScript               script;
+  PangoLanguage            *language;
+  const PangoOTFeatureMap  *static_gsub_features;
+  guint                   n_static_gsub_features;
+  const PangoOTFeatureMap  *static_gpos_features;
+  guint                   n_static_gpos_features;
+  const PangoOTFeatureMap  *other_features;
+  guint                   n_other_features;
+};
+
+

The PangoOTRuleset structure holds all the information needed +to build a complete PangoOTRuleset from an OpenType font. +The main use of this struct is to act as the key for a per-font +hash of rulesets. The user populates a ruleset description and +gets the ruleset using pango_ot_ruleset_get_for_description() +or create a new one using pango_ot_ruleset_new_from_description().

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PangoScript script;

a PangoScript.

 

PangoLanguage *language;

a PangoLanguage.

 

const PangoOTFeatureMap *static_gsub_features;

static map of GSUB features, +or NULL.

[nullable]

guint n_static_gsub_features;

length of static_gsub_features +, or 0.

 

const PangoOTFeatureMap *static_gpos_features;

static map of GPOS features, +or NULL.

[nullable]

guint n_static_gpos_features;

length of static_gpos_features +, or 0.

 

const PangoOTFeatureMap *other_features;

map of extra features to add to both +GSUB and GPOS, or NULL. Unlike the static maps, this pointer +need not live beyond the life of function calls taking this +struct.

[nullable]

guint n_other_features;

length of other_features +, or 0.

 
+
+

Since: 1.18

+
+
+
+

enum PangoOTTableType

+

The PangoOTTableType enumeration values are used to +identify the various OpenType tables in the +pango_ot_info_* functions.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PANGO_OT_TABLE_GSUB

+

The GSUB table.

+
 

PANGO_OT_TABLE_GPOS

+

The GPOS table.

+
 
+
+
+
+
+

struct PangoOTFeatureMap

+
struct PangoOTFeatureMap {
+  char     feature_name[5];
+  gulong   property_bit;
+};
+
+

The PangoOTFeatureMap typedef is used to represent an OpenType +feature with the property bit associated with it. The feature tag is +represented as a char array instead of a PangoOTTag for convenience.

+
+

Members

+
+++++ + + + + + + + + + + + + +

char feature_name[5];

feature tag in represented as four-letter ASCII string.

 

gulong property_bit;

the property bit to use for this feature. See +pango_ot_ruleset_add_feature() for details.

 
+
+

Since: 1.18

+
+
+
+

PANGO_OT_ALL_GLYPHS

+
#define PANGO_OT_ALL_GLYPHS			((guint) 0xFFFF)
+
+

This is used as the property bit in pango_ot_ruleset_add_feature() when a +feature should be applied to all glyphs.

+

Since: 1.16

+
+
+
+

PANGO_OT_NO_FEATURE

+
#define PANGO_OT_NO_FEATURE			((guint) 0xFFFF)
+
+

This is used as a feature index that represent no feature, that is, should be +skipped. It may be returned as feature index by pango_ot_info_find_feature() +if the feature is not found, and pango_ot_ruleset_add_feature() function +automatically skips this value, so no special handling is required by the user.

+

Since: 1.18

+
+
+
+

PANGO_OT_NO_SCRIPT

+
#define PANGO_OT_NO_SCRIPT			((guint) 0xFFFF)
+
+

This is used as a script index that represent no script, that is, when the +requested script was not found, and a default ('DFLT') script was not found +either. It may be returned as script index by pango_ot_info_find_script() +if the script or a default script are not found, all other functions +taking a script index essentially return if the input script index is +this value, so no special handling is required by the user.

+

Since: 1.18

+
+
+
+

PANGO_OT_DEFAULT_LANGUAGE

+
#define PANGO_OT_DEFAULT_LANGUAGE		((guint) 0xFFFF)
+
+

This is used as the language index in pango_ot_info_find_feature() when +the default language system of the script is desired.

+

It is also returned by pango_ot_info_find_language() if the requested language +is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE. +The end result is that one can always call pango_ot_tag_from_language() +followed by pango_ot_info_find_language() and pass the result to +pango_ot_info_find_feature() without having to worry about falling back to +default language system explicitly.

+

Since: 1.16

+
+
+
+

PANGO_OT_TAG_DEFAULT_LANGUAGE

+
#define PANGO_OT_TAG_DEFAULT_LANGUAGE		PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't')
+
+

This is a PangoOTTag representing a special language tag 'dflt'. It is +returned as language tag by pango_ot_tag_from_language() if the requested +language is not found. It is safe to pass this value to +pango_ot_info_find_language() as that function falls back to returning default +language-system if the requested language tag is not found.

+

Since: 1.18

+
+
+
+

PANGO_OT_TAG_DEFAULT_SCRIPT

+
#define PANGO_OT_TAG_DEFAULT_SCRIPT		PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T')
+
+

This is a PangoOTTag representing the special script tag 'DFLT'. It is +returned as script tag by pango_ot_tag_from_script() if the requested script +is not found.

+

Since: 1.18

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Scripts-and-Languages.html b/docs/html/pango-Scripts-and-Languages.html new file mode 100644 index 0000000..46564d6 --- /dev/null +++ b/docs/html/pango-Scripts-and-Languages.html @@ -0,0 +1,1625 @@ + + + + +Scripts and Languages: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Scripts and Languages

+

Scripts and Languages — Identifying writing systems and languages

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoScript + +pango_script_for_unichar () +
+PangoLanguage * + +pango_script_get_sample_language () +
+PangoScriptIter * + +pango_script_iter_new () +
+void + +pango_script_iter_get_range () +
+gboolean + +pango_script_iter_next () +
+void + +pango_script_iter_free () +
+PangoLanguage * + +pango_language_from_string () +
const char * + +pango_language_to_string () +
+gboolean + +pango_language_matches () +
+gboolean + +pango_language_includes_script () +
const PangoScript * + +pango_language_get_scripts () +
+PangoLanguage * + +pango_language_get_default () +
const char * + +pango_language_get_sample_string () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
enumPangoScript
#definePANGO_TYPE_SCRIPT
 PangoScriptIter
 PangoLanguage
#definePANGO_TYPE_LANGUAGE
+
+
+

Object Hierarchy

+
    GBoxed
+    ╰── PangoLanguage
+    GEnum
+    ╰── PangoScript
+
+
+
+

Description

+

The functions in this section are used to identify the writing +system, or script of individual characters +and of ranges within a larger text string.

+
+
+

Functions

+
+

pango_script_for_unichar ()

+
PangoScript
+pango_script_for_unichar (gunichar ch);
+

Looks up the PangoScript for a particular character (as defined by +Unicode Standard Annex #24). No check is made for ch + being a +valid Unicode character; if you pass in invalid character, the +result is undefined.

+

As of Pango 1.18, this function simply returns the return value of +g_unichar_get_script().

+
+

Parameters

+
+++++ + + + + + +

ch

a Unicode character

 
+
+
+

Returns

+

the PangoScript for the character.

+
+

Since: 1.4

+
+
+
+

pango_script_get_sample_language ()

+
PangoLanguage *
+pango_script_get_sample_language (PangoScript script);
+

Given a script, finds a language tag that is reasonably +representative of that script. This will usually be the +most widely spoken or used language written in that script: +for instance, the sample language for PANGO_SCRIPT_CYRILLIC +is ru (Russian), the sample language +for PANGO_SCRIPT_ARABIC is ar.

+

For some +scripts, no sample language will be returned because there +is no language that is sufficiently representative. The best +example of this is PANGO_SCRIPT_HAN, where various different +variants of written Chinese, Japanese, and Korean all use +significantly different sets of Han characters and forms +of shared characters. No sample language can be provided +for many historical scripts as well.

+

As of 1.18, this function checks the environment variables +PANGO_LANGUAGE and LANGUAGE (checked in that order) first. +If one of them is set, it is parsed as a list of language tags +separated by colons or other separators. This function +will return the first language in the parsed list that Pango +believes may use script + for writing. This last predicate +is tested using pango_language_includes_script(). This can +be used to control Pango's font selection for non-primary +languages. For example, a PANGO_LANGUAGE enviroment variable +set to "en:fa" makes Pango choose fonts suitable for Persian (fa) +instead of Arabic (ar) when a segment of Arabic text is found +in an otherwise non-Arabic text. The same trick can be used to +choose a default language for PANGO_SCRIPT_HAN when setting +context language is not feasible.

+
+

Parameters

+
+++++ + + + + + +

script

a PangoScript

 
+
+
+

Returns

+

a PangoLanguage that is representative +of the script, or NULL if no such language exists.

+

[nullable]

+
+

Since: 1.4

+
+
+
+

pango_script_iter_new ()

+
PangoScriptIter *
+pango_script_iter_new (const char *text,
+                       int length);
+

Create a new PangoScriptIter, used to break a string of +Unicode text into runs by Unicode script. No copy is made of +text +, so the caller needs to make sure it remains valid until +the iterator is freed with pango_script_iter_free().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

text

a UTF-8 string

 

length

length of text +, or -1 if text +is nul-terminated.

 
+
+
+

Returns

+

the new script iterator, initialized +to point at the first range in the text, which should be +freed with pango_script_iter_free(). If the string is +empty, it will point at an empty range.

+
+

Since: 1.4

+
+
+
+

pango_script_iter_get_range ()

+
void
+pango_script_iter_get_range (PangoScriptIter *iter,
+                             const char **start,
+                             const char **end,
+                             PangoScript *script);
+

Gets information about the range to which iter + currently points. +The range is the set of locations p where *start <= p < *end. +(That is, it doesn't include the character stored at *end)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

iter

a PangoScriptIter

 

start

location to store start position of the range, or NULL.

[out][allow-none]

end

location to store end position of the range, or NULL.

[out][allow-none]

script

location to store script for range, or NULL.

[out][allow-none]
+
+

Since: 1.4

+
+
+
+

pango_script_iter_next ()

+
gboolean
+pango_script_iter_next (PangoScriptIter *iter);
+

Advances a PangoScriptIter to the next range. If iter + +is already at the end, it is left unchanged and FALSE +is returned.

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoScriptIter

 
+
+
+

Returns

+

TRUE if iter +was successfully advanced.

+
+

Since: 1.4

+
+
+
+

pango_script_iter_free ()

+
void
+pango_script_iter_free (PangoScriptIter *iter);
+

Frees a PangoScriptIter created with pango_script_iter_new().

+
+

Parameters

+
+++++ + + + + + +

iter

a PangoScriptIter

 
+
+

Since: 1.4

+
+
+
+

pango_language_from_string ()

+
PangoLanguage *
+pango_language_from_string (const char *language);
+

Take a RFC-3066 format language tag as a string and convert it to a +PangoLanguage pointer that can be efficiently copied (copy the +pointer) and compared with other language tags (compare the +pointer.)

+

This function first canonicalizes the string by converting it to +lowercase, mapping '_' to '-', and stripping all characters other +than letters and '-'.

+

Use pango_language_get_default() if you want to get the PangoLanguage for +the current locale of the process.

+
+

Parameters

+
+++++ + + + + + +

language

a string representing a language tag, or NULL.

[allow-none]
+
+
+

Returns

+

an opaque pointer to a +PangoLanguage structure, or NULL if language +was +NULL. The returned pointer will be valid forever +after, and should not be freed.

+

[transfer none][nullable]

+
+
+
+
+

pango_language_to_string ()

+
const char *
+pango_language_to_string (PangoLanguage *language);
+

Gets the RFC-3066 format string representing the given language tag.

+
+

Parameters

+
+++++ + + + + + +

language

a language tag.

 
+
+
+

Returns

+

a string representing the language tag. This is owned by +Pango and should not be freed.

+
+
+
+
+

pango_language_matches ()

+
gboolean
+pango_language_matches (PangoLanguage *language,
+                        const char *range_list);
+

Checks if a language tag matches one of the elements in a list of +language ranges. A language tag is considered to match a range +in the list if the range is '*', the range is exactly the tag, +or the range is a prefix of the tag, and the character after it +in the tag is '-'.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

language

a language tag (see pango_language_from_string()), +NULL is allowed and matches nothing but '*'.

[nullable]

range_list

a list of language ranges, separated by ';', ':', +',', or space characters. +Each element must either be '*', or a RFC 3066 language range +canonicalized as by pango_language_from_string()

 
+
+
+

Returns

+

TRUE if a match was found.

+
+
+
+
+

pango_language_includes_script ()

+
gboolean
+pango_language_includes_script (PangoLanguage *language,
+                                PangoScript script);
+

Determines if script + is one of the scripts used to +write language +. The returned value is conservative; +if nothing is known about the language tag language +, +TRUE will be returned, since, as far as Pango knows, +script + might be used to write language +.

+

This routine is used in Pango's itemization process when +determining if a supplied language tag is relevant to +a particular section of text. It probably is not useful for +applications in most circumstances.

+

This function uses pango_language_get_scripts() internally.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

language

a PangoLanguage, or NULL.

[nullable]

script

a PangoScript

 
+
+
+

Returns

+

TRUE if script +is one of the scripts used +to write language +or if nothing is known about language +(including the case that language +is NULL), +FALSE otherwise.

+
+

Since: 1.4

+
+
+
+

pango_language_get_scripts ()

+
const PangoScript *
+pango_language_get_scripts (PangoLanguage *language,
+                            int *num_scripts);
+

Determines the scripts used to to write language +. +If nothing is known about the language tag language +, +or if language + is NULL, then NULL is returned. +The list of scripts returned starts with the script that the +language uses most and continues to the one it uses least.

+

The value num_script + points at will be set to the number +of scripts in the returned array (or zero if NULL is returned).

+

Most languages use only one script for writing, but there are +some that use two (Latin and Cyrillic for example), and a few +use three (Japanese for example). Applications should not make +any assumptions on the maximum number of scripts returned +though, except that it is positive if the return value is not +NULL, and it is a small number.

+

The pango_language_includes_script() function uses this function +internally.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

language

a PangoLanguage, or NULL.

[allow-none]

num_scripts

location to return number of scripts, +or NULL.

[out caller-allocates][allow-none]
+
+
+

Returns

+

An array of +PangoScript values, with the number of entries in the array stored +in num_scripts +, or NULL if Pango does not have any information +about this particular language tag (also the case if language +is +NULL). The returned array is owned by Pango and should not be +modified or freed.

+

[array length=num_scripts][nullable]

+
+

Since: 1.22

+
+
+
+

pango_language_get_default ()

+
PangoLanguage *
+pango_language_get_default (void);
+

Returns the PangoLanguage for the current locale of the process. +Note that this can change over the life of an application.

+

On Unix systems, this is the return value is derived from +setlocale(LC_CTYPE, NULL), and the user can +affect this through the environment variables LC_ALL, LC_CTYPE or +LANG (checked in that order). The locale string typically is in +the form lang_COUNTRY, where lang is an ISO-639 language code, and +COUNTRY is an ISO-3166 country code. For instance, sv_FI for +Swedish as written in Finland or pt_BR for Portuguese as written in +Brazil.

+

On Windows, the C library does not use any such environment +variables, and setting them won't affect the behavior of functions +like ctime(). The user sets the locale through the Regional Options +in the Control Panel. The C library (in the setlocale() function) +does not use country and language codes, but country and language +names spelled out in English. +However, this function does check the above environment +variables, and does return a Unix-style locale string based on +either said environment variables or the thread's current locale.

+

Your application should call setlocale(LC_ALL, ""); +for the user settings to take effect. Gtk+ does this in its initialization +functions automatically (by calling gtk_set_locale()). +See man setlocale for more details.

+
+

Returns

+

the default language as a +PangoLanguage, must not be freed.

+

[transfer none]

+
+

Since: 1.16

+
+
+
+

pango_language_get_sample_string ()

+
const char *
+pango_language_get_sample_string (PangoLanguage *language);
+

Get a string that is representative of the characters needed to +render a particular language.

+

The sample text may be a pangram, but is not necessarily. It is chosen to +be demonstrative of normal text in the language, as well as exposing font +feature requirements unique to the language. It is suitable for use +as sample text in a font selection dialog.

+

If language + is NULL, the default language as found by +pango_language_get_default() is used.

+

If Pango does not have a sample string for language +, the classic +"The quick brown fox..." is returned. This can be detected by +comparing the returned pointer value to that returned for (non-existent) +language code "xx". That is, compare to:

+ + +
+

Parameters

+
+++++ + + + + + +

language

a PangoLanguage, or NULL.

[nullable]
+
+
+

Returns

+

the sample string. This value is owned by Pango +and should not be freed.

+
+
+
+
+

Types and Values

+
+

enum PangoScript

+

The PangoScript enumeration identifies different writing +systems. The values correspond to the names as defined in the +Unicode standard. +Note that new types may be added in the future. Applications should be ready +to handle unknown values. This enumeration is interchangeable with +GUnicodeScript. See Unicode Standard Annex +24: Script names.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_SCRIPT_INVALID_CODE

+

a value never returned from pango_script_for_unichar()

+
 

PANGO_SCRIPT_COMMON

+

a character used by multiple different scripts

+
 

PANGO_SCRIPT_INHERITED

+

a mark glyph that takes its script from the +base glyph to which it is attached

+
 

PANGO_SCRIPT_ARABIC

+

Arabic

+
 

PANGO_SCRIPT_ARMENIAN

+

Armenian

+
 

PANGO_SCRIPT_BENGALI

+

Bengali

+
 

PANGO_SCRIPT_BOPOMOFO

+

Bopomofo

+
 

PANGO_SCRIPT_CHEROKEE

+

Cherokee

+
 

PANGO_SCRIPT_COPTIC

+

Coptic

+
 

PANGO_SCRIPT_CYRILLIC

+

Cyrillic

+
 

PANGO_SCRIPT_DESERET

+

Deseret

+
 

PANGO_SCRIPT_DEVANAGARI

+

Devanagari

+
 

PANGO_SCRIPT_ETHIOPIC

+

Ethiopic

+
 

PANGO_SCRIPT_GEORGIAN

+

Georgian

+
 

PANGO_SCRIPT_GOTHIC

+

Gothic

+
 

PANGO_SCRIPT_GREEK

+

Greek

+
 

PANGO_SCRIPT_GUJARATI

+

Gujarati

+
 

PANGO_SCRIPT_GURMUKHI

+

Gurmukhi

+
 

PANGO_SCRIPT_HAN

+

Han

+
 

PANGO_SCRIPT_HANGUL

+

Hangul

+
 

PANGO_SCRIPT_HEBREW

+

Hebrew

+
 

PANGO_SCRIPT_HIRAGANA

+

Hiragana

+
 

PANGO_SCRIPT_KANNADA

+

Kannada

+
 

PANGO_SCRIPT_KATAKANA

+

Katakana

+
 

PANGO_SCRIPT_KHMER

+

Khmer

+
 

PANGO_SCRIPT_LAO

+

Lao

+
 

PANGO_SCRIPT_LATIN

+

Latin

+
 

PANGO_SCRIPT_MALAYALAM

+

Malayalam

+
 

PANGO_SCRIPT_MONGOLIAN

+

Mongolian

+
 

PANGO_SCRIPT_MYANMAR

+

Myanmar

+
 

PANGO_SCRIPT_OGHAM

+

Ogham

+
 

PANGO_SCRIPT_OLD_ITALIC

+

Old Italic

+
 

PANGO_SCRIPT_ORIYA

+

Oriya

+
 

PANGO_SCRIPT_RUNIC

+

Runic

+
 

PANGO_SCRIPT_SINHALA

+

Sinhala

+
 

PANGO_SCRIPT_SYRIAC

+

Syriac

+
 

PANGO_SCRIPT_TAMIL

+

Tamil

+
 

PANGO_SCRIPT_TELUGU

+

Telugu

+
 

PANGO_SCRIPT_THAANA

+

Thaana

+
 

PANGO_SCRIPT_THAI

+

Thai

+
 

PANGO_SCRIPT_TIBETAN

+

Tibetan

+
 

PANGO_SCRIPT_CANADIAN_ABORIGINAL

+

Canadian Aboriginal

+
 

PANGO_SCRIPT_YI

+

Yi

+
 

PANGO_SCRIPT_TAGALOG

+

Tagalog

+
 

PANGO_SCRIPT_HANUNOO

+

Hanunoo

+
 

PANGO_SCRIPT_BUHID

+

Buhid

+
 

PANGO_SCRIPT_TAGBANWA

+

Tagbanwa

+
 

PANGO_SCRIPT_BRAILLE

+

Braille

+
 

PANGO_SCRIPT_CYPRIOT

+

Cypriot

+
 

PANGO_SCRIPT_LIMBU

+

Limbu

+
 

PANGO_SCRIPT_OSMANYA

+

Osmanya

+
 

PANGO_SCRIPT_SHAVIAN

+

Shavian

+
 

PANGO_SCRIPT_LINEAR_B

+

Linear B

+
 

PANGO_SCRIPT_TAI_LE

+

Tai Le

+
 

PANGO_SCRIPT_UGARITIC

+

Ugaritic

+
 

PANGO_SCRIPT_NEW_TAI_LUE

+

New Tai Lue. Since 1.10

+
 

PANGO_SCRIPT_BUGINESE

+

Buginese. Since 1.10

+
 

PANGO_SCRIPT_GLAGOLITIC

+

Glagolitic. Since 1.10

+
 

PANGO_SCRIPT_TIFINAGH

+

Tifinagh. Since 1.10

+
 

PANGO_SCRIPT_SYLOTI_NAGRI

+

Syloti Nagri. Since 1.10

+
 

PANGO_SCRIPT_OLD_PERSIAN

+

Old Persian. Since 1.10

+
 

PANGO_SCRIPT_KHAROSHTHI

+

Kharoshthi. Since 1.10

+
 

PANGO_SCRIPT_UNKNOWN

+

an unassigned code point. Since 1.14

+
 

PANGO_SCRIPT_BALINESE

+

Balinese. Since 1.14

+
 

PANGO_SCRIPT_CUNEIFORM

+

Cuneiform. Since 1.14

+
 

PANGO_SCRIPT_PHOENICIAN

+

Phoenician. Since 1.14

+
 

PANGO_SCRIPT_PHAGS_PA

+

Phags-pa. Since 1.14

+
 

PANGO_SCRIPT_NKO

+

N'Ko. Since 1.14

+
 

PANGO_SCRIPT_KAYAH_LI

+

Kayah Li. Since 1.20.1

+
 

PANGO_SCRIPT_LEPCHA

+

Lepcha. Since 1.20.1

+
 

PANGO_SCRIPT_REJANG

+

Rejang. Since 1.20.1

+
 

PANGO_SCRIPT_SUNDANESE

+

Sundanese. Since 1.20.1

+
 

PANGO_SCRIPT_SAURASHTRA

+

Saurashtra. Since 1.20.1

+
 

PANGO_SCRIPT_CHAM

+

Cham. Since 1.20.1

+
 

PANGO_SCRIPT_OL_CHIKI

+

Ol Chiki. Since 1.20.1

+
 

PANGO_SCRIPT_VAI

+

Vai. Since 1.20.1

+
 

PANGO_SCRIPT_CARIAN

+

Carian. Since 1.20.1

+
 

PANGO_SCRIPT_LYCIAN

+

Lycian. Since 1.20.1

+
 

PANGO_SCRIPT_LYDIAN

+

Lydian. Since 1.20.1

+
 

PANGO_SCRIPT_BATAK

+

Batak. Since 1.32

+
 

PANGO_SCRIPT_BRAHMI

+

Brahmi. Since 1.32

+
 

PANGO_SCRIPT_MANDAIC

+

Mandaic. Since 1.32

+
 

PANGO_SCRIPT_CHAKMA

+

Chakma. Since: 1.32

+
 

PANGO_SCRIPT_MEROITIC_CURSIVE

+

Meroitic Cursive. Since: 1.32

+
 

PANGO_SCRIPT_MEROITIC_HIEROGLYPHS

+

Meroitic Hieroglyphs. Since: 1.32

+
 

PANGO_SCRIPT_MIAO

+

Miao. Since: 1.32

+
 

PANGO_SCRIPT_SHARADA

+

Sharada. Since: 1.32

+
 

PANGO_SCRIPT_SORA_SOMPENG

+

Sora Sompeng. Since: 1.32

+
 

PANGO_SCRIPT_TAKRI

+

Takri. Since: 1.32

+
 

PANGO_SCRIPT_BASSA_VAH

+

Bassa. Since: 1.40

+
 

PANGO_SCRIPT_CAUCASIAN_ALBANIAN

+

Caucasian Albanian. Since: 1.40

+
 

PANGO_SCRIPT_DUPLOYAN

+

Duployan. Since: 1.40

+
 

PANGO_SCRIPT_ELBASAN

+

Elbasan. Since: 1.40

+
 

PANGO_SCRIPT_GRANTHA

+

Grantha. Since: 1.40

+
 

PANGO_SCRIPT_KHOJKI

+

Kjohki. Since: 1.40

+
 

PANGO_SCRIPT_KHUDAWADI

+

Khudawadi, Sindhi. Since: 1.40

+
 

PANGO_SCRIPT_LINEAR_A

+

Linear A. Since: 1.40

+
 

PANGO_SCRIPT_MAHAJANI

+

Mahajani. Since: 1.40

+
 

PANGO_SCRIPT_MANICHAEAN

+

Manichaean. Since: 1.40

+
 

PANGO_SCRIPT_MENDE_KIKAKUI

+

Mende Kikakui. Since: 1.40

+
 

PANGO_SCRIPT_MODI

+

Modi. Since: 1.40

+
 

PANGO_SCRIPT_MRO

+

Mro. Since: 1.40

+
 

PANGO_SCRIPT_NABATAEAN

+

Nabataean. Since: 1.40

+
 

PANGO_SCRIPT_OLD_NORTH_ARABIAN

+

Old North Arabian. Since: 1.40

+
 

PANGO_SCRIPT_OLD_PERMIC

+

Old Permic. Since: 1.40

+
 

PANGO_SCRIPT_PAHAWH_HMONG

+

Pahawh Hmong. Since: 1.40

+
 

PANGO_SCRIPT_PALMYRENE

+

Palmyrene. Since: 1.40

+
 

PANGO_SCRIPT_PAU_CIN_HAU

+

Pau Cin Hau. Since: 1.40

+
 

PANGO_SCRIPT_PSALTER_PAHLAVI

+

Psalter Pahlavi. Since: 1.40

+
 

PANGO_SCRIPT_SIDDHAM

+

Siddham. Since: 1.40

+
 

PANGO_SCRIPT_TIRHUTA

+

Tirhuta. Since: 1.40

+
 

PANGO_SCRIPT_WARANG_CITI

+

Warang Citi. Since: 1.40

+
 

PANGO_SCRIPT_AHOM

+

Ahom. Since: 1.40

+
 

PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS

+

Anatolian Hieroglyphs. Since: 1.40

+
 

PANGO_SCRIPT_HATRAN

+

Hatran. Since: 1.40

+
 

PANGO_SCRIPT_MULTANI

+

Multani. Since: 1.40

+
 

PANGO_SCRIPT_OLD_HUNGARIAN

+

Old Hungarian. Since: 1.40

+
 

PANGO_SCRIPT_SIGNWRITING

+

Signwriting. Since: 1.40

+
 
+
+
+
+
+

PANGO_TYPE_SCRIPT

+
#define PANGO_TYPE_SCRIPT (pango_script_get_type ())
+
+
+
+
+

PangoScriptIter

+
typedef struct _PangoScriptIter PangoScriptIter;
+

A PangoScriptIter is used to iterate through a string +and identify ranges in different scripts.

+
+
+
+

PangoLanguage

+
typedef struct _PangoLanguage PangoLanguage;
+

The PangoLanguage structure is used to +represent a language.

+

PangoLanguage pointers can be efficiently +copied and compared with each other.

+
+
+
+

PANGO_TYPE_LANGUAGE

+
#define PANGO_TYPE_LANGUAGE (pango_language_get_type ())
+
+

The GObject type for PangoLanguage.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Tab-Stops.html b/docs/html/pango-Tab-Stops.html new file mode 100644 index 0000000..accc022 --- /dev/null +++ b/docs/html/pango-Tab-Stops.html @@ -0,0 +1,576 @@ + + + + +Tab Stops: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Tab Stops

+

Tab Stops — Structures for storing tab stops

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoTabArray * + +pango_tab_array_new () +
+PangoTabArray * + +pango_tab_array_new_with_positions () +
+PangoTabArray * + +pango_tab_array_copy () +
+void + +pango_tab_array_free () +
+gint + +pango_tab_array_get_size () +
+void + +pango_tab_array_resize () +
+void + +pango_tab_array_set_tab () +
+void + +pango_tab_array_get_tab () +
+void + +pango_tab_array_get_tabs () +
+gboolean + +pango_tab_array_get_positions_in_pixels () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
 PangoTabArray
#definePANGO_TYPE_TAB_ARRAY
enumPangoTabAlign
#definePANGO_TYPE_TAB_ALIGN
+
+
+

Object Hierarchy

+
    GBoxed
+    ╰── PangoTabArray
+    GEnum
+    ╰── PangoTabAlign
+
+
+
+

Description

+

Functions in this section are used to deal with PangoTabArray objects +that can be used to set tab stop positions in a PangoLayout.

+
+
+

Functions

+
+

pango_tab_array_new ()

+
PangoTabArray *
+pango_tab_array_new (gint initial_size,
+                     gboolean positions_in_pixels);
+

Creates an array of initial_size + tab stops. Tab stops are specified in +pixel units if positions_in_pixels + is TRUE, otherwise in Pango +units. All stops are initially at position 0.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

initial_size

Initial number of tab stops to allocate, can be 0

 

positions_in_pixels

whether positions are in pixel units

 
+
+
+

Returns

+

the newly allocated PangoTabArray, which should +be freed with pango_tab_array_free().

+
+
+
+
+

pango_tab_array_new_with_positions ()

+
PangoTabArray *
+pango_tab_array_new_with_positions (gint size,
+                                    gboolean positions_in_pixels,
+                                    PangoTabAlign first_alignment,
+                                    gint first_position,
+                                    ...);
+

This is a convenience function that creates a PangoTabArray +and allows you to specify the alignment and position of each +tab stop. You must provide an alignment +and position for size + tab stops.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

size

number of tab stops in the array

 

positions_in_pixels

whether positions are in pixel units

 

first_alignment

alignment of first tab stop

 

first_position

position of first tab stop

 

...

additional alignment/position pairs

 
+
+
+

Returns

+

the newly allocated PangoTabArray, which should +be freed with pango_tab_array_free().

+
+
+
+
+

pango_tab_array_copy ()

+
PangoTabArray *
+pango_tab_array_copy (PangoTabArray *src);
+

Copies a PangoTabArray

+
+

Parameters

+
+++++ + + + + + +

src

PangoTabArray to copy

 
+
+
+

Returns

+

the newly allocated PangoTabArray, which should +be freed with pango_tab_array_free().

+
+
+
+
+

pango_tab_array_free ()

+
void
+pango_tab_array_free (PangoTabArray *tab_array);
+

Frees a tab array and associated resources.

+
+

Parameters

+
+++++ + + + + + +

tab_array

a PangoTabArray

 
+
+
+
+
+

pango_tab_array_get_size ()

+
gint
+pango_tab_array_get_size (PangoTabArray *tab_array);
+

Gets the number of tab stops in tab_array +.

+
+

Parameters

+
+++++ + + + + + +

tab_array

a PangoTabArray

 
+
+
+

Returns

+

the number of tab stops in the array.

+
+
+
+
+

pango_tab_array_resize ()

+
void
+pango_tab_array_resize (PangoTabArray *tab_array,
+                        gint new_size);
+

Resizes a tab array. You must subsequently initialize any tabs that +were added as a result of growing the array.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tab_array

a PangoTabArray

 

new_size

new size of the array

 
+
+
+
+
+

pango_tab_array_set_tab ()

+
void
+pango_tab_array_set_tab (PangoTabArray *tab_array,
+                         gint tab_index,
+                         PangoTabAlign alignment,
+                         gint location);
+

Sets the alignment and location of a tab stop. +alignment + must always be PANGO_TAB_LEFT in the current +implementation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

tab_array

a PangoTabArray

 

tab_index

the index of a tab stop

 

alignment

tab alignment

 

location

tab location in Pango units

 
+
+
+
+
+

pango_tab_array_get_tab ()

+
void
+pango_tab_array_get_tab (PangoTabArray *tab_array,
+                         gint tab_index,
+                         PangoTabAlign *alignment,
+                         gint *location);
+

Gets the alignment and position of a tab stop.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

tab_array

a PangoTabArray

 

tab_index

tab stop index

 

alignment

location to store alignment, or NULL.

[out][allow-none]

location

location to store tab position, or NULL.

[out][allow-none]
+
+
+
+
+

pango_tab_array_get_tabs ()

+
void
+pango_tab_array_get_tabs (PangoTabArray *tab_array,
+                          PangoTabAlign **alignments,
+                          gint **locations);
+

If non-NULL, alignments + and locations + are filled with allocated +arrays of length pango_tab_array_get_size(). You must free the +returned array.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

tab_array

a PangoTabArray

 

alignments

location to store an array of tab +stop alignments, or NULL.

[out][allow-none]

locations

location to store an array +of tab positions, or NULL.

[out][allow-none][array]
+
+
+
+
+

pango_tab_array_get_positions_in_pixels ()

+
gboolean
+pango_tab_array_get_positions_in_pixels
+                               (PangoTabArray *tab_array);
+

Returns TRUE if the tab positions are in pixels, FALSE if they are +in Pango units.

+
+

Parameters

+
+++++ + + + + + +

tab_array

a PangoTabArray

 
+
+
+

Returns

+

whether positions are in pixels.

+
+
+
+
+

Types and Values

+
+

PangoTabArray

+
typedef struct _PangoTabArray PangoTabArray;
+

A PangoTabArray struct contains an array +of tab stops. Each tab stop has an alignment and a position.

+
+
+
+

PANGO_TYPE_TAB_ARRAY

+
#define PANGO_TYPE_TAB_ARRAY (pango_tab_array_get_type ())
+
+

The GObject type for PangoTabArray.

+
+
+
+

enum PangoTabAlign

+

A PangoTabAlign specifies where a tab stop appears relative to the text.

+
+

Members

+
+++++ + + + + + +

PANGO_TAB_LEFT

+

the tab stop appears to the left of the text.

+
 
+
+
+
+
+

PANGO_TYPE_TAB_ALIGN

+
#define PANGO_TYPE_TAB_ALIGN (pango_tab_align_get_type ())
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Text-Attributes.html b/docs/html/pango-Text-Attributes.html new file mode 100644 index 0000000..319cdf6 --- /dev/null +++ b/docs/html/pango-Text-Attributes.html @@ -0,0 +1,3514 @@ + + + + +Text Attributes: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Text Attributes

+

Text Attributes — Font and other attributes for annotating text

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gboolean + +pango_parse_markup () +
+GMarkupParseContext * + +pango_markup_parser_new () +
+gboolean + +pango_markup_parser_finish () +
+PangoAttrType + +pango_attr_type_register () +
const char * + +pango_attr_type_get_name () +
+void + +pango_attribute_init () +
+PangoAttribute * + +pango_attribute_copy () +
+gboolean + +pango_attribute_equal () +
+void + +pango_attribute_destroy () +
+PangoAttribute * + +pango_attr_language_new () +
+PangoAttribute * + +pango_attr_family_new () +
+PangoAttribute * + +pango_attr_style_new () +
+PangoAttribute * + +pango_attr_variant_new () +
+PangoAttribute * + +pango_attr_stretch_new () +
+PangoAttribute * + +pango_attr_weight_new () +
+PangoAttribute * + +pango_attr_size_new () +
+PangoAttribute * + +pango_attr_size_new_absolute () +
+PangoAttribute * + +pango_attr_font_desc_new () +
+PangoAttribute * + +pango_attr_foreground_new () +
+PangoAttribute * + +pango_attr_background_new () +
+PangoAttribute * + +pango_attr_strikethrough_new () +
+PangoAttribute * + +pango_attr_strikethrough_color_new () +
+PangoAttribute * + +pango_attr_underline_new () +
+PangoAttribute * + +pango_attr_underline_color_new () +
+PangoAttribute * + +pango_attr_shape_new () +
+PangoAttribute * + +pango_attr_shape_new_with_data () +
+gpointer + +(*PangoAttrDataCopyFunc) () +
+PangoAttribute * + +pango_attr_scale_new () +
+PangoAttribute * + +pango_attr_rise_new () +
+PangoAttribute * + +pango_attr_letter_spacing_new () +
+PangoAttribute * + +pango_attr_fallback_new () +
+PangoAttribute * + +pango_attr_gravity_new () +
+PangoAttribute * + +pango_attr_gravity_hint_new () +
+PangoAttribute * + +pango_attr_font_features_new () +
+PangoAttribute * + +pango_attr_foreground_alpha_new () +
+PangoAttribute * + +pango_attr_background_alpha_new () +
+gboolean + +pango_color_parse () +
+PangoColor * + +pango_color_copy () +
+void + +pango_color_free () +
+gchar * + +pango_color_to_string () +
+PangoAttrList * + +pango_attr_list_new () +
+PangoAttrList * + +pango_attr_list_ref () +
+void + +pango_attr_list_unref () +
+PangoAttrList * + +pango_attr_list_copy () +
+void + +pango_attr_list_insert () +
+void + +pango_attr_list_insert_before () +
+void + +pango_attr_list_change () +
+void + +pango_attr_list_splice () +
+PangoAttrList * + +pango_attr_list_filter () +
+gboolean + +(*PangoAttrFilterFunc) () +
+PangoAttrIterator * + +pango_attr_list_get_iterator () +
+PangoAttrIterator * + +pango_attr_iterator_copy () +
+gboolean + +pango_attr_iterator_next () +
+void + +pango_attr_iterator_range () +
+PangoAttribute * + +pango_attr_iterator_get () +
+void + +pango_attr_iterator_get_font () +
+GSList * + +pango_attr_iterator_get_attrs () +
+void + +pango_attr_iterator_destroy () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
enumPangoAttrType
#definePANGO_TYPE_ATTR_TYPE
structPangoAttrClass
structPangoAttribute
#definePANGO_ATTR_INDEX_FROM_TEXT_BEGINNING
#definePANGO_ATTR_INDEX_TO_TEXT_END
structPangoAttrString
structPangoAttrLanguage
structPangoAttrColor
structPangoAttrInt
structPangoAttrFloat
structPangoAttrFontDesc
structPangoAttrShape
structPangoAttrSize
structPangoAttrFontFeatures
enumPangoUnderline
#definePANGO_TYPE_UNDERLINE
#definePANGO_SCALE_XX_SMALL
#definePANGO_SCALE_X_SMALL
#definePANGO_SCALE_SMALL
#definePANGO_SCALE_MEDIUM
#definePANGO_SCALE_LARGE
#definePANGO_SCALE_X_LARGE
#definePANGO_SCALE_XX_LARGE
structPangoColor
#definePANGO_TYPE_COLOR
 PangoAttrList
#definePANGO_TYPE_ATTR_LIST
 PangoAttrIterator
+
+
+

Object Hierarchy

+
    GBoxed
+    ├── PangoAttrList
+    ╰── PangoColor
+    GEnum
+    ├── PangoAttrType
+    ╰── PangoUnderline
+
+
+
+

Description

+

Attributed text is used in a number of places in Pango. It +is used as the input to the itemization process and also when +creating a PangoLayout. The data types and functions in +this section are used to represent and manipulate sets +of attributes applied to a portion of text.

+
+
+

Functions

+
+

pango_parse_markup ()

+
gboolean
+pango_parse_markup (const char *markup_text,
+                    int length,
+                    gunichar accel_marker,
+                    PangoAttrList **attr_list,
+                    char **text,
+                    gunichar *accel_char,
+                    GError **error);
+

Parses marked-up text (see

+markup format) to create +

a plain-text string and an attribute list.

+

If accel_marker + is nonzero, the given character will mark the +character following it as an accelerator. For example, accel_marker + +might be an ampersand or underscore. All characters marked +as an accelerator will receive a PANGO_UNDERLINE_LOW attribute, +and the first character so marked will be returned in accel_char +. +Two accel_marker + characters following each other produce a single +literal accel_marker + character.

+

To parse a stream of pango markup incrementally, use pango_markup_parser_new().

+

If any error happens, none of the output arguments are touched except +for error +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

markup_text

markup to parse (see markup format)

 

length

length of markup_text +, or -1 if nul-terminated

 

accel_marker

character that precedes an accelerator, or 0 for none

 

attr_list

address of return location for a PangoAttrList, or NULL.

[out][allow-none]

text

address of return location for text with tags stripped, or NULL.

[out][allow-none]

accel_char

address of return location for accelerator char, or NULL.

[out][allow-none]

error

address of return location for errors, or NULL

 
+
+
+

Returns

+

FALSE if error +is set, otherwise TRUE

+
+
+
+
+

pango_markup_parser_new ()

+
GMarkupParseContext *
+pango_markup_parser_new (gunichar accel_marker);
+

Parses marked-up text (see

+markup format) to create +

a plain-text string and an attribute list.

+

If accel_marker + is nonzero, the given character will mark the +character following it as an accelerator. For example, accel_marker + +might be an ampersand or underscore. All characters marked +as an accelerator will receive a PANGO_UNDERLINE_LOW attribute, +and the first character so marked will be returned in accel_char +, +when calling finish(). Two accel_marker + characters following each +other produce a single literal accel_marker + character.

+

To feed markup to the parser, use g_markup_parse_context_parse() +on the returned GMarkupParseContext. When done with feeding markup +to the parser, use pango_markup_parser_finish() to get the data out +of it, and then use g_markup_parse_context_free() to free it.

+

This function is designed for applications that read pango markup +from streams. To simply parse a string containing pango markup, +the simpler pango_parse_markup() API is recommended instead.

+
+

Parameters

+
+++++ + + + + + +

accel_marker

character that precedes an accelerator, or 0 for none

 
+
+
+

Returns

+

a GMarkupParseContext that should be +destroyed with g_markup_parse_context_free().

+

[transfer none]

+
+

Since: 1.31.0

+
+
+
+

pango_markup_parser_finish ()

+
gboolean
+pango_markup_parser_finish (GMarkupParseContext *context,
+                            PangoAttrList **attr_list,
+                            char **text,
+                            gunichar *accel_char,
+                            GError **error);
+

After feeding a pango markup parser some data with g_markup_parse_context_parse(), +use this function to get the list of pango attributes and text out of the +markup. This function will not free context +, use g_markup_parse_context_free() +to do so.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

context

A valid parse context that was returned from pango_markup_parser_new()

 

attr_list

address of return location for a PangoAttrList, or NULL.

[out][allow-none]

text

address of return location for text with tags stripped, or NULL.

[out][allow-none]

accel_char

address of return location for accelerator char, or NULL.

[out][allow-none]

error

address of return location for errors, or NULL

 
+
+
+

Returns

+

FALSE if error +is set, otherwise TRUE

+
+

Since: 1.31.0

+
+
+
+

pango_attr_type_register ()

+
PangoAttrType
+pango_attr_type_register (const gchar *name);
+

Allocate a new attribute type ID. The attribute type name can be accessed +later by using pango_attr_type_get_name().

+
+

Parameters

+
+++++ + + + + + +

name

an identifier for the type

 
+
+
+

Returns

+

the new type ID.

+
+
+
+
+

pango_attr_type_get_name ()

+
const char *
+pango_attr_type_get_name (PangoAttrType type);
+

Fetches the attribute type name passed in when registering the type using +pango_attr_type_register().

+

The returned value is an interned string (see g_intern_string() for what +that means) that should not be modified or freed.

+
+

Parameters

+
+++++ + + + + + +

type

an attribute type ID to fetch the name for

 
+
+
+

Returns

+

the type ID name (which may be NULL), or +NULL if type +is a built-in Pango attribute type or invalid.

+

[nullable]

+
+

Since: 1.22

+
+
+
+

pango_attribute_init ()

+
void
+pango_attribute_init (PangoAttribute *attr,
+                      const PangoAttrClass *klass);
+

Initializes attr +'s klass to klass +, +it's start_index to PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING +and end_index to PANGO_ATTR_INDEX_TO_TEXT_END +such that the attribute applies +to the entire text by default.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

attr

a PangoAttribute

 

klass

a PangoAttrClass

 
+
+

Since: 1.20

+
+
+
+

pango_attribute_copy ()

+
PangoAttribute *
+pango_attribute_copy (const PangoAttribute *attr);
+

Make a copy of an attribute.

+
+

Parameters

+
+++++ + + + + + +

attr

a PangoAttribute

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attribute_equal ()

+
gboolean
+pango_attribute_equal (const PangoAttribute *attr1,
+                       const PangoAttribute *attr2);
+

Compare two attributes for equality. This compares only the +actual value of the two attributes and not the ranges that the +attributes apply to.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

attr1

a PangoAttribute

 

attr2

another PangoAttribute

 
+
+
+

Returns

+

TRUE if the two attributes have the same value.

+
+
+
+
+

pango_attribute_destroy ()

+
void
+pango_attribute_destroy (PangoAttribute *attr);
+

Destroy a PangoAttribute and free all associated memory.

+
+

Parameters

+
+++++ + + + + + +

attr

a PangoAttribute.

 
+
+
+
+
+

pango_attr_language_new ()

+
PangoAttribute *
+pango_attr_language_new (PangoLanguage *language);
+

Create a new language tag attribute.

+
+

Parameters

+
+++++ + + + + + +

language

language tag

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_family_new ()

+
PangoAttribute *
+pango_attr_family_new (const char *family);
+

Create a new font family attribute.

+
+

Parameters

+
+++++ + + + + + +

family

the family or comma separated list of families

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_style_new ()

+
PangoAttribute *
+pango_attr_style_new (PangoStyle style);
+

Create a new font slant style attribute.

+
+

Parameters

+
+++++ + + + + + +

style

the slant style

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_variant_new ()

+
PangoAttribute *
+pango_attr_variant_new (PangoVariant variant);
+

Create a new font variant attribute (normal or small caps)

+
+

Parameters

+
+++++ + + + + + +

variant

the variant

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_stretch_new ()

+
PangoAttribute *
+pango_attr_stretch_new (PangoStretch stretch);
+

Create a new font stretch attribute

+
+

Parameters

+
+++++ + + + + + +

stretch

the stretch

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_weight_new ()

+
PangoAttribute *
+pango_attr_weight_new (PangoWeight weight);
+

Create a new font weight attribute.

+
+

Parameters

+
+++++ + + + + + +

weight

the weight

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_size_new ()

+
PangoAttribute *
+pango_attr_size_new (int size);
+

Create a new font-size attribute in fractional points.

+
+

Parameters

+
+++++ + + + + + +

size

the font size, in PANGO_SCALEths of a point.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_size_new_absolute ()

+
PangoAttribute *
+pango_attr_size_new_absolute (int size);
+

Create a new font-size attribute in device units.

+
+

Parameters

+
+++++ + + + + + +

size

the font size, in PANGO_SCALEths of a device unit.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, which should be +freed with pango_attribute_destroy().

+
+

Since: 1.8

+
+
+
+

pango_attr_font_desc_new ()

+
PangoAttribute *
+pango_attr_font_desc_new (const PangoFontDescription *desc);
+

Create a new font description attribute. This attribute +allows setting family, style, weight, variant, stretch, +and size simultaneously.

+
+

Parameters

+
+++++ + + + + + +

desc

the font description

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_foreground_new ()

+
PangoAttribute *
+pango_attr_foreground_new (guint16 red,
+                           guint16 green,
+                           guint16 blue);
+

Create a new foreground color attribute.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

red

the red value (ranging from 0 to 65535)

 

green

the green value

 

blue

the blue value

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_background_new ()

+
PangoAttribute *
+pango_attr_background_new (guint16 red,
+                           guint16 green,
+                           guint16 blue);
+

Create a new background color attribute.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

red

the red value (ranging from 0 to 65535)

 

green

the green value

 

blue

the blue value

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_strikethrough_new ()

+
PangoAttribute *
+pango_attr_strikethrough_new (gboolean strikethrough);
+

Create a new strike-through attribute.

+
+

Parameters

+
+++++ + + + + + +

strikethrough

TRUE if the text should be struck-through.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_strikethrough_color_new ()

+
PangoAttribute *
+pango_attr_strikethrough_color_new (guint16 red,
+                                    guint16 green,
+                                    guint16 blue);
+

Create a new strikethrough color attribute. This attribute +modifies the color of strikethrough lines. If not set, strikethrough +lines will use the foreground color.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

red

the red value (ranging from 0 to 65535)

 

green

the green value

 

blue

the blue value

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.8

+
+
+
+

pango_attr_underline_new ()

+
PangoAttribute *
+pango_attr_underline_new (PangoUnderline underline);
+

Create a new underline-style attribute.

+
+

Parameters

+
+++++ + + + + + +

underline

the underline style.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_underline_color_new ()

+
PangoAttribute *
+pango_attr_underline_color_new (guint16 red,
+                                guint16 green,
+                                guint16 blue);
+

Create a new underline color attribute. This attribute +modifies the color of underlines. If not set, underlines +will use the foreground color.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

red

the red value (ranging from 0 to 65535)

 

green

the green value

 

blue

the blue value

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.8

+
+
+
+

pango_attr_shape_new ()

+
PangoAttribute *
+pango_attr_shape_new (const PangoRectangle *ink_rect,
+                      const PangoRectangle *logical_rect);
+

Create a new shape attribute. A shape is used to impose a +particular ink and logical rectangle on the result of shaping a +particular glyph. This might be used, for instance, for +embedding a picture or a widget inside a PangoLayout.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ink_rect

ink rectangle to assign to each character

 

logical_rect

logical rectangle to assign to each character

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_shape_new_with_data ()

+
PangoAttribute *
+pango_attr_shape_new_with_data (const PangoRectangle *ink_rect,
+                                const PangoRectangle *logical_rect,
+                                gpointer data,
+                                PangoAttrDataCopyFunc copy_func,
+                                GDestroyNotify destroy_func);
+

Like pango_attr_shape_new(), but a user data pointer is also +provided; this pointer can be accessed when later +rendering the glyph.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

ink_rect

ink rectangle to assign to each character

 

logical_rect

logical rectangle to assign to each character

 

data

user data pointer

 

copy_func

function to copy data +when the +attribute is copied. If NULL, data +is simply +copied as a pointer.

[allow-none]

destroy_func

function to free data +when the +attribute is freed, or NULL.

[allow-none]
+
+
+

Returns

+

the newly allocated PangoAttribute, which should be +freed with pango_attribute_destroy().

+
+

Since: 1.8

+
+
+
+

PangoAttrDataCopyFunc ()

+
gpointer
+(*PangoAttrDataCopyFunc) (gconstpointer user_data);
+

Type of a function that can duplicate user data for an attribute.

+
+

Parameters

+
+++++ + + + + + +

user_data

user data to copy

 
+
+
+

Returns

+

new copy of user_data +.

+
+
+
+
+

pango_attr_scale_new ()

+
PangoAttribute *
+pango_attr_scale_new (double scale_factor);
+

Create a new font size scale attribute. The base font for the +affected text will have its size multiplied by scale_factor +.

+
+

Parameters

+
+++++ + + + + + +

scale_factor

factor to scale the font

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_rise_new ()

+
PangoAttribute *
+pango_attr_rise_new (int rise);
+

Create a new baseline displacement attribute.

+
+

Parameters

+
+++++ + + + + + +

rise

the amount that the text should be displaced vertically, +in Pango units. Positive values displace the text upwards.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_letter_spacing_new ()

+
PangoAttribute *
+pango_attr_letter_spacing_new (int letter_spacing);
+

Create a new letter-spacing attribute.

+
+

Parameters

+
+++++ + + + + + +

letter_spacing

amount of extra space to add between graphemes +of the text, in Pango units.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.6

+
+
+
+

pango_attr_fallback_new ()

+
PangoAttribute *
+pango_attr_fallback_new (gboolean enable_fallback);
+

Create a new font fallback attribute.

+

If fallback is disabled, characters will only be used from the +closest matching font on the system. No fallback will be done to +other fonts on the system that might contain the characters in the +text.

+
+

Parameters

+
+++++ + + + + + +

enable_fallback

TRUE if we should fall back on other fonts +for characters the active font is missing.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.4

+
+
+
+

pango_attr_gravity_new ()

+
PangoAttribute *
+pango_attr_gravity_new (PangoGravity gravity);
+

Create a new gravity attribute.

+
+

Parameters

+
+++++ + + + + + +

gravity

the gravity value; should not be PANGO_GRAVITY_AUTO.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.16

+
+
+
+

pango_attr_gravity_hint_new ()

+
PangoAttribute *
+pango_attr_gravity_hint_new (PangoGravityHint hint);
+

Create a new gravity hint attribute.

+
+

Parameters

+
+++++ + + + + + +

hint

the gravity hint value.

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.16

+
+
+
+

pango_attr_font_features_new ()

+
PangoAttribute *
+pango_attr_font_features_new (const gchar *features);
+

Create a new font features tag attribute.

+
+

Parameters

+
+++++ + + + + + +

features

a string with OpenType font features, in CSS syntax

 
+
+
+

Returns

+

the newly allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.38

+
+
+
+

pango_attr_foreground_alpha_new ()

+
PangoAttribute *
+pango_attr_foreground_alpha_new (guint16 alpha);
+

Create a new foreground alpha attribute.

+
+

Parameters

+
+++++ + + + + + +

alpha

the alpha value, between 1 and 65536

 
+
+
+

Returns

+

the new allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.38

+
+
+
+

pango_attr_background_alpha_new ()

+
PangoAttribute *
+pango_attr_background_alpha_new (guint16 alpha);
+

Create a new background alpha attribute.

+
+

Parameters

+
+++++ + + + + + +

alpha

the alpha value, between 1 and 65536

 
+
+
+

Returns

+

the new allocated PangoAttribute, +which should be freed with pango_attribute_destroy().

+

[transfer full]

+
+

Since: 1.38

+
+
+
+

pango_color_parse ()

+
gboolean
+pango_color_parse (PangoColor *color,
+                   const char *spec);
+

Fill in the fields of a color from a string specification. The +string can either one of a large set of standard names. (Taken +from the CSS specification), or it can be a hexadecimal +value in the +form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where +'r', 'g' and 'b' are hex digits of the red, green, and blue +components of the color, respectively. (White in the four +forms is '#fff' '#ffffff' '#fffffffff' and '#ffffffffffff')

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

color

a PangoColor structure in which to store the +result, or NULL.

[nullable]

spec

a string specifying the new color

 
+
+
+

Returns

+

TRUE if parsing of the specifier succeeded, +otherwise false.

+
+
+
+
+

pango_color_copy ()

+
PangoColor *
+pango_color_copy (const PangoColor *src);
+

Creates a copy of src +, which should be freed with +pango_color_free(). Primarily used by language bindings, +not that useful otherwise (since colors can just be copied +by assignment in C).

+
+

Parameters

+
+++++ + + + + + +

src

color to copy, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoColor, which +should be freed with pango_color_free(), or NULL if +src +was NULL.

+

[nullable]

+
+
+
+
+

pango_color_free ()

+
void
+pango_color_free (PangoColor *color);
+

Frees a color allocated by pango_color_copy().

+
+

Parameters

+
+++++ + + + + + +

color

an allocated PangoColor, may be NULL.

[nullable]
+
+
+
+
+

pango_color_to_string ()

+
gchar *
+pango_color_to_string (const PangoColor *color);
+

Returns a textual specification of color + in the hexadecimal form +#rrrrggggbbbb, where r, +g and b are hex digits representing +the red, green, and blue components respectively.

+
+

Parameters

+
+++++ + + + + + +

color

a PangoColor

 
+
+
+

Returns

+

a newly-allocated text string that must be freed with g_free().

+
+

Since: 1.16

+
+
+
+

pango_attr_list_new ()

+
PangoAttrList *
+pango_attr_list_new (void);
+

Create a new empty attribute list with a reference count of one.

+
+

Returns

+

the newly allocated PangoAttrList, +which should be freed with pango_attr_list_unref().

+

[transfer full]

+
+
+
+
+

pango_attr_list_ref ()

+
PangoAttrList *
+pango_attr_list_ref (PangoAttrList *list);
+

Increase the reference count of the given attribute list by one.

+
+

Parameters

+
+++++ + + + + + +

list

a PangoAttrList, may be NULL.

[nullable]
+
+
+

Returns

+

The attribute list passed in

+
+

Since: 1.10

+
+
+
+

pango_attr_list_unref ()

+
void
+pango_attr_list_unref (PangoAttrList *list);
+

Decrease the reference count of the given attribute list by one. +If the result is zero, free the attribute list and the attributes +it contains.

+
+

Parameters

+
+++++ + + + + + +

list

a PangoAttrList, may be NULL.

[nullable]
+
+
+
+
+

pango_attr_list_copy ()

+
PangoAttrList *
+pango_attr_list_copy (PangoAttrList *list);
+

Copy list + and return an identical new list.

+
+

Parameters

+
+++++ + + + + + +

list

a PangoAttrList, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoAttrList, with a +reference count of one, which should +be freed with pango_attr_list_unref(). +Returns NULL if list +was NULL.

+

[nullable]

+
+
+
+
+

pango_attr_list_insert ()

+
void
+pango_attr_list_insert (PangoAttrList *list,
+                        PangoAttribute *attr);
+

Insert the given attribute into the PangoAttrList. It will +be inserted after all other attributes with a matching +start_index +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

list

a PangoAttrList

 

attr

the attribute to insert. Ownership of this +value is assumed by the list.

[transfer full]
+
+
+
+
+

pango_attr_list_insert_before ()

+
void
+pango_attr_list_insert_before (PangoAttrList *list,
+                               PangoAttribute *attr);
+

Insert the given attribute into the PangoAttrList. It will +be inserted before all other attributes with a matching +start_index +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

list

a PangoAttrList

 

attr

the attribute to insert. Ownership of this +value is assumed by the list.

[transfer full]
+
+
+
+
+

pango_attr_list_change ()

+
void
+pango_attr_list_change (PangoAttrList *list,
+                        PangoAttribute *attr);
+

Insert the given attribute into the PangoAttrList. It will +replace any attributes of the same type on that segment +and be merged with any adjoining attributes that are identical.

+

This function is slower than pango_attr_list_insert() for +creating a attribute list in order (potentially much slower +for large lists). However, pango_attr_list_insert() is not +suitable for continually changing a set of attributes +since it never removes or combines existing attributes.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

list

a PangoAttrList

 

attr

the attribute to insert. Ownership of this +value is assumed by the list.

[transfer full]
+
+
+
+
+

pango_attr_list_splice ()

+
void
+pango_attr_list_splice (PangoAttrList *list,
+                        PangoAttrList *other,
+                        gint pos,
+                        gint len);
+

This function opens up a hole in list +, fills it in with attributes from +the left, and then merges other + on top of the hole.

+

This operation is equivalent to stretching every attribute +that applies at position pos + in list + by an amount len +, +and then calling pango_attr_list_change() with a copy +of each attribute in other + in sequence (offset in position by pos +).

+

This operation proves useful for, for instance, inserting +a pre-edit string in the middle of an edit buffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

list

a PangoAttrList

 

other

another PangoAttrList

 

pos

the position in list +at which to insert other +

 

len

the length of the spliced segment. (Note that this +must be specified since the attributes in other +may only be present at some subsection of this range)

 
+
+
+
+
+

pango_attr_list_filter ()

+
PangoAttrList *
+pango_attr_list_filter (PangoAttrList *list,
+                        PangoAttrFilterFunc func,
+                        gpointer data);
+

Given a PangoAttrList and callback function, removes any elements +of list + for which func + returns TRUE and inserts them into +a new list.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

list

a PangoAttrList

 

func

callback function; returns TRUE +if an attribute should be filtered out.

[scope call][closure data]

data

Data to be passed to func +.

[closure]
+
+
+

Returns

+

the new PangoAttrList or +NULL if no attributes of the given types were found.

+

[transfer full][nullable]

+
+

Since: 1.2

+
+
+
+

PangoAttrFilterFunc ()

+
gboolean
+(*PangoAttrFilterFunc) (PangoAttribute *attribute,
+                        gpointer user_data);
+

Type of a function filtering a list of attributes.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

attribute

a Pango attribute

 

user_data

user data passed to the function

 
+
+
+

Returns

+

TRUE if the attribute should be selected for +filtering, FALSE otherwise.

+
+
+
+
+

pango_attr_list_get_iterator ()

+
PangoAttrIterator *
+pango_attr_list_get_iterator (PangoAttrList *list);
+

Create a iterator initialized to the beginning of the list. +list + must not be modified until this iterator is freed.

+
+

Parameters

+
+++++ + + + + + +

list

a PangoAttrList

 
+
+
+

Returns

+

the newly allocated PangoAttrIterator, which should +be freed with pango_attr_iterator_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_iterator_copy ()

+
PangoAttrIterator *
+pango_attr_iterator_copy (PangoAttrIterator *iterator);
+

Copy a PangoAttrIterator

+
+

Parameters

+
+++++ + + + + + +

iterator

a PangoAttrIterator.

 
+
+
+

Returns

+

the newly allocated +PangoAttrIterator, which should be freed with +pango_attr_iterator_destroy().

+

[transfer full]

+
+
+
+
+

pango_attr_iterator_next ()

+
gboolean
+pango_attr_iterator_next (PangoAttrIterator *iterator);
+

Advance the iterator until the next change of style.

+
+

Parameters

+
+++++ + + + + + +

iterator

a PangoAttrIterator

 
+
+
+

Returns

+

FALSE if the iterator is at the end of the list, otherwise TRUE

+
+
+
+
+

pango_attr_iterator_range ()

+
void
+pango_attr_iterator_range (PangoAttrIterator *iterator,
+                           gint *start,
+                           gint *end);
+

Get the range of the current segment. Note that the +stored return values are signed, not unsigned like +the values in PangoAttribute. To deal with this API +oversight, stored return values that wouldn't fit into +a signed integer are clamped to G_MAXINT.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

iterator

a PangoAttrIterator

 

start

location to store the start of the range.

[out]

end

location to store the end of the range.

[out]
+
+
+
+
+

pango_attr_iterator_get ()

+
PangoAttribute *
+pango_attr_iterator_get (PangoAttrIterator *iterator,
+                         PangoAttrType type);
+

Find the current attribute of a particular type at the iterator +location. When multiple attributes of the same type overlap, +the attribute whose range starts closest to the current location +is used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

iterator

a PangoAttrIterator

 

type

the type of attribute to find.

 
+
+
+

Returns

+

the current attribute of the given type, +or NULL if no attribute of that type applies to the +current location.

+

[nullable]

+
+
+
+
+

pango_attr_iterator_get_font ()

+
void
+pango_attr_iterator_get_font (PangoAttrIterator *iterator,
+                              PangoFontDescription *desc,
+                              PangoLanguage **language,
+                              GSList **extra_attrs);
+

Get the font and other attributes at the current iterator position.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

iterator

a PangoAttrIterator

 

desc

a PangoFontDescription to fill in with the current values. +The family name in this structure will be set using +pango_font_description_set_family_static() using values from +an attribute in the PangoAttrList associated with the iterator, +so if you plan to keep it around, you must call: +pango_font_description_set_family (desc, pango_font_description_get_family (desc)).

 

language

if non-NULL, location to store language tag for item, or NULL +if none is found.

[allow-none]

extra_attrs

if non-NULL, +location in which to store a list of non-font +attributes at the the current position; only the highest priority +value of each attribute will be added to this list. In order +to free this value, you must call pango_attribute_destroy() on +each member.

[allow-none][element-type Pango.Attribute][transfer full]
+
+
+
+
+

pango_attr_iterator_get_attrs ()

+
GSList *
+pango_attr_iterator_get_attrs (PangoAttrIterator *iterator);
+

Gets a list of all attributes at the current position of the +iterator.

+
+

Parameters

+
+++++ + + + + + +

iterator

a PangoAttrIterator

 
+
+
+

Returns

+

a list of +all attributes for the current range. +To free this value, call pango_attribute_destroy() on +each value and g_slist_free() on the list.

+

[element-type Pango.Attribute][transfer full]

+
+

Since: 1.2

+
+
+
+

pango_attr_iterator_destroy ()

+
void
+pango_attr_iterator_destroy (PangoAttrIterator *iterator);
+

Destroy a PangoAttrIterator and free all associated memory.

+
+

Parameters

+
+++++ + + + + + +

iterator

a PangoAttrIterator.

 
+
+
+
+
+

Types and Values

+
+

enum PangoAttrType

+

The PangoAttrType +distinguishes between different types of attributes. Along with the +predefined values, it is possible to allocate additional values +for custom attributes using pango_attr_type_register(). The predefined +values are given below. The type of structure used to store the +attribute is listed in parentheses after the description.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_ATTR_INVALID

+

does not happen

+
 

PANGO_ATTR_LANGUAGE

+

language (PangoAttrLanguage)

+
 

PANGO_ATTR_FAMILY

+

font family name list (PangoAttrString)

+
 

PANGO_ATTR_STYLE

+

font slant style (PangoAttrInt)

+
 

PANGO_ATTR_WEIGHT

+

font weight (PangoAttrInt)

+
 

PANGO_ATTR_VARIANT

+

font variant (normal or small caps) (PangoAttrInt)

+
 

PANGO_ATTR_STRETCH

+

font stretch (PangoAttrInt)

+
 

PANGO_ATTR_SIZE

+

font size in points scaled by PANGO_SCALE (PangoAttrInt)

+
 

PANGO_ATTR_FONT_DESC

+

font description (PangoAttrFontDesc)

+
 

PANGO_ATTR_FOREGROUND

+

foreground color (PangoAttrColor)

+
 

PANGO_ATTR_BACKGROUND

+

background color (PangoAttrColor)

+
 

PANGO_ATTR_UNDERLINE

+

whether the text has an underline (PangoAttrInt)

+
 

PANGO_ATTR_STRIKETHROUGH

+

whether the text is struck-through (PangoAttrInt)

+
 

PANGO_ATTR_RISE

+

baseline displacement (PangoAttrInt)

+
 

PANGO_ATTR_SHAPE

+

shape (PangoAttrShape)

+
 

PANGO_ATTR_SCALE

+

font size scale factor (PangoAttrFloat)

+
 

PANGO_ATTR_FALLBACK

+

whether fallback is enabled (PangoAttrInt)

+
 

PANGO_ATTR_LETTER_SPACING

+

letter spacing (PangoAttrInt)

+
 

PANGO_ATTR_UNDERLINE_COLOR

+

underline color (PangoAttrColor)

+
 

PANGO_ATTR_STRIKETHROUGH_COLOR

+

strikethrough color (PangoAttrColor)

+
 

PANGO_ATTR_ABSOLUTE_SIZE

+

font size in pixels scaled by PANGO_SCALE (PangoAttrInt)

+
 

PANGO_ATTR_GRAVITY

+

base text gravity (PangoAttrInt)

+
 

PANGO_ATTR_GRAVITY_HINT

+

gravity hint (PangoAttrInt)

+
 

PANGO_ATTR_FONT_FEATURES

+

OpenType font features (PangoAttrString). Since 1.38

+
 

PANGO_ATTR_FOREGROUND_ALPHA

+

foreground alpha (PangoAttrInt). Since 1.38

+
 

PANGO_ATTR_BACKGROUND_ALPHA

+

background alpha (PangoAttrInt). Since 1.38

+
 
+
+
+
+
+

PANGO_TYPE_ATTR_TYPE

+
#define PANGO_TYPE_ATTR_TYPE (pango_attr_type_get_type ())
+
+
+
+
+

struct PangoAttrClass

+
struct PangoAttrClass {
+  PangoAttrType type;
+  PangoAttribute * (*copy) (const PangoAttribute *attr);
+  void             (*destroy) (PangoAttribute *attr);
+  gboolean         (*equal) (const PangoAttribute *attr1, const PangoAttribute *attr2);
+};
+
+

The PangoAttrClass structure stores the type and operations for +a particular type of attribute. The functions in this structure should +not be called directly. Instead, one should use the wrapper functions +provided for PangoAttribute.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

PangoAttrType type;

the type ID for this attribute

 

copy ()

function to duplicate an attribute of this type (see pango_attribute_copy())

 

destroy ()

function to free an attribute of this type (see pango_attribute_destroy())

 

equal ()

function to check two attributes of this type for equality (see pango_attribute_equal())

 
+
+
+
+
+

struct PangoAttribute

+
struct PangoAttribute {
+  const PangoAttrClass *klass;
+  guint start_index; /* in bytes */
+  guint end_index; /* in bytes. The character at this index is not included */
+};
+
+

The PangoAttribute structure represents the common portions of all +attributes. Particular types of attributes include this structure +as their initial portion. The common portion of the attribute holds +the range to which the value in the type-specific part of the attribute +applies and should be initialized using pango_attribute_init(). +By default an attribute will have an all-inclusive range of [0,G_MAXUINT].

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

const PangoAttrClass *klass;

the class structure holding information about the type of the attribute

 

guint start_index;

the start index of the range (in bytes).

 

guint end_index;

end index of the range (in bytes). The character at this index +is not included in the range.

 
+
+
+
+
+

PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING

+
#define PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING 0
+
+

This value can be used to set the start_index member of a PangoAttribute +such that the attribute covers from the beginning of the text.

+

Since: 1.24

+
+
+
+

PANGO_ATTR_INDEX_TO_TEXT_END

+
#define PANGO_ATTR_INDEX_TO_TEXT_END		G_MAXUINT
+
+

This value can be used to set the end_index member of a PangoAttribute +such that the attribute covers to the end of the text.

+

Since: 1.24

+
+
+
+

struct PangoAttrString

+
struct PangoAttrString {
+  PangoAttribute attr;
+  char *value;
+};
+
+

The PangoAttrString structure is used to represent attributes with +a string value.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

char *value;

the string which is the value of the attribute

 
+
+
+
+
+

struct PangoAttrLanguage

+
struct PangoAttrLanguage {
+  PangoAttribute attr;
+  PangoLanguage *value;
+};
+
+

The PangoAttrLanguage structure is used to represent attributes that +are languages.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

PangoLanguage *value;

the PangoLanguage which is the value of the attribute

 
+
+
+
+
+

struct PangoAttrColor

+
struct PangoAttrColor {
+  PangoAttribute attr;
+  PangoColor color;
+};
+
+

The PangoAttrColor structure is used to represent attributes that +are colors.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

PangoColor color;

the PangoColor which is the value of the attribute

 
+
+
+
+
+

struct PangoAttrInt

+
struct PangoAttrInt {
+  PangoAttribute attr;
+  int value;
+};
+
+

The PangoAttrInt structure is used to represent attributes with +an integer or enumeration value.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

int value;

the value of the attribute

 
+
+
+
+
+

struct PangoAttrFloat

+
struct PangoAttrFloat {
+  PangoAttribute attr;
+  double value;
+};
+
+

The PangoAttrFloat structure is used to represent attributes with +a float or double value.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

double value;

the value of the attribute

 
+
+
+
+
+

struct PangoAttrFontDesc

+
struct PangoAttrFontDesc {
+  PangoAttribute attr;
+  PangoFontDescription *desc;
+};
+
+

The PangoAttrFontDesc structure is used to store an attribute that +sets all aspects of the font description at once.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

PangoFontDescription *desc;

the font description which is the value of this attribute

 
+
+
+
+
+

struct PangoAttrShape

+
struct PangoAttrShape {
+  PangoAttribute attr;
+  PangoRectangle ink_rect;
+  PangoRectangle logical_rect;
+
+  gpointer              data;
+  PangoAttrDataCopyFunc copy_func;
+  GDestroyNotify        destroy_func;
+};
+
+

The PangoAttrShape structure is used to represent attributes which +impose shape restrictions.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

PangoRectangle ink_rect;

the ink rectangle to restrict to

 

PangoRectangle logical_rect;

the logical rectangle to restrict to

 

gpointer data;

user data set (see pango_attr_shape_new_with_data())

 

PangoAttrDataCopyFunc copy_func;

copy function for the user data

 

GDestroyNotify destroy_func;

destroy function for the user data

 
+
+
+
+
+

struct PangoAttrSize

+
struct PangoAttrSize {
+  PangoAttribute attr;
+  int size;
+  guint absolute : 1;
+};
+
+

The PangoAttrSize structure is used to represent attributes which +set font size.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

int size;

size of font, in units of 1/PANGO_SCALE of a point (for +PANGO_ATTR_SIZE) or of a device uni (for PANGO_ATTR_ABSOLUTE_SIZE)

 

guint absolute : 1;

whether the font size is in device units or points. +This field is only present for compatibility with Pango-1.8.0 +(PANGO_ATTR_ABSOLUTE_SIZE was added in 1.8.1); and always will +be FALSE for PANGO_ATTR_SIZE and TRUE for PANGO_ATTR_ABSOLUTE_SIZE.

 
+
+
+
+
+

struct PangoAttrFontFeatures

+
struct PangoAttrFontFeatures {
+  PangoAttribute attr;
+  gchar *features;
+};
+
+

The PangoAttrFontFeatures structure is used to represent OpenType +font features as an attribute.

+
+

Members

+
+++++ + + + + + + + + + + + + +

PangoAttribute attr;

the common portion of the attribute

 

gchar *features;

the featues, as a string in CSS syntax

 
+
+

Since: 1.38

+
+
+
+

enum PangoUnderline

+

The PangoUnderline enumeration is used to specify +whether text should be underlined, and if so, the type +of underlining.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_UNDERLINE_NONE

+

no underline should be drawn

+
 

PANGO_UNDERLINE_SINGLE

+

a single underline should be drawn

+
 

PANGO_UNDERLINE_DOUBLE

+

a double underline should be drawn

+
 

PANGO_UNDERLINE_LOW

+

a single underline should be drawn at a position +beneath the ink extents of the text being +underlined. This should be used only for underlining +single characters, such as for keyboard +accelerators. PANGO_UNDERLINE_SINGLE should +be used for extended portions of text.

+
 

PANGO_UNDERLINE_ERROR

+

a wavy underline should be drawn below. +This underline is typically used to indicate +an error such as a possilble mispelling; in some +cases a contrasting color may automatically +be used. This type of underlining is available since Pango 1.4.

+
 
+
+
+
+
+

PANGO_TYPE_UNDERLINE

+
#define PANGO_TYPE_UNDERLINE (pango_underline_get_type ())
+
+
+
+
+

PANGO_SCALE_XX_SMALL

+
#define PANGO_SCALE_XX_SMALL ((double)0.5787037037037)
+
+

The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).

+
+
+
+

PANGO_SCALE_X_SMALL

+
#define PANGO_SCALE_X_SMALL  ((double)0.6444444444444)
+
+

The scale factor for two shrinking steps (1 / (1.2 * 1.2)).

+
+
+
+

PANGO_SCALE_SMALL

+
#define PANGO_SCALE_SMALL    ((double)0.8333333333333)
+
+

The scale factor for one shrinking step (1 / 1.2).

+
+
+
+

PANGO_SCALE_MEDIUM

+
#define PANGO_SCALE_MEDIUM   ((double)1.0)
+
+

The scale factor for normal size (1.0).

+
+
+
+

PANGO_SCALE_LARGE

+
#define PANGO_SCALE_LARGE    ((double)1.2)
+
+

The scale factor for one magnification step (1.2).

+
+
+
+

PANGO_SCALE_X_LARGE

+
#define PANGO_SCALE_X_LARGE  ((double)1.4399999999999)
+
+

The scale factor for two magnification steps (1.2 * 1.2).

+
+
+
+

PANGO_SCALE_XX_LARGE

+
#define PANGO_SCALE_XX_LARGE ((double)1.728)
+
+

The scale factor for three magnification steps (1.2 * 1.2 * 1.2).

+
+
+
+

struct PangoColor

+
struct PangoColor {
+  guint16 red;
+  guint16 green;
+  guint16 blue;
+};
+
+

The PangoColor structure is used to +represent a color in an uncalibrated RGB color-space.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

guint16 red;

value of red component

 

guint16 green;

value of green component

 

guint16 blue;

value of blue component

 
+
+
+
+
+

PANGO_TYPE_COLOR

+
#define PANGO_TYPE_COLOR pango_color_get_type ()
+
+

The GObject type for PangoColor.

+
+
+
+

PangoAttrList

+
typedef struct _PangoAttrList PangoAttrList;
+

The PangoAttrList structure represents a list of attributes +that apply to a section of text. The attributes are, in general, +allowed to overlap in an arbitrary fashion, however, if the +attributes are manipulated only through pango_attr_list_change(), +the overlap between properties will meet stricter criteria.

+

Since the PangoAttrList structure is stored as a linear list, +it is not suitable for storing attributes for large amounts +of text. In general, you should not use a single PangoAttrList +for more than one paragraph of text.

+
+
+
+

PANGO_TYPE_ATTR_LIST

+
#define PANGO_TYPE_ATTR_LIST pango_attr_list_get_type ()
+
+

The GObject type for PangoAttrList.

+
+
+
+

PangoAttrIterator

+
typedef struct _PangoAttrIterator PangoAttrIterator;
+

The PangoAttrIterator structure is used to represent an +iterator through a PangoAttrList. A new iterator is created +with pango_attr_list_get_iterator(). Once the iterator +is created, it can be advanced through the style changes +in the text using pango_attr_iterator_next(). At each +style change, the range of the current style segment and the +attributes currently in effect can be queried.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Text-Processing.html b/docs/html/pango-Text-Processing.html new file mode 100644 index 0000000..18b9447 --- /dev/null +++ b/docs/html/pango-Text-Processing.html @@ -0,0 +1,2112 @@ + + + + +Rendering: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Rendering

+

Rendering — Functions to run the rendering pipeline

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GList * + +pango_itemize () +
+GList * + +pango_itemize_with_base_dir () +
+void + +pango_item_free () +
+PangoItem * + +pango_item_copy () +
+PangoItem * + +pango_item_new () +
+PangoItem * + +pango_item_split () +
+GList * + +pango_reorder_items () +
+PangoContext * + +pango_context_new () +
+void + +pango_context_changed () +
+guint + +pango_context_get_serial () +
+void + +pango_context_set_font_map () +
+PangoFontMap * + +pango_context_get_font_map () +
+PangoFontDescription * + +pango_context_get_font_description () +
+void + +pango_context_set_font_description () +
+PangoLanguage * + +pango_context_get_language () +
+void + +pango_context_set_language () +
+PangoDirection + +pango_context_get_base_dir () +
+void + +pango_context_set_base_dir () +
+PangoGravity + +pango_context_get_base_gravity () +
+void + +pango_context_set_base_gravity () +
+PangoGravity + +pango_context_get_gravity () +
+PangoGravityHint + +pango_context_get_gravity_hint () +
+void + +pango_context_set_gravity_hint () +
const PangoMatrix * + +pango_context_get_matrix () +
+void + +pango_context_set_matrix () +
+PangoFont * + +pango_context_load_font () +
+PangoFontset * + +pango_context_load_fontset () +
+PangoFontMetrics * + +pango_context_get_metrics () +
+void + +pango_context_list_families () +
+void + +pango_break () +
+void + +pango_get_log_attrs () +
+void + +pango_find_paragraph_boundary () +
+void + +pango_default_break () +
+void + +pango_shape () +
+void + +pango_shape_full () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 PangoContext
structPangoItem
structPangoAnalysis
#definePANGO_ANALYSIS_FLAG_CENTERED_BASELINE
#definePANGO_ANALYSIS_FLAG_IS_ELLIPSIS
#definePANGO_TYPE_DIRECTION
 PangoLogAttr
+
+
+

Object Hierarchy

+
    GBoxed
+    ╰── PangoItem
+    GObject
+    ╰── PangoContext
+
+
+
+

Description

+

The Pango rendering pipeline takes a string of +Unicode characters and converts it into glyphs. +The functions described in this section accomplish +various steps of this process.

+
+
+

Functions

+
+

pango_itemize ()

+
GList *
+pango_itemize (PangoContext *context,
+               const char *text,
+               int start_index,
+               int length,
+               PangoAttrList *attrs,
+               PangoAttrIterator *cached_iter);
+

Breaks a piece of text into segments with consistent +directional level and shaping engine. Each byte of text + will +be contained in exactly one of the items in the returned list; +the generated list of items will be in logical order (the start +offsets of the items are ascending).

+

cached_iter + should be an iterator over attrs + currently positioned at a +range before or containing start_index +; cached_iter + will be advanced to +the range covering the position just after start_index + + length +. +(i.e. if itemizing in a loop, just keep passing in the same cached_iter +).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

context

a structure holding information that affects +the itemization process.

 

text

the text to itemize.

 

start_index

first byte in text +to process

 

length

the number of bytes (not characters) to process +after start_index +. +This must be >= 0.

 

attrs

the set of attributes that apply to text +.

 

cached_iter

Cached attribute iterator, or NULL.

[allow-none]
+
+
+

Returns

+

a GList of PangoItem +structures. The items should be freed using pango_item_free() +probably in combination with g_list_foreach(), and the list itself +using g_list_free().

+

[transfer full][element-type Pango.Item]

+
+
+
+
+

pango_itemize_with_base_dir ()

+
GList *
+pango_itemize_with_base_dir (PangoContext *context,
+                             PangoDirection base_dir,
+                             const char *text,
+                             int start_index,
+                             int length,
+                             PangoAttrList *attrs,
+                             PangoAttrIterator *cached_iter);
+

Like pango_itemize(), but the base direction to use when +computing bidirectional levels (see pango_context_set_base_dir()), +is specified explicitly rather than gotten from the PangoContext.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

context

a structure holding information that affects +the itemization process.

 

base_dir

base direction to use for bidirectional processing

 

text

the text to itemize.

 

start_index

first byte in text +to process

 

length

the number of bytes (not characters) to process +after start_index +. This must be >= 0.

 

attrs

the set of attributes that apply to text +.

 

cached_iter

Cached attribute iterator, or NULL.

[allow-none]
+
+
+

Returns

+

a GList of +PangoItem structures. The items should be freed using +pango_item_free() probably in combination with +g_list_foreach(), and the list itself using g_list_free().

+

[transfer full][element-type Pango.Item]

+
+

Since: 1.4

+
+
+
+

pango_item_free ()

+
void
+pango_item_free (PangoItem *item);
+

Free a PangoItem and all associated memory.

+
+

Parameters

+
+++++ + + + + + +

item

a PangoItem, may be NULL.

[nullable]
+
+
+
+
+

pango_item_copy ()

+
PangoItem *
+pango_item_copy (PangoItem *item);
+

Copy an existing PangoItem structure.

+
+

Parameters

+
+++++ + + + + + +

item

a PangoItem, may be NULL.

[nullable]
+
+
+

Returns

+

the newly allocated PangoItem, which +should be freed with pango_item_free(), or NULL if +item +was NULL.

+

[nullable]

+
+
+
+
+

pango_item_new ()

+
PangoItem *
+pango_item_new (void);
+

Creates a new PangoItem structure initialized to default values.

+
+

Returns

+

the newly allocated PangoItem, which should +be freed with pango_item_free().

+
+
+
+
+

pango_item_split ()

+
PangoItem *
+pango_item_split (PangoItem *orig,
+                  int split_index,
+                  int split_offset);
+

Modifies orig + to cover only the text after split_index +, and +returns a new item that covers the text before split_index + that +used to be in orig +. You can think of split_index + as the length of +the returned item. split_index + may not be 0, and it may not be +greater than or equal to the length of orig + (that is, there must +be at least one byte assigned to each item, you can't create a +zero-length item). split_offset + is the length of the first item in +chars, and must be provided because the text used to generate the +item isn't available, so pango_item_split() can't count the char +length of the split items itself.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

orig

a PangoItem

 

split_index

byte index of position to split item, relative to the start of the item

 

split_offset

number of chars between start of orig +and split_index +

 
+
+
+

Returns

+

new item representing text before split_index +, which +should be freed with pango_item_free().

+
+
+
+
+

pango_reorder_items ()

+
GList *
+pango_reorder_items (GList *logical_items);
+

From a list of items in logical order and the associated +directional levels, produce a list in visual order. +The original list is unmodified.

+
+

Parameters

+
+++++ + + + + + +

logical_items

a GList of PangoItem in logical order.

[element-type Pango.Item]
+
+
+

Returns

+

a GList +of PangoItem structures in visual order.

+

(Please open a bug if you use this function. +It is not a particularly convenient interface, and the code +is duplicated elsewhere in Pango for that reason.).

+

[transfer full][element-type Pango.Item]

+
+
+
+
+

pango_context_new ()

+
PangoContext *
+pango_context_new (void);
+

Creates a new PangoContext initialized to default values.

+

This function is not particularly useful as it should always +be followed by a pango_context_set_font_map() call, and the +function pango_font_map_create_context() does these two steps +together and hence users are recommended to use that.

+

If you are using Pango as part of a higher-level system, +that system may have it's own way of create a PangoContext. +For instance, the GTK+ toolkit has, among others, +gdk_pango_context_get_for_screen(), and +gtk_widget_get_pango_context(). Use those instead.

+
+

Returns

+

the newly allocated PangoContext, which should +be freed with g_object_unref().

+
+
+
+
+

pango_context_changed ()

+
void
+pango_context_changed (PangoContext *context);
+

Forces a change in the context, which will cause any PangoLayout +using this context to re-layout.

+

This function is only useful when implementing a new backend +for Pango, something applications won't do. Backends should +call this function if they have attached extra data to the context +and such data is changed.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+

Since: 1.32.4

+
+
+
+

pango_context_get_serial ()

+
guint
+pango_context_get_serial (PangoContext *context);
+

Returns the current serial number of context +. The serial number is +initialized to an small number larger than zero when a new context +is created and is increased whenever the context is changed using any +of the setter functions, or the PangoFontMap it uses to find fonts has +changed. The serial may wrap, but will never have the value 0. Since it +can wrap, never compare it with "less than", always use "not equals".

+

This can be used to automatically detect changes to a PangoContext, and +is only useful when implementing objects that need update when their +PangoContext changes, like PangoLayout.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

The current serial number of context +.

+
+

Since: 1.32.4

+
+
+
+

pango_context_set_font_map ()

+
void
+pango_context_set_font_map (PangoContext *context,
+                            PangoFontMap *font_map);
+

Sets the font map to be searched when fonts are looked-up in this context. +This is only for internal use by Pango backends, a PangoContext obtained +via one of the recommended methods should already have a suitable font map.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

font_map

the PangoFontMap to set.

 
+
+
+
+
+

pango_context_get_font_map ()

+
PangoFontMap *
+pango_context_get_font_map (PangoContext *context);
+

Gets the PangoFontMap used to look up fonts for this context.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the font map for the PangoContext. +This value is owned by Pango and should not be unreferenced.

+

[transfer none]

+
+

Since: 1.6

+
+
+
+

pango_context_get_font_description ()

+
PangoFontDescription *
+pango_context_get_font_description (PangoContext *context);
+

Retrieve the default font description for the context.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

a pointer to the context's default font +description. This value must not be modified or freed.

+

[transfer none]

+
+
+
+
+

pango_context_set_font_description ()

+
void
+pango_context_set_font_description (PangoContext *context,
+                                    const PangoFontDescription *desc);
+

Set the default font description for the context

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

desc

the new pango font description

 
+
+
+
+
+

pango_context_get_language ()

+
PangoLanguage *
+pango_context_get_language (PangoContext *context);
+

Retrieves the global language tag for the context.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the global language tag.

+
+
+
+
+

pango_context_set_language ()

+
void
+pango_context_set_language (PangoContext *context,
+                            PangoLanguage *language);
+

Sets the global language tag for the context. The default language +for the locale of the running process can be found using +pango_language_get_default().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

language

the new language tag.

 
+
+
+
+
+

pango_context_get_base_dir ()

+
PangoDirection
+pango_context_get_base_dir (PangoContext *context);
+

Retrieves the base direction for the context. See +pango_context_set_base_dir().

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the base direction for the context.

+
+
+
+
+

pango_context_set_base_dir ()

+
void
+pango_context_set_base_dir (PangoContext *context,
+                            PangoDirection direction);
+

Sets the base direction for the context.

+

The base direction is used in applying the Unicode bidirectional +algorithm; if the direction + is PANGO_DIRECTION_LTR or +PANGO_DIRECTION_RTL, then the value will be used as the paragraph +direction in the Unicode bidirectional algorithm. A value of +PANGO_DIRECTION_WEAK_LTR or PANGO_DIRECTION_WEAK_RTL is used only +for paragraphs that do not contain any strong characters themselves.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

direction

the new base direction

 
+
+
+
+
+

pango_context_get_base_gravity ()

+
PangoGravity
+pango_context_get_base_gravity (PangoContext *context);
+

Retrieves the base gravity for the context. See +pango_context_set_base_gravity().

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the base gravity for the context.

+
+

Since: 1.16

+
+
+
+

pango_context_set_base_gravity ()

+
void
+pango_context_set_base_gravity (PangoContext *context,
+                                PangoGravity gravity);
+

Sets the base gravity for the context.

+

The base gravity is used in laying vertical text out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

gravity

the new base gravity

 
+
+

Since: 1.16

+
+
+
+

pango_context_get_gravity ()

+
PangoGravity
+pango_context_get_gravity (PangoContext *context);
+

Retrieves the gravity for the context. This is similar to +pango_context_get_base_gravity(), except for when the base gravity +is PANGO_GRAVITY_AUTO for which pango_gravity_get_for_matrix() is used +to return the gravity from the current context matrix.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the resolved gravity for the context.

+
+

Since: 1.16

+
+
+
+

pango_context_get_gravity_hint ()

+
PangoGravityHint
+pango_context_get_gravity_hint (PangoContext *context);
+

Retrieves the gravity hint for the context. See +pango_context_set_gravity_hint() for details.

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the gravity hint for the context.

+
+

Since: 1.16

+
+
+
+

pango_context_set_gravity_hint ()

+
void
+pango_context_set_gravity_hint (PangoContext *context,
+                                PangoGravityHint hint);
+

Sets the gravity hint for the context.

+

The gravity hint is used in laying vertical text out, and is only relevant +if gravity of the context as returned by pango_context_get_gravity() +is set PANGO_GRAVITY_EAST or PANGO_GRAVITY_WEST.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

hint

the new gravity hint

 
+
+

Since: 1.16

+
+
+
+

pango_context_get_matrix ()

+
const PangoMatrix *
+pango_context_get_matrix (PangoContext *context);
+

Gets the transformation matrix that will be applied when +rendering with this context. See pango_context_set_matrix().

+
+

Parameters

+
+++++ + + + + + +

context

a PangoContext

 
+
+
+

Returns

+

the matrix, or NULL if no matrix has +been set (which is the same as the identity matrix). The returned +matrix is owned by Pango and must not be modified or freed.

+

[nullable]

+
+

Since: 1.6

+
+
+
+

pango_context_set_matrix ()

+
void
+pango_context_set_matrix (PangoContext *context,
+                          const PangoMatrix *matrix);
+

Sets the transformation matrix that will be applied when rendering +with this context. Note that reported metrics are in the user space +coordinates before the application of the matrix, not device-space +coordinates after the application of the matrix. So, they don't scale +with the matrix, though they may change slightly for different +matrices, depending on how the text is fit to the pixel grid.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

matrix

a PangoMatrix, or NULL to unset any existing +matrix. (No matrix set is the same as setting the identity matrix.).

[allow-none]
+
+

Since: 1.6

+
+
+
+

pango_context_load_font ()

+
PangoFont *
+pango_context_load_font (PangoContext *context,
+                         const PangoFontDescription *desc);
+

Loads the font in one of the fontmaps in the context +that is the closest match for desc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

a PangoContext

 

desc

a PangoFontDescription describing the font to load

 
+
+
+

Returns

+

the newly allocated PangoFont +that was loaded, or NULL if no font matched.

+

[transfer full][nullable]

+
+
+
+
+

pango_context_load_fontset ()

+
PangoFontset *
+pango_context_load_fontset (PangoContext *context,
+                            const PangoFontDescription *desc,
+                            PangoLanguage *language);
+

Load a set of fonts in the context that can be used to render +a font matching desc +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

context

a PangoContext

 

desc

a PangoFontDescription describing the fonts to load

 

language

a PangoLanguage the fonts will be used for

 
+
+
+

Returns

+

the newly allocated +PangoFontset loaded, or NULL if no font matched.

+

[transfer full][nullable]

+
+
+
+
+

pango_context_get_metrics ()

+
PangoFontMetrics *
+pango_context_get_metrics (PangoContext *context,
+                           const PangoFontDescription *desc,
+                           PangoLanguage *language);
+

Get overall metric information for a particular font +description. Since the metrics may be substantially different for +different scripts, a language tag can be provided to indicate that +the metrics should be retrieved that correspond to the script(s) +used by that language.

+

The PangoFontDescription is interpreted in the same way as +by pango_itemize(), and the family name may be a comma separated +list of figures. If characters from multiple of these families +would be used to render the string, then the returned fonts would +be a composite of the metrics for the fonts loaded for the +individual families.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

context

a PangoContext

 

desc

a PangoFontDescription structure. NULL means that the +font description from the context will be used.

[allow-none]

language

language tag used to determine which script to get +the metrics for. NULL means that the language tag from the context +will be used. If no language tag is set on the context, metrics +for the default language (as determined by pango_language_get_default()) +will be returned.

[allow-none]
+
+
+

Returns

+

a PangoFontMetrics object. The caller must call pango_font_metrics_unref() +when finished using the object.

+
+
+
+
+

pango_context_list_families ()

+
void
+pango_context_list_families (PangoContext *context,
+                             PangoFontFamily ***families,
+                             int *n_families);
+

List all families for a context.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

context

a PangoContext

 

families

location to store a pointer to +an array of PangoFontFamily *. This array should be freed +with g_free().

[out][array length=n_families][transfer container]

n_families

location to store the number of elements in descs +.

[out]
+
+
+
+
+

pango_break ()

+
void
+pango_break (const gchar *text,
+             int length,
+             PangoAnalysis *analysis,
+             PangoLogAttr *attrs,
+             int attrs_len);
+

Determines possible line, word, and character breaks +for a string of Unicode text with a single analysis. For most +purposes you may want to use pango_get_log_attrs().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

text

the text to process

 

length

length of text +in bytes (may be -1 if text +is nul-terminated)

 

analysis

PangoAnalysis structure from pango_itemize()

 

attrs

an array to store character +information in.

[array length=attrs_len]

attrs_len

size of the array passed as attrs +

 
+
+
+
+
+

pango_get_log_attrs ()

+
void
+pango_get_log_attrs (const char *text,
+                     int length,
+                     int level,
+                     PangoLanguage *language,
+                     PangoLogAttr *log_attrs,
+                     int attrs_len);
+

Computes a PangoLogAttr for each character in text +. The log_attrs + +array must have one PangoLogAttr for each position in text +; if +text + contains N characters, it has N+1 positions, including the +last position at the end of the text. text + should be an entire +paragraph; logical attributes can't be computed without context +(for example you need to see spaces on either side of a word to know +the word is a word).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

text

text to process

 

length

length in bytes of text +

 

level

embedding level, or -1 if unknown

 

language

language tag

 

log_attrs

array with one PangoLogAttr +per character in text +, plus one extra, to be filled in.

[array length=attrs_len]

attrs_len

length of log_attrs +array

 
+
+
+
+
+

pango_find_paragraph_boundary ()

+
void
+pango_find_paragraph_boundary (const gchar *text,
+                               gint length,
+                               gint *paragraph_delimiter_index,
+                               gint *next_paragraph_start);
+

Locates a paragraph boundary in text +. A boundary is caused by +delimiter characters, such as a newline, carriage return, carriage +return-newline pair, or Unicode paragraph separator character. The +index of the run of delimiters is returned in +paragraph_delimiter_index +. The index of the start of the paragraph +(index after all delimiters) is stored in next_paragraph_start +.

+

If no delimiters are found, both paragraph_delimiter_index + and +next_paragraph_start + are filled with the length of text + (an index one +off the end).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

text

UTF-8 text

 

length

length of text +in bytes, or -1 if nul-terminated

 

paragraph_delimiter_index

return location for index of +delimiter.

[out]

next_paragraph_start

return location for start of next +paragraph.

[out]
+
+
+
+
+

pango_default_break ()

+
void
+pango_default_break (const gchar *text,
+                     int length,
+                     PangoAnalysis *analysis,
+                     PangoLogAttr *attrs,
+                     int attrs_len);
+

This is the default break algorithm, used if no language +engine overrides it. Normally you should use pango_break() +instead. Unlike pango_break(), +analysis + can be NULL, but only do that if you know what +you're doing. If you need an analysis to pass to pango_break(), +you need to pango_itemize(). In most cases however you should +simply use pango_get_log_attrs().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

text

text to break

 

length

length of text in bytes (may be -1 if text +is nul-terminated)

 

analysis

a PangoAnalysis for the text +.

[nullable]

attrs

logical attributes to fill in

 

attrs_len

size of the array passed as attrs +

 
+
+
+
+
+

pango_shape ()

+
void
+pango_shape (const gchar *text,
+             gint length,
+             const PangoAnalysis *analysis,
+             PangoGlyphString *glyphs);
+

Given a segment of text and the corresponding +PangoAnalysis structure returned from pango_itemize(), +convert the characters into glyphs. You may also pass +in only a substring of the item from pango_itemize().

+

It is recommended that you use pango_shape_full() instead, since +that API allows for shaping interaction happening across text item +boundaries.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

text

the text to process

 

length

the length (in bytes) of text +

 

analysis

PangoAnalysis structure from pango_itemize()

 

glyphs

glyph string in which to store results

 
+
+
+
+
+

pango_shape_full ()

+
void
+pango_shape_full (const gchar *item_text,
+                  gint item_length,
+                  const gchar *paragraph_text,
+                  gint paragraph_length,
+                  const PangoAnalysis *analysis,
+                  PangoGlyphString *glyphs);
+

Given a segment of text and the corresponding +PangoAnalysis structure returned from pango_itemize(), +convert the characters into glyphs. You may also pass +in only a substring of the item from pango_itemize().

+

This is similar to pango_shape(), except it also can optionally take +the full paragraph text as input, which will then be used to perform +certain cross-item shaping interactions. If you have access to the broader +text of which item_text + is part of, provide the broader text as +paragraph_text +. If paragraph_text + is NULL, item text is used instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

item_text

valid UTF-8 text to shape.

 

item_length

the length (in bytes) of item_text +. -1 means nul-terminated text.

 

paragraph_text

text of the paragraph (see details). May be NULL.

[allow-none]

paragraph_length

the length (in bytes) of paragraph_text +. -1 means nul-terminated text.

 

analysis

PangoAnalysis structure from pango_itemize().

 

glyphs

glyph string in which to store results.

 
+
+

Since: 1.32

+
+
+
+

Types and Values

+
+

PangoContext

+
typedef struct _PangoContext PangoContext;
+

The PangoContext structure stores global information +used to control the itemization process.

+
+
+
+

struct PangoItem

+
struct PangoItem {
+  gint offset;
+  gint length;
+  gint num_chars;
+  PangoAnalysis analysis;
+};
+
+

The PangoItem structure stores information about a segment of text.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

gint offset;

byte offset of the start of this item in text.

 

gint length;

length of this item in bytes.

 

gint num_chars;

number of Unicode characters in the item.

 

PangoAnalysis analysis;

analysis results for the item.

 
+
+
+
+
+

struct PangoAnalysis

+
struct PangoAnalysis {
+  PangoEngineShape *shape_engine;
+  PangoEngineLang  *lang_engine;
+  PangoFont *font;
+
+  guint8 level;
+  guint8 gravity; /* PangoGravity */
+  guint8 flags;
+
+  guint8 script; /* PangoScript */
+  PangoLanguage *language;
+
+  GSList *extra_attrs;
+};
+
+

The PangoAnalysis structure stores information about +the properties of a segment of text.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PangoEngineShape *shape_engine;

the engine for doing rendering-system-dependent processing.

 

PangoEngineLang *lang_engine;

the engine for doing rendering-system-independent processing.

 

PangoFont *font;

the font for this segment.

 

guint8 level;

the bidirectional level for this segment.

 

guint8 gravity;

the glyph orientation for this segment (A PangoGravity).

 

guint8 flags;

boolean flags for this segment (currently only one) (Since: 1.16).

 

guint8 script;

the detected script for this segment (A PangoScript) (Since: 1.18).

 

PangoLanguage *language;

the detected language for this segment.

 

GSList *extra_attrs;

extra attributes for this segment.

 
+
+
+
+
+

PANGO_ANALYSIS_FLAG_CENTERED_BASELINE

+
#define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0)
+
+

Whether the segment should be shifted to center around the baseline. +Used in vertical writing directions mostly.

+

Since: 1.16

+
+
+
+

PANGO_ANALYSIS_FLAG_IS_ELLIPSIS

+
#define PANGO_ANALYSIS_FLAG_IS_ELLIPSIS (1 << 1)
+
+

This flag is used to mark runs that hold ellipsized text, +in an ellipsized layout.

+

Since: 1.36.7

+
+
+
+

PANGO_TYPE_DIRECTION

+
#define PANGO_TYPE_DIRECTION (pango_direction_get_type ())
+
+
+
+
+

PangoLogAttr

+
typedef struct {
+  guint is_line_break : 1;      /* Can break line in front of character */
+
+  guint is_mandatory_break : 1; /* Must break line in front of character */
+
+  guint is_char_break : 1;      /* Can break here when doing char wrap */
+
+  guint is_white : 1;           /* Whitespace character */
+
+  /* Cursor can appear in front of character (i.e. this is a grapheme
+   * boundary, or the first character in the text).
+   */
+  guint is_cursor_position : 1;
+
+  /* Note that in degenerate cases, you could have both start/end set on
+   * some text, most likely for sentences (e.g. no space after a period, so
+   * the next sentence starts right away).
+   */
+
+  guint is_word_start : 1;      /* first character in a word */
+  guint is_word_end   : 1;      /* is first non-word char after a word */
+
+  /* There are two ways to divide sentences. The first assigns all
+   * intersentence whitespace/control/format chars to some sentence,
+   * so all chars are in some sentence; is_sentence_boundary denotes
+   * the boundaries there. The second way doesn't assign
+   * between-sentence spaces, etc. to any sentence, so
+   * is_sentence_start/is_sentence_end mark the boundaries of those
+   * sentences.
+   */
+  guint is_sentence_boundary : 1;
+  guint is_sentence_start : 1;  /* first character in a sentence */
+  guint is_sentence_end : 1;    /* first non-sentence char after a sentence */
+
+  /* If set, backspace deletes one character rather than
+   * the entire grapheme cluster.
+   */
+  guint backspace_deletes_character : 1;
+
+  /* Only few space variants (U+0020 and U+00A0) have variable
+   * width during justification.
+   */
+  guint is_expandable_space : 1;
+
+  /* Word boundary as defined by UAX#29 */
+  guint is_word_boundary : 1; /* is NOT in the middle of a word */
+} PangoLogAttr;
+
+

The PangoLogAttr structure stores information +about the attributes of a single character.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

guint is_line_break : 1;

if set, can break line in front of character

 

guint is_mandatory_break : 1;

if set, must break line in front of character

 

guint is_char_break : 1;

if set, can break here when doing character wrapping

 

guint is_white : 1;

is whitespace character

 

guint is_cursor_position : 1;

+

if set, cursor can appear in front of character. +i.e. this is a grapheme boundary, or the first character +in the text. +This flag implements Unicode's

+Grapheme +Cluster Boundaries semantics.
 

guint is_word_start : 1;

is first character in a word

 

guint is_word_end : 1;

is first non-word char after a word +Note that in degenerate cases, you could have both is_word_start +and is_word_end +set for some character.

 

guint is_sentence_boundary : 1;

is a sentence boundary. +There are two ways to divide sentences. The first assigns all +inter-sentence whitespace/control/format chars to some sentence, +so all chars are in some sentence; is_sentence_boundary +denotes +the boundaries there. The second way doesn't assign +between-sentence spaces, etc. to any sentence, so +is_sentence_start +/is_sentence_end +mark the boundaries of those sentences.

 

guint is_sentence_start : 1;

is first character in a sentence

 

guint is_sentence_end : 1;

is first char after a sentence. +Note that in degenerate cases, you could have both is_sentence_start +and is_sentence_end +set for some character. (e.g. no space after a +period, so the next sentence starts right away)

 

guint backspace_deletes_character : 1;

if set, backspace deletes one character +rather than the entire grapheme cluster. This +field is only meaningful on grapheme +boundaries (where is_cursor_position +is +set). In some languages, the full grapheme +(e.g. letter + diacritics) is considered a +unit, while in others, each decomposed +character in the grapheme is a unit. In the +default implementation of pango_break(), this +bit is set on all grapheme boundaries except +those following Latin, Cyrillic or Greek base characters.

 

guint is_expandable_space : 1;

is a whitespace character that can possibly be +expanded for justification purposes. (Since: 1.18)

 

guint is_word_boundary : 1;

+

is a word boundary. +More specifically, means that this is not a position in the middle +of a word. For example, both sides of a punctuation mark are +considered word boundaries. This flag is particularly useful when +selecting text word-by-word. +This flag implements Unicode's

+Word +Boundaries semantics. (Since: 1.22)
 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Version-Checking.html b/docs/html/pango-Version-Checking.html new file mode 100644 index 0000000..699fd64 --- /dev/null +++ b/docs/html/pango-Version-Checking.html @@ -0,0 +1,595 @@ + + + + +Version Checking: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Version Checking

+

Version Checking — Tools for checking Pango version at compile- and run-time.

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
#define +PANGO_VERSION_ENCODE() +
#define +PANGO_VERSION_CHECK() +
+int + +pango_version () +
const char * + +pango_version_string () +
const char * + +pango_version_check () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#definePANGO_VERSION
#definePANGO_VERSION_MAJOR
#definePANGO_VERSION_MINOR
#definePANGO_VERSION_MICRO
#definePANGO_VERSION_STRING
#definePANGO_VERSION_1_2
#definePANGO_VERSION_1_4
#definePANGO_VERSION_1_6
#definePANGO_VERSION_1_8
#definePANGO_VERSION_1_10
#definePANGO_VERSION_1_12
#definePANGO_VERSION_1_14
#definePANGO_VERSION_1_16
#definePANGO_VERSION_1_18
#definePANGO_VERSION_1_20
#definePANGO_VERSION_1_22
#definePANGO_VERSION_1_24
#definePANGO_VERSION_1_26
#definePANGO_VERSION_1_28
#definePANGO_VERSION_1_30
#definePANGO_VERSION_1_32
#definePANGO_VERSION_1_34
#definePANGO_VERSION_1_36
#definePANGO_VERSION_1_38
#definePANGO_VERSION_1_40
#definePANGO_VERSION_1_42
+
+
+

Description

+

The capital-letter macros defined here can be used to check the version of Pango +at compile-time, and to encode Pango versions into integers.

+

The functions can be used to check the version of the linked Pango library at run-time.

+
+
+

Functions

+
+

PANGO_VERSION_ENCODE()

+
#define             PANGO_VERSION_ENCODE(major, minor, micro)
+

This macro encodes the given Pango version into an integer. The numbers +returned by PANGO_VERSION and pango_version() are encoded using this macro. +Two encoded version numbers can be compared as integers.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

major

the major component of the version number

 

minor

the minor component of the version number

 

micro

the micro component of the version number

 
+
+
+
+
+

PANGO_VERSION_CHECK()

+
#define             PANGO_VERSION_CHECK(major,minor,micro)
+

Checks that the version of Pango available at compile-time is not older than +the provided version number.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

major

the major component of the version number

 

minor

the minor component of the version number

 

micro

the micro component of the version number

 
+
+
+
+
+

pango_version ()

+
int
+pango_version (void);
+

This is similar to the macro PANGO_VERSION except that +it returns the encoded version of Pango available at run-time, +as opposed to the version available at compile-time.

+

A version number can be encoded into an integer using +PANGO_VERSION_ENCODE().

+
+

Returns

+

The encoded version of Pango library +available at run time.

+
+

Since: 1.16

+
+
+
+

pango_version_string ()

+
const char *
+pango_version_string (void);
+

This is similar to the macro PANGO_VERSION_STRING except that +it returns the version of Pango available at run-time, as opposed to +the version available at compile-time.

+
+

Returns

+

A string containing the version of Pango library +available at run time. +The returned string is owned by Pango and should not be modified +or freed.

+
+

Since: 1.16

+
+
+
+

pango_version_check ()

+
const char *
+pango_version_check (int required_major,
+                     int required_minor,
+                     int required_micro);
+

Checks that the Pango library in use is compatible with the +given version. Generally you would pass in the constants +PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR, PANGO_VERSION_MICRO +as the three arguments to this function; that produces +a check that the library in use at run-time is compatible with +the version of Pango the application or module was compiled against.

+

Compatibility is defined by two things: first the version +of the running library is newer than the version +required_major.required_minor +.required_micro +. Second +the running library must be binary compatible with the +version required_major.required_minor +.required_micro + +(same major version.)

+

For compile-time version checking use PANGO_VERSION_CHECK().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

required_major

the required major version.

 

required_minor

the required minor version.

 

required_micro

the required major version.

 
+
+
+

Returns

+

NULL if the Pango library is compatible +with the given version, or a string describing the version +mismatch. The returned string is owned by Pango and should not +be modified or freed.

+

[nullable]

+
+

Since: 1.16

+
+
+
+

Types and Values

+
+

PANGO_VERSION

+
#define             PANGO_VERSION
+

The version of Pango available at compile-time, encoded using PANGO_VERSION_ENCODE().

+
+
+
+

PANGO_VERSION_MAJOR

+
#define PANGO_VERSION_MAJOR 1
+
+

The major component of the version of Pango available at compile-time.

+
+
+
+

PANGO_VERSION_MINOR

+
#define PANGO_VERSION_MINOR 42
+
+

The minor component of the version of Pango available at compile-time.

+
+
+
+

PANGO_VERSION_MICRO

+
#define PANGO_VERSION_MICRO 4
+
+

The micro component of the version of Pango available at compile-time.

+
+
+
+

PANGO_VERSION_STRING

+
#define PANGO_VERSION_STRING "1.42.4"
+
+

A string literal containing the version of Pango available at compile-time.

+
+
+
+

PANGO_VERSION_1_2

+
#define PANGO_VERSION_1_2        (G_ENCODE_VERSION (1, 2))
+
+

A macro that evaluates to the 1.2 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_4

+
#define PANGO_VERSION_1_4        (G_ENCODE_VERSION (1, 4))
+
+

A macro that evaluates to the 1.4 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_6

+
#define PANGO_VERSION_1_6        (G_ENCODE_VERSION (1, 6))
+
+

A macro that evaluates to the 1.6 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_8

+
#define PANGO_VERSION_1_8        (G_ENCODE_VERSION (1, 8))
+
+

A macro that evaluates to the 1.8 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_10

+
#define PANGO_VERSION_1_10       (G_ENCODE_VERSION (1, 10))
+
+

A macro that evaluates to the 1.10 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_12

+
#define PANGO_VERSION_1_12       (G_ENCODE_VERSION (1, 12))
+
+

A macro that evaluates to the 1.12 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_14

+
#define PANGO_VERSION_1_14       (G_ENCODE_VERSION (1, 14))
+
+

A macro that evaluates to the 1.14 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_16

+
#define PANGO_VERSION_1_16       (G_ENCODE_VERSION (1, 16))
+
+

A macro that evaluates to the 1.16 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_18

+
#define PANGO_VERSION_1_18       (G_ENCODE_VERSION (1, 18))
+
+

A macro that evaluates to the 1.18 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_20

+
#define PANGO_VERSION_1_20       (G_ENCODE_VERSION (1, 20))
+
+

A macro that evaluates to the 1.20 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_22

+
#define PANGO_VERSION_1_22       (G_ENCODE_VERSION (1, 22))
+
+

A macro that evaluates to the 1.22 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_24

+
#define PANGO_VERSION_1_24       (G_ENCODE_VERSION (1, 24))
+
+

A macro that evaluates to the 1.24 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_26

+
#define PANGO_VERSION_1_26       (G_ENCODE_VERSION (1, 26))
+
+

A macro that evaluates to the 1.26 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_28

+
#define PANGO_VERSION_1_28       (G_ENCODE_VERSION (1, 28))
+
+

A macro that evaluates to the 1.28 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_30

+
#define PANGO_VERSION_1_30       (G_ENCODE_VERSION (1, 30))
+
+

A macro that evaluates to the 1.30 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_32

+
#define PANGO_VERSION_1_32       (G_ENCODE_VERSION (1, 32))
+
+

A macro that evaluates to the 1.32 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_34

+
#define PANGO_VERSION_1_34       (G_ENCODE_VERSION (1, 34))
+
+

A macro that evaluates to the 1.34 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_36

+
#define PANGO_VERSION_1_36       (G_ENCODE_VERSION (1, 36))
+
+

A macro that evaluates to the 1.36 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_38

+
#define PANGO_VERSION_1_38       (G_ENCODE_VERSION (1, 38))
+
+

A macro that evaluates to the 1.38 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_40

+
#define PANGO_VERSION_1_40       (G_ENCODE_VERSION (1, 40))
+
+

A macro that evaluates to the 1.40 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+

PANGO_VERSION_1_42

+
#define PANGO_VERSION_1_42       (G_ENCODE_VERSION (1, 42))
+
+

A macro that evaluates to the 2.38 version of Pango, in a format +that can be used by the C pre-processor.

+

Since: 1.42

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Vertical-Text.html b/docs/html/pango-Vertical-Text.html new file mode 100644 index 0000000..f18ab77 --- /dev/null +++ b/docs/html/pango-Vertical-Text.html @@ -0,0 +1,516 @@ + + + + +Vertical Text: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Vertical Text

+

Vertical Text — Laying text out in vertical directions

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define +PANGO_GRAVITY_IS_IMPROPER() +
#define +PANGO_GRAVITY_IS_VERTICAL() +
+PangoGravity + +pango_gravity_get_for_matrix () +
+PangoGravity + +pango_gravity_get_for_script () +
+PangoGravity + +pango_gravity_get_for_script_and_width () +
+double + +pango_gravity_to_rotation () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
enumPangoGravity
enumPangoGravityHint
+
+
+

Object Hierarchy

+
    GEnum
+    ├── PangoGravity
+    ╰── PangoGravityHint
+
+
+
+

Description

+

Since 1.16, Pango is able to correctly lay vertical text out. In fact, it can +set layouts of mixed vertical and non-vertical text. This section describes +the types used for setting vertical text parameters.

+

The way this is implemented is through the concept of +gravity. Gravity of normal Latin text is south. A +gravity value of east means that glyphs will be rotated ninety degrees +counterclockwise. So, to render vertical text one needs to set the gravity +and rotate the layout using the matrix machinery already in place. This has +the huge advantage that most algorithms working on a PangoLayout do not need +any change as the assumption that lines run in the X direction and stack in +the Y direction holds even for vertical text layouts.

+

Applications should only need to set base gravity on PangoContext in use, and +let Pango decide the gravity assigned to each run of text. This automatically +handles text with mixed scripts. A very common use is to set the context base +gravity to auto using pango_context_set_base_gravity() +and rotate the layout normally. Pango will make sure that +Asian languages take the right form, while other scripts are rotated normally.

+

The correct way to set gravity on a layout is to set it on the context +associated with it using pango_context_set_base_gravity(). The context +of a layout can be accessed using pango_layout_get_context(). The currently +set base gravity of the context can be accessed using +pango_context_get_base_gravity() and the resolved +gravity of it using pango_context_get_gravity(). The resolved gravity is +the same as the base gravity for the most part, except that if the base +gravity is set to PANGO_GRAVITY_AUTO, the resolved gravity will depend +on the current matrix set on context, and is derived using +pango_gravity_get_for_matrix().

+

The next thing an application may want to set on the context is the +gravity hint. A PangoGravityHint instructs how +different scripts should react to the set base gravity.

+

Font descriptions have a gravity property too, that can be set using +pango_font_description_set_gravity() and accessed using +pango_font_description_get_gravity(). However, those are rarely useful +from application code and are mainly used by PangoLayout internally.

+

Last but not least, one can create PangoAttributes for gravity +and gravity hint using pango_attr_gravity_new() and +pango_attr_gravity_hint_new().

+
+
+

Functions

+
+

PANGO_GRAVITY_IS_IMPROPER()

+
#define             PANGO_GRAVITY_IS_IMPROPER(gravity)
+

Whether a PangoGravity represents a gravity that results in reversal of text direction.

+
+

Parameters

+
+++++ + + + + + +

gravity

the PangoGravity to check

 
+
+
+

Returns

+

TRUE if gravity +is PANGO_GRAVITY_WEST or PANGO_GRAVITY_NORTH, +FALSE otherwise.

+
+

Since: 1.32

+
+
+
+

PANGO_GRAVITY_IS_VERTICAL()

+
#define             PANGO_GRAVITY_IS_VERTICAL(gravity)
+

Whether a PangoGravity represents vertical writing directions.

+
+

Parameters

+
+++++ + + + + + +

gravity

the PangoGravity to check

 
+
+
+

Returns

+

TRUE if gravity +is PANGO_GRAVITY_EAST or PANGO_GRAVITY_WEST, +FALSE otherwise.

+
+

Since: 1.16

+
+
+
+

pango_gravity_get_for_matrix ()

+
PangoGravity
+pango_gravity_get_for_matrix (const PangoMatrix *matrix);
+

Finds the gravity that best matches the rotation component +in a PangoMatrix.

+
+

Parameters

+
+++++ + + + + + +

matrix

a PangoMatrix.

[nullable]
+
+
+

Returns

+

the gravity of matrix +, which will never be +PANGO_GRAVITY_AUTO, or PANGO_GRAVITY_SOUTH if matrix +is NULL

+
+

Since: 1.16

+
+
+
+

pango_gravity_get_for_script ()

+
PangoGravity
+pango_gravity_get_for_script (PangoScript script,
+                              PangoGravity base_gravity,
+                              PangoGravityHint hint);
+

Based on the script, base gravity, and hint, returns actual gravity +to use in laying out a single PangoItem.

+

If base_gravity + is PANGO_GRAVITY_AUTO, it is first replaced with the +preferred gravity of script +. To get the preferred gravity of a script, +pass PANGO_GRAVITY_AUTO and PANGO_GRAVITY_HINT_STRONG in.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

script

PangoScript to query

 

base_gravity

base gravity of the paragraph

 

hint

orientation hint

 
+
+
+

Returns

+

resolved gravity suitable to use for a run of text +with script +.

+
+

Since: 1.16

+
+
+
+

pango_gravity_get_for_script_and_width ()

+
PangoGravity
+pango_gravity_get_for_script_and_width
+                               (PangoScript script,
+                                gboolean wide,
+                                PangoGravity base_gravity,
+                                PangoGravityHint hint);
+

Based on the script, East Asian width, base gravity, and hint, +returns actual gravity to use in laying out a single character +or PangoItem.

+

This function is similar to pango_gravity_get_for_script() except +that this function makes a distinction between narrow/half-width and +wide/full-width characters also. Wide/full-width characters always +stand upright, that is, they always take the base gravity, +whereas narrow/full-width characters are always rotated in vertical +context.

+

If base_gravity + is PANGO_GRAVITY_AUTO, it is first replaced with the +preferred gravity of script +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

script

PangoScript to query

 

wide

TRUE for wide characters as returned by g_unichar_iswide()

 

base_gravity

base gravity of the paragraph

 

hint

orientation hint

 
+
+
+

Returns

+

resolved gravity suitable to use for a run of text +with script +and wide +.

+
+

Since: 1.26

+
+
+
+

pango_gravity_to_rotation ()

+
double
+pango_gravity_to_rotation (PangoGravity gravity);
+

Converts a PangoGravity value to its natural rotation in radians. +gravity + should not be PANGO_GRAVITY_AUTO.

+

Note that pango_matrix_rotate() takes angle in degrees, not radians. +So, to call pango_matrix_rotate() with the output of this function +you should multiply it by (180. / G_PI).

+
+

Parameters

+
+++++ + + + + + +

gravity

gravity to query

 
+
+
+

Returns

+

the rotation value corresponding to gravity +.

+
+

Since: 1.16

+
+
+
+

Types and Values

+
+

enum PangoGravity

+

The PangoGravity type represents the orientation of glyphs in a segment +of text. This is useful when rendering vertical text layouts. In +those situations, the layout is rotated using a non-identity PangoMatrix, +and then glyph orientation is controlled using PangoGravity. +Not every value in this enumeration makes sense for every usage of +PangoGravity; for example, PANGO_GRAVITY_AUTO only can be passed to +pango_context_set_base_gravity() and can only be returned by +pango_context_get_base_gravity().

+

See also: PangoGravityHint

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PANGO_GRAVITY_SOUTH

+

Glyphs stand upright (default)

+
 

PANGO_GRAVITY_EAST

+

Glyphs are rotated 90 degrees clockwise

+
 

PANGO_GRAVITY_NORTH

+

Glyphs are upside-down

+
 

PANGO_GRAVITY_WEST

+

Glyphs are rotated 90 degrees counter-clockwise

+
 

PANGO_GRAVITY_AUTO

+

Gravity is resolved from the context matrix

+
 
+
+

Since: 1.16

+
+
+
+

enum PangoGravityHint

+

The PangoGravityHint defines how horizontal scripts should behave in a +vertical context. That is, English excerpt in a vertical paragraph for +example.

+

See PangoGravity.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

PANGO_GRAVITY_HINT_NATURAL

+

scripts will take their natural gravity based +on the base gravity and the script. This is the default.

+
 

PANGO_GRAVITY_HINT_STRONG

+

always use the base gravity set, regardless of +the script.

+
 

PANGO_GRAVITY_HINT_LINE

+

for scripts not in their natural direction (eg. +Latin in East gravity), choose per-script gravity such that every script +respects the line progression. This means, Latin and Arabic will take +opposite gravities and both flow top-to-bottom for example.

+
 
+
+

Since: 1.16

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/html/pango-Win32-Fonts-and-Rendering.html b/docs/html/pango-Win32-Fonts-and-Rendering.html new file mode 100644 index 0000000..739cfdd --- /dev/null +++ b/docs/html/pango-Win32-Fonts-and-Rendering.html @@ -0,0 +1,1014 @@ + + + + +Win32 Fonts and Rendering: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Win32 Fonts and Rendering

+

Win32 Fonts and Rendering — Functions for shape engines to manipulate Win32 fonts

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoContext * + +pango_win32_get_context () +
+void + +pango_win32_render () +
+void + +pango_win32_render_transformed () +
+void + +pango_win32_render_layout_line () +
+void + +pango_win32_render_layout () +
+PangoGlyph + +pango_win32_get_unknown_glyph () +
+gint + +pango_win32_font_get_glyph_index () +
+gboolean + +pango_win32_font_select_font () +
+void + +pango_win32_font_done_font () +
+double + +pango_win32_font_get_metrics_factor () +
+gboolean + +pango_win32_get_debug_flag () +
+HDC + +pango_win32_get_dc () +
+PangoWin32FontCache * + +pango_win32_font_cache_new () +
+void + +pango_win32_font_cache_free () +
+HFONT + +pango_win32_font_cache_load () +
+HFONT + +pango_win32_font_cache_loadw () +
+void + +pango_win32_font_cache_unload () +
+PangoFontMap * + +pango_win32_font_map_for_display () +
+void + +pango_win32_shutdown_display () +
+PangoWin32FontCache * + +pango_win32_font_map_get_font_cache () +
+LOGFONTA * + +pango_win32_font_logfont () +
+LOGFONTW * + +pango_win32_font_logfontw () +
+PangoFontDescription * + +pango_win32_font_description_from_logfont () +
+PangoFontDescription * + +pango_win32_font_description_from_logfontw () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
#definePANGO_RENDER_TYPE_WIN32
 PangoWin32FontCache
+
+
+

Description

+

The macros and functions in this section are used to access fonts natively on +Win32 systems and to render text in conjunction with Win32 APIs.

+
+
+

Functions

+
+

pango_win32_get_context ()

+
PangoContext *
+pango_win32_get_context (void);
+
+

pango_win32_get_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_win32_font_map_for_display() followed by +pango_font_map_create_context() instead.

+
+

Retrieves a PangoContext appropriate for rendering with Windows fonts.

+
+

Returns

+

the new PangoContext

+
+
+
+
+

pango_win32_render ()

+
void
+pango_win32_render (HDC hdc,
+                    PangoFont *font,
+                    PangoGlyphString *glyphs,
+                    gint x,
+                    gint y);
+

Render a PangoGlyphString onto a Windows DC

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

hdc

the device context

 

font

the font in which to draw the string

 

glyphs

the glyph string to draw

 

x

the x position of start of string (in pixels)

 

y

the y position of baseline (in pixels)

 
+
+
+
+
+

pango_win32_render_transformed ()

+
void
+pango_win32_render_transformed (HDC hdc,
+                                const PangoMatrix *matrix,
+                                PangoFont *font,
+                                PangoGlyphString *glyphs,
+                                int x,
+                                int y);
+

Renders a PangoGlyphString onto a windows DC, possibly +transforming the layed-out coordinates through a transformation +matrix. Note that the transformation matrix for font + is not +changed, so to produce correct rendering results, the font + +must have been loaded using a PangoContext with an identical +transformation matrix to that passed in to this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

hdc

a windows device context

 

matrix

a PangoMatrix, or NULL to use an identity +transformation.

[nullable]

font

the font in which to draw the string

 

glyphs

the glyph string to draw

 

x

the x position of the start of the string (in Pango +units in user space coordinates)

 

y

the y position of the baseline (in Pango units +in user space coordinates)

 
+
+
+
+
+

pango_win32_render_layout_line ()

+
void
+pango_win32_render_layout_line (HDC hdc,
+                                PangoLayoutLine *line,
+                                int x,
+                                int y);
+

Render a PangoLayoutLine onto a device context. For underlining to +work property the text alignment of the DC should have TA_BASELINE +and TA_LEFT.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

hdc

DC to use for drawing

 

line

a PangoLayoutLine

 

x

the x position of start of string (in pixels)

 

y

the y position of baseline (in pixels)

 
+
+
+
+
+

pango_win32_render_layout ()

+
void
+pango_win32_render_layout (HDC hdc,
+                           PangoLayout *layout,
+                           int x,
+                           int y);
+

Render a PangoLayoutLine onto an X drawable

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

hdc

HDC to use for drawing

 

layout

a PangoLayout

 

x

the X position of the left of the layout (in pixels)

 

y

the Y position of the top of the layout (in pixels)

 
+
+
+
+
+

pango_win32_get_unknown_glyph ()

+
PangoGlyph
+pango_win32_get_unknown_glyph (PangoFont *font,
+                               gunichar wc);
+

pango_win32_get_unknown_glyph is deprecated and should not be used in newly-written code.

+

Returns the index of a glyph suitable for drawing wc + as an +unknown character.

+

Use PANGO_GET_UNKNOWN_GLYPH() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont

 

wc

the Unicode character for which a glyph is needed.

 
+
+
+

Returns

+

a glyph index into font +

+
+
+
+
+

pango_win32_font_get_glyph_index ()

+
gint
+pango_win32_font_get_glyph_index (PangoFont *font,
+                                  gunichar wc);
+

pango_win32_font_get_glyph_index is deprecated and should not be used in newly-written code.

+

Obtains the index of the glyph for wc + in font +, or 0, if not +covered.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont.

 

wc

a Unicode character.

 
+
+
+

Returns

+

the glyph index for wc +.

+
+
+
+
+

pango_win32_font_select_font ()

+
gboolean
+pango_win32_font_select_font (PangoFont *font,
+                              HDC hdc);
+

Selects the font into the specified DC and changes the mapping mode +and world transformation of the DC appropriately for the font. +You may want to surround the use of this function with calls +to SaveDC() and RestoreDC(). Call pango_win32_font_done_font() when +you are done using the DC to release allocated resources.

+

See pango_win32_font_get_metrics_factor() for information about +converting from the coordinate space used by this function +into Pango units.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont from the Win32 backend

 

hdc

a windows device context

 
+
+
+

Returns

+

TRUE if the operation succeeded.

+
+
+
+
+

pango_win32_font_done_font ()

+
void
+pango_win32_font_done_font (PangoFont *font);
+

Releases any resources allocated by pango_win32_font_done_font()

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont from the win32 backend

 
+
+
+
+
+

pango_win32_font_get_metrics_factor ()

+
double
+pango_win32_font_get_metrics_factor (PangoFont *font);
+

Returns the scale factor from logical units in the coordinate +space used by pango_win32_font_select_font() to Pango units +in user space.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont from the win32 backend

 
+
+
+

Returns

+

factor to multiply logical units by to get Pango +units.

+
+
+
+
+

pango_win32_get_debug_flag ()

+
gboolean
+pango_win32_get_debug_flag (void);
+

Returns whether debugging is turned on.

+
+

Returns

+

TRUE if debugging is turned on.

+
+

Since: 1.2

+
+
+
+

pango_win32_get_dc ()

+
HDC
+pango_win32_get_dc (void);
+

Obtains a handle to the Windows device context that is used by Pango.

+
+

Returns

+

A handle to the Windows device context that is used by Pango.

+
+
+
+
+

pango_win32_font_cache_new ()

+
PangoWin32FontCache *
+pango_win32_font_cache_new (void);
+

Creates a font cache.

+
+

Returns

+

The new font cache. This must be freed with +pango_win32_font_cache_free().

+
+
+
+
+

pango_win32_font_cache_free ()

+
void
+pango_win32_font_cache_free (PangoWin32FontCache *cache);
+

Frees a PangoWin32FontCache and all associated memory. All fonts loaded +through this font cache will be freed along with the cache.

+
+

Parameters

+
+++++ + + + + + +

cache

a PangoWin32FontCache

 
+
+
+
+
+

pango_win32_font_cache_load ()

+
HFONT
+pango_win32_font_cache_load (PangoWin32FontCache *cache,
+                             const LOGFONTA *logfont);
+

Creates a HFONT from a LOGFONTA. The +result may be newly loaded, or it may have been previously +stored

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cache

a PangoWin32FontCache

 

logfont

a pointer to a LOGFONTA structure describing the font to load.

 
+
+
+

Returns

+

The font structure, or NULL if the font +could not be loaded. In order to free this structure, you must call +pango_win32_font_cache_unload().

+

[nullable]

+
+
+
+
+

pango_win32_font_cache_loadw ()

+
HFONT
+pango_win32_font_cache_loadw (PangoWin32FontCache *cache,
+                              const LOGFONTW *logfont);
+

Creates a HFONT from a LOGFONTW. The +result may be newly loaded, or it may have been previously +stored

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cache

a PangoWin32FontCache

 

logfont

a pointer to a LOGFONTW structure describing the font to load.

 
+
+
+

Returns

+

The font structure, or NULL if the font +could not be loaded. In order to free this structure, you must call +pango_win32_font_cache_unload().

+

[nullable]

+
+

Since: 1.16

+
+
+
+

pango_win32_font_cache_unload ()

+
void
+pango_win32_font_cache_unload (PangoWin32FontCache *cache,
+                               HFONT hfont);
+

Frees a font structure previously loaded with pango_win32_font_cache_load().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

cache

a PangoWin32FontCache

 

hfont

the HFONT to unload

 
+
+
+
+
+

pango_win32_font_map_for_display ()

+
PangoFontMap *
+pango_win32_font_map_for_display (void);
+

Returns a PangoWin32FontMap. Font maps are cached and should +not be freed. If the font map is no longer needed, it can +be released with pango_win32_shutdown_display().

+
+

Returns

+

a PangoFontMap.

+
+
+
+
+

pango_win32_shutdown_display ()

+
void
+pango_win32_shutdown_display (void);
+

Free cached resources.

+
+
+
+

pango_win32_font_map_get_font_cache ()

+
PangoWin32FontCache *
+pango_win32_font_map_get_font_cache (PangoFontMap *font_map);
+

Obtains the font cache associated with the given font map.

+
+

Parameters

+
+++++ + + + + + +

font_map

a PangoWin32FontMap.

 
+
+
+

Returns

+

the PangoWin32FontCache of font_map +.

+
+
+
+
+

pango_win32_font_logfont ()

+
LOGFONTA *
+pango_win32_font_logfont (PangoFont *font);
+

Determine the LOGFONTA struct for the specified font. Note that +Pango internally uses LOGFONTW structs, so if converting the UTF-16 +face name in the LOGFONTW struct to system codepage fails, the +returned LOGFONTA will have an emppty face name. To get the +LOGFONTW of a PangoFont, use pango_win32_font_logfontw(). It +is recommended to do that always even if you don't expect +to come across fonts with odd names.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont which must be from the Win32 backend

 
+
+
+

Returns

+

A newly allocated LOGFONTA struct. It must be +freed with g_free().

+
+
+
+
+

pango_win32_font_logfontw ()

+
LOGFONTW *
+pango_win32_font_logfontw (PangoFont *font);
+

Determine the LOGFONTW struct for the specified font.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont which must be from the Win32 backend

 
+
+
+

Returns

+

A newly allocated LOGFONTW struct. It must be +freed with g_free().

+
+

Since: 1.16

+
+
+
+

pango_win32_font_description_from_logfont ()

+
PangoFontDescription *
+pango_win32_font_description_from_logfont
+                               (const LOGFONTA *lfp);
+

Creates a PangoFontDescription that matches the specified LOGFONTA.

+

The face name, italicness and weight fields in the LOGFONTA are used +to set up the resulting PangoFontDescription. If the face name in +the LOGFONTA contains non-ASCII characters the font is temporarily +loaded (using CreateFontIndirect()) and an ASCII (usually English) +name for it is looked up from the font name tables in the font +data. If that doesn't work, the face name is converted from the +system codepage to UTF-8 and that is used.

+
+

Parameters

+
+++++ + + + + + +

lfp

a LOGFONTA

 
+
+
+

Returns

+

the newly allocated PangoFontDescription, which +should be freed using pango_font_description_free()

+
+

Since: 1.12

+
+
+
+

pango_win32_font_description_from_logfontw ()

+
PangoFontDescription *
+pango_win32_font_description_from_logfontw
+                               (const LOGFONTW *lfp);
+

Creates a PangoFontDescription that matches the specified LOGFONTW.

+

The face name, italicness and weight fields in the LOGFONTW are used +to set up the resulting PangoFontDescription. If the face name in +the LOGFONTW contains non-ASCII characters the font is temporarily +loaded (using CreateFontIndirect()) and an ASCII (usually English) +name for it is looked up from the font name tables in the font +data. If that doesn't work, the face name is converted from UTF-16 +to UTF-8 and that is used.

+
+

Parameters

+
+++++ + + + + + +

lfp

a LOGFONTW

 
+
+
+

Returns

+

the newly allocated PangoFontDescription, which +should be freed using pango_font_description_free()

+
+

Since: 1.16

+
+
+
+

Types and Values

+
+

PANGO_RENDER_TYPE_WIN32

+
#define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
+
+

A string constant identifying the Win32 renderer. The associated quark (see +g_quark_from_string()) is used to identify the renderer in pango_find_map().

+
+
+
+

PangoWin32FontCache

+
typedef struct _PangoWin32FontCache PangoWin32FontCache;
+

A PangoWin32FontCache caches HFONTs by their LOGFONT descriptions.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-Xft-Fonts-and-Rendering.html b/docs/html/pango-Xft-Fonts-and-Rendering.html new file mode 100644 index 0000000..1f118da --- /dev/null +++ b/docs/html/pango-Xft-Fonts-and-Rendering.html @@ -0,0 +1,1270 @@ + + + + +Xft Fonts and Rendering: Pango Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Xft Fonts and Rendering

+

Xft Fonts and Rendering — Font handling and rendering with the Xft backend

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+PangoContext * + +pango_xft_get_context () +
+PangoFontMap * + +pango_xft_get_font_map () +
+void + +pango_xft_set_default_substitute () +
+void + +(*PangoXftSubstituteFunc) () +
+void + +pango_xft_substitute_changed () +
+void + +pango_xft_shutdown_display () +
+XftFont * + +pango_xft_font_get_font () +
+Display * + +pango_xft_font_get_display () +
+gboolean + +pango_xft_font_has_char () +
+FT_Face + +pango_xft_font_lock_face () +
+void + +pango_xft_font_unlock_face () +
+guint + +pango_xft_font_get_glyph () +
+PangoGlyph + +pango_xft_font_get_unknown_glyph () +
+PangoRenderer * + +pango_xft_renderer_new () +
+void + +pango_xft_renderer_set_draw () +
+void + +pango_xft_renderer_set_default_color () +
+void + +pango_xft_render () +
+void + +pango_xft_picture_render () +
+void + +pango_xft_render_transformed () +
+void + +pango_xft_render_layout_line () +
+void + +pango_xft_render_layout () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
gpointerdisplayWrite / Construct Only
gintscreenWrite / Construct Only
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
 PangoXftFont
 PangoXftFontMap
#definePANGO_RENDER_TYPE_XFT
structPangoXftRenderer
structPangoXftRendererClass
+
+
+

Object Hierarchy

+
    GObject
+    ├── PangoFont
+       ╰── PangoFcFont
+           ╰── PangoXftFont
+    ├── PangoFontMap
+       ╰── PangoFcFontMap
+           ╰── PangoXftFontMap
+    ╰── PangoRenderer
+        ╰── PangoXftRenderer
+
+
+
+

Description

+

The Xft library is a library for displaying fonts on the X window +system; internally it uses the fontconfig library to locate font +files, and the FreeType library to load and render fonts. The +Xft backend is the recommended Pango font backend for screen +display with X. (The Cairo back end is another possibility.)

+

Using the Xft backend is generally straightforward; +pango_xft_get_context() creates a context for a specified display +and screen. You can then create a PangoLayout with that context +and render it with pango_xft_render_layout(). At a more advanced +level, the low-level fontconfig options used for rendering fonts +can be affected using pango_xft_set_default_substitute(), and +pango_xft_substitute_changed().

+

A range of functions for drawing pieces of a layout, such as +individual layout lines and glyphs strings are provided. You can also +directly create a PangoXftRenderer. Finally, in some advanced cases, it +is useful to derive from PangoXftRenderer. Deriving from +PangoXftRenderer is useful for two reasons. One reason is be to +support custom attributes by overriding PangoRendererClass virtual +functions like 'prepare_run' or 'draw_shape'. The reason is to +customize exactly how the final bits are drawn to the destination by +overriding the PangoXftRendererClass virtual functions +'composite_glyphs' and 'composite_trapezoids'.

+
+
+

Functions

+
+

pango_xft_get_context ()

+
PangoContext *
+pango_xft_get_context (Display *display,
+                       int screen);
+
+

pango_xft_get_context has been deprecated since version 1.22 and should not be used in newly-written code.

+

Use pango_xft_get_font_map() followed by +pango_font_map_create_context() instead.

+
+

Retrieves a PangoContext appropriate for rendering with +Xft fonts on the given screen of the given display.

+

[skip]

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

display

an X display.

 

screen

an X screen.

 
+
+
+

Returns

+

the new PangoContext.

+
+
+
+
+

pango_xft_get_font_map ()

+
PangoFontMap *
+pango_xft_get_font_map (Display *display,
+                        int screen);
+

Returns the PangoXftFontMap for the given display and screen. +The fontmap is owned by Pango and will be valid until +the display is closed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

display

an X display

 

screen

the screen number of a screen within display +

 
+
+
+

Returns

+

a PangoFontMap object, owned by Pango.

+

[transfer none]

+
+

Since: 1.2

+
+
+
+

pango_xft_set_default_substitute ()

+
void
+pango_xft_set_default_substitute (Display *display,
+                                  int screen,
+                                  PangoXftSubstituteFunc func,
+                                  gpointer data,
+                                  GDestroyNotify notify);
+

Sets a function that will be called to do final configuration +substitution on a FcPattern before it is used to load +the font. This function can be used to do things like set +hinting and antialiasing options.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

display

an X Display

 

screen

the screen number of a screen within display +

 

func

function to call to to do final config tweaking +on FcPattern objects.

 

data

data to pass to func +

 

notify

function to call when data +is no longer used.

 
+
+

Since: 1.2

+
+
+
+

PangoXftSubstituteFunc ()

+
void
+(*PangoXftSubstituteFunc) (FcPattern *pattern,
+                           gpointer data);
+

Function type for doing final config tweaking on prepared FcPatterns.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pattern

the FcPattern to tweak.

 

data

user data.

 
+
+
+
+
+

pango_xft_substitute_changed ()

+
void
+pango_xft_substitute_changed (Display *display,
+                              int screen);
+

Call this function any time the results of the +default substitution function set with +pango_xft_set_default_substitute() change. +That is, if your substitution function will return different +results for the same input pattern, you must call this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

display

an X Display

 

screen

the screen number of a screen within display +

 
+
+

Since: 1.2

+
+
+
+

pango_xft_shutdown_display ()

+
void
+pango_xft_shutdown_display (Display *display,
+                            int screen);
+

Release any resources that have been cached for the +combination of display + and screen +. Note that when the +X display is closed, resources are released automatically, +without needing to call this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

display

an X display

 

screen

the screen number of a screen within display +

 
+
+

Since: 1.2

+
+
+
+

pango_xft_font_get_font ()

+
XftFont *
+pango_xft_font_get_font (PangoFont *font);
+

Returns the XftFont of a font.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont.

[nullable]
+
+
+

Returns

+

the XftFont associated to font +, or NULL +if font +is NULL.

+

[nullable]

+
+
+
+
+

pango_xft_font_get_display ()

+
Display *
+pango_xft_font_get_display (PangoFont *font);
+

Returns the X display of the XftFont of a font.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont.

 
+
+
+

Returns

+

the X display of the XftFont associated to font +.

+
+
+
+
+

pango_xft_font_has_char ()

+
gboolean
+pango_xft_font_has_char (PangoFont *font,
+                         gunichar wc);
+

pango_xft_font_has_char is deprecated and should not be used in newly-written code.

+

Determines whether font + has a glyph for the codepoint wc +.

+

Use pango_fc_font_has_char() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont for the Xft backend

 

wc

Unicode codepoint to look up

 
+
+
+

Returns

+

TRUE if font +has the requested codepoint.

+
+

Since: 1.2

+
+
+
+

pango_xft_font_lock_face ()

+
FT_Face
+pango_xft_font_lock_face (PangoFont *font);
+

pango_xft_font_lock_face is deprecated and should not be used in newly-written code.

+

Gets the FreeType FT_Face associated with a font, +This face will be kept around until you call +pango_xft_font_unlock_face().

+

Use pango_fc_font_lock_face() instead.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont.

 
+
+
+

Returns

+

the FreeType FT_Face associated with font +.

+
+

Since: 1.2

+
+
+
+

pango_xft_font_unlock_face ()

+
void
+pango_xft_font_unlock_face (PangoFont *font);
+

pango_xft_font_unlock_face is deprecated and should not be used in newly-written code.

+

Releases a font previously obtained with +pango_xft_font_lock_face().

+

Use pango_fc_font_unlock_face() instead.

+
+

Parameters

+
+++++ + + + + + +

font

a PangoFont.

 
+
+

Since: 1.2

+
+
+
+

pango_xft_font_get_glyph ()

+
guint
+pango_xft_font_get_glyph (PangoFont *font,
+                          gunichar wc);
+

pango_xft_font_get_glyph is deprecated and should not be used in newly-written code.

+

Gets the glyph index for a given Unicode character +for font +. If you only want to determine +whether the font has the glyph, use pango_xft_font_has_char().

+

Use pango_fc_font_get_glyph() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont for the Xft backend

 

wc

Unicode codepoint to look up

 
+
+
+

Returns

+

the glyph index, or 0, if the Unicode +character does not exist in the font.

+
+

Since: 1.2

+
+
+
+

pango_xft_font_get_unknown_glyph ()

+
PangoGlyph
+pango_xft_font_get_unknown_glyph (PangoFont *font,
+                                  gunichar wc);
+

pango_xft_font_get_unknown_glyph is deprecated and should not be used in newly-written code.

+

Returns the index of a glyph suitable for drawing wc + as an +unknown character.

+

Use PANGO_GET_UNKNOWN_GLYPH() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a PangoFont.

 

wc

the Unicode character for which a glyph is needed.

 
+
+
+

Returns

+

a glyph index into font +.

+
+
+
+
+

pango_xft_renderer_new ()

+
PangoRenderer *
+pango_xft_renderer_new (Display *display,
+                        int screen);
+

Create a new PangoXftRenderer to allow rendering Pango objects +with the Xft library. You must call pango_xft_renderer_set_draw() before +using the renderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

display

an X display

 

screen

the index of the screen for display +to which rendering will be done

 
+
+
+

Returns

+

the newly created PangoXftRenderer, which should +be freed with g_object_unref().

+
+

Since: 1.8

+
+
+
+

pango_xft_renderer_set_draw ()

+
void
+pango_xft_renderer_set_draw (PangoXftRenderer *xftrenderer,
+                             XftDraw *draw);
+

Sets the XftDraw object that the renderer is drawing to. +The renderer must not be currently active.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xftrenderer

a PangoXftRenderer

 

draw

a XftDraw

 
+
+

Since: 1.8

+
+
+
+

pango_xft_renderer_set_default_color ()

+
void
+pango_xft_renderer_set_default_color (PangoXftRenderer *xftrenderer,
+                                      PangoColor *default_color);
+

Sets the default foreground color for a XftRenderer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xftrenderer

a XftRenderer

 

default_color

the default foreground color

 
+
+

Since: 1.8

+
+
+
+

pango_xft_render ()

+
void
+pango_xft_render (XftDraw *draw,
+                  XftColor *color,
+                  PangoFont *font,
+                  PangoGlyphString *glyphs,
+                  gint x,
+                  gint y);
+

Renders a PangoGlyphString onto an XftDraw object wrapping an X drawable.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

draw

the XftDraw object.

 

color

the color in which to draw the string

 

font

the font in which to draw the string

 

glyphs

the glyph string to draw

 

x

the x position of start of string (in pixels)

 

y

the y position of baseline (in pixels)

 
+
+
+
+
+

pango_xft_picture_render ()

+
void
+pango_xft_picture_render (Display *display,
+                          Picture src_picture,
+                          Picture dest_picture,
+                          PangoFont *font,
+                          PangoGlyphString *glyphs,
+                          gint x,
+                          gint y);
+

Renders a PangoGlyphString onto an Xrender Picture object.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

display

an X display

 

src_picture

the source picture to draw the string with

 

dest_picture

the destination picture to draw the string onto

 

font

the font in which to draw the string

 

glyphs

the glyph string to draw

 

x

the x position of start of string (in pixels)

 

y

the y position of baseline (in pixels)

 
+
+
+
+
+

pango_xft_render_transformed ()

+
void
+pango_xft_render_transformed (XftDraw *draw,
+                              XftColor *color,
+                              PangoMatrix *matrix,
+                              PangoFont *font,
+                              PangoGlyphString *glyphs,
+                              int x,
+                              int y);
+

Renders a PangoGlyphString onto a XftDraw, possibly +transforming the layed-out coordinates through a transformation +matrix. Note that the transformation matrix for font + is not +changed, so to produce correct rendering results, the font + +must have been loaded using a PangoContext with an identical +transformation matrix to that passed in to this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

draw

an XftDraw

 

color

the color in which to draw the glyphs

 

font

the font in which to draw the string

 

matrix

a PangoMatrix, or NULL to use an identity +transformation.

[nullable]

glyphs

the glyph string to draw

 

x

the x position of the start of the string (in Pango +units in user space coordinates)

 

y

the y position of the baseline (in Pango units +in user space coordinates)

 
+
+

Since: 1.8

+
+
+
+

pango_xft_render_layout_line ()

+
void
+pango_xft_render_layout_line (XftDraw *draw,
+                              XftColor *color,
+                              PangoLayoutLine *line,
+                              int x,
+                              int y);
+

Render a PangoLayoutLine onto a XftDraw

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

draw

an XftDraw

 

color

the foreground color in which to draw the layout line +(may be overridden by color attributes)

 

line

a PangoLayoutLine

 

x

the x position of start of string (in Pango units)

 

y

the y position of baseline (in Pango units)

 
+
+

Since: 1.8

+
+
+
+

pango_xft_render_layout ()

+
void
+pango_xft_render_layout (XftDraw *draw,
+                         XftColor *color,
+                         PangoLayout *layout,
+                         int x,
+                         int y);
+

Render a PangoLayout onto a XftDraw

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

draw

an XftDraw

 

color

the foreground color in which to draw the layout +(may be overridden by color attributes)

 

layout

a PangoLayout

 

x

the X position of the left of the layout (in Pango units)

 

y

the Y position of the top of the layout (in Pango units)

 
+
+

Since: 1.8

+
+
+
+

Types and Values

+
+

PangoXftFont

+
typedef struct _PangoXftFont PangoXftFont;
+

PangoXftFont is an implementation of PangoFcFont using the Xft +library for rendering. It is used in conjunction with PangoXftFontMap.

+
+
+
+

PangoXftFontMap

+
typedef struct _PangoXftFontMap PangoXftFontMap;
+

PangoXftFontMap is an implementation of PangoFcFontMap suitable for +the Xft library as the renderer. It is used in to create fonts of +type PangoXftFont.

+
+
+
+

PANGO_RENDER_TYPE_XFT

+
#define PANGO_RENDER_TYPE_XFT "PangoRenderXft"
+
+

PANGO_RENDER_TYPE_XFT is deprecated and should not be used in newly-written code.

+

A string constant that was used to identify shape engines that work +with the Xft backend. See PANGO_RENDER_TYPE_FC for the replacement.

+
+
+
+

struct PangoXftRenderer

+
struct PangoXftRenderer;
+

PangoXftRenderer is a subclass of PangoRenderer used for rendering +with Pango's Xft backend. It can be used directly, or it can be +further subclassed to modify exactly how drawing of individual +elements occurs.

+

Since: 1.8

+
+
+
+

struct PangoXftRendererClass

+
struct PangoXftRendererClass {
+  void (*composite_trapezoids) (PangoXftRenderer *xftrenderer,
+				PangoRenderPart   part,
+				XTrapezoid       *trapezoids,
+				int               n_trapezoids);
+  void (*composite_glyphs)     (PangoXftRenderer *xftrenderer,
+				XftFont          *xft_font,
+				XftGlyphSpec     *glyphs,
+				int               n_glyphs);
+};
+
+

The class structure for PangoXftRenderer

+
+

Members

+
+++++ + + + + + + + + + + + + +

composite_trapezoids ()

draw the specified trapezoids using +the current color and other attributes for part +

 

composite_glyphs ()

draw the specified glyphs using +the current foreground color and other foreground +attributes

 
+
+

Since: 1.8

+
+
+
+

Property Details

+
+

The “display” property

+
  “display”                  gpointer
+

The display being rendered to.

+

Flags: Write / Construct Only

+
+
+
+

The “screen” property

+
  “screen”                   gint
+

The screen being rendered to.

+

Flags: Write / Construct Only

+

Allowed values: >= 0

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango-hierarchy.html b/docs/html/pango-hierarchy.html new file mode 100644 index 0000000..a03cd43 --- /dev/null +++ b/docs/html/pango-hierarchy.html @@ -0,0 +1,90 @@ + + + + +Object Hierarchy: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Object Hierarchy

+
+    GObject
+    ├── PangoFontMap
+       ╰── PangoFcFontMap
+           ├── PangoFT2FontMap
+           ╰── PangoXftFontMap
+    ├── PangoFont
+       ╰── PangoFcFont
+           ╰── PangoXftFont
+    ├── PangoContext
+    ├── PangoEngine
+       ├── PangoEngineLang
+       ╰── PangoEngineShape
+    ├── PangoFcDecoder
+    ├── PangoFontFace
+    ├── PangoFontFamily
+    ├── PangoFontset
+       ╰── PangoFontsetSimple
+    ├── PangoLayout
+    ├── PangoOTInfo
+    ├── PangoOTRuleset
+    ╰── PangoRenderer
+        ╰── PangoXftRenderer
+    GInterface
+    ├── PangoCairoFontMap
+    ╰── PangoCairoFont
+    GEnum
+    ├── PangoAlignment
+    ├── PangoAttrType
+    ├── PangoBidiType
+    ├── PangoCoverageLevel
+    ├── PangoDirection
+    ├── PangoEllipsizeMode
+    ├── PangoGravity
+    ├── PangoGravityHint
+    ├── PangoRenderPart
+    ├── PangoScript
+    ├── PangoStretch
+    ├── PangoStyle
+    ├── PangoTabAlign
+    ├── PangoUnderline
+    ├── PangoVariant
+    ├── PangoWeight
+    ╰── PangoWrapMode
+    GBoxed
+    ├── PangoAttrList
+    ├── PangoColor
+    ├── PangoFontDescription
+    ├── PangoFontMetrics
+    ├── PangoGlyphItem
+    ├── PangoGlyphItemIter
+    ├── PangoGlyphString
+    ├── PangoItem
+    ├── PangoLanguage
+    ├── PangoLayoutIter
+    ├── PangoLayoutLine
+    ├── PangoMatrix
+    ╰── PangoTabArray
+    GFlags
+    ╰── PangoFontMask
+
+
+ + + \ No newline at end of file diff --git a/docs/html/pango.devhelp2 b/docs/html/pango.devhelp2 new file mode 100644 index 0000000..100dbcb --- /dev/null +++ b/docs/html/pango.devhelp2 @@ -0,0 +1,1216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/pango.html b/docs/html/pango.html new file mode 100644 index 0000000..b0d573b --- /dev/null +++ b/docs/html/pango.html @@ -0,0 +1,62 @@ + + + + +Basic Pango Interfaces: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Basic Pango Interfaces

+
+
+Rendering — Functions to run the rendering pipeline +
+
+Glyph Storage — Structures for storing information about glyphs +
+
+Fonts — Structures representing abstract fonts +
+
+Text Attributes — Font and other attributes for annotating text +
+
+Tab Stops — Structures for storing tab stops +
+
+Text Attribute Markup — Simple +markup language to encode text with attributes +
+
+Layout Objects — High-level layout driver objects +
+
+Scripts and Languages — Identifying writing systems and languages +
+
+Bidirectional Text — Types and functions to help with handling bidirectional text +
+
+Vertical Text — Laying text out in vertical directions +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/rendering.html b/docs/html/rendering.html new file mode 100644 index 0000000..a989777 --- /dev/null +++ b/docs/html/rendering.html @@ -0,0 +1,46 @@ + + + + +Rendering with Pango: Pango Reference Manual + + + + + + + + + + + + + + + + +
+

+Rendering with Pango

+
+
+Win32 Fonts and Rendering — Functions for shape engines to manipulate Win32 fonts +
+
+FreeType Fonts and Rendering — Functions for shape engines to manipulate FreeType fonts +
+
+Xft Fonts and Rendering — Font handling and rendering with the Xft backend +
+
+Cairo Rendering — Rendering with the Cairo backend +
+
+CoreText Fonts — Font handling with CoreText fonts +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/right-insensitive.png b/docs/html/right-insensitive.png new file mode 100644 index 0000000..4c95785 Binary files /dev/null and b/docs/html/right-insensitive.png differ diff --git a/docs/html/right.png b/docs/html/right.png new file mode 100644 index 0000000..76260ec Binary files /dev/null and b/docs/html/right.png differ diff --git a/docs/html/rotated-text.png b/docs/html/rotated-text.png new file mode 100644 index 0000000..b29682e Binary files /dev/null and b/docs/html/rotated-text.png differ diff --git a/docs/html/style.css b/docs/html/style.css new file mode 100644 index 0000000..4be4ede --- /dev/null +++ b/docs/html/style.css @@ -0,0 +1,483 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +span.nowrap { + white-space: nowrap; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.informaltable table +{ + border-collapse: separate; + border-spacing: 1em 0.3em; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; + margin-top: 1em; + margin-bottom: 1em; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + diff --git a/docs/html/up-insensitive.png b/docs/html/up-insensitive.png new file mode 100644 index 0000000..f404986 Binary files /dev/null and b/docs/html/up-insensitive.png differ diff --git a/docs/html/up.png b/docs/html/up.png new file mode 100644 index 0000000..80b4b37 Binary files /dev/null and b/docs/html/up.png differ diff --git a/docs/layout.eps b/docs/layout.eps new file mode 100644 index 0000000..42c897a --- /dev/null +++ b/docs/layout.eps @@ -0,0 +1,231 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: layout.eps +%%Creator: fig2dev Version 3.2 Patchlevel 1 +%%CreationDate: Thu Mar 9 16:51:04 2000 +%%For: otaylor@fresnel.labs.redhat.com (Owen Taylor,,547-0012 x249) +%%Orientation: Portrait +%%BoundingBox: 0 0 629 233 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def +/col32 {0.443 0.459 0.443 srgb} bind def + +end +save +-5.0 253.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit +n -1000 5215 m -1000 -1000 l 11561 -1000 l 11561 5215 l cp clip + 0.06000 0.06000 sc +% Polyline +15.000 slw +gs clippath +10200 3405 m 10350 3450 l 10200 3495 l 10380 3495 l 10380 3405 l cp +6300 3495 m 6150 3450 l 6300 3405 l 6120 3405 l 6120 3495 l cp +clip +n 6150 3450 m 10350 3450 l gs col-1 s gr gr + +% arrowhead +7.500 slw +n 6300 3495 m 6150 3450 l 6300 3405 l 6300 3450 l 6300 3495 l cp gs 0.00 setgray ef gr col-1 s +% arrowhead +n 10200 3405 m 10350 3450 l 10200 3495 l 10200 3450 l 10200 3405 l cp gs 0.00 setgray ef gr col-1 s +% Polyline +n 1200 675 m 1200 3600 l gs col-1 s gr +% Polyline +15.000 slw +gs clippath +5250 3405 m 5400 3450 l 5250 3495 l 5430 3495 l 5430 3405 l cp +1350 3495 m 1200 3450 l 1350 3405 l 1170 3405 l 1170 3495 l cp +clip +n 1200 3450 m 5400 3450 l gs col-1 s gr gr + +% arrowhead +7.500 slw +n 1350 3495 m 1200 3450 l 1350 3405 l 1350 3450 l 1350 3495 l cp gs 0.00 setgray ef gr col-1 s +% arrowhead +n 5250 3405 m 5400 3450 l 5250 3495 l 5250 3450 l 5250 3405 l cp gs 0.00 setgray ef gr col-1 s +% Polyline +n 1050 2175 m 1200 2175 l gs col-1 s gr +% Polyline +15.000 slw +n 1125 2025 m 1125 2175 l gs col-1 s gr +% Polyline +7.500 slw +n 6150 975 m 6150 3600 l gs col-1 s gr +% Polyline +n 5400 975 m 5400 3600 l gs col-1 s gr +% Polyline +n 1800 975 m 1800 675 l gs col-1 s gr +% Polyline +15.000 slw +gs clippath +1650 780 m 1800 825 l 1650 870 l 1830 870 l 1830 780 l cp +1350 870 m 1200 825 l 1350 780 l 1170 780 l 1170 870 l cp +clip +n 1200 825 m 1800 825 l gs col-1 s gr gr + +% arrowhead +7.500 slw +n 1350 870 m 1200 825 l 1350 780 l 1350 825 l 1350 870 l cp gs 0.00 setgray ef gr col-1 s +% arrowhead +n 1650 780 m 1800 825 l 1650 870 l 1650 825 l 1650 780 l cp gs 0.00 setgray ef gr col-1 s +% Polyline +n 9750 975 m 9750 675 l gs col-1 s gr +% Polyline +15.000 slw +gs clippath +10200 780 m 10350 825 l 10200 870 l 10380 870 l 10380 780 l cp +9900 870 m 9750 825 l 9900 780 l 9720 780 l 9720 870 l cp +clip +n 9750 825 m 10350 825 l gs col-1 s gr gr + +% arrowhead +7.500 slw +n 9900 870 m 9750 825 l 9900 780 l 9900 825 l 9900 870 l cp gs 0.00 setgray ef gr col-1 s +% arrowhead +n 10200 780 m 10350 825 l 10200 870 l 10200 825 l 10200 780 l cp gs 0.00 setgray ef gr col-1 s +% Polyline +n 10350 675 m 10350 3600 l gs col-1 s gr +% Polyline +15.000 slw +n 4950 1425 m 1800 1425 l 1800 975 l 4950 975 l cp gs col32 s gr +% Polyline +n 4575 2025 m 1200 2025 l 1200 1575 l 4575 1575 l cp gs col32 s gr +% Polyline +n 5250 2625 m 1200 2625 l 1200 2175 l 5250 2175 l cp gs col32 s gr +% Polyline +n 2400 3225 m 1200 3225 l 1200 2775 l 2400 2775 l cp gs col32 s gr +% Polyline +n 9750 1425 m 6600 1425 l 6600 975 l 9750 975 l cp gs col32 s gr +% Polyline +n 10350 2025 m 6975 2025 l 6975 1575 l 10350 1575 l cp gs col32 s gr +% Polyline +n 10350 2625 m 6300 2625 l 6300 2175 l 10350 2175 l cp gs col32 s gr +% Polyline +n 10350 3225 m 9150 3225 l 9150 2775 l 10350 2775 l cp gs col32 s gr +% Polyline +7.500 slw +n 1200 2025 m 1050 2025 l gs col-1 s gr +/Times-Roman ff 360.00 scf sf +1200 2475 m +gs 1 -1 sc (demonstrate PangoLayout's) col0 sh gr +/Times-Roman ff 360.00 scf sf +1200 3075 m +gs 1 -1 sc (features.) col0 sh gr +/Times-Roman ff 360.00 scf sf +1200 1875 m +gs 1 -1 sc (should wrap suitably to) col0 sh gr +/Helvetica ff 240.00 scf sf +525 2175 m +gs 1 -1 sc (spacing) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 360.00 scf sf +1800 1275 m +gs 1 -1 sc (Here is some text that) col0 sh gr +/Times-Roman ff 360.00 scf sf +9150 3075 m +gs 1 -1 sc (features.) col0 sh gr +/Times-Roman ff 360.00 scf sf +6600 1275 m +gs 1 -1 sc (Here is some text that) col0 sh gr +/Helvetica ff 240.00 scf sf +1875 3825 m +gs 1 -1 sc (width) dup sw pop 2 div neg 0 rm col-1 sh gr +/Helvetica ff 240.00 scf sf +6825 3825 m +gs 1 -1 sc (width) dup sw pop 2 div neg 0 rm col-1 sh gr +/Helvetica ff 240.00 scf sf +10050 525 m +gs 1 -1 sc (indent) dup sw pop 2 div neg 0 rm col-1 sh gr +/Helvetica ff 240.00 scf sf +1575 525 m +gs 1 -1 sc (indent) dup sw pop 2 div neg 0 rm col-1 sh gr +/Helvetica ff 300.00 scf sf +9225 4125 m +gs 1 -1 sc (Right Aligned) dup sw pop 2 div neg 0 rm col-1 sh gr +/Helvetica ff 300.00 scf sf +4350 4125 m +gs 1 -1 sc (Left Aligned) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 360.00 scf sf +6975 1875 m +gs 1 -1 sc (should wrap suitably to) col0 sh gr +/Times-Roman ff 360.00 scf sf +6300 2475 m +gs 1 -1 sc (demonstrate PangoLayout's) col0 sh gr +$F2psEnd +rs diff --git a/docs/layout.fig b/docs/layout.fig new file mode 100644 index 0000000..7e43560 --- /dev/null +++ b/docs/layout.fig @@ -0,0 +1,75 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #717571 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 90.00 150.00 + 1 1 1.00 90.00 150.00 + 6150 3450 10350 3450 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1200 675 1200 3600 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 90.00 150.00 + 1 1 1.00 90.00 150.00 + 1200 3450 5400 3450 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1050 2175 1200 2175 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1125 2025 1125 2175 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6150 975 6150 3600 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 975 5400 3600 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1800 975 1800 675 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 90.00 150.00 + 1 1 1.00 90.00 150.00 + 1200 825 1800 825 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9750 975 9750 675 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 90.00 150.00 + 1 1 1.00 90.00 150.00 + 9750 825 10350 825 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 10350 675 10350 3600 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 4950 1425 1800 1425 1800 975 4950 975 4950 1425 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 4575 2025 1200 2025 1200 1575 4575 1575 4575 2025 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 5250 2625 1200 2625 1200 2175 5250 2175 5250 2625 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2400 3225 1200 3225 1200 2775 2400 2775 2400 3225 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 9750 1425 6600 1425 6600 975 9750 975 9750 1425 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 10350 2025 6975 2025 6975 1575 10350 1575 10350 2025 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 10350 2625 6300 2625 6300 2175 10350 2175 10350 2625 +2 2 0 2 32 7 100 0 -1 0.000 0 0 -1 0 0 5 + 10350 3225 9150 3225 9150 2775 10350 2775 10350 3225 +2 1 0 1 -1 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1200 2025 1050 2025 +4 0 0 100 0 0 24 0.0000 4 330 4155 1200 2475 demonstrate PangoLayout's\001 +4 0 0 100 0 0 24 0.0000 4 255 1260 1200 3075 features.\001 +4 0 0 100 0 0 24 0.0000 4 330 3405 1200 1875 should wrap suitably to\001 +4 1 -1 100 0 16 16 0.0000 4 240 855 525 2175 spacing\001 +4 0 0 100 0 0 24 0.0000 4 255 3270 1800 1275 Here is some text that\001 +4 0 0 100 0 0 24 0.0000 4 255 1260 9150 3075 features.\001 +4 0 0 100 0 0 24 0.0000 4 255 3270 6600 1275 Here is some text that\001 +4 1 -1 100 0 16 16 0.0000 4 180 540 1875 3825 width\001 +4 1 -1 100 0 16 16 0.0000 4 180 540 6825 3825 width\001 +4 1 -1 100 0 16 16 0.0000 4 180 645 10050 525 indent\001 +4 1 -1 100 0 16 16 0.0000 4 180 645 1575 525 indent\001 +4 1 -1 100 0 16 20 0.0000 4 300 1770 9225 4125 Right Aligned\001 +4 1 -1 100 0 16 20 0.0000 4 300 1590 4350 4125 Left Aligned\001 +4 0 0 100 0 0 24 0.0000 4 330 3405 6975 1875 should wrap suitably to\001 +4 0 0 100 0 0 24 0.0000 4 330 4155 6300 2475 demonstrate PangoLayout's\001 diff --git a/docs/layout.gif b/docs/layout.gif new file mode 100644 index 0000000..96bde1f Binary files /dev/null and b/docs/layout.gif differ diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 0000000..9122dc3 --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,110 @@ +subdir('xml') + +version_xml_conf = configuration_data() +version_xml_conf.set('PANGO_VERSION', meson.project_version()) +configure_file(input: 'version.xml.in', + output: 'version.xml', + configuration: version_xml_conf) + +private_headers = [ + 'pangoatsui-private.h', + 'pangocairo-private.h', + 'pangocairo-fc.h', + 'pangocairo-win32.h', + 'pangocairo-atsui.h', + 'pango-color-table.h', + 'pango-engine-private.h', + 'pango-impl-utils.h', + 'pango-glyph-item-private.h', + 'pango-layout-private.h', + 'pango-script-table.h', + 'pango-script-private.h', + 'pangofc-private.h', + 'pangoft2-private.h', + 'pangowin32-private.h', + 'pangoatsui-private.h', + 'pangox-private.h', + 'pangoxft-private.h', + 'pango-ot-private.h', + 'pango-script-lang-table.h', + 'pango-language-sample-table.h', + 'pangocoretext-private.h', + 'pangoatsui-private.h', +] + +if host_system != 'darwin' + private_headers += [ + 'pangocairo-coretextfont.h', + 'pangocairo-coretext.h', + 'pangocoretext.h', + ] +endif + +if host_system != 'windows' + private_headers += [ + 'pangocairo-win32.h', + 'pangowin32.h', + ] +else + private_headers += [ + 'pangoxft.h', + 'pangoxft-render.h', + ] +endif + +content_files = [ + 'pango_markup.sgml', + 'version.xml', +] + +html_images = [ + 'layout.gif', + 'rotated-text.png', +] + +docdeps = [ libpango_dep ] + +if build_pangoft2 + docdeps += libpangoft2_dep +endif + +if xft_dep.found() + docdeps += libpangoxft_dep +endif + +if cairo_dep.found() + docdeps += libpangocairo_dep +endif + +glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') +glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') +cairo_prefix = dependency('cairo').get_pkgconfig_variable('prefix') +cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html') +docpath = join_paths(pango_datadir, 'gtk-doc', 'html') + +gnome.gtkdoc('pango', + main_xml: 'pango-docs.sgml', + src_dir: [ + join_paths(meson.source_root(), 'pango'), + join_paths(meson.build_root(), 'pango'), + ], + dependencies: docdeps, + gobject_typesfile: 'pango.types', + scan_args: [ + '--rebuild-types', + '--deprecated-guards=PANGO_DISABLE_DEPRECATED', + '--ignore-decorators=_PANGO_EXTERN', + '--ignore-headers=' + ' '.join(private_headers), + ], + mkdb_args: [ + '--sgml-mode', + '--output-format=xml', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(cairo_docpath, 'cairo')), + ], + html_assets: html_images, + install: true) diff --git a/docs/pango-docs.sgml b/docs/pango-docs.sgml new file mode 100644 index 0000000..3c74d4a --- /dev/null +++ b/docs/pango-docs.sgml @@ -0,0 +1,150 @@ + + + +]> + + + Pango Reference Manual + for Pango &version; + + + + Basic Pango Interfaces + + + + + + + + + + + + + + Rendering with Pango + + + + + + + + + Low Level Functionality + + + + + + + + + + + + + + + + Object Hierarchy + + + + + + + + Index of all symbols + + + + Index of deprecated symbols + + + + Index of new symbols in 1.2 + + + + Index of new symbols in 1.4 + + + + Index of new symbols in 1.6 + + + + Index of new symbols in 1.8 + + + + Index of new symbols in 1.10 + + + + Index of new symbols in 1.12 + + + + Index of new symbols in 1.14 + + + + Index of new symbols in 1.16 + + + + Index of new symbols in 1.18 + + + + Index of new symbols in 1.20 + + + + Index of new symbols in 1.22 + + + + Index of new symbols in 1.24 + + + + Index of new symbols in 1.26 + + + + Index of new symbols in 1.30 + + + + Index of new symbols in 1.31 + + + + Index of new symbols in 1.32 + + + + Index of new symbols in 1.32.4 + + + + Index of new symbols in 1.34 + + + + Index of new symbols in 1.38 + + + + Index of new symbols in 1.40 + + + + diff --git a/docs/pango-overrides.txt b/docs/pango-overrides.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/docs/pango-overrides.txt diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt new file mode 100644 index 0000000..42e2581 --- /dev/null +++ b/docs/pango-sections.txt @@ -0,0 +1,1231 @@ +
+Text Processing +main + +PangoContext +PangoItem +PangoAnalysis +PANGO_ANALYSIS_FLAG_CENTERED_BASELINE +PANGO_ANALYSIS_FLAG_IS_ELLIPSIS +PANGO_TYPE_DIRECTION + +pango_itemize +pango_itemize_with_base_dir +pango_item_free +pango_item_copy +pango_item_new +pango_item_split +pango_reorder_items + +pango_context_new +pango_context_changed +pango_context_get_serial +pango_context_set_font_map +pango_context_get_font_map +pango_context_get_font_description +pango_context_set_font_description +pango_context_get_language +pango_context_set_language +pango_context_get_base_dir +pango_context_set_base_dir +pango_context_get_base_gravity +pango_context_set_base_gravity +pango_context_get_gravity +pango_context_get_gravity_hint +pango_context_set_gravity_hint +pango_context_get_matrix +pango_context_set_matrix +pango_context_load_font +pango_context_load_fontset +pango_context_get_metrics +pango_context_list_families + +PANGO_TYPE_CONTEXT +PangoContextClass +PANGO_CONTEXT +PANGO_CONTEXT_CLASS +PANGO_IS_CONTEXT +PANGO_IS_CONTEXT_CLASS +PANGO_CONTEXT_GET_CLASS +PANGO_TYPE_ITEM + +pango_break +pango_get_log_attrs +pango_find_paragraph_boundary +pango_default_break +PangoLogAttr + +pango_shape +pango_shape_full + + +pango_context_get_type +pango_item_get_type +
+ +
+Glyph Storage +glyphs +PANGO_SCALE +PANGO_PIXELS +PANGO_PIXELS_FLOOR +PANGO_PIXELS_CEIL +PANGO_UNITS_ROUND +pango_units_to_double +pango_units_from_double +PangoRectangle +PANGO_ASCENT +PANGO_DESCENT +PANGO_LBEARING +PANGO_RBEARING +pango_extents_to_pixels +PangoMatrix +PANGO_TYPE_MATRIX +PANGO_MATRIX_INIT +pango_matrix_copy +pango_matrix_free +pango_matrix_translate +pango_matrix_scale +pango_matrix_rotate +pango_matrix_concat +pango_matrix_transform_point +pango_matrix_transform_distance +pango_matrix_transform_rectangle +pango_matrix_transform_pixel_rectangle +pango_matrix_get_font_scale_factor +pango_matrix_get_font_scale_factors +PangoGlyph +PANGO_GLYPH_EMPTY +PANGO_GLYPH_INVALID_INPUT +PANGO_GLYPH_UNKNOWN_FLAG +PANGO_GET_UNKNOWN_GLYPH +PangoGlyphInfo +PangoGlyphGeometry +PangoGlyphUnit +PangoGlyphVisAttr +PangoGlyphString +PangoGlyphItem +PangoGlyphItemIter +PANGO_TYPE_GLYPH_STRING +pango_glyph_string_new +pango_glyph_string_copy +pango_glyph_string_set_size +pango_glyph_string_free +pango_glyph_string_extents +pango_glyph_string_extents_range +pango_glyph_string_get_width +pango_glyph_string_index_to_x +pango_glyph_string_x_to_index +pango_glyph_string_get_logical_widths +PANGO_TYPE_GLYPH_ITEM +pango_glyph_item_copy +pango_glyph_item_free +pango_glyph_item_split +pango_glyph_item_apply_attrs +pango_glyph_item_letter_space +pango_glyph_item_get_logical_widths +PANGO_TYPE_GLYPH_ITEM_ITER +pango_glyph_item_iter_copy +pango_glyph_item_iter_free +pango_glyph_item_iter_init_start +pango_glyph_item_iter_init_end +pango_glyph_item_iter_next_cluster +pango_glyph_item_iter_prev_cluster + + +pango_glyph_string_get_type +pango_glyph_item_get_type +pango_glyph_item_iter_get_type +pango_matrix_get_type +
+ +
+Coverage Maps +coverage-maps +PangoCoverageLevel +PANGO_TYPE_COVERAGE_LEVEL +PangoCoverage + +pango_coverage_new +pango_coverage_ref +pango_coverage_unref +pango_coverage_copy +pango_coverage_get +pango_coverage_max +pango_coverage_set +pango_coverage_to_bytes +pango_coverage_from_bytes + + +pango_coverage_level_get_type +
+ +
+Fonts +fonts +PangoFontDescription +PANGO_TYPE_FONT_DESCRIPTION +PangoStyle +PANGO_TYPE_STYLE +PangoWeight +PANGO_TYPE_WEIGHT +PangoVariant +PANGO_TYPE_VARIANT +PangoStretch +PANGO_TYPE_STRETCH +PangoFontMask +PANGO_TYPE_FONT_MASK +pango_font_description_new +pango_font_description_copy +pango_font_description_copy_static +pango_font_description_hash +pango_font_description_equal +pango_font_description_free +pango_font_descriptions_free +pango_font_description_set_family +pango_font_description_set_family_static +pango_font_description_get_family +pango_font_description_set_style +pango_font_description_get_style +pango_font_description_set_variant +pango_font_description_get_variant +pango_font_description_set_weight +pango_font_description_get_weight +pango_font_description_set_stretch +pango_font_description_get_stretch +pango_font_description_set_size +pango_font_description_get_size +pango_font_description_set_absolute_size +pango_font_description_get_size_is_absolute +pango_font_description_set_gravity +pango_font_description_get_gravity +pango_font_description_set_variations +pango_font_description_set_variations_static +pango_font_description_get_variations +pango_font_description_get_set_fields +pango_font_description_unset_fields +pango_font_description_merge +pango_font_description_merge_static +pango_font_description_better_match +pango_font_description_from_string +pango_font_description_to_string +pango_font_description_to_filename + +PangoFontMetrics +PANGO_TYPE_FONT_METRICS +pango_font_metrics_ref +pango_font_metrics_unref +pango_font_metrics_get_ascent +pango_font_metrics_get_descent +pango_font_metrics_get_approximate_char_width +pango_font_metrics_get_approximate_digit_width +pango_font_metrics_get_underline_thickness +pango_font_metrics_get_underline_position +pango_font_metrics_get_strikethrough_thickness +pango_font_metrics_get_strikethrough_position + +PangoFont +PANGO_TYPE_FONT +PANGO_FONT +PANGO_IS_FONT +pango_font_find_shaper +pango_font_describe +pango_font_describe_with_absolute_size +pango_font_get_coverage +pango_font_get_glyph_extents +pango_font_get_metrics +pango_font_get_font_map + +PangoFontFamily +PANGO_TYPE_FONT_FAMILY +PANGO_FONT_FAMILY +PANGO_IS_FONT_FAMILY +pango_font_family_get_name +pango_font_family_is_monospace +pango_font_family_list_faces + +PangoFontFace +PANGO_TYPE_FONT_FACE +PANGO_FONT_FACE +PANGO_IS_FONT_FACE +pango_font_face_get_face_name +pango_font_face_list_sizes +pango_font_face_describe +pango_font_face_is_synthesized + +PangoFontMap +PANGO_TYPE_FONT_MAP +PANGO_FONT_MAP +PANGO_IS_FONT_MAP +PangoFontMapClass +PANGO_FONT_MAP_CLASS +PANGO_IS_FONT_MAP_CLASS +PANGO_FONT_MAP_GET_CLASS +pango_font_map_create_context +pango_font_map_load_font +pango_font_map_load_fontset +pango_font_map_list_families +pango_font_map_get_shape_engine_type +pango_font_map_get_serial +pango_font_map_changed + +PangoFontset +PANGO_TYPE_FONTSET +PangoFontsetClass +pango_fontset_get_font +pango_fontset_get_metrics +PangoFontsetForeachFunc +pango_fontset_foreach +PangoFontsetSimple +PANGO_TYPE_FONTSET_SIMPLE +pango_fontset_simple_new +pango_fontset_simple_append +pango_fontset_simple_size + + +PANGO_FONT_FACE_CLASS +PANGO_IS_FONT_CLASS +PANGO_FONT_FACE_GET_CLASS +PangoFontFamilyClass +PangoFontFaceClass +PANGO_FONT_GET_CLASS +PANGO_FONT_CLASS +PANGO_IS_FONT_FAMILY_CLASS +PangoFontClass +PANGO_FONT_FAMILY_GET_CLASS +PANGO_FONT_FAMILY_CLASS +PANGO_IS_FONT_FACE_CLASS +PANGO_FONTSET +PANGO_IS_FONTSET +PANGO_FONTSET_CLASS +PANGO_IS_FONTSET_CLASS +PANGO_FONTSET_GET_CLASS +PANGO_FONTSET_SIMPLE +PANGO_IS_FONTSET_SIMPLE +PangoFontsetSimpleClass + + +pango_font_metrics_new +pango_font_get_type +pango_stretch_get_type +pango_style_get_type +pango_variant_get_type +pango_weight_get_type +pango_font_mask_get_type +pango_font_description_get_type +pango_font_map_get_type +pango_font_face_get_type +pango_font_family_get_type +pango_font_metrics_get_type +pango_fontset_get_type +pango_fontset_simple_get_type +PANGO_UNKNOWN_GLYPH_WIDTH +PANGO_UNKNOWN_GLYPH_HEIGHT +
+ +
+Text Attributes +text-attributes +PangoAttrType +PANGO_TYPE_ATTR_TYPE +PangoAttrClass +PangoAttribute +PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING +PANGO_ATTR_INDEX_TO_TEXT_END +PangoAttrString +PangoAttrLanguage +PangoAttrColor +PangoAttrInt +PangoAttrFloat +PangoAttrFontDesc +PangoAttrShape +PangoAttrSize +PangoAttrFontFeatures +pango_parse_markup +pango_markup_parser_new +pango_markup_parser_finish +pango_attr_type_register +pango_attr_type_get_name +pango_attribute_init +pango_attribute_copy +pango_attribute_equal +pango_attribute_destroy + +pango_attr_language_new +pango_attr_family_new +pango_attr_style_new +pango_attr_variant_new +pango_attr_stretch_new +pango_attr_weight_new +pango_attr_size_new +pango_attr_size_new_absolute +pango_attr_font_desc_new +pango_attr_foreground_new +pango_attr_background_new +pango_attr_strikethrough_new +pango_attr_strikethrough_color_new +pango_attr_underline_new +pango_attr_underline_color_new +PangoUnderline +PANGO_TYPE_UNDERLINE +pango_attr_shape_new +pango_attr_shape_new_with_data +PangoAttrDataCopyFunc +pango_attr_scale_new +PANGO_SCALE_XX_SMALL +PANGO_SCALE_X_SMALL +PANGO_SCALE_SMALL +PANGO_SCALE_MEDIUM +PANGO_SCALE_LARGE +PANGO_SCALE_X_LARGE +PANGO_SCALE_XX_LARGE +pango_attr_rise_new +pango_attr_letter_spacing_new +pango_attr_fallback_new +pango_attr_gravity_new +pango_attr_gravity_hint_new +pango_attr_font_features_new +pango_attr_foreground_alpha_new +pango_attr_background_alpha_new +PangoColor +PANGO_TYPE_COLOR +pango_color_parse +pango_color_copy +pango_color_free +pango_color_to_string + +PangoAttrList +PANGO_TYPE_ATTR_LIST +pango_attr_list_new +pango_attr_list_ref +pango_attr_list_unref +pango_attr_list_copy +pango_attr_list_insert +pango_attr_list_insert_before +pango_attr_list_change +pango_attr_list_splice +pango_attr_list_filter +PangoAttrFilterFunc +pango_attr_list_get_iterator +PangoAttrIterator +pango_attr_iterator_copy +pango_attr_iterator_next +pango_attr_iterator_range +pango_attr_iterator_get +pango_attr_iterator_get_font +pango_attr_iterator_get_attrs +pango_attr_iterator_destroy + +pango_attr_type_get_type +pango_attr_list_get_type +pango_underline_get_type +pango_color_get_type +
+ +
+Tab Stops +tab-stops +PangoTabArray +PANGO_TYPE_TAB_ARRAY +PangoTabAlign +PANGO_TYPE_TAB_ALIGN +pango_tab_array_new +pango_tab_array_new_with_positions +pango_tab_array_copy +pango_tab_array_free +pango_tab_array_get_size +pango_tab_array_resize +pango_tab_array_set_tab +pango_tab_array_get_tab +pango_tab_array_get_tabs +pango_tab_array_get_positions_in_pixels + + +pango_tab_align_get_type +pango_tab_array_get_type +
+ +
+Layout Objects +layout +PangoLayout +PangoLayoutIter +pango_layout_new +pango_layout_copy + +pango_layout_get_context +pango_layout_context_changed +pango_layout_get_serial + +pango_layout_set_text +pango_layout_get_text +pango_layout_get_character_count +pango_layout_set_markup +pango_layout_set_markup_with_accel +pango_layout_set_attributes +pango_layout_get_attributes +pango_layout_set_font_description +pango_layout_get_font_description +pango_layout_set_width +pango_layout_get_width +pango_layout_set_height +pango_layout_get_height +pango_layout_set_wrap +pango_layout_get_wrap +pango_layout_is_wrapped +PangoWrapMode +PANGO_TYPE_WRAP_MODE +pango_layout_set_ellipsize +pango_layout_get_ellipsize +pango_layout_is_ellipsized +PangoEllipsizeMode +PANGO_TYPE_ELLIPSIZE_MODE +pango_layout_set_indent +pango_layout_get_indent +pango_layout_get_spacing +pango_layout_set_spacing +pango_layout_set_justify +pango_layout_get_justify +pango_layout_set_auto_dir +pango_layout_get_auto_dir +pango_layout_set_alignment +pango_layout_get_alignment +pango_layout_set_tabs +pango_layout_get_tabs +pango_layout_set_single_paragraph_mode +pango_layout_get_single_paragraph_mode +PangoAlignment +PANGO_TYPE_ALIGNMENT + +pango_layout_get_unknown_glyphs_count +pango_layout_get_log_attrs +pango_layout_get_log_attrs_readonly + +pango_layout_index_to_pos +pango_layout_index_to_line_x +pango_layout_xy_to_index +pango_layout_get_cursor_pos +pango_layout_move_cursor_visually + +pango_layout_get_extents +pango_layout_get_pixel_extents +pango_layout_get_size +pango_layout_get_pixel_size +pango_layout_get_baseline +pango_layout_get_line_count +pango_layout_get_line +pango_layout_get_line_readonly +pango_layout_get_lines +pango_layout_get_lines_readonly + +pango_layout_get_iter +pango_layout_iter_copy +pango_layout_iter_free +pango_layout_iter_next_run +pango_layout_iter_next_char +pango_layout_iter_next_cluster +pango_layout_iter_next_line +pango_layout_iter_at_last_line +pango_layout_iter_get_index +pango_layout_iter_get_baseline +pango_layout_iter_get_run +pango_layout_iter_get_run_readonly +pango_layout_iter_get_line +pango_layout_iter_get_line_readonly +pango_layout_iter_get_layout +pango_layout_iter_get_char_extents +pango_layout_iter_get_cluster_extents +pango_layout_iter_get_run_extents +pango_layout_iter_get_line_yrange +pango_layout_iter_get_line_extents +pango_layout_iter_get_layout_extents + + +PangoLayoutLine +PangoLayoutRun + +pango_layout_line_ref +pango_layout_line_unref +pango_layout_line_get_extents +pango_layout_line_get_pixel_extents +pango_layout_line_index_to_x +pango_layout_line_x_to_index +pango_layout_line_get_x_ranges + + +PANGO_TYPE_LAYOUT +PangoLayoutClass +PANGO_LAYOUT +PANGO_IS_LAYOUT +PANGO_LAYOUT_CLASS +PANGO_IS_LAYOUT_CLASS +PANGO_LAYOUT_GET_CLASS +PANGO_TYPE_LAYOUT_ITER +PANGO_TYPE_LAYOUT_LINE + + +pango_layout_get_type +pango_layout_iter_get_type +pango_layout_line_get_type +pango_alignment_get_type +pango_wrap_mode_get_type +pango_ellipsize_mode_get_type +
+ +
+Scripts and Languages +scripts +PangoScript +PANGO_TYPE_SCRIPT +PangoScriptIter +pango_script_for_unichar +pango_script_get_sample_language +pango_script_iter_new +pango_script_iter_get_range +pango_script_iter_next +pango_script_iter_free +PangoLanguage +PANGO_TYPE_LANGUAGE +pango_language_from_string +pango_language_to_string +pango_language_matches +pango_language_includes_script +pango_language_get_scripts +pango_language_get_default +pango_language_get_sample_string + +pango_script_get_type +pango_language_get_type +
+ +
+Engines +engines +PangoEngineInfo +PangoEngineScriptInfo +PangoEngine +PangoEngineClass +PANGO_RENDER_TYPE_NONE +script_engine_list +script_engine_init +script_engine_exit +script_engine_create + +PANGO_ENGINE +PANGO_IS_ENGINE +PANGO_TYPE_ENGINE +PANGO_ENGINE_CLASS +PANGO_IS_ENGINE_CLASS +PANGO_ENGINE_GET_CLASS + +pango_engine_get_type +PANGO_MODULE_ENTRY +PANGO_ENGINE_DEFINE_TYPE +
+ +
+PangoEngineLang +pango-engine-lang +PangoEngineLang +PangoEngineLangClass +PANGO_ENGINE_TYPE_LANG +PANGO_ENGINE_LANG_DEFINE_TYPE + +PANGO_ENGINE_LANG +PANGO_IS_ENGINE_LANG +PANGO_TYPE_ENGINE_LANG +PANGO_ENGINE_LANG_CLASS +PANGO_IS_ENGINE_LANG_CLASS +PANGO_ENGINE_LANG_GET_CLASS + +pango_engine_lang_get_type +
+ +
+PangoEngineShape +pango-engine-shape +PangoEngineShape +PangoEngineShapeClass +PANGO_ENGINE_TYPE_SHAPE +PANGO_ENGINE_SHAPE_DEFINE_TYPE + +PANGO_ENGINE_SHAPE +PANGO_IS_ENGINE_SHAPE +PANGO_TYPE_ENGINE_SHAPE +PANGO_ENGINE_SHAPE_CLASS +PANGO_IS_ENGINE_SHAPE_CLASS +PANGO_ENGINE_SHAPE_GET_CLASS + +pango_engine_shape_get_type +
+ +
+Modules +modules +PangoIncludedModule +PangoMap +PangoMapEntry +pango_find_map +pango_map_get_engine +pango_map_get_engines +pango_module_register +
+ +
+pango-renderer +PangoRenderer +PangoRenderPart +PANGO_TYPE_RENDER_PART +PangoRendererClass +PangoRenderer +pango_renderer_draw_layout +pango_renderer_draw_layout_line +pango_renderer_draw_glyphs +pango_renderer_draw_glyph_item +pango_renderer_draw_rectangle +pango_renderer_draw_error_underline +pango_renderer_draw_trapezoid +pango_renderer_draw_glyph +pango_renderer_activate +pango_renderer_deactivate +pango_renderer_part_changed +pango_renderer_set_color +pango_renderer_get_color +pango_renderer_set_alpha +pango_renderer_get_alpha +pango_renderer_set_matrix +pango_renderer_get_matrix +pango_renderer_get_layout +pango_renderer_get_layout_line + +PANGO_RENDERER +PANGO_IS_RENDERER +PANGO_TYPE_RENDERER +pango_renderer_get_type +PANGO_RENDERER_CLASS +PANGO_IS_RENDERER_CLASS +PANGO_RENDERER_GET_CLASS + +pango_render_part_get_type +PangoRendererPrivate +
+ +
+Win32 Fonts and Rendering +win32-fonts +PANGO_RENDER_TYPE_WIN32 +pango_win32_get_context +pango_win32_render +pango_win32_render_transformed +pango_win32_render_layout_line +pango_win32_render_layout +pango_win32_get_unknown_glyph +pango_win32_font_get_glyph_index +pango_win32_font_select_font +pango_win32_font_done_font +pango_win32_font_get_metrics_factor +pango_win32_get_debug_flag +pango_win32_get_dc +PangoWin32FontCache +pango_win32_font_cache_new +pango_win32_font_cache_free +pango_win32_font_cache_load +pango_win32_font_cache_loadw +pango_win32_font_cache_unload +pango_win32_font_map_for_display +pango_win32_shutdown_display +pango_win32_font_map_get_font_cache +pango_win32_font_logfont +pango_win32_font_logfontw +pango_win32_font_description_from_logfont +pango_win32_font_description_from_logfontw + + +STRICT +
+ +
+FreeType Fonts and Rendering +freetype-fonts +PangoFT2FontMap +PANGO_RENDER_TYPE_FT2 +pango_ft2_font_map_new +pango_ft2_font_map_set_resolution +pango_ft2_font_map_create_context +PangoFT2SubstituteFunc +pango_ft2_font_map_set_default_substitute +pango_ft2_font_map_substitute_changed +pango_ft2_get_context +pango_ft2_render +pango_ft2_render_transformed +pango_ft2_render_layout_line +pango_ft2_render_layout_line_subpixel +pango_ft2_render_layout +pango_ft2_render_layout_subpixel +pango_ft2_get_unknown_glyph +pango_ft2_font_get_kerning +pango_ft2_font_get_face +pango_ft2_font_get_coverage +pango_ft2_font_map_for_display +pango_ft2_shutdown_display + +PANGO_TYPE_FT2_FONT_MAP +PANGO_FT2_FONT_MAP +PANGO_FT2_IS_FONT_MAP + +pango_ft2_font_map_get_type +STRICT +
+ +
+Xft Fonts and Rendering +xft-fonts +PangoXftFont +PangoXftFontMap +PANGO_RENDER_TYPE_XFT +pango_xft_get_context +pango_xft_get_font_map +pango_xft_set_default_substitute +PangoXftSubstituteFunc +pango_xft_substitute_changed +pango_xft_shutdown_display +pango_xft_font_get_font +pango_xft_font_get_display +pango_xft_font_has_char +pango_xft_font_lock_face +pango_xft_font_unlock_face +pango_xft_font_get_glyph +pango_xft_font_get_unknown_glyph +PangoXftRenderer +PangoXftRendererClass + +pango_xft_renderer_new +pango_xft_renderer_set_draw +pango_xft_renderer_set_default_color +pango_xft_render +pango_xft_picture_render +pango_xft_render_transformed +pango_xft_render_layout_line +pango_xft_render_layout + +PANGO_TYPE_XFT_FONT +PANGO_XFT_FONT +PANGO_XFT_IS_FONT +PANGO_TYPE_XFT_FONT_MAP +PANGO_XFT_FONT_MAP +PANGO_XFT_IS_FONT_MAP +PANGO_XFT_RENDERER +PANGO_IS_XFT_RENDERER +PANGO_TYPE_XFT_RENDERER +PANGO_XFT_RENDERER_CLASS +PANGO_IS_XFT_RENDERER_CLASS +PANGO_XFT_RENDERER_GET_CLASS + + +PangoXftRendererPrivate +pango_xft_font_get_type +pango_xft_font_map_get_type +pango_xft_renderer_get_type +
+ +
+Cairo Rendering +pangocairo +PangoCairoFont +PangoCairoFontMap +pango_cairo_font_map_get_default +pango_cairo_font_map_set_default +pango_cairo_font_map_new +pango_cairo_font_map_new_for_font_type +pango_cairo_font_map_get_font_type +pango_cairo_font_map_set_resolution +pango_cairo_font_map_get_resolution +pango_cairo_font_map_create_context +pango_cairo_font_get_scaled_font +pango_cairo_context_set_resolution +pango_cairo_context_get_resolution +pango_cairo_context_set_font_options +pango_cairo_context_get_font_options +PangoCairoShapeRendererFunc +pango_cairo_context_set_shape_renderer +pango_cairo_context_get_shape_renderer +pango_cairo_create_context +pango_cairo_update_context +pango_cairo_create_layout +pango_cairo_update_layout +pango_cairo_show_glyph_string +pango_cairo_show_glyph_item +pango_cairo_show_layout_line +pango_cairo_show_layout +pango_cairo_show_error_underline +pango_cairo_glyph_string_path +pango_cairo_layout_line_path +pango_cairo_layout_path +pango_cairo_error_underline_path + +PANGO_CAIRO_FONT +PANGO_CAIRO_FONT_MAP +PANGO_IS_CAIRO_FONT +PANGO_IS_CAIRO_FONT_MAP +PANGO_TYPE_CAIRO_FONT +PANGO_TYPE_CAIRO_FONT_MAP +pango_cairo_font_get_type +pango_cairo_font_map_get_type +
+ +
+CoreText Fonts +coretext-fonts +PANGO_RENDER_TYPE_CORE_TEXT +pango_core_text_font_get_ctfont + +PANGO_CAIRO_CORE_TEXT_FONT +PANGO_CAIRO_CORE_TEXT_FONT_CLASS +PANGO_CAIRO_CORE_TEXT_FONT_GET_CLASS +PANGO_CAIRO_CORE_TEXT_FONT_MAP +PANGO_CORE_TEXT_FONT +PANGO_CORE_TEXT_FONT_CLASS +PANGO_CORE_TEXT_FONT_GET_CLASS +PANGO_CORE_TEXT_FONT_MAP +PANGO_CORE_TEXT_FONT_MAP_CLASS +PANGO_CORE_TEXT_FONT_MAP_GET_CLASS +PANGO_CORE_TEXT_IS_FONT_MAP +PANGO_IS_CAIRO_CORE_TEXT_FONT_CLASS +PANGO_IS_CAIRO_CORE_TEXT_FONT_MAP +PANGO_IS_CORE_TEXT_FONT +PANGO_IS_CORE_TEXT_FONT_CLASS +PANGO_IS_CORE_TEXT_FONT_MAP_CLASS +PANGO_TYPE_CAIRO_CORE_TEXT_FONT +PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP +PANGO_TYPE_CORE_TEXT_FONT +PANGO_TYPE_CORE_TEXT_FONT_MAP +PangoCairoCoreTextFont +PangoCairoCoreTextFontClass +PangoCairoCoreTextFontMap +PangoCoreTextFace +PangoCoreTextFamily +PangoCoreTextFont +PangoCoreTextFontClass +PangoCoreTextFontMap +PangoCoreTextFontMapClass +PangoCoreTextFontPrivate +pango_cairo_core_text_font_get_type +pango_cairo_core_text_font_map_get_type +pango_core_text_font_get_type +pango_core_text_font_map_get_type +
+ +
+pangofc-fontmap +PangoFcFontMap +PangoFcFontMap +PangoFcFontMapClass +pango_fc_font_map_create_context +PangoFcDecoderFindFunc +pango_fc_font_map_add_decoder_find_func +pango_fc_font_map_find_decoder +pango_fc_font_map_cache_clear +pango_fc_font_map_config_changed +pango_fc_font_map_shutdown +pango_fc_font_map_set_config +pango_fc_font_map_get_config +pango_fc_font_description_from_pattern +PANGO_FC_FONT_FEATURES +PANGO_FC_GRAVITY +PANGO_FC_VERSION +PANGO_FC_PRGNAME + +PANGO_FC_FONT_MAP +PANGO_IS_FC_FONT_MAP +PANGO_TYPE_FC_FONT_MAP +PANGO_FC_FONT_MAP_CLASS +PANGO_IS_FC_FONT_MAP_CLASS +PANGO_FC_FONT_MAP_GET_CLASS + + +PangoFcFontsetKey +pango_fc_fontset_key_get_context_key +pango_fc_fontset_key_get_description +pango_fc_fontset_key_get_language +pango_fc_fontset_key_get_matrix +pango_fc_fontset_key_get_absolute_size +pango_fc_fontset_key_get_resolution +PangoFcFontKey +pango_fc_font_key_get_context_key +pango_fc_font_key_get_matrix +pango_fc_font_key_get_pattern + + +PangoFcFontMapPrivate +pango_fc_font_map_get_type +
+ + +
+pangofc-font +PangoFcFont +PangoFcFont +PangoFcFontClass +PANGO_RENDER_TYPE_FC +pango_fc_font_lock_face +pango_fc_font_unlock_face +pango_fc_font_has_char +pango_fc_font_get_glyph +pango_fc_font_get_unknown_glyph +pango_fc_font_kern_glyphs + +PANGO_FC_FONT +PANGO_IS_FC_FONT +PANGO_TYPE_FC_FONT +PANGO_FC_FONT_CLASS +PANGO_IS_FC_FONT_CLASS +PANGO_FC_FONT_GET_CLASS + +pango_fc_font_get_type +
+ +
+pangofc-decoder +PangoFcDecoder +PangoFcDecoder +PangoFcDecoderClass +pango_fc_decoder_get_charset +pango_fc_decoder_get_glyph + +PANGO_FC_DECODER +PANGO_IS_FC_DECODER +PANGO_TYPE_FC_DECODER +pango_fc_decoder_get_type +PANGO_FC_DECODER_CLASS +PANGO_IS_FC_DECODER_CLASS +PANGO_FC_DECODER_GET_CLASS +
+ +
+OpenType Font Handling +opentype +PangoOTTag +PangoOTInfo +PangoOTBuffer +PangoOTGlyph +PangoOTRuleset +PangoOTRulesetDescription +PangoOTTableType +PangoOTFeatureMap +PANGO_OT_TAG_MAKE +PANGO_OT_TAG_MAKE_FROM_STRING +PANGO_OT_ALL_GLYPHS +PANGO_OT_NO_FEATURE +PANGO_OT_NO_SCRIPT +PANGO_OT_DEFAULT_LANGUAGE +PANGO_OT_TAG_DEFAULT_LANGUAGE +PANGO_OT_TAG_DEFAULT_SCRIPT +pango_ot_info_get +pango_ot_info_find_script +pango_ot_info_find_language +pango_ot_info_find_feature +pango_ot_info_list_scripts +pango_ot_info_list_languages +pango_ot_info_list_features +pango_ot_buffer_new +pango_ot_buffer_destroy +pango_ot_buffer_clear +pango_ot_buffer_add_glyph +pango_ot_buffer_set_rtl +pango_ot_buffer_set_zero_width_marks +pango_ot_buffer_get_glyphs +pango_ot_buffer_output +pango_ot_ruleset_get_for_description +pango_ot_ruleset_new +pango_ot_ruleset_new_for +pango_ot_ruleset_new_from_description +pango_ot_ruleset_add_feature +pango_ot_ruleset_maybe_add_feature +pango_ot_ruleset_maybe_add_features +pango_ot_ruleset_get_feature_count +pango_ot_ruleset_substitute +pango_ot_ruleset_position +pango_ot_ruleset_description_copy +pango_ot_ruleset_description_equal +pango_ot_ruleset_description_free +pango_ot_ruleset_description_hash +pango_ot_tag_from_language +pango_ot_tag_from_script +pango_ot_tag_to_language +pango_ot_tag_to_script + + +PANGO_IS_OT_INFO +PANGO_IS_OT_RULESET +PANGO_OT_INFO +PANGO_OT_RULESET +PANGO_TYPE_OT_INFO +PANGO_TYPE_OT_RULESET +pango_ot_info_get_type +pango_ot_ruleset_get_type +
+ +
+Miscellaneous Utilities +utils +pango_split_file_list +pango_trim_string +pango_read_line +pango_skip_space +pango_scan_word +pango_scan_string +pango_scan_int +pango_config_key_get +pango_config_key_get_system +pango_lookup_aliases +pango_parse_enum +pango_parse_style +pango_parse_variant +pango_parse_weight +pango_parse_stretch +pango_get_sysconf_subdirectory +pango_get_lib_subdirectory +pango_log2vis_get_embedding_levels +pango_is_zero_width +pango_quantize_line_geometry +
+ +
+Version Checking +pango-version +PANGO_VERSION_ENCODE +PANGO_VERSION +PANGO_VERSION_MAJOR +PANGO_VERSION_MINOR +PANGO_VERSION_MICRO +PANGO_VERSION_STRING +PANGO_VERSION_CHECK +pango_version +pango_version_string +pango_version_check +PANGO_VERSION_1_2 +PANGO_VERSION_1_4 +PANGO_VERSION_1_6 +PANGO_VERSION_1_8 +PANGO_VERSION_1_10 +PANGO_VERSION_1_12 +PANGO_VERSION_1_14 +PANGO_VERSION_1_16 +PANGO_VERSION_1_18 +PANGO_VERSION_1_20 +PANGO_VERSION_1_22 +PANGO_VERSION_1_24 +PANGO_VERSION_1_26 +PANGO_VERSION_1_28 +PANGO_VERSION_1_30 +PANGO_VERSION_1_32 +PANGO_VERSION_1_34 +PANGO_VERSION_1_36 +PANGO_VERSION_1_38 +PANGO_VERSION_1_40 +PANGO_VERSION_1_42 +PANGO_MIN_REQUIRED +PANGO_MAX_ALLOWED + +PANGO_AVAILABLE_IN_ALL +PANGO_VERSION_CUR_STABLE +PANGO_VERSION_PREV_STABLE +PANGO_AVAILABLE_IN_1_2 +PANGO_AVAILABLE_IN_1_4 +PANGO_AVAILABLE_IN_1_6 +PANGO_AVAILABLE_IN_1_8 +PANGO_AVAILABLE_IN_1_10 +PANGO_AVAILABLE_IN_1_12 +PANGO_AVAILABLE_IN_1_14 +PANGO_AVAILABLE_IN_1_16 +PANGO_AVAILABLE_IN_1_18 +PANGO_AVAILABLE_IN_1_20 +PANGO_AVAILABLE_IN_1_22 +PANGO_AVAILABLE_IN_1_24 +PANGO_AVAILABLE_IN_1_26 +PANGO_AVAILABLE_IN_1_28 +PANGO_AVAILABLE_IN_1_30 +PANGO_AVAILABLE_IN_1_32 +PANGO_AVAILABLE_IN_1_34 +PANGO_AVAILABLE_IN_1_36 +PANGO_AVAILABLE_IN_1_38 +PANGO_AVAILABLE_IN_1_40 +PANGO_AVAILABLE_IN_1_42 +PANGO_DEPRECATED_IN_1_2 +PANGO_DEPRECATED_IN_1_2_FOR +PANGO_DEPRECATED_IN_1_4 +PANGO_DEPRECATED_IN_1_4_FOR +PANGO_DEPRECATED_IN_1_6 +PANGO_DEPRECATED_IN_1_6_FOR +PANGO_DEPRECATED_IN_1_8 +PANGO_DEPRECATED_IN_1_8_FOR +PANGO_DEPRECATED_IN_1_10 +PANGO_DEPRECATED_IN_1_10_FOR +PANGO_DEPRECATED_IN_1_12 +PANGO_DEPRECATED_IN_1_12_FOR +PANGO_DEPRECATED_IN_1_14 +PANGO_DEPRECATED_IN_1_14_FOR +PANGO_DEPRECATED_IN_1_16 +PANGO_DEPRECATED_IN_1_16_FOR +PANGO_DEPRECATED_IN_1_18 +PANGO_DEPRECATED_IN_1_18_FOR +PANGO_DEPRECATED_IN_1_20 +PANGO_DEPRECATED_IN_1_20_FOR +PANGO_DEPRECATED_IN_1_22 +PANGO_DEPRECATED_IN_1_22_FOR +PANGO_DEPRECATED_IN_1_24 +PANGO_DEPRECATED_IN_1_24_FOR +PANGO_DEPRECATED_IN_1_26 +PANGO_DEPRECATED_IN_1_26_FOR +PANGO_DEPRECATED_IN_1_28 +PANGO_DEPRECATED_IN_1_28_FOR +PANGO_DEPRECATED_IN_1_30 +PANGO_DEPRECATED_IN_1_30_FOR +PANGO_DEPRECATED_IN_1_32 +PANGO_DEPRECATED_IN_1_32_FOR +PANGO_DEPRECATED_IN_1_34 +PANGO_DEPRECATED_IN_1_34_FOR +PANGO_DEPRECATED_IN_1_36 +PANGO_DEPRECATED_IN_1_36_FOR +PANGO_DEPRECATED_IN_1_38 +PANGO_DEPRECATED_IN_1_38_FOR +PANGO_DEPRECATED_IN_1_40 +PANGO_DEPRECATED_IN_1_40_FOR +PANGO_DEPRECATED_IN_1_42 +PANGO_DEPRECATED_IN_1_42_FOR +
+ +
+Vertical Text +vertical +PangoGravity +PangoGravityHint +PANGO_GRAVITY_IS_IMPROPER +PANGO_GRAVITY_IS_VERTICAL +pango_gravity_get_for_matrix +pango_gravity_get_for_script +pango_gravity_get_for_script_and_width +pango_gravity_to_rotation + +PANGO_TYPE_GRAVITY +PANGO_TYPE_GRAVITY_HINT + +pango_gravity_get_type +pango_gravity_hint_get_type +
+ +
+Bidirectional Text +bidi +PangoDirection +pango_unichar_direction +pango_find_base_dir +pango_get_mirror_char +PangoBidiType +pango_bidi_type_for_unichar + +PANGO_TYPE_BIDI_TYPE + +pango_bidi_type_get_type +pango_direction_get_type +
diff --git a/docs/pango.types b/docs/pango.types new file mode 100644 index 0000000..7d93cda --- /dev/null +++ b/docs/pango.types @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +pango_alignment_get_type +pango_attr_list_get_type +pango_attr_type_get_type +pango_bidi_type_get_type +pango_cairo_fc_font_map_get_type +pango_cairo_font_get_type +pango_cairo_font_map_get_type +pango_color_get_type +pango_context_get_type +pango_coverage_level_get_type +pango_direction_get_type +pango_ellipsize_mode_get_type +pango_engine_get_type +pango_engine_lang_get_type +pango_engine_shape_get_type +pango_fc_decoder_get_type +pango_fc_font_get_type +pango_fc_font_map_get_type +pango_font_description_get_type +pango_font_face_get_type +pango_font_family_get_type +pango_font_get_type +pango_font_map_get_type +pango_font_mask_get_type +pango_font_metrics_get_type +pango_fontset_get_type +pango_fontset_simple_get_type +pango_ft2_font_map_get_type +pango_glyph_item_get_type +pango_glyph_item_iter_get_type +pango_glyph_string_get_type +pango_gravity_get_type +pango_gravity_hint_get_type +pango_item_get_type +pango_language_get_type +pango_layout_get_type +pango_layout_iter_get_type +pango_layout_line_get_type +pango_matrix_get_type +pango_ot_info_get_type +pango_ot_ruleset_get_type +pango_render_part_get_type +pango_renderer_get_type +pango_script_get_type +pango_stretch_get_type +pango_style_get_type +pango_tab_align_get_type +pango_tab_array_get_type +pango_underline_get_type +pango_variant_get_type +pango_weight_get_type +pango_wrap_mode_get_type +pango_xft_font_get_type +pango_xft_font_map_get_type +pango_xft_renderer_get_type diff --git a/docs/pango_markup.sgml b/docs/pango_markup.sgml new file mode 100644 index 0000000..c2ba377 --- /dev/null +++ b/docs/pango_markup.sgml @@ -0,0 +1,301 @@ + + +Text Attribute Markup +3 +Pango Library + + + +Text Attribute MarkupSimple +markup language to encode text with attributes + + + +Pango Text Attribute Markup Language + + +Frequently, you want to display some text to the user with attributes +applied to part of the text (for example, you might want bold or +italicized words). With the base Pango interfaces, you could create a +PangoAttrList and apply it to the +text; the problem is that you'd need to apply attributes to some +numeric range of characters, for example "characters 12-17." This is +broken from an internationalization standpoint; once the text is +translated, the word you wanted to italicize could be in a different +position. + + + +The solution is to include the text attributes in the string to be +translated. Pango provides this feature with a small markup language. +You can parse a marked-up string into the string text plus a +PangoAttrList using either of +pango_parse_markup() or +pango_markup_parser_new(). + + + +A simple example of a marked-up string might be: +"<span foreground="blue" size="x-large">Blue text</span> is <i>cool</i>!" + + + +Pango uses #GMarkup to parse this language, which means that XML features +such as numeric character entities such as &#169; for © can +be used too. + + + +The root tag of a marked-up document is <markup>, but pango_parse_markup() allows you to +omit this tag, so you will most likely never need to use it. The most +general markup tag is <span>, then there are some convenience +tags. <span> has the following attributes: +<span> attributes + + +fontSince 1.21 +font_desc + +A font description string, such as "Sans Italic 12". See +pango_font_description_from_string() +for a description of the format of the string representation . Note that any +other span attributes will override this description. So if you have +"Sans Italic" and also a style="normal" attribute, you will get Sans normal, +not italic. + + + +font_family +face + +A font family name + + + + +font_size +size + +Font size in 1024ths of a point, or one of the absolute sizes +'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', +'xx-large', or one of the relative sizes 'smaller' or 'larger'. +If you want to specify a absolute size, it's usually easier +to take advantage of the ability to specify a partial +font description using 'font'; you can use +font='12.5' rather than +size='12800'. + + + + +font_style +style + +One of 'normal', 'oblique', 'italic' + + + + +font_weight +weight + +One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', +or a numeric weight + + + + +font_variant +variant + +One of 'normal' or 'smallcaps' + + + + +font_stretch +stretch + +One of 'ultracondensed', 'extracondensed', 'condensed', +'semicondensed', 'normal', 'semiexpanded', 'expanded', +'extraexpanded', 'ultraexpanded' + + + + +font_featuresSince 1.38 + +A comma separated list of OpenType font feature settings, in the same +syntax as accepted by CSS. E.g: font_features='dlig=1, -kern, afrc on' + + + + +foreground +fgcolor +color + +An RGB color specification such as '#00FF00' or a color name such as +'red'. +Since 1.38, an RGBA color specification such as '#00FF007F' will +be interpreted as specifying both a foreground color and foreground alpha. + + + + +background +bgcolor + +An RGB color specification such as '#00FF00' or a color name such as +'red'. +Since 1.38, an RGBA color specification such as '#00FF007F' will +be interpreted as specifying both a background color and background alpha. + + + + +alpha +fgalpha + +An alpha value for the foreground color, either a plain integer between 1 and 65536 +or a percentage value like '50%'. + + + + +background_alpha +bgalpha + +An alpha value for the background color, either a plain integer between 1 and 65536 +or a percentage value like '50%'. + + + +underline + +One of 'none', 'single', 'double', 'low', 'error' + + + +underline_color + +The color of underlines; an RGB color specification such as '#00FF00' +or a color name such as 'red' + + + +rise + +Vertical displacement, in Pango units. Can be negative for +subscript, positive for superscript. + + + +strikethrough + +'true' or 'false' whether to strike through the text + + + +strikethrough_color + +The color of strikethrough lines; an RGB color specification such as +'#00FF00' or a color name such as 'red' + + + +fallback + +'true' or 'false' whether to enable fallback. If disabled, then characters +will only be used from the closest matching font on the system. No fallback +will be done to other fonts on the system that might contain the characters +in the text. Fallback is enabled by default. Most applications should not +disable fallback. + + + +lang + +A language code, indicating the text language + + + +letter_spacing + +Inter-letter spacing in 1024ths of a point. + + + +gravity + +One of 'south', 'east', 'north', 'west', 'auto'. + + + +gravity_hint + +One of 'natural', 'strong', 'line'. + + + + + + + + +The following convenience tags are provided: + +Convenience tags +b + +Bold + + +big + +Makes font relatively larger, equivalent to <span size="larger"> + + +i + +Italic + + +s + +Strikethrough + + +sub + +Subscript + + +sup + +Superscript + + +small + +Makes font relatively smaller, equivalent to <span size="smaller"> + + +tt + +Monospace font + + +u + +Underline + + + + + + + + + diff --git a/docs/rotated-text.png b/docs/rotated-text.png new file mode 100644 index 0000000..b29682e Binary files /dev/null and b/docs/rotated-text.png differ diff --git a/docs/version.xml b/docs/version.xml new file mode 100644 index 0000000..6f7c8cd --- /dev/null +++ b/docs/version.xml @@ -0,0 +1 @@ +1.42.4 diff --git a/docs/version.xml.in b/docs/version.xml.in new file mode 100644 index 0000000..8f55647 --- /dev/null +++ b/docs/version.xml.in @@ -0,0 +1 @@ +@PANGO_VERSION@ diff --git a/docs/xml/gtkdocentities.ent.in b/docs/xml/gtkdocentities.ent.in new file mode 100644 index 0000000..f12c9ff --- /dev/null +++ b/docs/xml/gtkdocentities.ent.in @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/xml/meson.build b/docs/xml/meson.build new file mode 100644 index 0000000..2a4cf4b --- /dev/null +++ b/docs/xml/meson.build @@ -0,0 +1,10 @@ +ent_conf = configuration_data() +ent_conf.set('PACKAGE', meson.project_name()) +ent_conf.set('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=pango') +ent_conf.set('PACKAGE_NAME', meson.project_name()) +ent_conf.set('PACKAGE_STRING', meson.project_name()) +ent_conf.set('PACKAGE_TARNAME', '@0@-@1@'.format(meson.project_name(), meson.project_version())) +ent_conf.set('PACKAGE_URL', 'https://developer.gnome.org/pango/stable') +ent_conf.set('PACKAGE_VERSION', meson.project_version()) +ent_conf.set('PACKAGE_API_VERSION', pango_api_version) +configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf) diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..4cb54ba --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,34 @@ +## Process this file with automake to create Makefile.in. + +EXTRA_DIST = \ + pangowin32tobmp.c + +INCLUDES = \ + -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(X_CFLAGS) + +noinst_PROGRAMS = + +if HAVE_CAIRO_PNG +noinst_PROGRAMS += cairosimple cairotwisted cairoshape + +cairosimple_LDADD = \ + -lm \ + ../pango/libpango-$(PANGO_API_VERSION).la \ + ../pango/libpangocairo-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(CAIRO_LIBS) +if HAVE_FREETYPE +cairosimple_LDADD += \ + ../pango/libpangoft2-$(PANGO_API_VERSION).la +endif +cairotwisted_LDADD = $(cairosimple_LDADD) +cairoshape_LDADD = $(cairosimple_LDADD) +endif + +-include $(top_srcdir)/git.mk diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 0000000..da3a041 --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,696 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = $(am__EXEEXT_1) +@HAVE_CAIRO_PNG_TRUE@am__append_1 = cairosimple cairotwisted cairoshape +@HAVE_CAIRO_PNG_TRUE@@HAVE_FREETYPE_TRUE@am__append_2 = \ +@HAVE_CAIRO_PNG_TRUE@@HAVE_FREETYPE_TRUE@ ../pango/libpangoft2-$(PANGO_API_VERSION).la + +subdir = examples +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_CAIRO_PNG_TRUE@am__EXEEXT_1 = cairosimple$(EXEEXT) \ +@HAVE_CAIRO_PNG_TRUE@ cairotwisted$(EXEEXT) cairoshape$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +cairoshape_SOURCES = cairoshape.c +cairoshape_OBJECTS = cairoshape.$(OBJEXT) +am__DEPENDENCIES_1 = +@HAVE_CAIRO_PNG_TRUE@am__DEPENDENCIES_2 = ../pango/libpango-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ $(am__DEPENDENCIES_1) \ +@HAVE_CAIRO_PNG_TRUE@ $(am__DEPENDENCIES_1) $(am__append_2) +@HAVE_CAIRO_PNG_TRUE@cairoshape_DEPENDENCIES = $(am__DEPENDENCIES_2) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +cairosimple_SOURCES = cairosimple.c +cairosimple_OBJECTS = cairosimple.$(OBJEXT) +@HAVE_CAIRO_PNG_TRUE@cairosimple_DEPENDENCIES = ../pango/libpango-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ $(am__DEPENDENCIES_1) \ +@HAVE_CAIRO_PNG_TRUE@ $(am__DEPENDENCIES_1) $(am__append_2) +cairotwisted_SOURCES = cairotwisted.c +cairotwisted_OBJECTS = cairotwisted.$(OBJEXT) +@HAVE_CAIRO_PNG_TRUE@cairotwisted_DEPENDENCIES = \ +@HAVE_CAIRO_PNG_TRUE@ $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = cairoshape.c cairosimple.c cairotwisted.c +DIST_SOURCES = cairoshape.c cairosimple.c cairotwisted.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pangowin32tobmp.c + +INCLUDES = \ + -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(X_CFLAGS) + +@HAVE_CAIRO_PNG_TRUE@cairosimple_LDADD = -lm \ +@HAVE_CAIRO_PNG_TRUE@ ../pango/libpango-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_PNG_TRUE@ $(GLIB_LIBS) $(CAIRO_LIBS) \ +@HAVE_CAIRO_PNG_TRUE@ $(am__append_2) +@HAVE_CAIRO_PNG_TRUE@cairotwisted_LDADD = $(cairosimple_LDADD) +@HAVE_CAIRO_PNG_TRUE@cairoshape_LDADD = $(cairosimple_LDADD) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits examples/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +cairoshape$(EXEEXT): $(cairoshape_OBJECTS) $(cairoshape_DEPENDENCIES) $(EXTRA_cairoshape_DEPENDENCIES) + @rm -f cairoshape$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cairoshape_OBJECTS) $(cairoshape_LDADD) $(LIBS) + +cairosimple$(EXEEXT): $(cairosimple_OBJECTS) $(cairosimple_DEPENDENCIES) $(EXTRA_cairosimple_DEPENDENCIES) + @rm -f cairosimple$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cairosimple_OBJECTS) $(cairosimple_LDADD) $(LIBS) + +cairotwisted$(EXEEXT): $(cairotwisted_OBJECTS) $(cairotwisted_DEPENDENCIES) $(EXTRA_cairotwisted_DEPENDENCIES) + @rm -f cairotwisted$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cairotwisted_OBJECTS) $(cairotwisted_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairoshape.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairosimple.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairotwisted.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/examples/cairoshape.c b/examples/cairoshape.c new file mode 100644 index 0000000..d288db1 --- /dev/null +++ b/examples/cairoshape.c @@ -0,0 +1,236 @@ +/* Example code to show how to use pangocairo to render arbitrary shapes + * inside a text layout, positioned by Pango. This has become possibly + * using the following API added in Pango 1.18: + * + * pango_cairo_context_set_shape_renderer () + * + * This examples uses a small parser to convert shapes in the format of + * SVG paths to cairo instructions. You can typically extract these from + * the SVG file's elements directly. + * + * The code then searches for the Unicode bullet character in the layout + * text and automatically adds PangoAttribtues to the layout to replace + * each of the with a rendering of the GNOME Foot logo. + * + * + * Written by Behdad Esfahbod, 2007 + * + * Permission to use, copy, modify, distribute, and sell this example + * for any purpose is hereby granted without fee. + * It is provided "as is" without express or implied warranty. + */ + + +#include +#include + +#include + +#define BULLET "•" + +const char text[] = +"The GNOME project provides two things:\n" +"\n" +" • The GNOME desktop environment\n" +" • The GNOME development platform\n" +" • Planet GNOME"; + +typedef struct { + double width, height; + const char *path; +} MiniSvg; + +static MiniSvg GnomeFootLogo = { + 96.2152, 118.26, + "M 86.068,1 C 61.466,0 56.851,35.041 70.691,35.041 C 84.529,35.041 110.671,0 86.068,0 z " + "M 45.217,30.699 C 52.586,31.149 60.671,2.577 46.821,4.374 C 32.976,6.171 37.845,30.249 45.217,30.699 z " + "M 11.445,48.453 C 16.686,46.146 12.12,23.581 3.208,29.735 C -5.7,35.89 6.204,50.759 11.445,48.453 z " + "M 26.212,36.642 C 32.451,35.37 32.793,9.778 21.667,14.369 C 10.539,18.961 19.978,37.916 26.212,36.642 L 26.212,36.642 z " + "M 58.791,93.913 C 59.898,102.367 52.589,106.542 45.431,101.092 C 22.644,83.743 83.16,75.088 79.171,51.386 C 75.86,31.712 15.495,37.769 8.621,68.553 C 3.968,89.374 27.774,118.26 52.614,118.26 C 64.834,118.26 78.929,107.226 81.566,93.248 C 83.58,82.589 57.867,86.86 58.791,93.913 L 58.791,93.913 z " + "\0" +}; + +static void +mini_svg_render (MiniSvg *shape, + cairo_t *cr, + gboolean do_path) +{ + double x, y; + const char *p; + char op[2]; + int len; + + cairo_get_current_point (cr, &x, &y); + cairo_translate (cr, x, y); + + for (p = shape->path; sscanf (p, "%1s %n", op, &len), p += len, *p;) + switch (*op) + { + case 'M': + { + sscanf (p, "%lf,%lf %n", &x, &y, &len); p += len; + cairo_move_to (cr, x, y); + break; + } + case 'L': + { + sscanf (p, "%lf,%lf %n", &x, &y, &len); p += len; + cairo_line_to (cr, x, y); + break; + } + case 'C': + { + double x1, y1, x2, y2, x3, y3; + sscanf (p, "%lf,%lf %lf,%lf %lf,%lf %n", &x1, &y1, &x2, &y2, &x3, &y3, &len); p += len; + cairo_curve_to (cr, x1, y1, x2, y2, x3, y3); + break; + } + case 'z': + { + cairo_close_path (cr); + break; + } + default: + { + g_warning ("Invalid MiniSvg operation '%c'", *op); + break; + } + } + + if (!do_path) + cairo_fill (cr); +} + +static void +mini_svg_shape_renderer (cairo_t *cr, + PangoAttrShape *attr, + gboolean do_path, + gpointer data G_GNUC_UNUSED) +{ + MiniSvg *shape = (MiniSvg *) attr->data; + double scale_x, scale_y; + + scale_x = (double) attr->ink_rect.width / (PANGO_SCALE * shape->width ); + scale_y = (double) attr->ink_rect.height / (PANGO_SCALE * shape->height); + + cairo_rel_move_to (cr, + (double) attr->ink_rect.x / PANGO_SCALE, + (double) attr->ink_rect.y / PANGO_SCALE); + cairo_scale (cr, scale_x, scale_y); + + mini_svg_render (shape, cr, do_path); +} + + +static PangoLayout * +get_layout (cairo_t *cr) +{ + PangoLayout *layout; + PangoAttrList *attrs; + PangoRectangle ink_rect = {1 * PANGO_SCALE, -11 * PANGO_SCALE, 8 * PANGO_SCALE, 10 * PANGO_SCALE}; + PangoRectangle logical_rect = {0 * PANGO_SCALE, -12 * PANGO_SCALE, 10 * PANGO_SCALE, 12 * PANGO_SCALE}; + const char *p; + + /* Create a PangoLayout, set the font and text */ + layout = pango_cairo_create_layout (cr); + + pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout), + mini_svg_shape_renderer, NULL, NULL); + + pango_layout_set_text (layout, text, -1); + + attrs = pango_attr_list_new (); + + /* Set gnome shape attributes for all bullets */ + for (p = text; (p = strstr (p, BULLET)); p += strlen (BULLET)) + { + PangoAttribute *attr; + + attr = pango_attr_shape_new_with_data (&ink_rect, + &logical_rect, + &GnomeFootLogo, + NULL, NULL); + + attr->start_index = p - text; + attr->end_index = attr->start_index + strlen (BULLET); + + pango_attr_list_insert (attrs, attr); + } + + pango_layout_set_attributes (layout, attrs); + pango_attr_list_unref (attrs); + + return layout; +} + +static void +draw_text (cairo_t *cr, int *width, int *height) +{ + + PangoLayout *layout = get_layout (cr); + + /* Adds a fixed 10-pixel margin on the sides. */ + + if (width || height) + { + pango_layout_get_pixel_size (layout, width, height); + if (width) + *width += 20; + if (height) + *height += 20; + } + + cairo_move_to (cr, 10, 10); + pango_cairo_show_layout (cr, layout); + + g_object_unref (layout); +} + +int main (int argc, char **argv) +{ + cairo_t *cr; + char *filename; + cairo_status_t status; + cairo_surface_t *surface; + int width, height; + + if (argc != 2) + { + g_printerr ("Usage: cairoshape OUTPUT_FILENAME\n"); + return 1; + } + + filename = argv[1]; + + /* First create and use a 0x0 surface, to measure how large + * the final surface needs to be */ + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + 0, 0); + cr = cairo_create (surface); + draw_text (cr, &width, &height); + cairo_destroy (cr); + cairo_surface_destroy (surface); + + /* Now create the final surface and draw to it. */ + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + width, height); + cr = cairo_create (surface); + + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_paint (cr); + cairo_set_source_rgb (cr, 0.0, 0.0, 0.5); + draw_text (cr, NULL, NULL); + cairo_destroy (cr); + + /* Write out the surface as PNG */ + status = cairo_surface_write_to_png (surface, filename); + cairo_surface_destroy (surface); + + if (status != CAIRO_STATUS_SUCCESS) + { + g_printerr ("Could not save png to '%s'\n", filename); + return 1; + } + + return 0; +} diff --git a/examples/cairosimple.c b/examples/cairosimple.c new file mode 100644 index 0000000..881bac5 --- /dev/null +++ b/examples/cairosimple.c @@ -0,0 +1,106 @@ +/* Simple example to use pangocairo to render rotated text */ + +#include +#include + +static void +draw_text (cairo_t *cr) +{ +#define RADIUS 200 +#define N_WORDS 8 +#define FONT_WITH_MANUAL_SIZE "Times new roman,Sans" +#define FONT_SIZE 36 +#define DEVICE_DPI 72 + +/* The following number applies a cairo CTM. Tests for + * https://bugzilla.gnome.org/show_bug.cgi?id=700592 + */ +#define TWEAKABLE_SCALE ((double) 0.1) + + PangoLayout *layout; + PangoFontDescription *desc; + int i; + + /* Center coordinates on the middle of the region we are drawing + */ + cairo_translate (cr, RADIUS / TWEAKABLE_SCALE, RADIUS / TWEAKABLE_SCALE); + + /* Create a PangoLayout, set the font and text */ + layout = pango_cairo_create_layout (cr); + + pango_layout_set_text (layout, "Test\nسَلام", -1); + + desc = pango_font_description_from_string (FONT_WITH_MANUAL_SIZE); + pango_font_description_set_absolute_size(desc, FONT_SIZE * DEVICE_DPI * PANGO_SCALE / (72.0 * TWEAKABLE_SCALE)); + //pango_font_description_set_size(desc, 27 * PANGO_SCALE / TWEAKABLE_SCALE); + + printf("PANGO_SCALE = %d\n", PANGO_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + /* Draw the layout N_WORDS times in a circle */ + for (i = 0; i < N_WORDS; i++) + { + int width, height; + double angle = (360. * i) / N_WORDS; + double red; + + cairo_save (cr); + + /* Gradient from red at angle == 60 to blue at angle == 240 */ + red = (1 + cos ((angle - 60) * G_PI / 180.)) / 2; + cairo_set_source_rgb (cr, red, 0, 1.0 - red); + + cairo_rotate (cr, angle * G_PI / 180.); + + /* Inform Pango to re-layout the text with the new transformation */ + pango_cairo_update_layout (cr, layout); + + pango_layout_get_size (layout, &width, &height); + cairo_move_to (cr,( - (((double)width) / PANGO_SCALE) / 2.0) , (- RADIUS) / TWEAKABLE_SCALE); + pango_cairo_show_layout (cr, layout); + + cairo_restore (cr); + } + + /* free the layout object */ + g_object_unref (layout); +} + +int main (int argc, char **argv) +{ + cairo_t *cr; + char *filename; + cairo_status_t status; + cairo_surface_t *surface; + + if (argc != 2) + { + g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n"); + return 1; + } + + filename = argv[1]; + + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + 2 * RADIUS, 2 * RADIUS); + cr = cairo_create (surface); + + cairo_scale(cr, 1 * TWEAKABLE_SCALE, 1 * TWEAKABLE_SCALE); + + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_paint (cr); + draw_text (cr); + cairo_destroy (cr); + + status = cairo_surface_write_to_png (surface, filename); + cairo_surface_destroy (surface); + + if (status != CAIRO_STATUS_SUCCESS) + { + g_printerr ("Could not save png to '%s'\n", filename); + return 1; + } + + return 0; +} diff --git a/examples/cairotwisted.c b/examples/cairotwisted.c new file mode 100644 index 0000000..d2d1cd3 --- /dev/null +++ b/examples/cairotwisted.c @@ -0,0 +1,624 @@ +/* Example code to show how to use pangocairo to render text + * projected on a path. + * + * + * Written by Behdad Esfahbod, 2006..2007 + * + * Permission to use, copy, modify, distribute, and sell this example + * for any purpose is hereby granted without fee. + * It is provided "as is" without express or implied warranty. + */ + +#include +#include +#include + +void fancy_cairo_stroke (cairo_t *cr); +void fancy_cairo_stroke_preserve (cairo_t *cr); + +/* A fancy cairo_stroke[_preserve]() that draws points and control + * points, and connects them together. + */ +static void +_fancy_cairo_stroke (cairo_t *cr, cairo_bool_t preserve) +{ + int i; + double line_width; + cairo_path_t *path; + cairo_path_data_t *data; + const double dash[] = {10, 10}; + + cairo_save (cr); + cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); + + line_width = cairo_get_line_width (cr); + path = cairo_copy_path (cr); + cairo_new_path (cr); + + cairo_save (cr); + cairo_set_line_width (cr, line_width / 3); + cairo_set_dash (cr, dash, G_N_ELEMENTS (dash), 0); + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + switch (data->header.type) { + case CAIRO_PATH_MOVE_TO: + case CAIRO_PATH_LINE_TO: + cairo_move_to (cr, data[1].point.x, data[1].point.y); + break; + case CAIRO_PATH_CURVE_TO: + cairo_line_to (cr, data[1].point.x, data[1].point.y); + cairo_move_to (cr, data[2].point.x, data[2].point.y); + cairo_line_to (cr, data[3].point.x, data[3].point.y); + break; + case CAIRO_PATH_CLOSE_PATH: + break; + default: + g_assert_not_reached (); + } + } + cairo_stroke (cr); + cairo_restore (cr); + + cairo_save (cr); + cairo_set_line_width (cr, line_width * 4); + cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + switch (data->header.type) { + case CAIRO_PATH_MOVE_TO: + cairo_move_to (cr, data[1].point.x, data[1].point.y); + break; + case CAIRO_PATH_LINE_TO: + cairo_rel_line_to (cr, 0, 0); + cairo_move_to (cr, data[1].point.x, data[1].point.y); + break; + case CAIRO_PATH_CURVE_TO: + cairo_rel_line_to (cr, 0, 0); + cairo_move_to (cr, data[1].point.x, data[1].point.y); + cairo_rel_line_to (cr, 0, 0); + cairo_move_to (cr, data[2].point.x, data[2].point.y); + cairo_rel_line_to (cr, 0, 0); + cairo_move_to (cr, data[3].point.x, data[3].point.y); + break; + case CAIRO_PATH_CLOSE_PATH: + cairo_rel_line_to (cr, 0, 0); + break; + default: + g_assert_not_reached (); + } + } + cairo_rel_line_to (cr, 0, 0); + cairo_stroke (cr); + cairo_restore (cr); + + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + switch (data->header.type) { + case CAIRO_PATH_MOVE_TO: + cairo_move_to (cr, data[1].point.x, data[1].point.y); + break; + case CAIRO_PATH_LINE_TO: + cairo_line_to (cr, data[1].point.x, data[1].point.y); + break; + case CAIRO_PATH_CURVE_TO: + cairo_curve_to (cr, data[1].point.x, data[1].point.y, + data[2].point.x, data[2].point.y, + data[3].point.x, data[3].point.y); + break; + case CAIRO_PATH_CLOSE_PATH: + cairo_close_path (cr); + break; + default: + g_assert_not_reached (); + } + } + cairo_stroke (cr); + + if (preserve) + cairo_append_path (cr, path); + + cairo_path_destroy (path); + + cairo_restore (cr); +} + +/* A fancy cairo_stroke() that draws points and control points, and + * connects them together. + */ +void +fancy_cairo_stroke (cairo_t *cr) +{ + _fancy_cairo_stroke (cr, FALSE); +} + +/* A fancy cairo_stroke_preserve() that draws points and control + * points, and connects them together. + */ +void +fancy_cairo_stroke_preserve (cairo_t *cr) +{ + _fancy_cairo_stroke (cr, TRUE); +} + + +/* Returns Euclidean distance between two points */ +static double +two_points_distance (cairo_path_data_t *a, cairo_path_data_t *b) +{ + double dx, dy; + + dx = b->point.x - a->point.x; + dy = b->point.y - a->point.y; + + return sqrt (dx * dx + dy * dy); +} + +/* Returns length of a Bezier curve. + * Seems like computing that analytically is not easy. The + * code just flattens the curve using cairo and adds the length + * of segments. + */ +static double +curve_length (double x0, double y0, + double x1, double y1, + double x2, double y2, + double x3, double y3) +{ + cairo_surface_t *surface; + cairo_t *cr; + cairo_path_t *path; + cairo_path_data_t *data, current_point = {0,}; + int i; + double length; + + surface = cairo_image_surface_create (CAIRO_FORMAT_A8, 0, 0); + cr = cairo_create (surface); + cairo_surface_destroy (surface); + + cairo_move_to (cr, x0, y0); + cairo_curve_to (cr, x1, y1, x2, y2, x3, y3); + + length = 0; + path = cairo_copy_path_flat (cr); + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + switch (data->header.type) { + + case CAIRO_PATH_MOVE_TO: + current_point = data[1]; + break; + + case CAIRO_PATH_LINE_TO: + length += two_points_distance (¤t_point, &data[1]); + current_point = data[1]; + break; + + default: + case CAIRO_PATH_CURVE_TO: + case CAIRO_PATH_CLOSE_PATH: + g_assert_not_reached (); + } + } + cairo_path_destroy (path); + + cairo_destroy (cr); + + return length; +} + + +typedef double parametrization_t; + +/* Compute parametrization info. That is, for each part of the + * cairo path, tags it with its length. + * + * Free returned value with g_free(). + */ +static parametrization_t * +parametrize_path (cairo_path_t *path) +{ + int i; + cairo_path_data_t *data, last_move_to = {0,}, current_point = {0,}; + parametrization_t *parametrization; + + parametrization = g_malloc (path->num_data * sizeof (parametrization[0])); + + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + parametrization[i] = 0.0; + switch (data->header.type) { + case CAIRO_PATH_MOVE_TO: + last_move_to = data[1]; + current_point = data[1]; + break; + case CAIRO_PATH_CLOSE_PATH: + /* Make it look like it's a line_to to last_move_to */ + data = (&last_move_to) - 1; + /* fall through */ + case CAIRO_PATH_LINE_TO: + parametrization[i] = two_points_distance (¤t_point, &data[1]); + current_point = data[1]; + break; + case CAIRO_PATH_CURVE_TO: + /* naive curve-length, treating bezier as three line segments: + parametrization[i] = two_points_distance (¤t_point, &data[1]) + + two_points_distance (&data[1], &data[2]) + + two_points_distance (&data[2], &data[3]); + */ + parametrization[i] = curve_length (current_point.point.x, current_point.point.y, + data[1].point.x, data[1].point.y, + data[2].point.x, data[2].point.y, + data[3].point.x, data[3].point.y); + + current_point = data[3]; + break; + default: + g_assert_not_reached (); + } + } + + return parametrization; +} + + +typedef void (*transform_point_func_t) (void *closure, double *x, double *y); + +/* Project a path using a function. Each point of the path (including + * Bezier control points) is passed to the function for transformation. + */ +static void +transform_path (cairo_path_t *path, transform_point_func_t f, void *closure) +{ + int i; + cairo_path_data_t *data; + + for (i=0; i < path->num_data; i += path->data[i].header.length) { + data = &path->data[i]; + switch (data->header.type) { + case CAIRO_PATH_CURVE_TO: + f (closure, &data[3].point.x, &data[3].point.y); + f (closure, &data[2].point.x, &data[2].point.y); + case CAIRO_PATH_MOVE_TO: + case CAIRO_PATH_LINE_TO: + f (closure, &data[1].point.x, &data[1].point.y); + break; + case CAIRO_PATH_CLOSE_PATH: + break; + default: + g_assert_not_reached (); + } + } +} + + +/* Simple struct to hold a path and its parametrization */ +typedef struct { + cairo_path_t *path; + parametrization_t *parametrization; +} parametrized_path_t; + + +/* Project a point X,Y onto a parameterized path. The final point is + * where you get if you walk on the path forward from the beginning for X + * units, then stop there and walk another Y units perpendicular to the + * path at that point. In more detail: + * + * There's three pieces of math involved: + * + * - The parametric form of the Line equation + * http://en.wikipedia.org/wiki/Line + * + * - The parametric form of the Cubic Bézier curve equation + * http://en.wikipedia.org/wiki/B%C3%A9zier_curve + * + * - The Gradient (aka multi-dimensional derivative) of the above + * http://en.wikipedia.org/wiki/Gradient + * + * The parametric forms are used to answer the question of "where will I be + * if I walk a distance of X on this path". The Gradient is used to answer + * the question of "where will I be if then I stop, rotate left for 90 + * degrees and walk straight for a distance of Y". + */ +static void +point_on_path (parametrized_path_t *param, + double *x, double *y) +{ + int i; + double ratio, the_y = *y, the_x = *x, dx, dy; + cairo_path_data_t *data, last_move_to = {0,}, current_point = {0,}; + cairo_path_t *path = param->path; + parametrization_t *parametrization = param->parametrization; + + for (i=0; i + path->data[i].header.length < path->num_data && + (the_x > parametrization[i] || + path->data[i].header.type == CAIRO_PATH_MOVE_TO); + i += path->data[i].header.length) { + the_x -= parametrization[i]; + data = &path->data[i]; + switch (data->header.type) { + case CAIRO_PATH_MOVE_TO: + current_point = data[1]; + last_move_to = data[1]; + break; + case CAIRO_PATH_LINE_TO: + current_point = data[1]; + break; + case CAIRO_PATH_CURVE_TO: + current_point = data[3]; + break; + case CAIRO_PATH_CLOSE_PATH: + break; + default: + g_assert_not_reached (); + } + } + data = &path->data[i]; + + switch (data->header.type) { + + case CAIRO_PATH_MOVE_TO: + break; + case CAIRO_PATH_CLOSE_PATH: + /* Make it look like it's a line_to to last_move_to */ + data = (&last_move_to) - 1; + /* fall through */ + case CAIRO_PATH_LINE_TO: + { + ratio = the_x / parametrization[i]; + /* Line polynomial */ + *x = current_point.point.x * (1 - ratio) + data[1].point.x * ratio; + *y = current_point.point.y * (1 - ratio) + data[1].point.y * ratio; + + /* Line gradient */ + dx = -(current_point.point.x - data[1].point.x); + dy = -(current_point.point.y - data[1].point.y); + + /*optimization for: ratio = the_y / sqrt (dx * dx + dy * dy);*/ + ratio = the_y / parametrization[i]; + *x += -dy * ratio; + *y += dx * ratio; + } + break; + case CAIRO_PATH_CURVE_TO: + { + /* FIXME the formulas here are not exactly what we want, because the + * Bezier parametrization is not uniform. But I don't know how to do + * better. The caller can do slightly better though, by flattening the + * Bezier and avoiding this branch completely. That has its own cost + * though, as large y values magnify the flattening error drastically. + */ + + double ratio_1_0, ratio_0_1; + double ratio_2_0, ratio_0_2; + double ratio_3_0, ratio_2_1, ratio_1_2, ratio_0_3; + double _1__4ratio_1_0_3ratio_2_0, _2ratio_1_0_3ratio_2_0; + + ratio = the_x / parametrization[i]; + + ratio_1_0 = ratio; + ratio_0_1 = 1 - ratio; + + ratio_2_0 = ratio_1_0 * ratio_1_0; /* ratio * ratio */ + ratio_0_2 = ratio_0_1 * ratio_0_1; /* (1 - ratio) * (1 - ratio) */ + + ratio_3_0 = ratio_2_0 * ratio_1_0; /* ratio * ratio * ratio */ + ratio_2_1 = ratio_2_0 * ratio_0_1; /* ratio * ratio * (1 - ratio) */ + ratio_1_2 = ratio_1_0 * ratio_0_2; /* ratio * (1 - ratio) * (1 - ratio) */ + ratio_0_3 = ratio_0_1 * ratio_0_2; /* (1 - ratio) * (1 - ratio) * (1 - ratio) */ + + _1__4ratio_1_0_3ratio_2_0 = 1 - 4 * ratio_1_0 + 3 * ratio_2_0; + _2ratio_1_0_3ratio_2_0 = 2 * ratio_1_0 - 3 * ratio_2_0; + + /* Bezier polynomial */ + *x = current_point.point.x * ratio_0_3 + + 3 * data[1].point.x * ratio_1_2 + + 3 * data[2].point.x * ratio_2_1 + + data[3].point.x * ratio_3_0; + *y = current_point.point.y * ratio_0_3 + + 3 * data[1].point.y * ratio_1_2 + + 3 * data[2].point.y * ratio_2_1 + + data[3].point.y * ratio_3_0; + + /* Bezier gradient */ + dx =-3 * current_point.point.x * ratio_0_2 + + 3 * data[1].point.x * _1__4ratio_1_0_3ratio_2_0 + + 3 * data[2].point.x * _2ratio_1_0_3ratio_2_0 + + 3 * data[3].point.x * ratio_2_0; + dy =-3 * current_point.point.y * ratio_0_2 + + 3 * data[1].point.y * _1__4ratio_1_0_3ratio_2_0 + + 3 * data[2].point.y * _2ratio_1_0_3ratio_2_0 + + 3 * data[3].point.y * ratio_2_0; + + ratio = the_y / sqrt (dx * dx + dy * dy); + *x += -dy * ratio; + *y += dx * ratio; + } + break; + default: + g_assert_not_reached (); + } +} + +/* Projects the current path of cr onto the provided path. */ +static void +map_path_onto (cairo_t *cr, cairo_path_t *path) +{ + cairo_path_t *current_path; + parametrized_path_t param; + + param.path = path; + param.parametrization = parametrize_path (path); + + current_path = cairo_copy_path (cr); + cairo_new_path (cr); + + transform_path (current_path, + (transform_point_func_t) point_on_path, ¶m); + + cairo_append_path (cr, current_path); + + cairo_path_destroy (current_path); + g_free (param.parametrization); +} + + +typedef void (*draw_path_func_t) (cairo_t *cr); + +static void +draw_text (cairo_t *cr, + double x, + double y, + const char *font, + const char *text) +{ + PangoLayout *layout; + PangoLayoutLine *line; + PangoFontDescription *desc; + cairo_font_options_t *font_options; + + font_options = cairo_font_options_create (); + + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF); + + cairo_set_font_options (cr, font_options); + cairo_font_options_destroy (font_options); + + layout = pango_cairo_create_layout (cr); + + desc = pango_font_description_from_string (font); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, text, -1); + + /* Use pango_layout_get_line() instead of pango_layout_get_line_readonly() + * for older versions of pango + */ + line = pango_layout_get_line_readonly (layout, 0); + + cairo_move_to (cr, x, y); + pango_cairo_layout_line_path (cr, line); + + g_object_unref (layout); +} + +static void +draw_twisted (cairo_t *cr, + double x, + double y, + const char *font, + const char *text) +{ + cairo_path_t *path; + + cairo_save (cr); + + /* Decrease tolerance a bit, since it's going to be magnified */ + cairo_set_tolerance (cr, 0.01); + + /* Using cairo_copy_path() here shows our deficiency in handling + * Bezier curves, specially around sharper curves. + * + * Using cairo_copy_path_flat() on the other hand, magnifies the + * flattening error with large off-path values. We decreased + * tolerance for that reason. Increase tolerance to see that + * artifact. + */ + path = cairo_copy_path_flat (cr); +/*path = cairo_copy_path (cr);*/ + + cairo_new_path (cr); + + draw_text (cr, x, y, font, text); + map_path_onto (cr, path); + + cairo_path_destroy (path); + + cairo_fill_preserve (cr); + + cairo_save (cr); + cairo_set_source_rgb (cr, 0.1, 0.1, 0.1); + cairo_stroke (cr); + cairo_restore (cr); + + cairo_restore (cr); +} + +static void +draw_dream (cairo_t *cr) +{ + cairo_move_to (cr, 50, 650); + + cairo_rel_line_to (cr, 250, 50); + cairo_rel_curve_to (cr, 250, 50, 600, -50, 600, -250); + cairo_rel_curve_to (cr, 0, -400, -300, -100, -800, -300); + + cairo_set_line_width (cr, 1.5); + cairo_set_source_rgba (cr, 0.3, 0.3, 1.0, 0.3); + + fancy_cairo_stroke_preserve (cr); + + draw_twisted (cr, + 0, 0, + "Serif 72", + "It was a dream... Oh Just a dream..."); +} + +static void +draw_wow (cairo_t *cr) +{ + cairo_move_to (cr, 400, 780); + + cairo_rel_curve_to (cr, 50, -50, 150, -50, 200, 0); + + cairo_scale (cr, 1.0, 2.0); + cairo_set_line_width (cr, 2.0); + cairo_set_source_rgba (cr, 0.3, 1.0, 0.3, 1.0); + + fancy_cairo_stroke_preserve (cr); + + draw_twisted (cr, + -20, -150, + "Serif 60", + "WOW!"); +} + +int main (int argc, char **argv) +{ + cairo_t *cr; + char *filename; + cairo_status_t status; + cairo_surface_t *surface; + + if (argc != 2) + { + g_printerr ("Usage: cairotwisted OUTPUT_FILENAME\n"); + return 1; + } + + filename = argv[1]; + + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + 1000, 800); + cr = cairo_create (surface); + + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_paint (cr); + + draw_dream (cr); + draw_wow (cr); + + cairo_destroy (cr); + + status = cairo_surface_write_to_png (surface, filename); + cairo_surface_destroy (surface); + + if (status != CAIRO_STATUS_SUCCESS) + { + g_printerr ("Could not save png to '%s'\n", filename); + return 1; + } + + return 0; +} diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000..8c7275f --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,28 @@ +examples = [] + +if pango_cairo_backends.contains('png') + examples += [ + 'cairoshape', + 'cairosimple', + 'cairotwisted', + ] +endif + +examples_deps = [ libpango_dep, libpangocairo_dep, ] + +if pango_font_backends.contains('freetype') + examples_deps += libpangoft2_dep +endif + +if host_system == 'windows' + # This hasn't been built in years, most likely, but try now + examples += [ 'pangowin32tobmp' ] + examples_deps += [ libpangowin32_dep ] +endif + +foreach e: examples + executable(e, '@0@.c'.format(e), + dependencies: examples_deps + pango_deps, + include_directories: root_inc, + install: false) +endforeach diff --git a/examples/pangowin32tobmp.c b/examples/pangowin32tobmp.c new file mode 100644 index 0000000..b657744 --- /dev/null +++ b/examples/pangowin32tobmp.c @@ -0,0 +1,449 @@ +/* Pango + * Copyright (C) 1999 Red Hat Software + * + * testfonts.c: + * Copyright (C) 2001 Hans Breuer + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include "pango.h" +#include "pango-impl-utils.h" +#include "pangowin32.h" + + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include + +#include + +static HDC pre_render (int width, int height); +static void post_render (HDC hdc, const char* sFile); + +static float +calc_duration (GTimeVal *tv1, GTimeVal *tv0) +{ + return ( ((float)tv1->tv_sec - tv0->tv_sec) + + (tv1->tv_usec - tv0->tv_usec) / 1000000.0); +} + +static int +compare_font_family (PangoFontFamily** a, + PangoFontFamily** b) +{ + return strcmp (pango_font_family_get_name (*a), pango_font_family_get_name (*b)); +} + +int main (int argc, char **argv) +{ + PangoFontMap *fontmap = pango_win32_font_map_for_display(); + PangoContext *context; + PangoCoverage * coverage = NULL; + PangoFont* font = NULL; + PangoFontFamily** families = NULL; + PangoFontFace** faces = NULL; + int nb, i; + gchar* family_name = NULL; + PangoLanguage *lang = pango_language_from_string (g_win32_getlocale ()); + HDC hdc = NULL; + int line = 0; + GTimeVal tv0, tv1; + int my_font_size = 12; + + printf ("# Pango Font Test\n" + "# Language: %s\n" + "#\n", pango_language_to_string (lang)); + + /* this wasn't necessary with previous version + * + * force initialization of built-in engines, otherwise + * the rendering get's really fast - too fast to work :-( + */ + context = pango_win32_get_context (); + + if (argc == 1) /* No arguments given */ + { + char *std_fonts[] = {"Sans 12", "Serif 12", "Monospace 12"}; + + /* try to load some fonts often hardcoded */ + for (i = 0; i < G_N_ELEMENTS (std_fonts); i++) + { + PangoFontDescription *desc = pango_font_description_from_string(std_fonts[i]); + + /* spits warnings if font cannot be loaded */ + font = pango_font_map_load_font (fontmap, context, desc); + + g_object_unref (font); + } + } + else + { + PangoFontDescription *desc = NULL; + GString *s; + + s = g_string_new (argv[1]); + for (i = 2; i < argc; i++) + { + s = g_string_append_c (s, ' '); + s = g_string_append (s, argv[i]); + + if (0 != atoi (argv[i])) + my_font_size = atoi (argv[i]); + } + + desc = pango_font_description_from_string(s->str); + family_name = g_strdup (pango_font_description_get_family (desc)); + + font = pango_font_map_load_font (fontmap, context, desc); + + coverage = pango_font_get_coverage (font, lang); + + /* ... */ + + pango_coverage_unref (coverage); + pango_font_description_free (desc); + g_object_unref (font); + } + + pango_font_map_list_families (fontmap, &families, &nb); + + if (!family_name) + { + qsort (families, nb, sizeof (PangoFontFamily*), compare_font_family); + } + else + { + /* Get on the family faces. No simple way ? */ + for (i = 0; i < nb; i++) + { + if (0 == g_ascii_strcasecmp (pango_font_family_get_name (families[i]), family_name)) + { + pango_font_family_list_faces (families[i], &faces, &nb); + /* now nb is the number of faces */ + break; + } + } + g_free (families); + families = NULL; + g_free (family_name); + family_name = NULL; + } + + hdc = pre_render(my_font_size * 64, 3 * my_font_size * nb / 2); + + for (i = 0; i < nb; i++) + { + PangoFontDescription *desc; + const char *f_name; + PangoWeight weight; + PangoStyle style; + + if (families) + { + desc = pango_font_description_new (); + + f_name = pango_font_family_get_name (families[i]); + pango_font_description_set_family (desc, f_name); + } + else + { + desc = pango_font_face_describe (faces[i]); + /* this is _not_ the family name from above */ + f_name = pango_font_description_get_family (desc); + } + weight = pango_font_description_get_weight (desc); + style = pango_font_description_get_style (desc); + + g_print ("%s; Style: %d; Weight: %d\n", + f_name, style, weight); + + /* give it an arbitray size to load it */ + pango_font_description_set_size (desc, my_font_size * PANGO_SCALE); + + g_get_current_time (&tv0); + font = pango_font_map_load_font (fontmap, context, desc); + g_get_current_time (&tv1); + g_print ("\tpango_font_map_load_font took %.3f sec\n", calc_duration (&tv1, &tv0)); + + if (font) + { + PangoItem *item; + PangoGlyphString * glyphs; + char s[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "1234567890 -+*/!\xc2\xa7$%&()[]{}<>|#=?@"; + + g_get_current_time (&tv0); + coverage = pango_font_get_coverage (font, lang); + g_get_current_time (&tv1); + g_print ("\tpango_font_get_coverage took %.3f sec\n", calc_duration (&tv1, &tv0)); + + /* ... */ + pango_context_set_language (context, lang); + pango_context_set_base_dir (context, PANGO_DIRECTION_LTR); + pango_context_set_font_description (context, desc); + + glyphs = pango_glyph_string_new (); + item = pango_item_new (); + + item->analysis.shape_engine = pango_font_find_shaper (font, lang, s[0]); + item->analysis.font = g_object_ref (font); + pango_shape ( s, sizeof(s), &(item->analysis), glyphs); + + if (hdc) + { + /* the positioning isn't correct */ + char* name = g_strdup_printf ("%s (%s%s)", + f_name, + weight == PANGO_WEIGHT_NORMAL ? "n" : + (weight == PANGO_WEIGHT_HEAVY ? "h" : + (weight > PANGO_WEIGHT_NORMAL ? "b" : "l")), + style == PANGO_STYLE_OBLIQUE ? "o" : + (style == PANGO_STYLE_ITALIC ? "i" : "n")); + + TextOut (hdc, 0, line, name, strlen(name)); + g_get_current_time (&tv0); + pango_win32_render (hdc, font, glyphs, 200, line); + g_get_current_time (&tv1); + g_print ("\tpango_win32_render took %.3f sec\n", + calc_duration (&tv1, &tv0)); + line += (3 * my_font_size / 2); + g_free(name); + } + + /* free glyphs, ... */ + pango_glyph_string_free (glyphs); + pango_item_free (item); + + pango_coverage_unref (coverage); + g_object_unref (font); + } + pango_font_description_free (desc); + } + + if (hdc) + post_render (hdc, "pango-fonts.bmp"); + + g_free (families); + g_free (faces); + + return 0; +} + +/* + * Real Win32 specific render support + */ +static HBITMAP hbmpold = NULL; +static HWND hwndRender = NULL; + +static BOOL +SaveBitmap (HBITMAP hBmp, const char* pszFile); + +static HDC +pre_render (int width, int height) +{ + HDC hmemdc; + HDC hdc; + HBITMAP hbmp; + RECT r; + r.top = 0; r.left = 0; + r.right = width; + r.bottom = height; + + hwndRender = CreateWindow ("EDIT", + "pango-render-window", + WS_DISABLED, + 0, 0, width, height, + GetDesktopWindow(), + NULL, + GetModuleHandle(NULL), + NULL); + + if (hwndRender == NULL) + fprintf (stderr, "Couldn't create window\n"), exit (1); + + hdc = GetDC(hwndRender); + hmemdc = CreateCompatibleDC (hdc); + if (hdc == NULL) + fprintf (stderr, "CreateCompatibleDC failed\n"), exit (1); + + hbmp = CreateCompatibleBitmap (hdc, width, height); + if (hbmp == NULL) + fprintf (stderr, "CreateCompatibleBitmap failed\n"), exit (1); + + hbmpold = SelectObject(hmemdc, hbmp); + + FillRect (hmemdc, &r, GetStockObject(WHITE_BRUSH)); + SetTextColor (hmemdc, RGB (0,0,0)); + SetBkMode (hmemdc, TRANSPARENT); + return hmemdc; +} + +static void +post_render (HDC hdc, const char* sFile) +{ + HBITMAP hbmp = SelectObject(hdc, hbmpold); + if (sFile) + SaveBitmap (hbmp, sFile); + DeleteObject (hbmp); + DeleteDC (hdc); + ReleaseDC(hwndRender, GetDC(hwndRender)); + DestroyWindow (hwndRender); +} + +static BOOL +SaveBitmap (HBITMAP hBmp, const char* pszFile) +{ + BITMAP bmp; + PBITMAPINFO pbmi; + WORD cClrBits; + /* Retrieve the bitmap's color format, width, and height. */ + if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&bmp)) + return FALSE; + /* Convert the color format to a count of bits. */ + cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel); + if (cClrBits == 1) + cClrBits = 1; + else if (cClrBits <= 4) + cClrBits = 4; + else if (cClrBits <= 8) + cClrBits = 8; + else if (cClrBits <= 16) + cClrBits = 16; + else if (cClrBits <= 24) + cClrBits = 24; + else + cClrBits = 32; + + /* + * Allocate memory for the BITMAPINFO structure. (This structure + * contains a BITMAPINFOHEADER structure and an array of RGBQUAD data + * structures.) */ + if (cClrBits < 24) + pbmi = (PBITMAPINFO) GlobalAlloc(LPTR, + sizeof(BITMAPINFOHEADER) + + sizeof(RGBQUAD) * (1 << cClrBits)); + /* + * There is no RGBQUAD array for the 24-bit-per-pixel format. */ + else + pbmi = (PBITMAPINFO) GlobalAlloc(LPTR, + sizeof(BITMAPINFOHEADER)); + /* Initialize the fields in the BITMAPINFO structure. */ + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = bmp.bmWidth; + pbmi->bmiHeader.biHeight = bmp.bmHeight; + pbmi->bmiHeader.biPlanes = bmp.bmPlanes; + pbmi->bmiHeader.biBitCount = bmp.bmBitsPixel; + if (cClrBits < 24) + pbmi->bmiHeader.biClrUsed = (1 << cClrBits); + else + pbmi->bmiHeader.biClrUsed = 0; + /* If the bitmap is not compressed, set the BI_RGB flag. */ + pbmi->bmiHeader.biCompression = BI_RGB; + /* + * Compute the number of bytes in the array of color + * indices and store the result in biSizeImage. + */ + pbmi->bmiHeader.biSizeImage = (pbmi->bmiHeader.biWidth + 7) /8 + * pbmi->bmiHeader.biHeight + * cClrBits; + /* + * Set biClrImportant to 0, indicating that all of the + * device colors are important. + */ + pbmi->bmiHeader.biClrImportant = 0; + + { /* C sucks */ + HANDLE hf; /* file handle */ + BITMAPFILEHEADER hdr; /* bitmap file-header */ + PBITMAPINFOHEADER pbih; /* bitmap info-header */ + LPBYTE lpBits; /* memory pointer */ + DWORD dwTotal; /* total count of bytes */ + DWORD cb; /* incremental count of bytes */ + DWORD dwTmp; + HDC hDC; + + pbih = (PBITMAPINFOHEADER) pbmi; + lpBits = (LPBYTE) GlobalAlloc(GMEM_FIXED, pbih->biSizeImage); + if (!lpBits) + return FALSE; + /* + * Retrieve the color table (RGBQUAD array) and the bits + * (array of palette indices) from the DIB. + */ + hDC = CreateCompatibleDC(NULL); + if (!GetDIBits(hDC, hBmp, 0, (WORD) pbih->biHeight, + lpBits, pbmi, DIB_RGB_COLORS)) + return FALSE; + /* Create the .BMP file. */ + hf = CreateFile (pszFile, + GENERIC_READ | GENERIC_WRITE, + (DWORD) 0, + (LPSECURITY_ATTRIBUTES) NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + (HANDLE) NULL); + + if (hf == INVALID_HANDLE_VALUE) + return FALSE; + hdr.bfType = 0x4d42; /* 0x42 = "B" 0x4d = "M" */ + /* Compute the size of the entire file. */ + hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + + pbih->biSize + pbih->biClrUsed + * sizeof(RGBQUAD) + pbih->biSizeImage); + hdr.bfReserved1 = 0; + hdr.bfReserved2 = 0; + /* Compute the offset to the array of color indices. */ + hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + + pbih->biSize + pbih->biClrUsed + * sizeof (RGBQUAD); + /* Copy the BITMAPFILEHEADER into the .BMP file. */ + if (!WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), + (LPDWORD) &dwTmp, (LPOVERLAPPED) NULL)) + return FALSE; + /* Copy the BITMAPINFOHEADER and RGBQUAD array into the file. */ + if (!WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) + + pbih->biClrUsed * sizeof (RGBQUAD), + (LPDWORD) &dwTmp, (LPOVERLAPPED) NULL)) + return FALSE; + /* Copy the array of color indices into the .BMP file. */ + dwTotal = cb = pbih->biSizeImage; + + if (!WriteFile(hf, (LPSTR) lpBits, (int) cb, + (LPDWORD) &dwTotal, (LPOVERLAPPED) NULL)) + return FALSE; + + /* Close the .BMP file. */ + if (!CloseHandle(hf)) + return FALSE; + + /* Free memory. */ + GlobalFree((HGLOBAL)lpBits); + GlobalFree((HGLOBAL)pbmi); + + DeleteDC(hDC); + } /* C sucks */ + return TRUE; +} diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 0000000..f87eaab --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,320 @@ +# -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = \ + $(HTML_IMAGES) \ + $(SETUP_FILES) + +DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test + +if GTK_DOC_BUILD_HTML +HTML_BUILD_STAMP=html-build.stamp +else +HTML_BUILD_STAMP= +endif +if GTK_DOC_BUILD_PDF +PDF_BUILD_STAMP=pdf-build.stamp +else +PDF_BUILD_STAMP= +endif + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +if ENABLE_GTK_DOC +all-local: all-gtk-doc +endif + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### setup #### + +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) +GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +#### scan #### + +GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) +GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; + +GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) +GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +GTK_DOC_V_XML=$(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_=$(GTK_DOC_V_XML_@AM_DEFAULT_V@) +GTK_DOC_V_XML_0=@echo " DOC Building XML"; + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +#### html #### + +GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_@AM_DEFAULT_V@) +GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; + +GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_@AM_DEFAULT_V@) +GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +#### pdf #### + +GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_@AM_DEFAULT_V@) +GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if HAVE_GTK_DOC +dist-check-gtkdoc: docs +else +dist-check-gtkdoc: + @echo "*** gtk-doc is needed to run 'make dist'. ***" + @echo "*** gtk-doc was not found when 'configure' ran. ***" + @echo "*** please install gtk-doc and rerun 'configure'. ***" + @false +endif + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..0360b79 --- /dev/null +++ b/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2016-01-11.22; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..30be9c8 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,11149 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.6 +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..fb66613 --- /dev/null +++ b/meson.build @@ -0,0 +1,520 @@ +project('pango', 'c', 'cpp', + version: '1.42.3', + license: 'LGPLv2.1+', + default_options: [ + 'buildtype=debugoptimized', + 'warning_level=1', + 'c_std=c99', + ], + meson_version : '>= 0.43.0') + +add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_POSIX_THREAD_SAFE_FUNCTIONS', '-D_GNU_SOURCE', ], language: 'c') + +pango_prefix = get_option('prefix') +pango_libdir = join_paths(pango_prefix, get_option('libdir')) +pango_sysconfdir = join_paths(pango_prefix, get_option('sysconfdir')) +pango_includedir = join_paths(pango_prefix, get_option('includedir')) +pango_datadir = join_paths(pango_prefix, get_option('datadir')) +pango_libexecdir = join_paths(pango_prefix, get_option('libexecdir')) + +version = meson.project_version().split('.') +pango_major_version = version[0].to_int() +pango_minor_version = version[1].to_int() +pango_micro_version = version[2].to_int() + +pango_interface_age = pango_minor_version.is_odd() ? 0 : pango_micro_version +pango_binary_age = pango_minor_version * 100 + pango_micro_version + +pango_api_version = '@0@.0'.format(pango_major_version) +pango_api_path = 'pango-@0@/pango'.format(pango_api_version) + +pango_conf = configuration_data() + +pango_conf.set('PANGO_BINARY_AGE', pango_binary_age) +pango_conf.set('PANGO_INTERFACE_AGE', pango_interface_age) +pango_conf.set('PANGO_VERSION_MAJOR', pango_major_version) +pango_conf.set('PANGO_VERSION_MINOR', pango_minor_version) +pango_conf.set('PANGO_VERSION_MICRO', pango_micro_version) + +# Maintain version scheme with libtool +pango_soversion = 0 +pango_libversion = '@0@.@1@.@2@'.format(pango_soversion, (pango_binary_age - pango_interface_age), pango_interface_age) + +cc = meson.get_compiler('c') +host_system = host_machine.system() + +# Compiler and linker flags +common_cflags = [] +common_cppflags = [] +common_ldflags = [] + +# Add more compiler warnings to the default set +if cc.get_id() == 'msvc' + # Compiler options taken from msvc_recommended_pragmas.h + # in GLib, based on _Win32_Programming_ by Rector and Newcomer + test_cflags = [] + add_project_arguments([ '-FImsvc_recommended_pragmas.h' ], language: 'c') + test_c_only_flags = [] +elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' + test_c_only_flags = [ + '-Wimplicit-function-declaration', + '-Wstrict-prototypes', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wno-int-conversion', + '-Wno-discarded-qualifiers', + ] + + test_cflags = test_c_only_flags + [ + '-fno-strict-aliasing', + '-Wpointer-arith', + '-Wmissing-declarations', + '-Wformat=2', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wunused', + '-Wcast-align', + '-Wmissing-noreturn', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wlogical-op', + '-Wno-uninitialized', + '-Wno-shadow', + '-Werror=redundant-decls', + '-Werror=implicit', + '-Werror=nonnull', + '-Werror=init-self', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=sequence-point', + '-Werror=return-type', + '-Werror=trigraphs', + '-Werror=array-bounds', + '-Werror=write-strings', + '-Werror=address', + '-Werror=int-to-pointer-cast', + '-Werror=pointer-to-int-cast', + '-Werror=empty-body', + '-Werror=write-strings', + '-Wundef', # FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=792481 + ] + + if host_system == 'windows' + test_cflags += [ '-mms-bitfields' ] + endif +else + test_cflags = [] + test_c_only_flags = [] +endif + +# Symbol visibility +if get_option('default_library') != 'static' + if host_system == 'windows' + pango_conf.set('DLL_EXPORT', true) + pango_conf.set('_PANGO_EXTERN', '__declspec(dllexport) extern') + if cc.get_id() != 'msvc' + test_cflags += ['-fvisibility=hidden'] + endif + else + pango_conf.set('_PANGO_EXTERN', '__attribute__((visibility("default"))) extern') + test_cflags += ['-fvisibility=hidden'] + endif +endif + +# Check all compiler flags +foreach cflag: test_cflags + if cc.has_argument(cflag) + common_cflags += [ cflag ] + endif +endforeach + +# Isolate the C++ compiler flags +foreach cflag: common_cflags + if not test_c_only_flags.contains(cflag) + common_cppflags += [ cflag ] + endif +endforeach + +# Linker flags +if host_machine.system() == 'linux' + foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + if cc.has_argument(ldflag) + common_ldflags += [ ldflag ] + endif + endforeach +endif + +# Maintain compatibility with autotools on macOS +if host_machine.system() == 'darwin' + common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ] +endif + +# Functions +checked_funcs = [ + 'sysconf', + 'getpagesize', + 'flockfile', + 'strtok_r', +] + +foreach f: checked_funcs + if cc.has_function(f) + pango_conf.set('HAVE_' + f.underscorify().to_upper(), 1) + endif +endforeach + +# Headers +checked_headers = [ + 'unistd.h', + 'sys/mman.h', + 'dirent.h', +] + +foreach h: checked_headers + if cc.has_header(h) + pango_conf.set('HAVE_' + h.underscorify().to_upper(), 1) + endif +endforeach + +buildtype = get_option('buildtype') +if buildtype.startswith('debug') + pango_debug_cflags = [ '-DPANGO_ENABLE_DEBUG', ] +elif buildtype == 'release' + pango_debug_cflags = [ '-DG_DISABLE_CAST_CHECKS', ] + # TODO: We may want a configuration argument to add `G_DISABLE_CHECKS` + # and `G_DISABLE_ASSERT` from the build, for specific build environments. + # On the other hand, those who need these symbols can inject them in their + # build as well. +else + pango_debug_cflags = [] +endif + +# Dependencies +pango_deps = [] + +glib_req_version = '>= 2.33.12' +fribidi_req_version = '>= 0.19.7' +libthai_req_version = '>= 0.1.9' +harfbuzz_req_version = '>= 1.4.2' +fontconfig_req_version = '>= 2.11.91' +xft_req_version = '>= 2.0.0' +cairo_req_version = '>= 1.12.10' + +# libm +mathlib_dep = cc.find_library('m', required: false) +pango_deps += mathlib_dep + +# gobject +gobject_dep = dependency('gobject-2.0', version: glib_req_version) +pango_deps += gobject_dep + +fribidi_dep = dependency('fribidi', version: fribidi_req_version) +pango_deps += fribidi_dep + +thai_dep = dependency('libthai', version: libthai_req_version, required: false) +if thai_dep.found() + pango_conf.set('HAVE_LIBTHAI', 1) + pango_deps += thai_dep + + if cc.has_function('th_brk_find_breaks', dependencies: thai_dep) + pango_conf.set('HAVE_TH_BRK_FIND_BREAKS', 1) + endif +endif + +# These are for the various .pc files so that things will link +# properly, depending on whether we have the pkg-config files +# for those non-GNOME dependencies, or when we find them manually +# for MSVC builds, as their MSVC build systems do not generate +# pkg-config files for them +cairo_pc = '' +cairo_lib = '' +harfbuzz_pc='' +freetype2_pc='' +fontconfig_pc='' +harfbuzz_lib='' +freetype2_lib='' +fontconfig_lib='' + +harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version, required: false) +if harfbuzz_dep.found() + harfbuzz_pc = 'harfbuzz' +else + if cc.get_id() == 'msvc' and cc.has_header('hb.h') + # The CMake build files for HarfBuzz (which is used for MSVC builds) do not + # generate pkg-config files, so look for harfbuzz.lib + harfbuzz_dep = cc.find_library('harfbuzz', required: false) + if harfbuzz_dep.found() + harfbuzz_lib = '-lharfbuzz' + endif + endif +endif +if harfbuzz_dep.found() + pango_deps += harfbuzz_dep +endif + +fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, required: false) +if fontconfig_dep.found() + fontconfig_pc = 'fontconfig' +else + if cc.get_id() == 'msvc' and cc.has_header('fontconfig/fontconfig.h') + # Look for the Visual Studio-style import library if FontConfig's .pc file cannot be + # found on Visual Studio + fontconfig_dep = cc.find_library('fontconfig', required: false) + if fontconfig_dep.found() + fontconfig_lib = '-lfontconfig' + endif + endif +endif + +if fontconfig_dep.found() + pango_deps += fontconfig_dep + + if cc.has_function('FcWeightFromOpenTypeDouble', dependencies: fontconfig_dep) + pango_conf.set('HAVE_FCWEIGHTFROMOPENTYPEDOUBLE', 1) + endif +endif + +# The first version of freetype with a pkg-config file is 2.1.5 +# We require both fontconfig and freetype if we are to have either. +freetype_dep = dependency('freetype2', required: false) + +if freetype_dep.found() + freetype2_pc = 'freetype2' +else + if cc.get_id() == 'msvc' and cc.has_header('ft2build.h') + foreach ft2_lib: ['freetype', 'freetypemt'] + if not freetype_dep.found() + freetype_dep = cc.find_library(ft2_lib, required: false) + if freetype_dep.found() + freetype2_lib = '-l@0@'.format(ft2_lib) + endif + endif + endforeach + endif +endif + +# To build pangoft2, we need HarfBuzz, FontConfig and FreeType +build_pangoft2 = harfbuzz_dep.found() and fontconfig_dep.found() and freetype_dep.found() +if build_pangoft2 + pango_conf.set('HAVE_FREETYPE', 1) + pango_deps += freetype_dep +endif + +xft_dep = dependency('xft', version: xft_req_version, required: false) +if xft_dep.found() + pango_conf.set('HAVE_XFT', 1) + pango_deps += dependency('xrender', required: false) + pango_deps += xft_dep +endif + +if host_system == 'darwin' + has_core_text = cc.links('''#include + int main (void) { + CTGetCoreTextVersion (); + return 0; + }''', + name: 'CoreText availability', + dependencies: dependency('appleframeworks', modules: 'ApplicationServices')) + if has_core_text + pango_conf.set('HAVE_CORE_TEXT', 1) + endif +endif + +cairo_pkgconfig_found = false +cairo_dep = dependency('cairo', version: cairo_req_version, required: false) + +if cairo_dep.found() + cairo_pkgconfig_found = true +else + if cc.get_id() == 'msvc' and cc.has_header('cairo.h') + cairo_dep = cc.find_library('cairo', required: false) + endif +endif + +pango_font_backends = [] +pango_cairo_backends = [] + +if cairo_pkgconfig_found + # Check the following Cairo font backends + # - dependency + # - version + # - define + # - backend name + # Note that Cairo can be built with FreeType but without FontConfig + + cairo_font_backends = [ + [ 'cairo-ft', cairo_req_version, 'HAVE_CAIRO_FREETYPE', 'freetype', ], + [ 'cairo-win32', cairo_req_version, 'HAVE_CAIRO_WIN32', 'win32', ], + [ 'cairo-quartz', cairo_req_version, 'HAVE_CAIRO_QUARTZ', 'quartz', ], + ] + + foreach b: cairo_font_backends + dep = dependency(b[0], version: b[1], required: false) + if dep.found() + if b[0] == 'cairo-ft' + if build_pangoft2 + pango_conf.set(b[2], 1) + pango_font_backends += b[3] + endif + else + pango_conf.set(b[2], 1) + pango_font_backends += b[3] + endif + endif + endforeach + + if pango_font_backends.length() == 0 + error('No Cairo font backends found') + endif + + # Check the following Cairo surface backends + # - dependency + # - version + # - define + # - backend name + cairo_surface_backends = [ + [ 'cairo-png', cairo_req_version, 'HAVE_CAIRO_PNG', 'png', ], + [ 'cairo-ps', cairo_req_version, 'HAVE_CAIRO_PS', 'ps', ], + [ 'cairo-pdf', cairo_req_version, 'HAVE_CAIRO_PDF', 'pdf', ], + [ 'cairo-xlib', cairo_req_version, 'HAVE_CAIRO_XLIB', 'xlib', ], + ] + + foreach b: cairo_surface_backends + dep = dependency(b[0], version: b[1], required: false) + if dep.found() + pango_conf.set(b[2], 1) + pango_cairo_backends += b[3] + endif + endforeach + + # This is to set up pangocairo.pc so that things that refer to + # it will link correctly + cairo_pc = 'cairo' +elif (cc.get_id() == 'msvc' and cairo_dep.found()) + # Fallback: Look for Cairo items manually + # We need to check for headers for some + cairo_headers = [ 'win32', 'quartz', 'ps', 'pdf', 'xlib' ] + + foreach header : cairo_headers + if cc.has_header('cairo-@0@.h'.format(header)) + pango_conf.set('HAVE_CAIRO_@0@'.format(header.underscorify().to_upper()), 1) + if header == 'win32' or header == 'quartz' + pango_font_backends += header + else + pango_cairo_backends += header + endif + endif + endforeach + + # Other cairo features that we need to check for symbols + # Note that Cairo with FreeType support can be without FontConfig + # support, so we must check for FontConfig support in Cairo + if cc.links('''#include + int main() { + FcPattern *p = NULL; + cairo_ft_font_face_create_for_pattern (p); + return 0; + }''', + dependencies: cairo_dep, + name : 'Cairo is built with FreeType and FontConfig support') + if build_pangoft2 + pango_conf.set('HAVE_CAIRO_FREETYPE', 1) + pango_font_backends += 'freetype' + endif + endif + + if pango_font_backends.length() == 0 + error('No Cairo font backends found') + endif + + # Check for Cairo's libpng output surface support + if cc.links('''#include + #include + int main() { + cairo_surface_t *s = NULL; + const char *f = "abc.png"; + cairo_surface_write_to_png (s, f); + return 0; + }''', + dependencies: cairo_dep, + name : 'Cairo is built with PNG output surface support') + pango_conf.set('HAVE_CAIRO_PNG', 1) + pango_cairo_backends += 'png' + endif + + # This is to set up pangocairo.pc so that things that refer to + # it will link correctly, when we don't have pkg-config files for cairo + cairo_lib = '-lcairo' +endif + +if cairo_dep.found() + pango_conf.set('HAVE_CAIRO', 1) + pango_deps += cairo_dep + + pangocairo_requires = '' + + if pango_font_backends.contains('freetype') + pangocairo_requires += 'pangoft2 ' + endif + + if pango_font_backends.contains('win32') + pangocairo_requires += 'pangowin32 ' + endif +endif + +# Compat variables for pkgconfig +pkgconf = configuration_data() +pkgconf.set('prefix', pango_prefix) +pkgconf.set('exec_prefix', pango_prefix) +pkgconf.set('libdir', pango_libdir) +pkgconf.set('includedir', pango_includedir) +pkgconf.set('VERSION', meson.project_version()) +pkgconf.set('PANGO_API_VERSION', pango_api_version) +pkgconf.set('PKGCONFIG_CAIRO_REQUIRES', pangocairo_requires) +pkgconf.set('CAIRO_PC', cairo_pc) +pkgconf.set('CAIRO_LIB', cairo_lib) +pkgconf.set('FREETYPE2_PC', freetype2_pc) +pkgconf.set('FREETYPE2_LIB', freetype2_lib) +pkgconf.set('FONTCONFIG_PC', fontconfig_pc) +pkgconf.set('FONTCONFIG_LIB', fontconfig_lib) +pkgconf.set('HARFBUZZ_PC', harfbuzz_pc) +pkgconf.set('HARFBUZZ_LIB', harfbuzz_lib) + +pkgconf_files = [ + [ 'pango.pc' ], + [ 'pangowin32.pc', host_system == 'windows' ], + [ 'pangoft2.pc', build_pangoft2 ], + [ 'pangoxft.pc', xft_dep.found() ], + [ 'pangocairo.pc', cairo_dep.found() ], +] + +foreach pkg: pkgconf_files + pkg_name = pkg[0] + pkg_enabled = pkg.get(1, true) + + if pkg_enabled + configure_file(input: pkg_name + '.in', + output: pkg_name, + configuration: pkgconf, + install: true, + install_dir: join_paths(pango_libdir, 'pkgconfig')) + endif +endforeach + +gnome = import('gnome') + +# Internal configuration header +configure_file(output: 'config.h', configuration: pango_conf) + +root_inc = include_directories('.') + +subdir('pango') +subdir('utils') +subdir('examples') +subdir('tests') +subdir('tools') + +if get_option('enable_docs') + subdir('docs') +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..ac64126 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,8 @@ +option('enable_docs', + description: 'Build API reference for Pango using GTK-Doc', + type: 'boolean', + value: false) +option('gir', + description: 'Build the GObject introspection data for Pango', + type: 'boolean', + value: true) diff --git a/missing b/missing new file mode 100755 index 0000000..b7e571e --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#!/bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/pango.doap b/pango.doap new file mode 100644 index 0000000..1aeb8e0 --- /dev/null +++ b/pango.doap @@ -0,0 +1,35 @@ + + + pango + Internationalized text layout and rendering library + + C + + + + + + + + + Owen Taylor + + otaylor + + + + + Behdad Esfahbod + + behdad + + + diff --git a/pango.pc.in b/pango.pc.in new file mode 100644 index 0000000..81c074b --- /dev/null +++ b/pango.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Pango +Description: Internationalized text handling +Version: @VERSION@ +Requires: glib-2.0 gobject-2.0 +Requires.private: fribidi +Libs: -L${libdir} -lpango-@PANGO_API_VERSION@ +Libs.private: -lm +Cflags: -I${includedir}/pango-1.0 diff --git a/pango/Makefile.am b/pango/Makefile.am new file mode 100644 index 0000000..b360533 --- /dev/null +++ b/pango/Makefile.am @@ -0,0 +1,545 @@ +## Process this file with automake to create Makefile.in. + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH. +GPATH = $(srcdir) + +include $(INTROSPECTION_MAKEFILE) + +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --warn-all --add-include-path=$(srcdir) --add-include-path=. +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=. +INTROSPECTION_SCANNER_ENV = CC="$(CC)" + +SUBDIRS = + +INCLUDES = \ + -DG_LOG_DOMAIN=\"Pango\" \ + -DPANGO_COMPILATION \ + -DPANGO_ENABLE_BACKEND \ + -DPANGO_ENABLE_ENGINE \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBDIR=\"$(libdir)\" \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(HARFBUZZ_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + $(FRIBIDI_CFLAGS) \ + $(LIBTHAI_CFLAGS) \ + $(X_CFLAGS) \ + $(PANGO_HIDDEN_VISIBILITY_CFLAGS) + +BUILT_SOURCES = pango-enum-types.h pango-enum-types.c pango-features.h + +pangoincludedir=$(includedir)/pango-1.0/pango + +if OS_WIN32 +else +libm = -lm +endif + +# ------------------- libpango ------------------- + +lib_LTLIBRARIES = libpango-1.0.la +INTROSPECTION_GIRS += Pango-1.0.gir + +libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) +libpango_1_0_la_LIBADD = \ + $(GLIB_LIBS) \ + $(LIBTHAI_LIBS) \ + $(FRIBIDI_LIBS) \ + $(libm) +libpango_1_0_la_DEPENDENCIES = + +if PLATFORM_WIN32 +libpango_1_0_la_LDFLAGS += -Wl,pango-win32-res.o +libpango_1_0_la_DEPENDENCIES += pango-win32-res.o +endif +pango-win32-res.o: pango.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +libpango_1_0_la_SOURCES = \ + break.c \ + ellipsize.c \ + fonts.c \ + glyphstring.c \ + modules.c \ + pango-attributes.c \ + pango-bidi-type.c \ + pango-color.c \ + pango-color-table.h \ + pango-context.c \ + pango-coverage.c \ + pango-emoji.c \ + pango-emoji-private.h \ + pango-emoji-table.h \ + pango-engine.c \ + pango-engine-private.h \ + pango-fontmap.c \ + pango-fontset.c \ + pango-glyph-item.c \ + pango-gravity.c \ + pango-impl-utils.h \ + pango-item.c \ + pango-language.c \ + pango-language-sample-table.h \ + pango-layout.c \ + pango-layout-private.h \ + pango-markup.c \ + pango-matrix.c \ + pango-renderer.c \ + pango-script.c \ + pango-script-lang-table.h \ + pango-script-private.h \ + pango-tabs.c \ + pango-utils.c \ + pango-utils-internal.h \ + reorder-items.c \ + shape.c \ + pango-enum-types.c + +pango_headers = \ + pango.h \ + pango-attributes.h \ + pango-bidi-type.h \ + pango-break.h \ + pango-context.h \ + pango-coverage.h \ + pango-engine.h \ + pango-font.h \ + pango-fontmap.h \ + pango-fontset.h \ + pango-glyph.h \ + pango-glyph-item.h \ + pango-gravity.h \ + pango-item.h \ + pango-language.h \ + pango-layout.h \ + pango-matrix.h \ + pango-modules.h \ + pango-renderer.h \ + pango-script.h \ + pango-tabs.h \ + pango-types.h \ + pango-utils.h \ + pango-version-macros.h + +pangoinclude_HEADERS = \ + $(pango_headers) \ + pango-features.h \ + pango-enum-types.h + +pango-enum-types.h: s-enum-types-h +s-enum-types-h: $(pango_headers) Makefile.am pango-enum-types.h.template + $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ + --template pango-enum-types.h.template \ + $(pango_headers) ) > pango-enum-types.h.tmp \ + && mv pango-enum-types.h.tmp pango-enum-types.h \ + && echo timestamp > $@ + +pango-enum-types.c: s-enum-types-c +s-enum-types-c: $(pango_headers) Makefile.am pango-enum-types.c.template + $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ + --template pango-enum-types.c.template \ + $(pango_headers) ) > pango-enum-types.c.tmp \ + && mv pango-enum-types.c.tmp pango-enum-types.c \ + && echo timestamp > $@ + +pango-features.h: + $(AM_V_GEN) cd $(top_builddir) && ./config.status pango/pango-features.h + +pango_introspection_files = \ + $(libpango_1_0_la_SOURCES) \ + $(pango_headers) \ + pango-enum-types.h +Pango-1.0.gir: libpango-1.0.la + +Pango_1_0_gir_PACKAGES = gobject-2.0 cairo glib-2.0 +if HAVE_CAIRO_FREETYPE +Pango_1_0_gir_PACKAGES += freetype2 +endif +Pango_1_0_gir_EXPORT_PACKAGES = pango +Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +Pango_1_0_gir_LIBS = libpango-1.0.la +Pango_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +Pango_1_0_gir_FILES = $(filter-out %-private.h pango-color-table.h, $(pango_introspection_files)) +Pango_1_0_gir_SCANNERFLAGS = --c-include "pango/pango.h" + +# ------------------- libpangoft2 ------------------- + +if HAVE_FREETYPE +pangoinclude_HEADERS += $(pangoft2_headers) +lib_LTLIBRARIES += libpangoft2-1.0.la +INTROSPECTION_GIRS += PangoFT2-1.0.gir +endif + +pangoft2_headers = \ + pango-ot.h \ + pangofc-font.h \ + pangofc-fontmap.h \ + pangofc-decoder.h \ + pangoft2.h + +pangoft2_public_sources = \ + pangofc-font.c \ + pangofc-fontmap.c \ + pangofc-decoder.c \ + pangofc-shape.c \ + pangoft2.c + +libpangoft2_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) +libpangoft2_1_0_la_LIBADD = \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(HARFBUZZ_LIBS) \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(libm) +libpangoft2_1_0_la_DEPENDENCIES = \ + libpango-$(PANGO_API_VERSION).la +libpangoft2_1_0_la_SOURCES = \ + $(pangoft2_public_sources) \ + pangofc-private.h \ + pangoft2.h \ + pangoft2-private.h \ + pangoft2-fontmap.c \ + pangoft2-render.c \ + pango-ot-private.h \ + pango-ot-buffer.c \ + pango-ot-info.c \ + pango-ot-ruleset.c \ + pango-ot-tag.c + + +if PLATFORM_WIN32 +libpangoft2_1_0_la_LDFLAGS += -Wl,pangoft2-win32-res.o +libpangoft2_1_0_la_DEPENDENCIES += pangoft2-win32-res.o +endif +pangoft2-win32-res.o: pangoft2.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +pangoft2_introspection_files = \ + $(pangoft2_headers) \ + $(pangoft2_public_sources) + +PangoFT2-1.0.gir: libpangoft2-1.0.la +PangoFT2-1.0.gir: Pango-1.0.gir + +PangoFT2_1_0_gir_PACKAGES = freetype2 +PangoFT2_1_0_gir_EXPORT_PACKAGES = pangoft2 +PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 freetype2-2.0 fontconfig-2.0 +PangoFT2_1_0_gir_LIBS = $(Pango_1_0_gir_LIBS) libpangoft2-1.0.la +PangoFT2_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoFT2_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --c-include "pango/pangoft2.h" +PangoFT2_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoft2_introspection_files))) + +# ------------------- libpangoxft ------------------- + +if HAVE_XFT +pangoinclude_HEADERS += $(pangoxft_headers) +lib_LTLIBRARIES += libpangoxft-1.0.la +INTROSPECTION_GIRS += PangoXft-1.0.gir +endif + +pangoxft_headers = pangoxft.h pangoxft-render.h + +libpangoxft_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) +libpangoxft_1_0_la_LIBADD = \ + libpangoft2-$(PANGO_API_VERSION).la \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(XFT_LIBS) \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(libm) +libpangoxft_1_0_la_DEPENDENCIES = \ + libpangoft2-$(PANGO_API_VERSION).la \ + libpango-$(PANGO_API_VERSION).la + +if PLATFORM_WIN32 +libpangoxft_1_0_la_LDFLAGS += -Wl,pangoxft-win32-res.o +libpangoxft_1_0_la_DEPENDENCIES += pangoxft-win32-res.o +endif +pangoxft-win32-res.o: pangoxft.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +libpangoxft_1_0_la_SOURCES = \ + pangoxft-font.c \ + pangoxft-fontmap.c \ + pangoxft-private.h \ + pangoxft-render.c + +pangoxft_introspection_files = \ + $(pangoxft_headers) \ + $(libpangoxft_1_0_la_SOURCES) + +PangoXft-1.0.gir: libpangoxft-1.0.la +PangoXft-1.0.gir: Pango-1.0.gir PangoFT2-1.0.gir + +PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2 +PangoXft_1_0_gir_EXPORT_PACKAGES = pangoxft +PangoXft_1_0_gir_INCLUDES = GObject-2.0 xft-2.0 xlib-2.0 +PangoXft_1_0_gir_LIBS = $(PangoFT2_1_0_gir_LIBS) libpangoxft-1.0.la +PangoXft_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoXft_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --include-uninstalled=$(builddir)/PangoFT2-1.0.gir --c-include "pango/pangoxft.h" +PangoXft_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoxft_introspection_files))) + +# ------------------- libpangocairo ------------------- + +if HAVE_CAIRO +pangoinclude_HEADERS += $(pangocairo_headers) +lib_LTLIBRARIES += libpangocairo-1.0.la +INTROSPECTION_GIRS += PangoCairo-1.0.gir +endif + +pangocairo_headers = pangocairo.h + +libpangocairo_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) +libpangocairo_1_0_la_LIBADD = \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(CAIRO_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(libm) +libpangocairo_1_0_la_DEPENDENCIES = \ + libpango-$(PANGO_API_VERSION).la +pangocairo_core_sources = \ + pangocairo-context.c \ + pangocairo-font.c \ + pangocairo-fontmap.c \ + pangocairo-render.c \ + pangocairo-private.h + +libpangocairo_1_0_la_SOURCES = $(pangocairo_core_sources) + +if HAVE_CAIRO_WIN32 +if PLATFORM_WIN32 +libpangocairo_1_0_la_LDFLAGS += -Wl,pangocairo-win32-res.o +libpangocairo_1_0_la_DEPENDENCIES += pangocairo-win32-res.o +endif +pangocairo-win32-res.o: pangocairo.rc + $(AM_V_GEN) $(WINDRES) $< $@ + + +libpangocairo_1_0_la_LIBADD += libpangowin32-$(PANGO_API_VERSION).la -lgdi32 +libpangocairo_1_0_la_DEPENDENCIES += libpangowin32-$(PANGO_API_VERSION).la + +libpangocairo_1_0_la_SOURCES += pangocairo-win32font.c pangocairo-win32fontmap.c pangocairo-win32.h +endif + +if HAVE_CAIRO_FREETYPE +libpangocairo_1_0_la_LIBADD += libpangoft2-$(PANGO_API_VERSION).la $(FREETYPE_LIBS) +libpangocairo_1_0_la_DEPENDENCIES += libpangoft2-$(PANGO_API_VERSION).la +PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoFT2-1.0.gir + +libpangocairo_1_0_la_SOURCES += \ + pangocairo-fcfont.c \ + pangocairo-fcfontmap.c \ + pangocairo-fc.h +endif + +if HAVE_CAIRO_QUARTZ +if HAVE_CORE_TEXT +libpangocairo_1_0_la_SOURCES += \ + pangocoretext.h \ + pangocoretext.c \ + pangocoretext-private.h \ + pangocoretext-fontmap.c \ + pangocoretext-shape.c \ + pangocairo-coretext.h \ + pangocairo-coretextfont.c \ + pangocairo-coretextfont.h \ + pangocairo-coretextfontmap.c +pangoinclude_HEADERS += pangocoretext.h + +libpangocairo_1_0_la_LDFLAGS += -framework CoreFoundation -framework ApplicationServices +# We don't have an CoreText GIR right now, so this is just hypothetical +# PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoCoreText-1.0.gir +endif +endif + +pangocairo_introspection_files = \ + $(libpangocairo_1_0_la_SOURCES) \ + $(pangocairo_headers) + +PangoCairo-1.0.gir: libpangocairo-1.0.la +PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) + +PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo +PangoCairo_1_0_gir_EXPORT_PACKAGES = pangocairo +PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +PangoCairo_1_0_gir_LIBS = $(Pango_1_0_gir_LIBS) libpangocairo-1.0.la +PangoCairo_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoCairo_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --c-include "pango/pangocairo.h" +if HAVE_CAIRO_FREETYPE +PangoCairo_1_0_gir_SCANNERFLAGS += --include-uninstalled=$(builddir)/$(PANGOCAIRO_FONT_BACKEND_GI_MODULE) +PangoCairo_1_0_gir_LIBS += $(PangoFT2_1_0_gir_LIBS) +endif +PangoCairo_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangocairo_introspection_files))) + +# ------------------- libpangowin32 ------------------- + +if HAVE_WIN32 +pangoinclude_HEADERS += pangowin32.h +lib_LTLIBRARIES += libpangowin32-1.0.la +endif + +libpangowin32_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) +libpangowin32_1_0_la_LIBADD = \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + -lusp10 -lgdi32 +libpangowin32_1_0_la_DEPENDENCIES = \ + libpango-$(PANGO_API_VERSION).la +libpangowin32_1_0_la_SOURCES = \ + pangowin32.h \ + pangowin32.c \ + pangowin32-private.h \ + pangowin32-fontcache.c \ + pangowin32-fontmap.c \ + pangowin32-shape.c + +if PLATFORM_WIN32 +libpangowin32_1_0_la_LDFLAGS += -Wl,pangowin32-win32-res.o +libpangowin32_1_0_la_DEPENDENCIES += pangowin32-win32-res.o +endif +pangowin32-win32-res.o: pangowin32.rc + $(AM_V_GEN) $(WINDRES) $< $@ + + +# ------------------- introspection ------------------- + +if HAVE_INTROSPECTION + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibsdir = $(libdir)/girepository-1.0 +typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +endif # HAVE_INTROSPECTION + + +EXTRA_DIST = \ + pango-enum-types.h \ + pango-enum-types.h.template \ + pango-enum-types.c.template \ + pango.rc \ + pango.rc.in \ + pangoft2.rc \ + pangoft2.rc.in \ + pangowin32.rc \ + pangowin32.rc.in \ + pangocairo.rc \ + pangocairo.rc.in \ + pangoxft.rc \ + pangoxft.rc.in \ + break-arabic.c \ + break-indic.c \ + break-thai.c + +CLEANFILES = \ + pango-enum-types.h \ + s-enum-types-h \ + pango-enum-types.c \ + s-enum-types-c \ + $(INTROSPECTION_GIRS) \ + $(INTROSPECTION_GIRS:.gir=.typelib) + +MOSTLYCLEANFILES = \ + *.list \ + *.expected + +DISTCLEANFILES = \ + pango-features.h + +# ------------------- MSVC Build Items ---------------- + +MSVCPROJS = pango pangowin32 pangoft2 pangocairo + +pango_FILES = \ + $(libpango_1_0_la_SOURCES) +pango_EXCLUDES = dummy +pango_HEADERS_DIR = $(pangoincludedir) + +# We can't just use $(pangoinclude_HEADERS), due to different platforms this may run on. +# We don't include the pangoft2 headers here, as it is optional on Windows Builds. +pango_HEADERS_INST = \ + $(pango_headers) \ + $(pangocairo_headers) \ + pangowin32.h \ + pango-features.h \ + pango-enum-types.h + +pango_HEADERS_EXCLUDES = dummy + +pangowin32_FILES = $(libpangowin32_1_0_la_SOURCES) +pangowin32_EXCLUDES = dummy + +pangoft2_FILES = $(libpangoft2_1_0_la_SOURCES) +pangoft2_EXCLUDES = dummy + +# Again, can't use $(libpangocairo_1_0_la_SOURCES), due to different platforms this may run on. +pangocairo_FILES = $(pangocairo_core_sources) +pangocairo_EXCLUDES = dummy + +include $(top_srcdir)/win32/Makefile.msvcproj + +if HAVE_INTROSPECTION +# Introspection Items for MSVC +MSVC_INTROSPECT_GIRS = Pango-1.0.gir PangoCairo-1.0.gir + +BASE_MSVC_GIR_CFLAGS = \ + -DG_LOG_DOMAIN=\"Pango\" \ + -DPANGO_ENABLE_BACKEND \ + -DPANGO_ENABLE_ENGINE + +INTROSPECTION_INTERMEDIATE_ITEMS = \ + $(top_builddir)/win32/Pango-1.0.gir.msvc.introspect \ + $(top_builddir)/win32/Pango_1_0_gir_list \ + $(top_builddir)/win32/PangoCairo-1.0.gir.msvc.introspect \ + $(top_builddir)/win32/PangoCairo_1_0_gir_list + +Pango_1_0_gir_MSVC_FILES = $(Pango_1_0_gir_FILES) +Pango_1_0_gir_MSVC_PACKAGES = gobject-2.0 cairo glib-2.0 +Pango_1_0_gir_MSVC_EXPORT_PACKAGES = $(Pango_1_0_gir_EXPORT_PACKAGES) +Pango_1_0_gir_MSVC_INCLUDE_GIRS = $(Pango_1_0_gir_INCLUDES) +Pango_1_0_gir_MSVC_LIBS = pango-1.0 +Pango_1_0_gir_MSVC_CFLAGS = -I.. $(BASE_MSVC_GIR_CFLAGS) +Pango_1_0_gir_MSVC_SCANNERFLAGS = $(Pango_1_0_gir_SCANNERFLAGS) + +pangocairo_msvc_introspection_files = \ + $(pangocairo_core_sources) \ + pangocairo-win32font.c \ + pangocairo-win32fontmap.c \ + pangocairo-win32.h \ + $(pangocairo_headers) + +PangoCairo_1_0_gir_MSVC_FILES = $(filter-out %-private.h, $(pangocairo_msvc_introspection_files)) +PangoCairo_1_0_gir_MSVC_GIR_DEPS = Pango-1.0.gir +PangoCairo_1_0_gir_MSVC_PACKAGES = $(PangoCairo_1_0_gir_PACKAGES) +PangoCairo_1_0_gir_MSVC_EXPORT_PACKAGES = $(PangoCairo_1_0_gir_EXPORT_PACKAGES) +PangoCairo_1_0_gir_MSVC_INCLUDE_GIRS = $(PangoCairo_1_0_gir_INCLUDES) win32-1.0 +PangoCairo_1_0_gir_MSVC_LIBS = $(Pango_1_0_gir_MSVC_LIBS) pangocairo-1.0 +PangoCairo_1_0_gir_MSVC_CFLAGS = $(Pango_1_0_gir_MSVC_CFLAGS) +PangoCairo_1_0_gir_MSVC_SCANNERFLAGS = --include-uninstalled=./Pango-1.0.gir --c-include "pango/pangocairo.h" + +include $(top_srcdir)/win32/Makefile.msvc-introspection +else +INTROSPECTION_INTERMEDIATE_ITEMS = +endif + +dist-hook: \ + $(top_builddir)/win32/vs9/pango.vcproj \ + $(top_builddir)/win32/vs9/pangowin32.vcproj \ + $(top_builddir)/win32/vs9/pangoft2.vcproj \ + $(top_builddir)/win32/vs9/pangocairo.vcproj \ + $(top_builddir)/win32/vs9/pango.headers \ + $(INTROSPECTION_INTERMEDIATE_ITEMS) + +-include $(top_srcdir)/git.mk diff --git a/pango/Makefile.in b/pango/Makefile.in new file mode 100644 index 0000000..0b3856f --- /dev/null +++ b/pango/Makefile.in @@ -0,0 +1,1816 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Author: Fan, Chun-wei +# Common Autotools file used to generate Visual Studio 2008+ +# Projects from their templates + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# * Input variables: +# +# MSVCPROJS - List of Projects that should be generated +# +# * Simple tutorial +# +# Add this to Makefile.am where your library/program is built: +# include +# MSVCPROJS = YourProject (can be multiple projects in a single srcdir) +# YourProject_FILES = $(libyourlib_1_0_SOURCES) +# YourProject_EXCLUDES = ... # list of sources to exclude, separated by '|', wildcards allowed; use random unsed value if none +# (the following 3 lines if headers need to be installed) +# YourProject_HEADERS_DIR = $(libyourlibincludedir) +# YourProject_HEADERS_INST = $(libyourlib_1_0_HEADERS) +# YourProject_HEADERS_EXCLUDES = ... # +# +# dist-hook: \ # (or add to it if it is already there, note the vs9 items will also call the vs10 items in the process) +# $(top_builddir)/win32/vs9/YourProject.vcproj \ +# $(top_builddir)/win32/vs9/YourProject.headers # if headers need to be installed +# +# --or, if Visual Studio 2013 or later is required-- +# dist-hook: \ # (or add to it if it is already there, this does -not- call other vs items in the process) +# $(top_builddir)/win32/vs12/YourProject.vcxproj \ +# $(top_builddir)/win32/vs12/YourProject.vs12.headers # if headers need to be installed + +# Private functions + +# Author: Fan, Chun-wei +# Common autotools file for constructing the g-ir-scanner and +# g-ir-compiler command lines for Visual Studio builds. + +# This is copied from $(srcroot)/win32 from the gobject-introspection +# project, which may be included in projects that support both +# Visual Studio builds and introspection. + +# * Input variables: +# +# MSVC_INTROSPECT_GIRS - List of .gir's that should be built +# in the NMake Makefiles +# +# * Simple tutorial +# +# Add this to Makefile.am where your library/program is built: +# (Either YourLib_1_0_gir_MSVC_LIBS or YourLib_1_0_gir_MSVC_PROGRAM +# is required unless --headers-only is specified in +# YourLib_1_0_gir__MSVC_SCANNERFLAGS) +# +# include +# MSVC_INTROSPECT_GIRS = YourLib-1.0.gir +# YourLib_1_0_gir_NAMESPACE = YourLib # This is optional +# YourLib_1_0_gir_VERSION = 1.0 # This is optional +# YourLib_1_0_gir_MSVC_LIBS = yourlib-1.0 +# YourLib_1_0_gir_MSVC_FILES = $(libyourlib_1_0_SOURCES) +# YourLib_1_0_gir_MSVC_PROGRAM = YourProgram +# YourLib_1_0_gir_MSVC_PACKAGES = (Dependent .pc files) +# YourLib_1_0_gir_MSVC_INCLUDE_GIRS = (Dependent external .gir's) +# YourLib_1_0_gir_MSVC_EXPORT_PACKAGES = (Packages exported by this .gir) +# YourLib_1_0_gir_MSVC_C_INCLUDES = (List of public C headers which need to be included by +# consumers at compile time to make use of the API) + +# Private functions + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@PLATFORM_WIN32_TRUE@am__append_1 = -Wl,pango-win32-res.o +@PLATFORM_WIN32_TRUE@am__append_2 = pango-win32-res.o +@HAVE_CAIRO_FREETYPE_TRUE@am__append_3 = freetype2 + +# ------------------- libpangoft2 ------------------- +@HAVE_FREETYPE_TRUE@am__append_4 = $(pangoft2_headers) +@HAVE_FREETYPE_TRUE@am__append_5 = libpangoft2-1.0.la +@HAVE_FREETYPE_TRUE@am__append_6 = PangoFT2-1.0.gir +@PLATFORM_WIN32_TRUE@am__append_7 = -Wl,pangoft2-win32-res.o +@PLATFORM_WIN32_TRUE@am__append_8 = pangoft2-win32-res.o + +# ------------------- libpangoxft ------------------- +@HAVE_XFT_TRUE@am__append_9 = $(pangoxft_headers) +@HAVE_XFT_TRUE@am__append_10 = libpangoxft-1.0.la +@HAVE_XFT_TRUE@am__append_11 = PangoXft-1.0.gir +@PLATFORM_WIN32_TRUE@am__append_12 = -Wl,pangoxft-win32-res.o +@PLATFORM_WIN32_TRUE@am__append_13 = pangoxft-win32-res.o + +# ------------------- libpangocairo ------------------- +@HAVE_CAIRO_TRUE@am__append_14 = $(pangocairo_headers) +@HAVE_CAIRO_TRUE@am__append_15 = libpangocairo-1.0.la +@HAVE_CAIRO_TRUE@am__append_16 = PangoCairo-1.0.gir +@HAVE_CAIRO_WIN32_TRUE@@PLATFORM_WIN32_TRUE@am__append_17 = -Wl,pangocairo-win32-res.o +@HAVE_CAIRO_WIN32_TRUE@@PLATFORM_WIN32_TRUE@am__append_18 = pangocairo-win32-res.o +@HAVE_CAIRO_WIN32_TRUE@am__append_19 = libpangowin32-$(PANGO_API_VERSION).la -lgdi32 +@HAVE_CAIRO_WIN32_TRUE@am__append_20 = libpangowin32-$(PANGO_API_VERSION).la +@HAVE_CAIRO_WIN32_TRUE@am__append_21 = pangocairo-win32font.c pangocairo-win32fontmap.c pangocairo-win32.h +@HAVE_CAIRO_FREETYPE_TRUE@am__append_22 = libpangoft2-$(PANGO_API_VERSION).la $(FREETYPE_LIBS) +@HAVE_CAIRO_FREETYPE_TRUE@am__append_23 = libpangoft2-$(PANGO_API_VERSION).la +@HAVE_CAIRO_FREETYPE_TRUE@am__append_24 = \ +@HAVE_CAIRO_FREETYPE_TRUE@ pangocairo-fcfont.c \ +@HAVE_CAIRO_FREETYPE_TRUE@ pangocairo-fcfontmap.c \ +@HAVE_CAIRO_FREETYPE_TRUE@ pangocairo-fc.h + +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@am__append_25 = \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext.h \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext.c \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext-private.h \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext-fontmap.c \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext-shape.c \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretext.h \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretextfont.c \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretextfont.h \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretextfontmap.c + +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@am__append_26 = pangocoretext.h +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@am__append_27 = -framework CoreFoundation -framework ApplicationServices +@HAVE_CAIRO_FREETYPE_TRUE@am__append_28 = --include-uninstalled=$(builddir)/$(PANGOCAIRO_FONT_BACKEND_GI_MODULE) +@HAVE_CAIRO_FREETYPE_TRUE@am__append_29 = $(PangoFT2_1_0_gir_LIBS) + +# ------------------- libpangowin32 ------------------- +@HAVE_WIN32_TRUE@am__append_30 = pangowin32.h +@HAVE_WIN32_TRUE@am__append_31 = libpangowin32-1.0.la +@PLATFORM_WIN32_TRUE@am__append_32 = -Wl,pangowin32-win32-res.o +@PLATFORM_WIN32_TRUE@am__append_33 = pangowin32-win32-res.o +subdir = pango +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__pangoinclude_HEADERS_DIST) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = pango.rc pangoft2.rc pangowin32.rc pangocairo.rc \ + pangoxft.rc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(pangoincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +am_libpango_1_0_la_OBJECTS = break.lo ellipsize.lo fonts.lo \ + glyphstring.lo modules.lo pango-attributes.lo \ + pango-bidi-type.lo pango-color.lo pango-context.lo \ + pango-coverage.lo pango-emoji.lo pango-engine.lo \ + pango-fontmap.lo pango-fontset.lo pango-glyph-item.lo \ + pango-gravity.lo pango-item.lo pango-language.lo \ + pango-layout.lo pango-markup.lo pango-matrix.lo \ + pango-renderer.lo pango-script.lo pango-tabs.lo pango-utils.lo \ + reorder-items.lo shape.lo pango-enum-types.lo +libpango_1_0_la_OBJECTS = $(am_libpango_1_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libpango_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libpango_1_0_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@HAVE_CAIRO_WIN32_TRUE@am__DEPENDENCIES_2 = \ +@HAVE_CAIRO_WIN32_TRUE@ libpangowin32-$(PANGO_API_VERSION).la +@HAVE_CAIRO_FREETYPE_TRUE@am__DEPENDENCIES_3 = \ +@HAVE_CAIRO_FREETYPE_TRUE@ libpangoft2-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) +am__libpangocairo_1_0_la_SOURCES_DIST = pangocairo-context.c \ + pangocairo-font.c pangocairo-fontmap.c pangocairo-render.c \ + pangocairo-private.h pangocairo-win32font.c \ + pangocairo-win32fontmap.c pangocairo-win32.h \ + pangocairo-fcfont.c pangocairo-fcfontmap.c pangocairo-fc.h \ + pangocoretext.h pangocoretext.c pangocoretext-private.h \ + pangocoretext-fontmap.c pangocoretext-shape.c \ + pangocairo-coretext.h pangocairo-coretextfont.c \ + pangocairo-coretextfont.h pangocairo-coretextfontmap.c +am__objects_1 = pangocairo-context.lo pangocairo-font.lo \ + pangocairo-fontmap.lo pangocairo-render.lo +@HAVE_CAIRO_WIN32_TRUE@am__objects_2 = pangocairo-win32font.lo \ +@HAVE_CAIRO_WIN32_TRUE@ pangocairo-win32fontmap.lo +@HAVE_CAIRO_FREETYPE_TRUE@am__objects_3 = pangocairo-fcfont.lo \ +@HAVE_CAIRO_FREETYPE_TRUE@ pangocairo-fcfontmap.lo +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@am__objects_4 = \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext.lo \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext-fontmap.lo \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocoretext-shape.lo \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretextfont.lo \ +@HAVE_CAIRO_QUARTZ_TRUE@@HAVE_CORE_TEXT_TRUE@ pangocairo-coretextfontmap.lo +am_libpangocairo_1_0_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) +libpangocairo_1_0_la_OBJECTS = $(am_libpangocairo_1_0_la_OBJECTS) +libpangocairo_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libpangocairo_1_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@HAVE_CAIRO_TRUE@am_libpangocairo_1_0_la_rpath = -rpath $(libdir) +am__objects_5 = pangofc-font.lo pangofc-fontmap.lo pangofc-decoder.lo \ + pangofc-shape.lo pangoft2.lo +am_libpangoft2_1_0_la_OBJECTS = $(am__objects_5) pangoft2-fontmap.lo \ + pangoft2-render.lo pango-ot-buffer.lo pango-ot-info.lo \ + pango-ot-ruleset.lo pango-ot-tag.lo +libpangoft2_1_0_la_OBJECTS = $(am_libpangoft2_1_0_la_OBJECTS) +libpangoft2_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libpangoft2_1_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@HAVE_FREETYPE_TRUE@am_libpangoft2_1_0_la_rpath = -rpath $(libdir) +am_libpangowin32_1_0_la_OBJECTS = pangowin32.lo \ + pangowin32-fontcache.lo pangowin32-fontmap.lo \ + pangowin32-shape.lo +libpangowin32_1_0_la_OBJECTS = $(am_libpangowin32_1_0_la_OBJECTS) +libpangowin32_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libpangowin32_1_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@HAVE_WIN32_TRUE@am_libpangowin32_1_0_la_rpath = -rpath $(libdir) +am_libpangoxft_1_0_la_OBJECTS = pangoxft-font.lo pangoxft-fontmap.lo \ + pangoxft-render.lo +libpangoxft_1_0_la_OBJECTS = $(am_libpangoxft_1_0_la_OBJECTS) +libpangoxft_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libpangoxft_1_0_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@HAVE_XFT_TRUE@am_libpangoxft_1_0_la_rpath = -rpath $(libdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libpango_1_0_la_SOURCES) $(libpangocairo_1_0_la_SOURCES) \ + $(libpangoft2_1_0_la_SOURCES) $(libpangowin32_1_0_la_SOURCES) \ + $(libpangoxft_1_0_la_SOURCES) +DIST_SOURCES = $(libpango_1_0_la_SOURCES) \ + $(am__libpangocairo_1_0_la_SOURCES_DIST) \ + $(libpangoft2_1_0_la_SOURCES) $(libpangowin32_1_0_la_SOURCES) \ + $(libpangoxft_1_0_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(gir_DATA) $(typelibs_DATA) +am__pangoinclude_HEADERS_DIST = pango.h pango-attributes.h \ + pango-bidi-type.h pango-break.h pango-context.h \ + pango-coverage.h pango-engine.h pango-font.h pango-fontmap.h \ + pango-fontset.h pango-glyph.h pango-glyph-item.h \ + pango-gravity.h pango-item.h pango-language.h pango-layout.h \ + pango-matrix.h pango-modules.h pango-renderer.h pango-script.h \ + pango-tabs.h pango-types.h pango-utils.h \ + pango-version-macros.h pango-features.h pango-enum-types.h \ + pango-ot.h pangofc-font.h pangofc-fontmap.h pangofc-decoder.h \ + pangoft2.h pangoxft.h pangoxft-render.h pangocairo.h \ + pangocoretext.h pangowin32.h +HEADERS = $(pangoinclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/pango.rc.in \ + $(srcdir)/pangocairo.rc.in $(srcdir)/pangoft2.rc.in \ + $(srcdir)/pangowin32.rc.in $(srcdir)/pangoxft.rc.in \ + $(top_srcdir)/depcomp \ + $(top_srcdir)/win32/Makefile.msvc-introspection \ + $(top_srcdir)/win32/Makefile.msvcproj +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH. +GPATH = $(srcdir) +INTROSPECTION_GIRS = Pango-1.0.gir $(am__append_6) $(am__append_11) \ + $(am__append_16) +INTROSPECTION_SCANNER_ARGS = --warn-all --add-include-path=$(srcdir) --add-include-path=. +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=. +INTROSPECTION_SCANNER_ENV = CC="$(CC)" +SUBDIRS = +INCLUDES = \ + -DG_LOG_DOMAIN=\"Pango\" \ + -DPANGO_COMPILATION \ + -DPANGO_ENABLE_BACKEND \ + -DPANGO_ENABLE_ENGINE \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBDIR=\"$(libdir)\" \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(HARFBUZZ_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + $(FRIBIDI_CFLAGS) \ + $(LIBTHAI_CFLAGS) \ + $(X_CFLAGS) \ + $(PANGO_HIDDEN_VISIBILITY_CFLAGS) + +BUILT_SOURCES = pango-enum-types.h pango-enum-types.c pango-features.h +pangoincludedir = $(includedir)/pango-1.0/pango +@OS_WIN32_FALSE@libm = -lm + +# ------------------- libpango ------------------- +lib_LTLIBRARIES = libpango-1.0.la $(am__append_5) $(am__append_10) \ + $(am__append_15) $(am__append_31) +libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) $(am__append_1) +libpango_1_0_la_LIBADD = \ + $(GLIB_LIBS) \ + $(LIBTHAI_LIBS) \ + $(FRIBIDI_LIBS) \ + $(libm) + +libpango_1_0_la_DEPENDENCIES = $(am__append_2) +libpango_1_0_la_SOURCES = \ + break.c \ + ellipsize.c \ + fonts.c \ + glyphstring.c \ + modules.c \ + pango-attributes.c \ + pango-bidi-type.c \ + pango-color.c \ + pango-color-table.h \ + pango-context.c \ + pango-coverage.c \ + pango-emoji.c \ + pango-emoji-private.h \ + pango-emoji-table.h \ + pango-engine.c \ + pango-engine-private.h \ + pango-fontmap.c \ + pango-fontset.c \ + pango-glyph-item.c \ + pango-gravity.c \ + pango-impl-utils.h \ + pango-item.c \ + pango-language.c \ + pango-language-sample-table.h \ + pango-layout.c \ + pango-layout-private.h \ + pango-markup.c \ + pango-matrix.c \ + pango-renderer.c \ + pango-script.c \ + pango-script-lang-table.h \ + pango-script-private.h \ + pango-tabs.c \ + pango-utils.c \ + pango-utils-internal.h \ + reorder-items.c \ + shape.c \ + pango-enum-types.c + +pango_headers = \ + pango.h \ + pango-attributes.h \ + pango-bidi-type.h \ + pango-break.h \ + pango-context.h \ + pango-coverage.h \ + pango-engine.h \ + pango-font.h \ + pango-fontmap.h \ + pango-fontset.h \ + pango-glyph.h \ + pango-glyph-item.h \ + pango-gravity.h \ + pango-item.h \ + pango-language.h \ + pango-layout.h \ + pango-matrix.h \ + pango-modules.h \ + pango-renderer.h \ + pango-script.h \ + pango-tabs.h \ + pango-types.h \ + pango-utils.h \ + pango-version-macros.h + +pangoinclude_HEADERS = $(pango_headers) pango-features.h \ + pango-enum-types.h $(am__append_4) $(am__append_9) \ + $(am__append_14) $(am__append_26) $(am__append_30) +pango_introspection_files = \ + $(libpango_1_0_la_SOURCES) \ + $(pango_headers) \ + pango-enum-types.h + +Pango_1_0_gir_PACKAGES = gobject-2.0 cairo glib-2.0 $(am__append_3) +Pango_1_0_gir_EXPORT_PACKAGES = pango +Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +Pango_1_0_gir_LIBS = libpango-1.0.la +Pango_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +Pango_1_0_gir_FILES = $(filter-out %-private.h pango-color-table.h, $(pango_introspection_files)) +Pango_1_0_gir_SCANNERFLAGS = --c-include "pango/pango.h" +pangoft2_headers = \ + pango-ot.h \ + pangofc-font.h \ + pangofc-fontmap.h \ + pangofc-decoder.h \ + pangoft2.h + +pangoft2_public_sources = \ + pangofc-font.c \ + pangofc-fontmap.c \ + pangofc-decoder.c \ + pangofc-shape.c \ + pangoft2.c + +libpangoft2_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) \ + $(am__append_7) +libpangoft2_1_0_la_LIBADD = \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(HARFBUZZ_LIBS) \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(libm) + +libpangoft2_1_0_la_DEPENDENCIES = libpango-$(PANGO_API_VERSION).la \ + $(am__append_8) +libpangoft2_1_0_la_SOURCES = \ + $(pangoft2_public_sources) \ + pangofc-private.h \ + pangoft2.h \ + pangoft2-private.h \ + pangoft2-fontmap.c \ + pangoft2-render.c \ + pango-ot-private.h \ + pango-ot-buffer.c \ + pango-ot-info.c \ + pango-ot-ruleset.c \ + pango-ot-tag.c + +pangoft2_introspection_files = \ + $(pangoft2_headers) \ + $(pangoft2_public_sources) + +PangoFT2_1_0_gir_PACKAGES = freetype2 +PangoFT2_1_0_gir_EXPORT_PACKAGES = pangoft2 +PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 freetype2-2.0 fontconfig-2.0 +PangoFT2_1_0_gir_LIBS = $(Pango_1_0_gir_LIBS) libpangoft2-1.0.la +PangoFT2_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoFT2_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --c-include "pango/pangoft2.h" +PangoFT2_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoft2_introspection_files))) +pangoxft_headers = pangoxft.h pangoxft-render.h +libpangoxft_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) \ + $(am__append_12) +libpangoxft_1_0_la_LIBADD = \ + libpangoft2-$(PANGO_API_VERSION).la \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + $(XFT_LIBS) \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(libm) + +libpangoxft_1_0_la_DEPENDENCIES = libpangoft2-$(PANGO_API_VERSION).la \ + libpango-$(PANGO_API_VERSION).la $(am__append_13) +libpangoxft_1_0_la_SOURCES = \ + pangoxft-font.c \ + pangoxft-fontmap.c \ + pangoxft-private.h \ + pangoxft-render.c + +pangoxft_introspection_files = \ + $(pangoxft_headers) \ + $(libpangoxft_1_0_la_SOURCES) + +PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2 +PangoXft_1_0_gir_EXPORT_PACKAGES = pangoxft +PangoXft_1_0_gir_INCLUDES = GObject-2.0 xft-2.0 xlib-2.0 +PangoXft_1_0_gir_LIBS = $(PangoFT2_1_0_gir_LIBS) libpangoxft-1.0.la +PangoXft_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoXft_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --include-uninstalled=$(builddir)/PangoFT2-1.0.gir --c-include "pango/pangoxft.h" +PangoXft_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoxft_introspection_files))) +pangocairo_headers = pangocairo.h +libpangocairo_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) \ + $(am__append_17) $(am__append_27) +libpangocairo_1_0_la_LIBADD = libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(libm) \ + $(am__append_19) $(am__append_22) +libpangocairo_1_0_la_DEPENDENCIES = libpango-$(PANGO_API_VERSION).la \ + $(am__append_18) $(am__append_20) $(am__append_23) +pangocairo_core_sources = \ + pangocairo-context.c \ + pangocairo-font.c \ + pangocairo-fontmap.c \ + pangocairo-render.c \ + pangocairo-private.h + +libpangocairo_1_0_la_SOURCES = $(pangocairo_core_sources) \ + $(am__append_21) $(am__append_24) $(am__append_25) +@HAVE_CAIRO_FREETYPE_TRUE@PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoFT2-1.0.gir +# We don't have an CoreText GIR right now, so this is just hypothetical +# PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoCoreText-1.0.gir +pangocairo_introspection_files = \ + $(libpangocairo_1_0_la_SOURCES) \ + $(pangocairo_headers) + +PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo +PangoCairo_1_0_gir_EXPORT_PACKAGES = pangocairo +PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +PangoCairo_1_0_gir_LIBS = $(Pango_1_0_gir_LIBS) libpangocairo-1.0.la \ + $(am__append_29) +PangoCairo_1_0_gir_CFLAGS = -I$(top_builddir) -I$(top_srcdir) $(INCLUDES) +PangoCairo_1_0_gir_SCANNERFLAGS = \ + --include-uninstalled=$(builddir)/Pango-1.0.gir --c-include \ + "pango/pangocairo.h" $(am__append_28) +PangoCairo_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangocairo_introspection_files))) +libpangowin32_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) \ + $(am__append_32) +libpangowin32_1_0_la_LIBADD = \ + libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) \ + -lusp10 -lgdi32 + +libpangowin32_1_0_la_DEPENDENCIES = libpango-$(PANGO_API_VERSION).la \ + $(am__append_33) +libpangowin32_1_0_la_SOURCES = \ + pangowin32.h \ + pangowin32.c \ + pangowin32-private.h \ + pangowin32-fontcache.c \ + pangowin32-fontmap.c \ + pangowin32-shape.c + + +# ------------------- introspection ------------------- +@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 +@HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS) +@HAVE_INTROSPECTION_TRUE@typelibsdir = $(libdir)/girepository-1.0 +@HAVE_INTROSPECTION_TRUE@typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) +EXTRA_DIST = \ + pango-enum-types.h \ + pango-enum-types.h.template \ + pango-enum-types.c.template \ + pango.rc \ + pango.rc.in \ + pangoft2.rc \ + pangoft2.rc.in \ + pangowin32.rc \ + pangowin32.rc.in \ + pangocairo.rc \ + pangocairo.rc.in \ + pangoxft.rc \ + pangoxft.rc.in \ + break-arabic.c \ + break-indic.c \ + break-thai.c + +CLEANFILES = \ + pango-enum-types.h \ + s-enum-types-h \ + pango-enum-types.c \ + s-enum-types-c \ + $(INTROSPECTION_GIRS) \ + $(INTROSPECTION_GIRS:.gir=.typelib) + +MOSTLYCLEANFILES = \ + *.list \ + *.expected + +DISTCLEANFILES = \ + pango-features.h + + +# ------------------- MSVC Build Items ---------------- +MSVCPROJS = pango pangowin32 pangoft2 pangocairo +pango_FILES = \ + $(libpango_1_0_la_SOURCES) + +pango_EXCLUDES = dummy +pango_HEADERS_DIR = $(pangoincludedir) + +# We can't just use $(pangoinclude_HEADERS), due to different platforms this may run on. +# We don't include the pangoft2 headers here, as it is optional on Windows Builds. +pango_HEADERS_INST = \ + $(pango_headers) \ + $(pangocairo_headers) \ + pangowin32.h \ + pango-features.h \ + pango-enum-types.h + +pango_HEADERS_EXCLUDES = dummy +pangowin32_FILES = $(libpangowin32_1_0_la_SOURCES) +pangowin32_EXCLUDES = dummy +pangoft2_FILES = $(libpangoft2_1_0_la_SOURCES) +pangoft2_EXCLUDES = dummy + +# Again, can't use $(libpangocairo_1_0_la_SOURCES), due to different platforms this may run on. +pangocairo_FILES = $(pangocairo_core_sources) +pangocairo_EXCLUDES = dummy +_proj_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1)))) +_proj_path_raw := $(subst $(abs_top_srcdir),,$(abs_srcdir)) +_proj_path = $(subst /,\\,$(_proj_path_raw)) +_proj_subdir_int = $(subst \\\\,\\,\\$(_proj_path)\\) +_proj_subdir = $(subst \\.\\,\\,$(_proj_subdir_int)) +_proj_files_raw = $(subst /,\\,$($(_proj_name)_FILES)) +_proj_files = $(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_proj_path)\\,\\,$(_proj_files_raw)))) +_proj_filters = $($(_proj_name)_EXCLUDES) +_proj_headers_raw = $(subst /,\\,$($(_proj_name)_HEADERS_INST)) +_proj_headers = $(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_proj_path)\\,\\,$(_proj_headers_raw)))) +_proj_headers_excludes = $($(_proj_name)_HEADERS_EXCLUDES) +_headers_dest_posix = $(subst $(includedir),,$($(_proj_name)_HEADERS_DIR)) +_headers_destdir = $(subst /,\\,$(_headers_dest_posix)) + +# Introspection Items for MSVC +@HAVE_INTROSPECTION_TRUE@MSVC_INTROSPECT_GIRS = Pango-1.0.gir PangoCairo-1.0.gir +@HAVE_INTROSPECTION_TRUE@BASE_MSVC_GIR_CFLAGS = \ +@HAVE_INTROSPECTION_TRUE@ -DG_LOG_DOMAIN=\"Pango\" \ +@HAVE_INTROSPECTION_TRUE@ -DPANGO_ENABLE_BACKEND \ +@HAVE_INTROSPECTION_TRUE@ -DPANGO_ENABLE_ENGINE + +@HAVE_INTROSPECTION_FALSE@INTROSPECTION_INTERMEDIATE_ITEMS = +@HAVE_INTROSPECTION_TRUE@INTROSPECTION_INTERMEDIATE_ITEMS = \ +@HAVE_INTROSPECTION_TRUE@ $(top_builddir)/win32/Pango-1.0.gir.msvc.introspect \ +@HAVE_INTROSPECTION_TRUE@ $(top_builddir)/win32/Pango_1_0_gir_list \ +@HAVE_INTROSPECTION_TRUE@ $(top_builddir)/win32/PangoCairo-1.0.gir.msvc.introspect \ +@HAVE_INTROSPECTION_TRUE@ $(top_builddir)/win32/PangoCairo_1_0_gir_list + +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_FILES = $(Pango_1_0_gir_FILES) +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_PACKAGES = gobject-2.0 cairo glib-2.0 +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_EXPORT_PACKAGES = $(Pango_1_0_gir_EXPORT_PACKAGES) +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_INCLUDE_GIRS = $(Pango_1_0_gir_INCLUDES) +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_LIBS = pango-1.0 +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_CFLAGS = -I.. $(BASE_MSVC_GIR_CFLAGS) +@HAVE_INTROSPECTION_TRUE@Pango_1_0_gir_MSVC_SCANNERFLAGS = $(Pango_1_0_gir_SCANNERFLAGS) +@HAVE_INTROSPECTION_TRUE@pangocairo_msvc_introspection_files = \ +@HAVE_INTROSPECTION_TRUE@ $(pangocairo_core_sources) \ +@HAVE_INTROSPECTION_TRUE@ pangocairo-win32font.c \ +@HAVE_INTROSPECTION_TRUE@ pangocairo-win32fontmap.c \ +@HAVE_INTROSPECTION_TRUE@ pangocairo-win32.h \ +@HAVE_INTROSPECTION_TRUE@ $(pangocairo_headers) + +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_FILES = $(filter-out %-private.h, $(pangocairo_msvc_introspection_files)) +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_GIR_DEPS = Pango-1.0.gir +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_PACKAGES = $(PangoCairo_1_0_gir_PACKAGES) +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_EXPORT_PACKAGES = $(PangoCairo_1_0_gir_EXPORT_PACKAGES) +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_INCLUDE_GIRS = $(PangoCairo_1_0_gir_INCLUDES) win32-1.0 +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_LIBS = $(Pango_1_0_gir_MSVC_LIBS) pangocairo-1.0 +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_CFLAGS = $(Pango_1_0_gir_MSVC_CFLAGS) +@HAVE_INTROSPECTION_TRUE@PangoCairo_1_0_gir_MSVC_SCANNERFLAGS = --include-uninstalled=./Pango-1.0.gir --c-include "pango/pangocairo.h" +@HAVE_INTROSPECTION_TRUE@_gir_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1)))) + +# Namespace and Version is either fetched from the gir filename +# or the _NAMESPACE/_VERSION variable combo +@HAVE_INTROSPECTION_TRUE@_gir_namespace_msvc = $(or $($(_gir_name)_NAMESPACE),$(firstword $(subst -, ,$(notdir $(1))))) +@HAVE_INTROSPECTION_TRUE@_gir_version_msvc = $(or $($(_gir_name)_VERSION),$(lastword $(subst -, ,$(1:.gir=)))) +@HAVE_INTROSPECTION_TRUE@_typelib_basename_msvc = $(_gir_namespace_msvc)'-'$(_gir_version_msvc) + +# _PROGRAM is an optional variable which needs its own --program argument +@HAVE_INTROSPECTION_TRUE@_gir_program_msvc = $(if $($(_gir_name)_MSVC_PROGRAM),--program=$($(_gir_name)_MSVC_PROGRAM)) + +# Deduce the sub-folder from $(srcroot) where the sources reside in +@HAVE_INTROSPECTION_TRUE@_gir_source_path_raw_msvc := $(subst $(abs_top_srcdir),,$(abs_srcdir)) +@HAVE_INTROSPECTION_TRUE@_gir_source_path_msvc = $(subst /,\\,$(_gir_source_path_raw_msvc)) +@HAVE_INTROSPECTION_TRUE@_gir_source_subdir_int_msvc = $(subst \\\\,\\,\\$(_gir_source_path_msvc)\\) +@HAVE_INTROSPECTION_TRUE@_gir_source_subdir_msvc = $(subst \\.\\,\\,$(_gir_source_subdir_int_msvc)) +@HAVE_INTROSPECTION_TRUE@_gir_files_raw_msvc = $(subst /,\\,$($(_gir_name)_MSVC_FILES)) +@HAVE_INTROSPECTION_TRUE@_gir_files_msvc = $(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_gir_source_path_msvc)\\,\\,$(_gir_files_raw_msvc)))) + +# Create a list of items for: +# - Libraries +# - Packages +# - GIRs to include +# - packages to export +@HAVE_INTROSPECTION_TRUE@_gir_libraries_msvc = $(foreach lib,$($(_gir_name)_MSVC_LIBS),--library=$(lib)) +@HAVE_INTROSPECTION_TRUE@_gir_packages_msvc = $(foreach pkg,$($(_gir_name)_MSVC_PACKAGES),--pkg=$(pkg)) +@HAVE_INTROSPECTION_TRUE@_gir_includes_msvc = $(foreach include,$($(_gir_name)_MSVC_INCLUDE_GIRS),--include=$(include)) +@HAVE_INTROSPECTION_TRUE@_gir_export_packages_msvc = $(foreach pkg,$($(_gir_name)_MSVC_EXPORT_PACKAGES),--pkg-export=$(pkg)) +@HAVE_INTROSPECTION_TRUE@_gir_c_includes_msvc = $(foreach include,$($(_gir_name)_MSVC_C_INCLUDES),--c-include=$(include)) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/win32/Makefile.msvcproj $(top_srcdir)/win32/Makefile.msvc-introspection $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits pango/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits pango/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/win32/Makefile.msvcproj $(top_srcdir)/win32/Makefile.msvc-introspection $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +pango.rc: $(top_builddir)/config.status $(srcdir)/pango.rc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +pangoft2.rc: $(top_builddir)/config.status $(srcdir)/pangoft2.rc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +pangowin32.rc: $(top_builddir)/config.status $(srcdir)/pangowin32.rc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +pangocairo.rc: $(top_builddir)/config.status $(srcdir)/pangocairo.rc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +pangoxft.rc: $(top_builddir)/config.status $(srcdir)/pangoxft.rc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libpango-1.0.la: $(libpango_1_0_la_OBJECTS) $(libpango_1_0_la_DEPENDENCIES) $(EXTRA_libpango_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpango_1_0_la_LINK) -rpath $(libdir) $(libpango_1_0_la_OBJECTS) $(libpango_1_0_la_LIBADD) $(LIBS) + +libpangocairo-1.0.la: $(libpangocairo_1_0_la_OBJECTS) $(libpangocairo_1_0_la_DEPENDENCIES) $(EXTRA_libpangocairo_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpangocairo_1_0_la_LINK) $(am_libpangocairo_1_0_la_rpath) $(libpangocairo_1_0_la_OBJECTS) $(libpangocairo_1_0_la_LIBADD) $(LIBS) + +libpangoft2-1.0.la: $(libpangoft2_1_0_la_OBJECTS) $(libpangoft2_1_0_la_DEPENDENCIES) $(EXTRA_libpangoft2_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpangoft2_1_0_la_LINK) $(am_libpangoft2_1_0_la_rpath) $(libpangoft2_1_0_la_OBJECTS) $(libpangoft2_1_0_la_LIBADD) $(LIBS) + +libpangowin32-1.0.la: $(libpangowin32_1_0_la_OBJECTS) $(libpangowin32_1_0_la_DEPENDENCIES) $(EXTRA_libpangowin32_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpangowin32_1_0_la_LINK) $(am_libpangowin32_1_0_la_rpath) $(libpangowin32_1_0_la_OBJECTS) $(libpangowin32_1_0_la_LIBADD) $(LIBS) + +libpangoxft-1.0.la: $(libpangoxft_1_0_la_OBJECTS) $(libpangoxft_1_0_la_DEPENDENCIES) $(EXTRA_libpangoxft_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpangoxft_1_0_la_LINK) $(am_libpangoxft_1_0_la_rpath) $(libpangoxft_1_0_la_OBJECTS) $(libpangoxft_1_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/break.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ellipsize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glyphstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modules.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-attributes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-bidi-type.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-coverage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-emoji.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-engine.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-enum-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-fontset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-glyph-item.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-gravity.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-item.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-language.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-layout.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-markup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-matrix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-ot-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-ot-info.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-ot-ruleset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-ot-tag.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-renderer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-script.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-tabs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-coretextfont.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-coretextfontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-fcfont.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-fcfontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-render.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-win32font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocairo-win32fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocoretext-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocoretext-shape.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangocoretext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangofc-decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangofc-font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangofc-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangofc-shape.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoft2-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoft2-render.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoft2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangowin32-fontcache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangowin32-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangowin32-shape.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangowin32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoxft-font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoxft-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoxft-render.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reorder-items.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-girDATA: $(gir_DATA) + @$(NORMAL_INSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ + done + +uninstall-girDATA: + @$(NORMAL_UNINSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) +install-typelibsDATA: $(typelibs_DATA) + @$(NORMAL_INSTALL) + @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(typelibsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(typelibsdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibsdir)" || exit $$?; \ + done + +uninstall-typelibsDATA: + @$(NORMAL_UNINSTALL) + @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(typelibsdir)'; $(am__uninstall_files_from_dir) +install-pangoincludeHEADERS: $(pangoinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pangoinclude_HEADERS)'; test -n "$(pangoincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pangoincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pangoincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pangoincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pangoincludedir)" || exit $$?; \ + done + +uninstall-pangoincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pangoinclude_HEADERS)'; test -n "$(pangoincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pangoincludedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(pangoincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-girDATA install-pangoincludeHEADERS \ + install-typelibsDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \ + uninstall-pangoincludeHEADERS uninstall-typelibsDATA + +.MAKE: $(am__recursive_targets) all check install install-am \ + install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am dist-hook distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-girDATA \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pangoincludeHEADERS \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip install-typelibsDATA installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-girDATA \ + uninstall-libLTLIBRARIES uninstall-pangoincludeHEADERS \ + uninstall-typelibsDATA + +.PRECIOUS: Makefile + + +include $(INTROSPECTION_MAKEFILE) +pango-win32-res.o: pango.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +pango-enum-types.h: s-enum-types-h +s-enum-types-h: $(pango_headers) Makefile.am pango-enum-types.h.template + $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ + --template pango-enum-types.h.template \ + $(pango_headers) ) > pango-enum-types.h.tmp \ + && mv pango-enum-types.h.tmp pango-enum-types.h \ + && echo timestamp > $@ + +pango-enum-types.c: s-enum-types-c +s-enum-types-c: $(pango_headers) Makefile.am pango-enum-types.c.template + $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ + --template pango-enum-types.c.template \ + $(pango_headers) ) > pango-enum-types.c.tmp \ + && mv pango-enum-types.c.tmp pango-enum-types.c \ + && echo timestamp > $@ + +pango-features.h: + $(AM_V_GEN) cd $(top_builddir) && ./config.status pango/pango-features.h +Pango-1.0.gir: libpango-1.0.la +pangoft2-win32-res.o: pangoft2.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +PangoFT2-1.0.gir: libpangoft2-1.0.la +PangoFT2-1.0.gir: Pango-1.0.gir +pangoxft-win32-res.o: pangoxft.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +PangoXft-1.0.gir: libpangoxft-1.0.la +PangoXft-1.0.gir: Pango-1.0.gir PangoFT2-1.0.gir +@HAVE_CAIRO_WIN32_TRUE@pangocairo-win32-res.o: pangocairo.rc +@HAVE_CAIRO_WIN32_TRUE@ $(AM_V_GEN) $(WINDRES) $< $@ + +PangoCairo-1.0.gir: libpangocairo-1.0.la +PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) +pangowin32-win32-res.o: pangowin32.rc + $(AM_V_GEN) $(WINDRES) $< $@ + +# +# Creates Visual Studio 2008/2010 projects from items passed in from autotools files +# $(1) - Base Name of the MSVC project files (outputs) +# + +define msvcproj-builder + +$(top_builddir)/win32/vs10/$(1).vcxproj: $(top_builddir)/win32/vs9/$(1).vcproj +$(top_builddir)/win32/vs10/$(1).vcxproj.filters: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).sourcefiles: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).vs10.sourcefiles: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).vs10.sourcefiles.filters: $(top_builddir)/win32/vs9/$(1).vcproj + +$(top_builddir)/win32/vs9/$(1).vcproj: Makefile + -$(RM) $(top_builddir)/win32/vs9/$(1).vcproj + -$(RM) $(top_builddir)/win32/vs10/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs10/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs11/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs11/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs12/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs12/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj.filters + + for F in $(_proj_files); do \ + case $$$$F in \ + $(_proj_filters)) \ + ;; \ + *.c|*.cpp|*.cc|*.cxx) \ + echo ' ' >>$(1).sourcefiles && \ + echo ' ' >>$(1).vs10.sourcefiles && \ + echo ' Source Files' >>$(1).vs10.sourcefiles.filters \ + ;; \ + esac; \ + done + + $(CPP) -P - <$(top_srcdir)/win32/vs9/$(1).vcprojin >$(top_builddir)/win32/vs9/$(1).vcproj + $(CPP) -P - <$(top_srcdir)/win32/vs10/$(1).vcxprojin >$(top_builddir)/win32/vs10/$(1).vcxproj + $(CPP) -P - <$(top_srcdir)/win32/vs10/$(1).vcxproj.filtersin >$(top_builddir)/win32/vs10/$(1).vcxproj.filters + $(RM) $(1).sourcefiles + $(RM) $(1).vs10.sourcefiles + $(RM) $(1).vs10.sourcefiles.filters + +$(top_builddir)/win32/vs10/$(1).vs10.headers: $(top_builddir)/win32/vs9/$(1).headers + +$(top_builddir)/win32/vs9/$(1).headers: Makefile + -$(RM) $(top_builddir)/win32/vs9/$(1).headers + -$(RM) $(top_builddir)/win32/vs10/$(1).vs10.headers + + for F in $(_proj_headers); do \ + case $$$$F in \ + $(_proj_headers_excludes)) \ + ;; \ + *.h|*.hpp|*.hh|*.hxx) \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F' ' >>$(top_builddir)/win32/vs9/$(1).headers && \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F >>$(top_builddir)/win32/vs10/$(1).vs10.headers \ + ;; \ + esac; \ + done + +$(top_builddir)/win32/vs12/$(1).vcxproj.filters: $(top_builddir)/win32/vs12/$(1).vcxproj + +$(top_builddir)/win32/vs12/$(1).vcxproj: Makefile + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj.filters + + for F in $(_proj_files); do \ + case $$$$F in \ + $(_proj_filters)) \ + ;; \ + *.c|*.cpp|*.cc|*.cxx) \ + echo ' ' >>$(1).vs12.sourcefiles && \ + echo ' Source Files' >>$(1).vs12.sourcefiles.filters \ + ;; \ + esac; \ + done + + $(CPP) -P - <$(top_srcdir)/win32/vs12/$(1).vcxprojin >$(top_builddir)/win32/vs12/$(1).vcxproj + $(CPP) -P - <$(top_srcdir)/win32/vs12/$(1).vcxproj.filtersin >$(top_builddir)/win32/vs12/$(1).vcxproj.filters + $(RM) $(1).vs12.sourcefiles + $(RM) $(1).vs12.sourcefiles.filters + +$(top_builddir)/win32/vs12/$(1).vs12.headers: Makefile + -$(RM) $(top_builddir)/win32/vs12/$(1).vs12.headers + + for F in $(_proj_headers); do \ + case $$$$F in \ + $(_proj_headers_excludes)) \ + ;; \ + *.h|*.hpp|*.hh|*.hxx) \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F >>$(top_builddir)/win32/vs12/$(1).vs12.headers \ + ;; \ + esac; \ + done + +endef + +$(foreach proj,$(MSVCPROJS),$(eval $(call msvcproj-builder,$(proj)))) + +# +# Create NMake Makefile Sections for Building Introspection files +# from autotools files +# $(1) - File Name of the .gir that is to be generated +# + +@HAVE_INTROSPECTION_TRUE@define gir-nmake-builder + +# Basic sanity check, to make sure required variables are set +@HAVE_INTROSPECTION_TRUE@$(if $($(_gir_name)_MSVC_FILES),,$(error Need to define $(_gir_name)_MSVC_FILES)) +@HAVE_INTROSPECTION_TRUE@$(if $(or $(findstring --header-only,$($(_gir_name)_MSVC_SCANNERFLAGS)), +@HAVE_INTROSPECTION_TRUE@ $($(_gir_name)_MSVC_LIBS), +@HAVE_INTROSPECTION_TRUE@ $($(_gir_name)_MSVC_PROGRAM)),, +@HAVE_INTROSPECTION_TRUE@ $(error Need to define $(_gir_name)_MSVC_LIBS or $(_gir_name)_MSVC_PROGRAM)) + +@HAVE_INTROSPECTION_TRUE@$(top_builddir)/win32/$(_gir_name)_list: +@HAVE_INTROSPECTION_TRUE@ for F in $(_gir_files_msvc); do \ +@HAVE_INTROSPECTION_TRUE@ case $$$$F in \ +@HAVE_INTROSPECTION_TRUE@ *.c|*.cpp|*.cc|*.cxx|*.h|*.hpp|*.hh|*.hxx) \ +@HAVE_INTROSPECTION_TRUE@ echo '..'$(_gir_source_subdir_msvc)$$$$F >>$(top_builddir)/win32/$(_gir_name)_list \ +@HAVE_INTROSPECTION_TRUE@ ;; \ +@HAVE_INTROSPECTION_TRUE@ esac; \ +@HAVE_INTROSPECTION_TRUE@ done + +@HAVE_INTROSPECTION_TRUE@$(top_builddir)/win32/$(1).msvc.introspect: +@HAVE_INTROSPECTION_TRUE@ -$(RM) $(top_builddir)/win32/$(1).msvc.introspect + +# Assemble the Command to Run g-ir-scanner +@HAVE_INTROSPECTION_TRUE@ echo $(1)': '$(_gir_name)'_list '$($(_gir_name)_MSVC_GIR_DEPS)>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' @-echo Generating $$$$@...'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' $$$$(PYTHON) $$$$(G_IR_SCANNER) \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --verbose -no-libtool \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --namespace='$(_gir_namespace_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --nsversion='$(_gir_version_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_packages_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_libraries_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_program_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --add-include-path=$$$$(G_IR_INCLUDEDIR) \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_includes_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_export_packages_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(_gir_c_includes_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --cflags-begin \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$($(_gir_name)_MSVC_CFLAGS)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --cflags-end \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$($(_gir_name)_MSVC_SCANNERFLAGS)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --filelist='$(_gir_name)'_list \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' -o $$$$@'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo '' >>$(top_builddir)/win32/$(1).msvc.introspect + +# Finally Assemble the Command to Compile the generated .gir +@HAVE_INTROSPECTION_TRUE@ echo '$(_typelib_basename_msvc).typelib: '$(_typelib_basename_msvc)'.gir'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' @-echo Compiling $$$$@...'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' $$$$(G_IR_COMPILER) \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' --includedir=. --debug --verbose \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' '$(1)' \'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo ' -o $$$$@'>>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@ echo '' >>$(top_builddir)/win32/$(1).msvc.introspect +@HAVE_INTROSPECTION_TRUE@endef + +@HAVE_INTROSPECTION_TRUE@$(foreach gir,$(MSVC_INTROSPECT_GIRS),$(eval $(call gir-nmake-builder,$(gir)))) + +dist-hook: \ + $(top_builddir)/win32/vs9/pango.vcproj \ + $(top_builddir)/win32/vs9/pangowin32.vcproj \ + $(top_builddir)/win32/vs9/pangoft2.vcproj \ + $(top_builddir)/win32/vs9/pangocairo.vcproj \ + $(top_builddir)/win32/vs9/pango.headers \ + $(INTROSPECTION_INTERMEDIATE_ITEMS) + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/pango/break-arabic.c b/pango/break-arabic.c new file mode 100644 index 0000000..5e2f606 --- /dev/null +++ b/pango/break-arabic.c @@ -0,0 +1,91 @@ +/* Pango + * break-arabic.c: + * + * Copyright (C) 2006 Red Hat Software + * Copyright (C) 2006 Sharif FarsiWeb, Inc. + * Authors: Behdad Esfahbod + * Roozbeh Pournader + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-break.h" + +#define ALEF_WITH_MADDA_ABOVE 0x0622 +#define YEH_WITH_HAMZA_ABOVE 0x0626 +#define ALEF 0x0627 +#define WAW 0x0648 +#define YEH 0x064A + +#define MADDAH_ABOVE 0x0653 +#define HAMZA_ABOVE 0x0654 +#define HAMZA_BELOW 0x0655 + +/* + * Arabic characters with canonical decompositions that are not just + * ligatures. The characters U+06C0, U+06C2, and U+06D3 are intentionally + * excluded as they are marked as "not an independent letter" in Unicode + * Character Database's NamesList.txt + */ +#define IS_COMPOSITE(c) (ALEF_WITH_MADDA_ABOVE <= (c) && (c) <= YEH_WITH_HAMZA_ABOVE) + +/* If a character is the second part of a composite Arabic character with an Alef */ +#define IS_COMPOSITE_WITH_ALEF(c) (MADDAH_ABOVE <= (c) && (c) <= HAMZA_BELOW) + +static void +break_arabic (const char *text, + int length, + const PangoAnalysis *analysis G_GNUC_UNUSED, + PangoLogAttr *attrs, + int attrs_len G_GNUC_UNUSED) +{ + int i; + const char *p; + gunichar prev_wc, this_wc; + + /* See http://bugzilla.gnome.org/show_bug.cgi?id=350132 for issues this + * module tries to solve. + */ + + for (p = text, i = 0, prev_wc = 0; + p < text + length; + p = g_utf8_next_char (p), i++, prev_wc = this_wc) + { + this_wc = g_utf8_get_char (p); + + /* + * Unset backspace_deletes_character for various combinations. + * + * A few more combinations may need to be handled here, but are not + * handled yet, as expectations of users is not known or may differ + * among different languages or users: + * some letters combined with U+0658 ARABIC MARK NOON GHUNNA; + * combinations considered one letter in Azerbaijani (WAW+SUKUN and + * FARSI_YEH+HAMZA_ABOVE); combinations of YEH and ALEF_MAKSURA with + * HAMZA_BELOW (Qur'anic); TATWEEL+HAMZA_ABOVE (Qur'anic). + * + * FIXME: Ordering these in some other way may lower the time spent here, or not. + */ + if (G_UNLIKELY ( + IS_COMPOSITE (this_wc) || + (prev_wc == ALEF && IS_COMPOSITE_WITH_ALEF (this_wc)) || + (this_wc == HAMZA_ABOVE && (prev_wc == WAW || prev_wc == YEH)) + )) + attrs[i+1].backspace_deletes_character = FALSE; + } +} diff --git a/pango/break-indic.c b/pango/break-indic.c new file mode 100644 index 0000000..bb44d64 --- /dev/null +++ b/pango/break-indic.c @@ -0,0 +1,208 @@ +/* Pango + * break-indic.c: + * + * Copyright (C) 2006 Red Hat Software + * Author: Akira TAGOH + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-break.h" + +#define DEV_RRA 0x0931 /* 0930 + 093c */ +#define DEV_QA 0x0958 /* 0915 + 093c */ +#define DEV_YA 0x095F /* 092f + 003c */ +#define DEV_KHHA 0x0959 +#define DEV_GHHA 0x095A +#define DEV_ZA 0x095B +#define DEV_DDDHA 0x095C +#define DEV_RHA 0x095D +#define DEV_FA 0x095E +#define DEV_YYA 0x095F + +/* Bengali */ +/* for split matras in all brahmi based script */ +#define BENGALI_SIGN_O 0x09CB /* 09c7 + 09be */ +#define BENGALI_SIGN_AU 0x09CC /* 09c7 + 09d7 */ +#define BENGALI_RRA 0x09DC +#define BENGALI_RHA 0x09DD +#define BENGALI_YYA 0x09DF + +/* Gurumukhi */ +#define GURUMUKHI_LLA 0x0A33 +#define GURUMUKHI_SHA 0x0A36 +#define GURUMUKHI_KHHA 0x0A59 +#define GURUMUKHI_GHHA 0x0A5A +#define GURUMUKHI_ZA 0x0A5B +#define GURUMUKHI_RRA 0x0A5C +#define GURUMUKHI_FA 0x0A5E + +/* Oriya */ +#define ORIYA_AI 0x0B48 +#define ORIYA_O 0x0B4B +#define ORIYA_AU 0x0B4C + +/* Telugu */ +#define TELUGU_EE 0x0C47 +#define TELUGU_AI 0x0C48 + +/* Tamil */ +#define TAMIL_O 0x0BCA +#define TAMIL_OO 0x0BCB +#define TAMIL_AU 0x0BCC + +/* Kannada */ +#define KNDA_EE 0x0CC7 +#define KNDA_AI 0x0CC8 +#define KNDA_O 0x0CCA +#define KNDA_OO 0x0CCB + +/* Malayalam */ +#define MLYM_O 0x0D4A +#define MLYM_OO 0x0D4B +#define MLYM_AU 0x0D4C + +#define IS_COMPOSITE_WITH_BRAHMI_NUKTA(c) ( \ + (c >= BENGALI_RRA && c <= BENGALI_YYA) || \ + (c >= DEV_QA && c <= DEV_YA) || (c == DEV_RRA) || (c >= DEV_KHHA && c <= DEV_YYA) || \ + (c >= KNDA_EE && c <= KNDA_AI) ||(c >= KNDA_O && c <= KNDA_OO) || \ + (c == TAMIL_O) || (c == TAMIL_OO) || (c == TAMIL_AU) || \ + (c == TELUGU_EE) || (c == TELUGU_AI) || \ + (c == ORIYA_AI) || (c == ORIYA_O) || (c == ORIYA_AU) || \ + (c >= GURUMUKHI_KHHA && c <= GURUMUKHI_RRA) || (c == GURUMUKHI_FA)|| (c == GURUMUKHI_LLA)|| (c == GURUMUKHI_SHA) || \ + FALSE) +#define IS_SPLIT_MATRA_BRAHMI(c) ( \ + (c == BENGALI_SIGN_O) || (c == BENGALI_SIGN_AU) || \ + (c >= MLYM_O && c <= MLYM_AU) || \ + FALSE) + +static void +not_cursor_position (PangoLogAttr *attr) +{ + attr->is_cursor_position = FALSE; + attr->is_char_break = FALSE; + attr->is_line_break = FALSE; + attr->is_mandatory_break = FALSE; +} + +static void +break_indic (const char *text, + int length, + const PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len G_GNUC_UNUSED) +{ + const gchar *p, *next = NULL, *next_next; + gunichar prev_wc, this_wc, next_wc, next_next_wc; + gboolean is_conjunct = FALSE; + int i; + + for (p = text, prev_wc = 0, i = 0; + p != NULL && p < (text + length); + p = next, prev_wc = this_wc, i++) + { + this_wc = g_utf8_get_char (p); + next = g_utf8_next_char (p); + + if (G_UNLIKELY ( + IS_COMPOSITE_WITH_BRAHMI_NUKTA(this_wc) || IS_SPLIT_MATRA_BRAHMI(this_wc))) { + attrs[i+1].backspace_deletes_character = FALSE; + } + + if (next != NULL && next < (text + length)) + { + next_wc = g_utf8_get_char (next); + next_next = g_utf8_next_char (next); + } + else + { + next_wc = 0; + next_next = NULL; + } + if (next_next != NULL && next_next < (text + length)) + next_next_wc = g_utf8_get_char (next_next); + else + next_next_wc = 0; + + switch (analysis->script) + { + case PANGO_SCRIPT_SINHALA: + /* + * TODO: The cursor position should be based on the state table. + * This is the wrong place to be doing this. + */ + + /* + * The cursor should treat as a single glyph: + * SINHALA CONS + 0x0DCA + 0x200D + SINHALA CONS + * SINHALA CONS + 0x200D + 0x0DCA + SINHALA CONS + */ + if ((this_wc == 0x0DCA && next_wc == 0x200D) + || (this_wc == 0x200D && next_wc == 0x0DCA)) + { + not_cursor_position(&attrs[i]); + not_cursor_position(&attrs[i + 1]); + is_conjunct = TRUE; + } + else if (is_conjunct + && (prev_wc == 0x200D || prev_wc == 0x0DCA) + && this_wc >= 0x0D9A + && this_wc <= 0x0DC6) + { + not_cursor_position(&attrs[i]); + is_conjunct = FALSE; + } + /* + * Consonant clusters do NOT result in implicit conjuncts + * in SINHALA orthography. + */ + else if (!is_conjunct && prev_wc == 0x0DCA && this_wc != 0x200D) + { + attrs[i].is_cursor_position = TRUE; + } + + break; + + default: + + if (prev_wc != 0 && (this_wc == 0x200D || this_wc == 0x200C)) + { + not_cursor_position(&attrs[i]); + if (next_wc != 0) + { + not_cursor_position(&attrs[i+1]); + if ((next_next_wc != 0) && + (next_wc == 0x09CD || /* Bengali */ + next_wc == 0x0ACD || /* Gujarati */ + next_wc == 0x094D || /* Hindi */ + next_wc == 0x0CCD || /* Kannada */ + next_wc == 0x0D4D || /* Malayalam */ + next_wc == 0x0B4D || /* Oriya */ + next_wc == 0x0A4D || /* Punjabi */ + next_wc == 0x0BCD || /* Tamil */ + next_wc == 0x0C4D)) /* Telugu */ + { + not_cursor_position(&attrs[i+2]); + } + } + } + + break; + } + } +} diff --git a/pango/break-thai.c b/pango/break-thai.c new file mode 100644 index 0000000..4a6c427 --- /dev/null +++ b/pango/break-thai.c @@ -0,0 +1,112 @@ +/* Pango + * break-thai.c: + * + * Copyright (C) 2003 Theppitak Karoonboonyanan + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" + +#include "pango-break.h" +#include "pango-impl-utils.h" + +#ifdef HAVE_LIBTHAI +#include +#include + +#ifndef HAVE_TH_BRK_FIND_BREAKS +G_LOCK_DEFINE_STATIC (th_brk); +#endif + +/* + * tis_text is assumed to be large enough to hold the converted string, + * i.e. it must be at least pango_utf8_strlen(text, len)+1 bytes. + */ +static thchar_t * +utf8_to_tis (const char *text, int len, thchar_t *tis_text, int *tis_cnt) +{ + thchar_t *tis_p; + const char *text_p; + + tis_p = tis_text; + for (text_p = text; text_p < text + len; text_p = g_utf8_next_char (text_p)) + *tis_p++ = th_uni2tis (g_utf8_get_char (text_p)); + *tis_p++ = '\0'; + + *tis_cnt = tis_p - tis_text; + return tis_text; +} + +#endif +static void +break_thai (const char *text, + int len, + const PangoAnalysis *analysis G_GNUC_UNUSED, + PangoLogAttr *attrs, + int attrs_len G_GNUC_UNUSED) +{ +#ifdef HAVE_LIBTHAI + thchar_t tis_stack[512]; + int brk_stack[512]; + thchar_t *tis_text; + int *brk_pnts; + int cnt; +#ifdef HAVE_TH_BRK_FIND_BREAKS + ThBrk* brk; +#endif + + cnt = pango_utf8_strlen (text, len) + 1; + + tis_text = tis_stack; + if (cnt > (int) G_N_ELEMENTS (tis_stack)) + tis_text = g_new (thchar_t, cnt); + + utf8_to_tis (text, len, tis_text, &cnt); + + brk_pnts = brk_stack; + if (cnt > (int) G_N_ELEMENTS (brk_stack)) + brk_pnts = g_new (int, cnt); + + /* find line break positions */ + +#ifdef HAVE_TH_BRK_FIND_BREAKS + brk = th_brk_new(NULL); + len = th_brk_find_breaks(brk, tis_text, brk_pnts, cnt); + th_brk_delete(brk); +#else + G_LOCK (th_brk); + len = th_brk (tis_text, brk_pnts, cnt); + G_UNLOCK (th_brk); +#endif + for (cnt = 0; cnt < len; cnt++) + if (attrs[brk_pnts[cnt]].is_char_break) + { + /* Only allow additional line breaks if line-breaking is NOT + * prohibited. (The alternative would be to set is_char_break to + * TRUE as well. NOT setting it will break invariants that any + * line break opportunity is also a char break opportunity. */ + attrs[brk_pnts[cnt]].is_line_break = TRUE; + attrs[brk_pnts[cnt]].is_word_start = TRUE; + attrs[brk_pnts[cnt]].is_word_end = TRUE; + } + + if (brk_pnts != brk_stack) + g_free (brk_pnts); + + if (tis_text != tis_stack) + g_free (tis_text); +#endif +} diff --git a/pango/break.c b/pango/break.c new file mode 100644 index 0000000..2e66972 --- /dev/null +++ b/pango/break.c @@ -0,0 +1,1992 @@ +/* Pango + * break.c: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-break.h" +#include "pango-engine-private.h" +#include "pango-script-private.h" +#include "pango-impl-utils.h" +#include + +#define PARAGRAPH_SEPARATOR 0x2029 +#define PARAGRAPH_SEPARATOR_STRING "\xE2\x80\xA9" + +/* See http://www.unicode.org/unicode/reports/tr14/ if you hope + * to understand the line breaking code. + */ + +typedef enum +{ + BREAK_ALREADY_HANDLED, /* didn't use the table */ + BREAK_PROHIBITED, /* no break, even if spaces intervene */ + BREAK_IF_SPACES, /* "indirect break" (only if there are spaces) */ + BREAK_ALLOWED /* "direct break" (can always break here) */ + /* TR 14 has two more break-opportunity classes, + * "indirect break opportunity for combining marks following a space" + * and "prohibited break for combining marks" + * but we handle that inline in the code. + */ +} BreakOpportunity; + +/* need to sync the break range to glib/gunicode.h . */ +#define BREAK_TYPE_SAFE(btype) \ + ((btype) <= G_UNICODE_BREAK_ZERO_WIDTH_JOINER ? (btype) : G_UNICODE_BREAK_UNKNOWN) + + +/* + * Hangul Conjoining Jamo handling. + * + * The way we implement it is just a bit different from TR14, + * but produces the same results. + * The same algorithm is also used in TR29 for cluster boundaries. + * + */ + + +/* An enum that works as the states of the Hangul syllables system. + **/ +typedef enum +{ + JAMO_L, /* G_UNICODE_BREAK_HANGUL_L_JAMO */ + JAMO_V, /* G_UNICODE_BREAK_HANGUL_V_JAMO */ + JAMO_T, /* G_UNICODE_BREAK_HANGUL_T_JAMO */ + JAMO_LV, /* G_UNICODE_BREAK_HANGUL_LV_SYLLABLE */ + JAMO_LVT, /* G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE */ + NO_JAMO /* Other */ +} JamoType; + +/* There are Hangul syllables encoded as characters, that act like a + * sequence of Jamos. For each character we define a JamoType + * that the character starts with, and one that it ends with. This + * decomposes JAMO_LV and JAMO_LVT to simple other JAMOs. So for + * example, a character with LineBreak type + * G_UNICODE_BREAK_HANGUL_LV_SYLLABLE has start=JAMO_L and end=JAMO_V. + */ +typedef struct _CharJamoProps +{ + JamoType start, end; +} CharJamoProps; + +/* Map from JamoType to CharJamoProps that hold only simple + * JamoTypes (no LV or LVT) or none. + */ +static const CharJamoProps HangulJamoProps[] = { + {JAMO_L, JAMO_L}, /* JAMO_L */ + {JAMO_V, JAMO_V}, /* JAMO_V */ + {JAMO_T, JAMO_T}, /* JAMO_T */ + {JAMO_L, JAMO_V}, /* JAMO_LV */ + {JAMO_L, JAMO_T}, /* JAMO_LVT */ + {NO_JAMO, NO_JAMO} /* NO_JAMO */ +}; + +/* A character forms a syllable with the previous character if and only if: + * JamoType(this) is not NO_JAMO and: + * + * HangulJamoProps[JamoType(prev)].end and + * HangulJamoProps[JamoType(this)].start are equal, + * or the former is one less than the latter. + */ + +#define IS_JAMO(btype) \ + ((btype >= G_UNICODE_BREAK_HANGUL_L_JAMO) && \ + (btype <= G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE)) +#define JAMO_TYPE(btype) \ + (IS_JAMO(btype) ? (btype - G_UNICODE_BREAK_HANGUL_L_JAMO) : NO_JAMO) + +/* Types of Japanese characters */ +#define JAPANESE(wc) ((wc) >= 0x2F00 && (wc) <= 0x30FF) +#define KANJI(wc) ((wc) >= 0x2F00 && (wc) <= 0x2FDF) +#define HIRAGANA(wc) ((wc) >= 0x3040 && (wc) <= 0x309F) +#define KATAKANA(wc) ((wc) >= 0x30A0 && (wc) <= 0x30FF) + +#define LATIN(wc) (((wc) >= 0x0020 && (wc) <= 0x02AF) || ((wc) >= 0x1E00 && (wc) <= 0x1EFF)) +#define CYRILLIC(wc) (((wc) >= 0x0400 && (wc) <= 0x052F)) +#define GREEK(wc) (((wc) >= 0x0370 && (wc) <= 0x3FF) || ((wc) >= 0x1F00 && (wc) <= 0x1FFF)) +#define KANA(wc) ((wc) >= 0x3040 && (wc) <= 0x30FF) +#define HANGUL(wc) ((wc) >= 0xAC00 && (wc) <= 0xD7A3) +#define BACKSPACE_DELETES_CHARACTER(wc) (!LATIN (wc) && !CYRILLIC (wc) && !GREEK (wc) && !KANA(wc) && !HANGUL(wc)) + +/* Previously "123foo" was two words. But in UAX 29 of Unicode, + * we know don't break words between consecutive letters and numbers + */ +typedef enum +{ + WordNone, + WordLetters, + WordNumbers +} WordType; + + +/** + * pango_default_break: + * @text: text to break + * @length: length of text in bytes (may be -1 if @text is nul-terminated) + * @analysis: (nullable): a #PangoAnalysis for the @text + * @attrs: logical attributes to fill in + * @attrs_len: size of the array passed as @attrs + * + * This is the default break algorithm, used if no language + * engine overrides it. Normally you should use pango_break() + * instead. Unlike pango_break(), + * @analysis can be %NULL, but only do that if you know what + * you're doing. If you need an analysis to pass to pango_break(), + * you need to pango_itemize(). In most cases however you should + * simply use pango_get_log_attrs(). + **/ +void +pango_default_break (const gchar *text, + gint length, + PangoAnalysis *analysis G_GNUC_UNUSED, + PangoLogAttr *attrs, + int attrs_len G_GNUC_UNUSED) +{ + /* The rationale for all this is in section 5.15 of the Unicode 3.0 book, + * the line breaking stuff is also in TR14 on unicode.org + */ + + /* This is a default break implementation that should work for nearly all + * languages. Language engines can override it optionally. + */ + + /* FIXME one cheesy optimization here would be to memset attrs to 0 + * before we start, and then never assign %FALSE to anything + */ + + const gchar *next; + gint i; + + gunichar prev_wc; + gunichar next_wc; + + JamoType prev_jamo; + + GUnicodeBreakType next_break_type; + GUnicodeBreakType prev_break_type; + GUnicodeBreakType prev_prev_break_type; + + /* See Grapheme_Cluster_Break Property Values table of UAX#29 */ + typedef enum + { + GB_Other, + GB_ControlCRLF, + GB_Extend, + GB_ZWJ, + GB_Prepend, + GB_SpacingMark, + GB_InHangulSyllable, /* Handles all of L, V, T, LV, LVT rules */ + /* Use state machine to handle emoji sequence */ + /* Rule GB10 and GB11 */ + GB_E_Base, + GB_E_Modifier, + GB_Glue_After_Zwj, + GB_E_Base_GAZ, + /* Rule GB12 and GB13 */ + GB_RI_Odd, /* Meets odd number of RI */ + GB_RI_Even, /* Meets even number of RI */ + } GraphemeBreakType; + GraphemeBreakType prev_GB_type = GB_Other; + + /* See Word_Break Property Values table of UAX#29 */ + typedef enum + { + WB_Other, + WB_NewlineCRLF, + WB_ExtendFormat, + WB_Katakana, + WB_Hebrew_Letter, + WB_ALetter, + WB_MidNumLet, + WB_MidLetter, + WB_MidNum, + WB_Numeric, + WB_ExtendNumLet, + WB_RI_Odd, + WB_RI_Even, + } WordBreakType; + WordBreakType prev_prev_WB_type = WB_Other, prev_WB_type = WB_Other; + gint prev_WB_i = -1; + + /* See Sentence_Break Property Values table of UAX#29 */ + typedef enum + { + SB_Other, + SB_ExtendFormat, + SB_ParaSep, + SB_Sp, + SB_Lower, + SB_Upper, + SB_OLetter, + SB_Numeric, + SB_ATerm, + SB_SContinue, + SB_STerm, + SB_Close, + /* Rules SB8 and SB8a */ + SB_ATerm_Close_Sp, + SB_STerm_Close_Sp, + } SentenceBreakType; + SentenceBreakType prev_prev_SB_type = SB_Other, prev_SB_type = SB_Other; + gint prev_SB_i = -1; + + /* Rule LB25 with Example 7 of Customization */ + typedef enum + { + LB_Other, + LB_Numeric, + LB_Numeric_Close, + LB_RI_Odd, + LB_RI_Even, + } LineBreakType; + LineBreakType prev_LB_type = LB_Other; + + WordType current_word_type = WordNone; + gunichar last_word_letter = 0; + gunichar base_character = 0; + + gint last_sentence_start = -1; + gint last_non_space = -1; + + gboolean almost_done = FALSE; + gboolean done = FALSE; + + g_return_if_fail (length == 0 || text != NULL); + g_return_if_fail (attrs != NULL); + + next = text; + + prev_break_type = G_UNICODE_BREAK_UNKNOWN; + prev_prev_break_type = G_UNICODE_BREAK_UNKNOWN; + prev_wc = 0; + prev_jamo = NO_JAMO; + + if (length == 0 || *text == '\0') + { + next_wc = PARAGRAPH_SEPARATOR; + almost_done = TRUE; + } + else + next_wc = g_utf8_get_char (next); + + next_break_type = g_unichar_break_type (next_wc); + next_break_type = BREAK_TYPE_SAFE (next_break_type); + + for (i = 0; !done ; i++) + { + GUnicodeType type; + gunichar wc; + GUnicodeBreakType break_type; + GUnicodeBreakType row_break_type; + BreakOpportunity break_op; + JamoType jamo; + gboolean makes_hangul_syllable; + + /* UAX#29 boundaries */ + gboolean is_grapheme_boundary; + gboolean is_word_boundary; + gboolean is_sentence_boundary; + + + wc = next_wc; + break_type = next_break_type; + + if (almost_done) + { + /* + * If we have already reached the end of @text g_utf8_next_char() + * may not increment next + */ + next_wc = 0; + next_break_type = G_UNICODE_BREAK_UNKNOWN; + done = TRUE; + } + else + { + next = g_utf8_next_char (next); + + if ((length >= 0 && next >= text + length) || *next == '\0') + { + /* This is how we fill in the last element (end position) of the + * attr array - assume there's a paragraph separators off the end + * of @text. + */ + next_wc = PARAGRAPH_SEPARATOR; + almost_done = TRUE; + } + else + next_wc = g_utf8_get_char (next); + + next_break_type = g_unichar_break_type (next_wc); + next_break_type = BREAK_TYPE_SAFE (next_break_type); + } + + type = g_unichar_type (wc); + jamo = JAMO_TYPE (break_type); + + /* Determine wheter this forms a Hangul syllable with prev. */ + if (jamo == NO_JAMO) + makes_hangul_syllable = FALSE; + else + { + JamoType prev_end = HangulJamoProps[prev_jamo].end ; + JamoType this_start = HangulJamoProps[ jamo].start; + + /* See comments before IS_JAMO */ + makes_hangul_syllable = (prev_end == this_start) || (prev_end + 1 == this_start); + } + + switch (type) + { + case G_UNICODE_SPACE_SEPARATOR: + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + attrs[i].is_white = TRUE; + break; + default: + if (wc == '\t' || wc == '\n' || wc == '\r' || wc == '\f') + attrs[i].is_white = TRUE; + else + attrs[i].is_white = FALSE; + break; + } + + /* Just few spaces have variable width. So explicitly mark them. + */ + attrs[i].is_expandable_space = (0x0020 == wc || 0x00A0 == wc); + + /* ---- UAX#29 Grapheme Boundaries ---- */ + { + GraphemeBreakType GB_type; + /* Find the GraphemeBreakType of wc */ + GB_type = GB_Other; + switch ((int) type) + { + case G_UNICODE_FORMAT: + if (G_UNLIKELY (wc == 0x200C)) + { + GB_type = GB_Extend; + break; + } + if (G_UNLIKELY (wc == 0x200D)) + { + GB_type = GB_ZWJ; + break; + } + if (G_UNLIKELY((wc >= 0x600 && wc <= 0x605) || + wc == 0x6DD || + wc == 0x70F || + wc == 0x8E2 || + wc == 0xD4E || + wc == 0x110BD || + (wc >= 0x111C2 && wc <= 0x111C3))) + { + GB_type = GB_Prepend; + break; + } + /* fall through */ + case G_UNICODE_CONTROL: + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + case G_UNICODE_SURROGATE: + GB_type = GB_ControlCRLF; + break; + + case G_UNICODE_UNASSIGNED: + /* Unassigned default ignorables */ + if ((wc >= 0xFFF0 && wc <= 0xFFF8) || + (wc >= 0xE0000 && wc <= 0xE0FFF)) + { + GB_type = GB_ControlCRLF; + break; + } + + case G_UNICODE_OTHER_LETTER: + if (makes_hangul_syllable) + GB_type = GB_InHangulSyllable; + break; + + case G_UNICODE_MODIFIER_LETTER: + if (wc >= 0xFF9E && wc <= 0xFF9F) + GB_type = GB_Extend; /* Other_Grapheme_Extend */ + break; + + case G_UNICODE_SPACING_MARK: + GB_type = GB_SpacingMark; /* SpacingMark */ + if (wc >= 0x0900) + { + if (wc == 0x09BE || wc == 0x09D7 || + wc == 0x0B3E || wc == 0x0B57 || wc == 0x0BBE || wc == 0x0BD7 || + wc == 0x0CC2 || wc == 0x0CD5 || wc == 0x0CD6 || + wc == 0x0D3E || wc == 0x0D57 || wc == 0x0DCF || wc == 0x0DDF || + wc == 0x1D165 || (wc >= 0x1D16E && wc <= 0x1D172)) + GB_type = GB_Extend; /* Other_Grapheme_Extend */ + } + break; + + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: + GB_type = GB_Extend; /* Grapheme_Extend */ + break; + + case G_UNICODE_OTHER_SYMBOL: + if (G_UNLIKELY(wc == 0x261D || + wc == 0x26F9 || + (wc >= 0x270A && wc <= 0x270D) || + wc == 0x1F385 || + (wc >= 0x1F3C2 && wc <= 0x1F3C4) || + wc == 0x1F3C7 || + (wc >= 0x1F3CA && wc <= 0x1F3CC) || + (wc >= 0x1F442 && wc <= 0x1F443) || + (wc >= 0x1F446 && wc <= 0x1F450) || + wc == 0x1F46E || + (wc >= 0x1F470 && wc <= 0x1F478) || + wc == 0x1F47C || + (wc >= 0x1F481 && wc <= 0x1F483) || + (wc >= 0x1F485 && wc <= 0x1F487) || + wc == 0x1F4AA || + (wc >= 0x1F574 && wc <= 0x1F575) || + wc == 0x1F57A || + wc == 0x1F590 || + (wc >= 0x1F595 && wc <= 0x1F596) || + (wc >= 0x1F645 && wc <= 0x1F647) || + (wc >= 0x1F64B && wc <= 0x1F64F) || + wc == 0x1F6A3 || + (wc >= 0x1F6B4 && wc <= 0x1F6B6) || + wc == 0x1F6C0 || + wc == 0x1F6CC || + (wc >= 0x1F918 && wc <= 0x1F91C) || + (wc >= 0x1F91E && wc <= 0x1F91F) || + wc == 0x1F926 || + (wc >= 0x1F930 && wc <= 0x1F939) || + (wc >= 0x1F93D && wc <= 0x1F93E) || + (wc >= 0x1F9D1 && wc <= 0x1F9DD))) + { + GB_type = GB_E_Base; + break; + } + if (G_UNLIKELY(wc == 0x2640 || + wc == 0x2642 || + (wc >= 0x2695 && wc <= 0x2696) || + wc == 0x2708 || + wc == 0x2764 || + wc == 0x1F308 || + wc == 0x1F33E || + wc == 0x1F373 || + wc == 0x1F393 || + wc == 0x1F3A4 || + wc == 0x1F3A8 || + wc == 0x1F3EB || + wc == 0x1F3ED || + wc == 0x1F48B || + (wc >= 0x1F4BB && wc <= 0x1F4BC) || + wc == 0x1F527 || + wc == 0x1F52C || + wc == 0x1F5E8 || + wc == 0x1F680 || + wc == 0x1F692)) + { + GB_type = GB_Glue_After_Zwj; + break; + } + if (G_UNLIKELY(wc >= 0x1F466 && wc <= 0x1F469)) + { + GB_type = GB_E_Base_GAZ; + break; + } + if (G_UNLIKELY(wc >=0x1F1E6 && wc <=0x1F1FF)) + { + if (prev_GB_type == GB_RI_Odd) + GB_type = GB_RI_Even; + else if (prev_GB_type == GB_RI_Even) + GB_type = GB_RI_Odd; + else + GB_type = GB_RI_Odd; + break; + } + break; + + case G_UNICODE_MODIFIER_SYMBOL: + if (wc >= 0x1F3FB && wc <= 0x1F3FF) + GB_type = GB_E_Modifier; + break; + } + + /* Grapheme Cluster Boundary Rules */ + + /* We apply Rules GB1 and GB2 at the end of the function */ + if (wc == '\n' && prev_wc == '\r') + is_grapheme_boundary = FALSE; /* Rule GB3 */ + else if (prev_GB_type == GB_ControlCRLF || GB_type == GB_ControlCRLF) + is_grapheme_boundary = TRUE; /* Rules GB4 and GB5 */ + else if (GB_type == GB_InHangulSyllable) + is_grapheme_boundary = FALSE; /* Rules GB6, GB7, GB8 */ + else if (GB_type == GB_Extend) + { + /* Rule GB10 */ + if (prev_GB_type == GB_E_Base || prev_GB_type == GB_E_Base_GAZ) + GB_type = prev_GB_type; + is_grapheme_boundary = FALSE; /* Rule GB9 */ + } + else if (GB_type == GB_ZWJ) + is_grapheme_boundary = FALSE; /* Rule GB9 */ + else if (GB_type == GB_SpacingMark) + is_grapheme_boundary = FALSE; /* Rule GB9a */ + else if (prev_GB_type == GB_Prepend) + is_grapheme_boundary = FALSE; /* Rule GB9b */ + /* Rule GB10 */ + else if (prev_GB_type == GB_E_Base || prev_GB_type == GB_E_Base_GAZ) + { + if (GB_type == GB_E_Modifier) + is_grapheme_boundary = FALSE; + else + is_grapheme_boundary = TRUE; + } + else if (prev_GB_type == GB_ZWJ && + (GB_type == GB_Glue_After_Zwj || GB_type == GB_E_Base_GAZ)) + is_grapheme_boundary = FALSE; /* Rule GB11 */ + else if (prev_GB_type == GB_RI_Odd && GB_type == GB_RI_Even) + is_grapheme_boundary = FALSE; /* Rule GB12 and GB13 */ + else + is_grapheme_boundary = TRUE; /* Rule GB999 */ + + attrs[i].is_cursor_position = is_grapheme_boundary; + /* If this is a grapheme boundary, we have to decide if backspace + * deletes a character or the whole grapheme cluster */ + if (is_grapheme_boundary) + { + if (prev_GB_type == GB_E_Base || + prev_GB_type == GB_E_Base_GAZ || + prev_GB_type == GB_Glue_After_Zwj || + prev_GB_type == GB_Extend || + prev_GB_type == GB_E_Modifier || + prev_GB_type == GB_RI_Odd || + prev_GB_type == GB_RI_Even) + attrs[i].backspace_deletes_character = FALSE; + else + attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character); + } + else + attrs[i].backspace_deletes_character = FALSE; + + prev_GB_type = GB_type; + } + + /* ---- UAX#29 Word Boundaries ---- */ + { + is_word_boundary = FALSE; + if (is_grapheme_boundary || + G_UNLIKELY(wc >=0x1F1E6 && wc <=0x1F1FF)) /* Rules WB3 and WB4 */ + { + PangoScript script; + WordBreakType WB_type; + + script = g_unichar_get_script (wc); + + /* Find the WordBreakType of wc */ + WB_type = WB_Other; + + if (script == PANGO_SCRIPT_KATAKANA) + WB_type = WB_Katakana; + + if (script == PANGO_SCRIPT_HEBREW && type == G_UNICODE_OTHER_LETTER) + WB_type = WB_Hebrew_Letter; + + if (WB_type == WB_Other) + switch (wc >> 8) + { + case 0x30: + if (wc == 0x3031 || wc == 0x3032 || wc == 0x3033 || wc == 0x3034 || wc == 0x3035 || + wc == 0x309b || wc == 0x309c || wc == 0x30a0 || wc == 0x30fc) + WB_type = WB_Katakana; /* Katakana exceptions */ + break; + case 0xFF: + if (wc == 0xFF70) + WB_type = WB_Katakana; /* Katakana exceptions */ + else if (wc >= 0xFF9E && wc <= 0xFF9F) + WB_type = WB_ExtendFormat; /* Other_Grapheme_Extend */ + break; + case 0x05: + if (wc == 0x05F3) + WB_type = WB_ALetter; /* ALetter exceptions */ + break; + } + + if (WB_type == WB_Other) + switch ((int) break_type) + { + case G_UNICODE_BREAK_NUMERIC: + if (wc != 0x066C) + WB_type = WB_Numeric; /* Numeric */ + break; + case G_UNICODE_BREAK_INFIX_SEPARATOR: + if (wc != 0x003A && wc != 0xFE13 && wc != 0x002E) + WB_type = WB_MidNum; /* MidNum */ + break; + } + + if (WB_type == WB_Other) + switch ((int) type) + { + case G_UNICODE_CONTROL: + if (wc != 0x000D && wc != 0x000A && wc != 0x000B && wc != 0x000C && wc != 0x0085) + break; + /* fall through */ + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + WB_type = WB_NewlineCRLF; /* CR, LF, Newline */ + break; + + case G_UNICODE_FORMAT: + case G_UNICODE_SPACING_MARK: + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: + WB_type = WB_ExtendFormat; /* Extend, Format */ + break; + + case G_UNICODE_CONNECT_PUNCTUATION: + WB_type = WB_ExtendNumLet; /* ExtendNumLet */ + break; + + case G_UNICODE_INITIAL_PUNCTUATION: + case G_UNICODE_FINAL_PUNCTUATION: + if (wc == 0x2018 || wc == 0x2019) + WB_type = WB_MidNumLet; /* MidNumLet */ + break; + case G_UNICODE_OTHER_PUNCTUATION: + if (wc == 0x0027 || wc == 0x002e || wc == 0x2024 || + wc == 0xfe52 || wc == 0xff07 || wc == 0xff0e) + WB_type = WB_MidNumLet; /* MidNumLet */ + else if (wc == 0x00b7 || wc == 0x05f4 || wc == 0x2027 || wc == 0x003a || wc == 0x0387 || + wc == 0xfe13 || wc == 0xfe55 || wc == 0xff1a) + WB_type = WB_MidLetter; /* WB_MidLetter */ + else if (wc == 0x066c || + wc == 0xfe50 || wc == 0xfe54 || wc == 0xff0c || wc == 0xff1b) + WB_type = WB_MidNum; /* MidNum */ + break; + + case G_UNICODE_OTHER_SYMBOL: + if (wc >= 0x24B6 && wc <= 0x24E9) /* Other_Alphabetic */ + goto Alphabetic; + + if (G_UNLIKELY(wc >=0x1F1E6 && wc <=0x1F1FF)) + { + if (prev_WB_type == WB_RI_Odd) + WB_type = WB_RI_Even; + else if (prev_WB_type == WB_RI_Even) + WB_type = WB_RI_Odd; + else + WB_type = WB_RI_Odd; + } + + break; + + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_LETTER_NUMBER: + if (wc == 0x3006 || wc == 0x3007 || + (wc >= 0x3021 && wc <= 0x3029) || + (wc >= 0x3038 && wc <= 0x303A) || + (wc >= 0x3400 && wc <= 0x4DB5) || + (wc >= 0x4E00 && wc <= 0x9FC3) || + (wc >= 0xF900 && wc <= 0xFA2D) || + (wc >= 0xFA30 && wc <= 0xFA6A) || + (wc >= 0xFA70 && wc <= 0xFAD9) || + (wc >= 0x20000 && wc <= 0x2A6D6) || + (wc >= 0x2F800 && wc <= 0x2FA1D)) + break; /* ALetter exceptions: Ideographic */ + goto Alphabetic; + + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: + Alphabetic: + if (break_type != G_UNICODE_BREAK_COMPLEX_CONTEXT && script != PANGO_SCRIPT_HIRAGANA) + WB_type = WB_ALetter; /* ALetter */ + break; + } + + /* Grapheme Cluster Boundary Rules */ + + /* We apply Rules WB1 and WB2 at the end of the function */ + + if (prev_wc == 0x3031 && wc == 0x41) + g_debug ("Y %d %d", prev_WB_type, WB_type); + if (prev_WB_type == WB_NewlineCRLF && prev_WB_i + 1 == i) + { + /* The extra check for prev_WB_i is to correctly handle sequences like + * Newline ÷ Extend × Extend + * since we have not skipped ExtendFormat yet. + */ + is_word_boundary = TRUE; /* Rule WB3a */ + } + else if (WB_type == WB_NewlineCRLF) + is_word_boundary = TRUE; /* Rule WB3b */ + else if (WB_type == WB_ExtendFormat) + is_word_boundary = FALSE; /* Rules WB4? */ + else if ((prev_WB_type == WB_ALetter || + prev_WB_type == WB_Hebrew_Letter || + prev_WB_type == WB_Numeric) && + (WB_type == WB_ALetter || + WB_type == WB_Hebrew_Letter || + WB_type == WB_Numeric)) + is_word_boundary = FALSE; /* Rules WB5, WB8, WB9, WB10 */ + else if (prev_WB_type == WB_Katakana && WB_type == WB_Katakana) + is_word_boundary = FALSE; /* Rule WB13 */ + else if ((prev_WB_type == WB_ALetter || + prev_WB_type == WB_Hebrew_Letter || + prev_WB_type == WB_Numeric || + prev_WB_type == WB_Katakana || + prev_WB_type == WB_ExtendNumLet) && + WB_type == WB_ExtendNumLet) + is_word_boundary = FALSE; /* Rule WB13a */ + else if (prev_WB_type == WB_ExtendNumLet && + (WB_type == WB_ALetter || + WB_type == WB_Hebrew_Letter || + WB_type == WB_Numeric || + WB_type == WB_Katakana)) + is_word_boundary = FALSE; /* Rule WB13b */ + else if (((prev_prev_WB_type == WB_ALetter || + prev_prev_WB_type == WB_Hebrew_Letter) && + (WB_type == WB_ALetter || + WB_type == WB_Hebrew_Letter)) && + (prev_WB_type == WB_MidLetter || + prev_WB_type == WB_MidNumLet || + prev_wc == 0x0027)) + { + attrs[prev_WB_i].is_word_boundary = FALSE; /* Rule WB6 */ + is_word_boundary = FALSE; /* Rule WB7 */ + } + else if (prev_WB_type == WB_Hebrew_Letter && wc == 0x0027) + is_word_boundary = FALSE; /* Rule WB7a */ + else if (prev_prev_WB_type == WB_Hebrew_Letter && prev_wc == 0x0022 && + WB_type == WB_Hebrew_Letter) { + attrs[prev_WB_i].is_word_boundary = FALSE; /* Rule WB7b */ + is_word_boundary = FALSE; /* Rule WB7c */ + } + else if ((prev_prev_WB_type == WB_Numeric && WB_type == WB_Numeric) && + (prev_WB_type == WB_MidNum || prev_WB_type == WB_MidNumLet || + prev_wc == 0x0027)) + { + is_word_boundary = FALSE; /* Rule WB11 */ + attrs[prev_WB_i].is_word_boundary = FALSE; /* Rule WB12 */ + } + else if (prev_WB_type == WB_RI_Odd && WB_type == WB_RI_Even) + is_word_boundary = FALSE; /* Rule WB15 and WB16 */ + else + is_word_boundary = TRUE; /* Rule WB999 */ + + if (WB_type != WB_ExtendFormat) + { + prev_prev_WB_type = prev_WB_type; + prev_WB_type = WB_type; + prev_WB_i = i; + } + } + + attrs[i].is_word_boundary = is_word_boundary; + } + + /* ---- UAX#29 Sentence Boundaries ---- */ + { + is_sentence_boundary = FALSE; + if (is_word_boundary || + wc == '\r' || wc == '\n') /* Rules SB3 and SB5 */ + { + SentenceBreakType SB_type; + + /* Find the SentenceBreakType of wc */ + SB_type = SB_Other; + + if (break_type == G_UNICODE_BREAK_NUMERIC) + SB_type = SB_Numeric; /* Numeric */ + + if (SB_type == SB_Other) + switch ((int) type) + { + case G_UNICODE_CONTROL: + if (wc == '\r' || wc == '\n') + SB_type = SB_ParaSep; + else if (wc == 0x0009 || wc == 0x000B || wc == 0x000C) + SB_type = SB_Sp; + else if (wc == 0x0085) + SB_type = SB_ParaSep; + break; + + case G_UNICODE_SPACE_SEPARATOR: + if (wc == 0x0020 || wc == 0x00A0 || wc == 0x1680 || + (wc >= 0x2000 && wc <= 0x200A) || + wc == 0x202F || wc == 0x205F || wc == 0x3000) + SB_type = SB_Sp; + break; + + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + SB_type = SB_ParaSep; + break; + + case G_UNICODE_FORMAT: + case G_UNICODE_SPACING_MARK: + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: + SB_type = SB_ExtendFormat; /* Extend, Format */ + break; + + case G_UNICODE_MODIFIER_LETTER: + if (wc >= 0xFF9E && wc <= 0xFF9F) + SB_type = SB_ExtendFormat; /* Other_Grapheme_Extend */ + break; + + case G_UNICODE_TITLECASE_LETTER: + SB_type = SB_Upper; + break; + + case G_UNICODE_DASH_PUNCTUATION: + if (wc == 0x002D || + (wc >= 0x2013 && wc <= 0x2014) || + (wc >= 0xFE31 && wc <= 0xFE32) || + wc == 0xFE58 || + wc == 0xFE63 || + wc == 0xFF0D) + SB_type = SB_SContinue; + break; + + case G_UNICODE_OTHER_PUNCTUATION: + if (wc == 0x05F3) + SB_type = SB_OLetter; + else if (wc == 0x002E || wc == 0x2024 || + wc == 0xFE52 || wc == 0xFF0E) + SB_type = SB_ATerm; + + if (wc == 0x002C || + wc == 0x003A || + wc == 0x055D || + (wc >= 0x060C && wc <= 0x060D) || + wc == 0x07F8 || + wc == 0x1802 || + wc == 0x1808 || + wc == 0x3001 || + (wc >= 0xFE10 && wc <= 0xFE11) || + wc == 0xFE13 || + (wc >= 0xFE50 && wc <= 0xFE51) || + wc == 0xFE55 || + wc == 0xFF0C || + wc == 0xFF1A || + wc == 0xFF64) + SB_type = SB_SContinue; + + if (wc == 0x0021 || + wc == 0x003F || + wc == 0x0589 || + wc == 0x061F || + wc == 0x06D4 || + (wc >= 0x0700 && wc <= 0x0702) || + wc == 0x07F9 || + (wc >= 0x0964 && wc <= 0x0965) || + (wc >= 0x104A && wc <= 0x104B) || + wc == 0x1362 || + (wc >= 0x1367 && wc <= 0x1368) || + wc == 0x166E || + (wc >= 0x1735 && wc <= 0x1736) || + wc == 0x1803 || + wc == 0x1809 || + (wc >= 0x1944 && wc <= 0x1945) || + (wc >= 0x1AA8 && wc <= 0x1AAB) || + (wc >= 0x1B5A && wc <= 0x1B5B) || + (wc >= 0x1B5E && wc <= 0x1B5F) || + (wc >= 0x1C3B && wc <= 0x1C3C) || + (wc >= 0x1C7E && wc <= 0x1C7F) || + (wc >= 0x203C && wc <= 0x203D) || + (wc >= 0x2047 && wc <= 0x2049) || + wc == 0x2E2E || + wc == 0x2E3C || + wc == 0x3002 || + wc == 0xA4FF || + (wc >= 0xA60E && wc <= 0xA60F) || + wc == 0xA6F3 || + wc == 0xA6F7 || + (wc >= 0xA876 && wc <= 0xA877) || + (wc >= 0xA8CE && wc <= 0xA8CF) || + wc == 0xA92F || + (wc >= 0xA9C8 && wc <= 0xA9C9) || + (wc >= 0xAA5D && wc <= 0xAA5F) || + (wc >= 0xAAF0 && wc <= 0xAAF1) || + wc == 0xABEB || + (wc >= 0xFE56 && wc <= 0xFE57) || + wc == 0xFF01 || + wc == 0xFF1F || + wc == 0xFF61 || + (wc >= 0x10A56 && wc <= 0x10A57) || + (wc >= 0x11047 && wc <= 0x11048) || + (wc >= 0x110BE && wc <= 0x110C1) || + (wc >= 0x11141 && wc <= 0x11143) || + (wc >= 0x111C5 && wc <= 0x111C6) || + wc == 0x111CD || + (wc >= 0x111DE && wc <= 0x111DF) || + (wc >= 0x11238 && wc <= 0x11239) || + (wc >= 0x1123B && wc <= 0x1123C) || + wc == 0x112A9 || + (wc >= 0x1144B && wc <= 0x1144C) || + (wc >= 0x115C2 && wc <= 0x115C3) || + (wc >= 0x115C9 && wc <= 0x115D7) || + (wc >= 0x11641 && wc <= 0x11642) || + (wc >= 0x1173C && wc <= 0x1173E) || + (wc >= 0x11C41 && wc <= 0x11C42) || + (wc >= 0x16A6E && wc <= 0x16A6F) || + wc == 0x16AF5 || + (wc >= 0x16B37 && wc <= 0x16B38) || + wc == 0x16B44 || + wc == 0x1BC9F || + wc == 0x1DA88) + SB_type = SB_STerm; + + break; + } + + if (SB_type == SB_Other) + { + if (g_unichar_islower(wc)) + SB_type = SB_Lower; + else if (g_unichar_isupper(wc)) + SB_type = SB_Upper; + else if (g_unichar_isalpha(wc)) + SB_type = SB_OLetter; + + if (type == G_UNICODE_OPEN_PUNCTUATION || + type == G_UNICODE_CLOSE_PUNCTUATION || + break_type == G_UNICODE_BREAK_QUOTATION) + SB_type = SB_Close; + } + + /* Sentence Boundary Rules */ + + /* We apply Rules SB1 and SB2 at the end of the function */ + +#define IS_OTHER_TERM(SB_type) \ + /* not in (OLetter | Upper | Lower | ParaSep | SATerm) */ \ + !(SB_type == SB_OLetter || \ + SB_type == SB_Upper || SB_type == SB_Lower || \ + SB_type == SB_ParaSep || \ + SB_type == SB_ATerm || SB_type == SB_STerm || \ + SB_type == SB_ATerm_Close_Sp || \ + SB_type == SB_STerm_Close_Sp) + + + if (wc == '\n' && prev_wc == '\r') + is_sentence_boundary = FALSE; /* Rule SB3 */ + else if (prev_SB_type == SB_ParaSep && prev_SB_i + 1 == i) + { + /* The extra check for prev_SB_i is to correctly handle sequences like + * ParaSep ÷ Extend × Extend + * since we have not skipped ExtendFormat yet. + */ + + is_sentence_boundary = TRUE; /* Rule SB4 */ + } + else if (SB_type == SB_ExtendFormat) + is_sentence_boundary = FALSE; /* Rule SB5? */ + else if (prev_SB_type == SB_ATerm && SB_type == SB_Numeric) + is_sentence_boundary = FALSE; /* Rule SB6 */ + else if ((prev_prev_SB_type == SB_Upper || + prev_prev_SB_type == SB_Lower) && + prev_SB_type == SB_ATerm && + SB_type == SB_Upper) + is_sentence_boundary = FALSE; /* Rule SB7 */ + else if (prev_SB_type == SB_ATerm && SB_type == SB_Close) + SB_type = SB_ATerm; + else if (prev_SB_type == SB_STerm && SB_type == SB_Close) + SB_type = SB_STerm; + else if (prev_SB_type == SB_ATerm && SB_type == SB_Sp) + SB_type = SB_ATerm_Close_Sp; + else if (prev_SB_type == SB_STerm && SB_type == SB_Sp) + SB_type = SB_STerm_Close_Sp; + /* Rule SB8 */ + else if ((prev_SB_type == SB_ATerm || + prev_SB_type == SB_ATerm_Close_Sp) && + SB_type == SB_Lower) + is_sentence_boundary = FALSE; + else if ((prev_prev_SB_type == SB_ATerm || + prev_prev_SB_type == SB_ATerm_Close_Sp) && + IS_OTHER_TERM(prev_SB_type) && + SB_type == SB_Lower) + attrs[prev_SB_i].is_sentence_boundary = FALSE; + else if ((prev_SB_type == SB_ATerm || + prev_SB_type == SB_ATerm_Close_Sp || + prev_SB_type == SB_STerm || + prev_SB_type == SB_STerm_Close_Sp) && + (SB_type == SB_SContinue || + SB_type == SB_ATerm || SB_type == SB_STerm)) + is_sentence_boundary = FALSE; /* Rule SB8a */ + else if ((prev_SB_type == SB_ATerm || + prev_SB_type == SB_STerm) && + (SB_type == SB_Close || SB_type == SB_Sp || + SB_type == SB_ParaSep)) + is_sentence_boundary = FALSE; /* Rule SB9 */ + else if ((prev_SB_type == SB_ATerm || + prev_SB_type == SB_ATerm_Close_Sp || + prev_SB_type == SB_STerm || + prev_SB_type == SB_STerm_Close_Sp) && + (SB_type == SB_Sp || SB_type == SB_ParaSep)) + is_sentence_boundary = FALSE; /* Rule SB10 */ + else if ((prev_SB_type == SB_ATerm || + prev_SB_type == SB_ATerm_Close_Sp || + prev_SB_type == SB_STerm || + prev_SB_type == SB_STerm_Close_Sp) && + SB_type != SB_ParaSep) + is_sentence_boundary = TRUE; /* Rule SB11 */ + else + is_sentence_boundary = FALSE; /* Rule SB998 */ + + if (SB_type != SB_ExtendFormat && + !((prev_prev_SB_type == SB_ATerm || + prev_prev_SB_type == SB_ATerm_Close_Sp) && + IS_OTHER_TERM(prev_SB_type) && + IS_OTHER_TERM(SB_type))) + { + prev_prev_SB_type = prev_SB_type; + prev_SB_type = SB_type; + prev_SB_i = i; + } + +#undef IS_OTHER_TERM + + } + + if (i == 0 || done) + is_sentence_boundary = TRUE; /* Rules SB1 and SB2 */ + + attrs[i].is_sentence_boundary = is_sentence_boundary; + } + + /* ---- Line breaking ---- */ + + break_op = BREAK_ALREADY_HANDLED; + + row_break_type = prev_break_type == G_UNICODE_BREAK_SPACE ? + prev_prev_break_type : prev_break_type; + g_assert (row_break_type != G_UNICODE_BREAK_SPACE); + + attrs[i].is_char_break = FALSE; + attrs[i].is_line_break = FALSE; + attrs[i].is_mandatory_break = FALSE; + + /* Rule LB1: + assign a line breaking class to each code point of the input. */ + switch ((int) break_type) + { + case G_UNICODE_BREAK_AMBIGUOUS: + case G_UNICODE_BREAK_SURROGATE: + case G_UNICODE_BREAK_UNKNOWN: + break_type = G_UNICODE_BREAK_ALPHABETIC; + break; + + case G_UNICODE_BREAK_COMPLEX_CONTEXT: + if (type == G_UNICODE_NON_SPACING_MARK || + type == G_UNICODE_SPACING_MARK) + break_type = G_UNICODE_BREAK_COMBINING_MARK; + else + break_type = G_UNICODE_BREAK_ALPHABETIC; + break; + + case G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: + break_type = G_UNICODE_BREAK_NON_STARTER; + break; + + default: + ; + } + + /* If it's not a grapheme boundary, it's not a line break either */ + if (attrs[i].is_cursor_position || + break_type == G_UNICODE_BREAK_COMBINING_MARK || + break_type == G_UNICODE_BREAK_ZERO_WIDTH_JOINER || + break_type == G_UNICODE_BREAK_HANGUL_L_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_T_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE || + break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE || + break_type == G_UNICODE_BREAK_REGIONAL_INDICATOR) + { + LineBreakType LB_type; + + /* Find the LineBreakType of wc */ + LB_type = LB_Other; + + if (break_type == G_UNICODE_BREAK_NUMERIC) + LB_type = LB_Numeric; + + if (break_type == G_UNICODE_BREAK_SYMBOL || + break_type == G_UNICODE_BREAK_INFIX_SEPARATOR) + { + if (!(prev_LB_type == LB_Numeric)) + LB_type = LB_Other; + } + + if (break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION || + break_type == G_UNICODE_BREAK_CLOSE_PARANTHESIS) + { + if (prev_LB_type == LB_Numeric) + LB_type = LB_Numeric_Close; + else + LB_type = LB_Other; + } + + if (break_type == G_UNICODE_BREAK_REGIONAL_INDICATOR) + { + if (prev_LB_type == LB_RI_Odd) + LB_type = LB_RI_Even; + else if (prev_LB_type == LB_RI_Even) + LB_type = LB_RI_Odd; + else + LB_type = LB_RI_Odd; + } + + attrs[i].is_line_break = TRUE; /* Rule LB31 */ + /* Unicode doesn't specify char wrap; + we wrap around all chars currently. */ + if (attrs[i].is_cursor_position) + attrs[i].is_char_break = TRUE; + + /* Make any necessary replacements first */ + if (row_break_type == G_UNICODE_BREAK_UNKNOWN) + row_break_type = G_UNICODE_BREAK_ALPHABETIC; + + /* add the line break rules in reverse order to override + the lower priority rules. */ + + /* Rule LB30 */ + if ((prev_break_type == G_UNICODE_BREAK_ALPHABETIC || + prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER || + prev_break_type == G_UNICODE_BREAK_NUMERIC) && + break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_CLOSE_PARANTHESIS && + (break_type == G_UNICODE_BREAK_ALPHABETIC || + break_type == G_UNICODE_BREAK_HEBREW_LETTER || + break_type == G_UNICODE_BREAK_NUMERIC)) + break_op = BREAK_PROHIBITED; + + /* Rule LB30a */ + if (prev_LB_type == LB_RI_Odd && LB_type == LB_RI_Even) + break_op = BREAK_PROHIBITED; + + /* Rule LB30b */ + if (prev_break_type == G_UNICODE_BREAK_EMOJI_BASE && + break_type == G_UNICODE_BREAK_EMOJI_MODIFIER) + break_op = BREAK_PROHIBITED; + + /* Rule LB29 */ + if (prev_break_type == G_UNICODE_BREAK_INFIX_SEPARATOR && + (break_type == G_UNICODE_BREAK_ALPHABETIC || + break_type == G_UNICODE_BREAK_HEBREW_LETTER)) + break_op = BREAK_PROHIBITED; + + /* Rule LB28 */ + if ((prev_break_type == G_UNICODE_BREAK_ALPHABETIC || + prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER) && + (break_type == G_UNICODE_BREAK_ALPHABETIC || + break_type == G_UNICODE_BREAK_HEBREW_LETTER)) + break_op = BREAK_PROHIBITED; + + /* Rule LB27 */ + if ((prev_break_type == G_UNICODE_BREAK_HANGUL_L_JAMO || + prev_break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + prev_break_type == G_UNICODE_BREAK_HANGUL_T_JAMO || + prev_break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE || + prev_break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE) && + (break_type == G_UNICODE_BREAK_INSEPARABLE || + break_type == G_UNICODE_BREAK_POSTFIX)) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_PREFIX && + (break_type == G_UNICODE_BREAK_HANGUL_L_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_T_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE || + break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE)) + break_op = BREAK_PROHIBITED; + + /* Rule LB26 */ + if (prev_break_type == G_UNICODE_BREAK_HANGUL_L_JAMO && + (break_type == G_UNICODE_BREAK_HANGUL_L_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE || + break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE)) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + prev_break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE) && + (break_type == G_UNICODE_BREAK_HANGUL_V_JAMO || + break_type == G_UNICODE_BREAK_HANGUL_T_JAMO)) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_HANGUL_T_JAMO || + prev_break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE) && + break_type == G_UNICODE_BREAK_HANGUL_T_JAMO) + break_op = BREAK_PROHIBITED; + + /* Rule LB25 with Example 7 of Customization */ + if ((prev_break_type == G_UNICODE_BREAK_PREFIX || + prev_break_type == G_UNICODE_BREAK_POSTFIX) && + break_type == G_UNICODE_BREAK_NUMERIC) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_PREFIX || + prev_break_type == G_UNICODE_BREAK_POSTFIX) && + (break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION || + break_type == G_UNICODE_BREAK_HYPHEN) && + next_break_type == G_UNICODE_BREAK_NUMERIC) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION || + prev_break_type == G_UNICODE_BREAK_HYPHEN) && + break_type == G_UNICODE_BREAK_NUMERIC) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_NUMERIC && + (break_type == G_UNICODE_BREAK_NUMERIC || + break_type == G_UNICODE_BREAK_SYMBOL || + break_type == G_UNICODE_BREAK_INFIX_SEPARATOR)) + break_op = BREAK_PROHIBITED; + + if (prev_LB_type == LB_Numeric && + (break_type == G_UNICODE_BREAK_NUMERIC || + break_type == G_UNICODE_BREAK_SYMBOL || + break_type == G_UNICODE_BREAK_INFIX_SEPARATOR || + break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION || + break_type == G_UNICODE_BREAK_CLOSE_PARANTHESIS)) + break_op = BREAK_PROHIBITED; + + if ((prev_LB_type == LB_Numeric || + prev_LB_type == LB_Numeric_Close) && + (break_type == G_UNICODE_BREAK_POSTFIX || + break_type == G_UNICODE_BREAK_PREFIX)) + break_op = BREAK_PROHIBITED; + + /* Rule LB24 */ + if ((prev_break_type == G_UNICODE_BREAK_PREFIX || + prev_break_type == G_UNICODE_BREAK_POSTFIX) && + (break_type == G_UNICODE_BREAK_ALPHABETIC || + break_type == G_UNICODE_BREAK_HEBREW_LETTER)) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_ALPHABETIC || + prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER) && + (break_type == G_UNICODE_BREAK_PREFIX || + break_type == G_UNICODE_BREAK_POSTFIX)) + break_op = BREAK_PROHIBITED; + + /* Rule LB23 */ + if ((prev_break_type == G_UNICODE_BREAK_ALPHABETIC || + prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER) && + break_type == G_UNICODE_BREAK_NUMERIC) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_NUMERIC && + (break_type == G_UNICODE_BREAK_ALPHABETIC || + break_type == G_UNICODE_BREAK_HEBREW_LETTER)) + break_op = BREAK_PROHIBITED; + + /* Rule LB23a */ + if (prev_break_type == G_UNICODE_BREAK_PREFIX && + (break_type == G_UNICODE_BREAK_IDEOGRAPHIC || + break_type == G_UNICODE_BREAK_EMOJI_BASE || + break_type == G_UNICODE_BREAK_EMOJI_MODIFIER)) + break_op = BREAK_PROHIBITED; + + if ((prev_break_type == G_UNICODE_BREAK_IDEOGRAPHIC || + prev_break_type == G_UNICODE_BREAK_EMOJI_BASE || + prev_break_type == G_UNICODE_BREAK_EMOJI_MODIFIER) && + break_type == G_UNICODE_BREAK_POSTFIX) + break_op = BREAK_PROHIBITED; + + /* Rule LB22 */ + if (break_type == G_UNICODE_BREAK_INSEPARABLE) + { + if (prev_break_type == G_UNICODE_BREAK_ALPHABETIC || + prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_EXCLAMATION) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_IDEOGRAPHIC || + prev_break_type == G_UNICODE_BREAK_EMOJI_BASE || + prev_break_type == G_UNICODE_BREAK_EMOJI_MODIFIER) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_INSEPARABLE) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_NUMERIC) + break_op = BREAK_PROHIBITED; + } + + if (break_type == G_UNICODE_BREAK_AFTER || + break_type == G_UNICODE_BREAK_HYPHEN || + break_type == G_UNICODE_BREAK_NON_STARTER || + prev_break_type == G_UNICODE_BREAK_BEFORE) + break_op = BREAK_PROHIBITED; /* Rule LB21 */ + + if (prev_prev_break_type == G_UNICODE_BREAK_HEBREW_LETTER && + (prev_break_type == G_UNICODE_BREAK_HYPHEN || + prev_break_type == G_UNICODE_BREAK_AFTER)) + break_op = BREAK_PROHIBITED; /* Rule LB21a */ + + if (prev_break_type == G_UNICODE_BREAK_SYMBOL && + break_type == G_UNICODE_BREAK_HEBREW_LETTER) + break_op = BREAK_PROHIBITED; /* Rule LB21b */ + + if (prev_break_type == G_UNICODE_BREAK_CONTINGENT || + break_type == G_UNICODE_BREAK_CONTINGENT) + break_op = BREAK_ALLOWED; /* Rule LB20 */ + + if (prev_break_type == G_UNICODE_BREAK_QUOTATION || + break_type == G_UNICODE_BREAK_QUOTATION) + break_op = BREAK_PROHIBITED; /* Rule LB19 */ + + /* handle related rules for Space as state machine here, + and override the pair table result. */ + if (prev_break_type == G_UNICODE_BREAK_SPACE) /* Rule LB18 */ + break_op = BREAK_ALLOWED; + + if (row_break_type == G_UNICODE_BREAK_BEFORE_AND_AFTER && + break_type == G_UNICODE_BREAK_BEFORE_AND_AFTER) + break_op = BREAK_PROHIBITED; /* Rule LB17 */ + + if ((row_break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION || + row_break_type == G_UNICODE_BREAK_CLOSE_PARANTHESIS) && + break_type == G_UNICODE_BREAK_NON_STARTER) + break_op = BREAK_PROHIBITED; /* Rule LB16 */ + + if (row_break_type == G_UNICODE_BREAK_QUOTATION && + break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION) + break_op = BREAK_PROHIBITED; /* Rule LB15 */ + + if (row_break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION) + break_op = BREAK_PROHIBITED; /* Rule LB14 */ + + /* Rule LB13 with Example 7 of Customization */ + if (break_type == G_UNICODE_BREAK_EXCLAMATION) + break_op = BREAK_PROHIBITED; + + if (prev_break_type != G_UNICODE_BREAK_NUMERIC && + (break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION || + break_type == G_UNICODE_BREAK_CLOSE_PARANTHESIS || + break_type == G_UNICODE_BREAK_INFIX_SEPARATOR || + break_type == G_UNICODE_BREAK_SYMBOL)) + break_op = BREAK_PROHIBITED; + + if (prev_break_type == G_UNICODE_BREAK_NON_BREAKING_GLUE) + break_op = BREAK_PROHIBITED; /* Rule LB12 */ + + if (break_type == G_UNICODE_BREAK_NON_BREAKING_GLUE && + (prev_break_type != G_UNICODE_BREAK_SPACE && + prev_break_type != G_UNICODE_BREAK_AFTER && + prev_break_type != G_UNICODE_BREAK_HYPHEN)) + break_op = BREAK_PROHIBITED; /* Rule LB12a */ + + if (prev_break_type == G_UNICODE_BREAK_WORD_JOINER || + break_type == G_UNICODE_BREAK_WORD_JOINER) + break_op = BREAK_PROHIBITED; /* Rule LB11 */ + + + /* Rule LB9 */ + if (break_type == G_UNICODE_BREAK_COMBINING_MARK || + break_type == G_UNICODE_BREAK_ZERO_WIDTH_JOINER) + { + if (!(prev_break_type == G_UNICODE_BREAK_MANDATORY || + prev_break_type == G_UNICODE_BREAK_CARRIAGE_RETURN || + prev_break_type == G_UNICODE_BREAK_LINE_FEED || + prev_break_type == G_UNICODE_BREAK_NEXT_LINE || + prev_break_type == G_UNICODE_BREAK_SPACE || + prev_break_type == G_UNICODE_BREAK_ZERO_WIDTH_SPACE)) + break_op = BREAK_PROHIBITED; + } + + if (row_break_type == G_UNICODE_BREAK_ZERO_WIDTH_SPACE) + break_op = BREAK_ALLOWED; /* Rule LB8 */ + + if (prev_wc == 0x200D && + (break_type == G_UNICODE_BREAK_IDEOGRAPHIC || + break_type == G_UNICODE_BREAK_EMOJI_BASE || + break_type == G_UNICODE_BREAK_EMOJI_MODIFIER)) + break_op = BREAK_PROHIBITED; /* Rule LB8a */ + + if (break_type == G_UNICODE_BREAK_SPACE || + break_type == G_UNICODE_BREAK_ZERO_WIDTH_SPACE) + break_op = BREAK_PROHIBITED; /* Rule LB7 */ + + /* Rule LB6 */ + if (break_type == G_UNICODE_BREAK_MANDATORY || + break_type == G_UNICODE_BREAK_CARRIAGE_RETURN || + break_type == G_UNICODE_BREAK_LINE_FEED || + break_type == G_UNICODE_BREAK_NEXT_LINE) + break_op = BREAK_PROHIBITED; + + /* Rules LB4 and LB5 */ + if (prev_break_type == G_UNICODE_BREAK_MANDATORY || + (prev_break_type == G_UNICODE_BREAK_CARRIAGE_RETURN && + wc != '\n') || + prev_break_type == G_UNICODE_BREAK_LINE_FEED || + prev_break_type == G_UNICODE_BREAK_NEXT_LINE) + { + attrs[i].is_mandatory_break = TRUE; + break_op = BREAK_ALLOWED; + } + + switch (break_op) + { + case BREAK_PROHIBITED: + /* can't break here */ + attrs[i].is_line_break = FALSE; + break; + + case BREAK_IF_SPACES: + /* break if prev char was space */ + if (prev_break_type != G_UNICODE_BREAK_SPACE) + attrs[i].is_line_break = FALSE; + break; + + case BREAK_ALLOWED: + attrs[i].is_line_break = TRUE; + break; + + case BREAK_ALREADY_HANDLED: + break; + + default: + g_assert_not_reached (); + break; + } + + /* Rule LB9 */ + if (!(break_type == G_UNICODE_BREAK_COMBINING_MARK || + break_type == G_UNICODE_BREAK_ZERO_WIDTH_JOINER)) + { + /* Rule LB25 with Example 7 of Customization */ + if (break_type == G_UNICODE_BREAK_NUMERIC || + break_type == G_UNICODE_BREAK_SYMBOL || + break_type == G_UNICODE_BREAK_INFIX_SEPARATOR) + { + if (prev_LB_type != LB_Numeric) + prev_LB_type = LB_type; + /* else don't change the prev_LB_type */ + } + else + { + prev_LB_type = LB_type; + } + } + /* else don't change the prev_LB_type for Rule LB9 */ + } + + if (break_type != G_UNICODE_BREAK_SPACE) + { + /* Rule LB9 */ + if (break_type == G_UNICODE_BREAK_COMBINING_MARK || + break_type == G_UNICODE_BREAK_ZERO_WIDTH_JOINER) + { + if (i == 0 /* start of text */ || + prev_break_type == G_UNICODE_BREAK_MANDATORY || + prev_break_type == G_UNICODE_BREAK_CARRIAGE_RETURN || + prev_break_type == G_UNICODE_BREAK_LINE_FEED || + prev_break_type == G_UNICODE_BREAK_NEXT_LINE || + prev_break_type == G_UNICODE_BREAK_SPACE || + prev_break_type == G_UNICODE_BREAK_ZERO_WIDTH_SPACE) + prev_break_type = G_UNICODE_BREAK_ALPHABETIC; /* Rule LB10 */ + /* else don't change the prev_break_type for Rule LB9 */ + } + else + { + prev_prev_break_type = prev_break_type; + prev_break_type = break_type; + } + + prev_jamo = jamo; + } + else + { + if (prev_break_type != G_UNICODE_BREAK_SPACE) + { + prev_prev_break_type = prev_break_type; + prev_break_type = break_type; + } + /* else don't change the prev_break_type */ + } + + /* ---- Word breaks ---- */ + + /* default to not a word start/end */ + attrs[i].is_word_start = FALSE; + attrs[i].is_word_end = FALSE; + + if (current_word_type != WordNone) + { + /* Check for a word end */ + switch ((int) type) + { + case G_UNICODE_SPACING_MARK: + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: + case G_UNICODE_FORMAT: + /* nothing, we just eat these up as part of the word */ + break; + + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: + if (current_word_type == WordLetters) + { + /* Japanese special cases for ending the word */ + if (JAPANESE (last_word_letter) || + JAPANESE (wc)) + { + if ((HIRAGANA (last_word_letter) && + !HIRAGANA (wc)) || + (KATAKANA (last_word_letter) && + !(KATAKANA (wc) || HIRAGANA (wc))) || + (KANJI (last_word_letter) && + !(HIRAGANA (wc) || KANJI (wc))) || + (JAPANESE (last_word_letter) && + !JAPANESE (wc)) || + (!JAPANESE (last_word_letter) && + JAPANESE (wc))) + attrs[i].is_word_end = TRUE; + } + } + last_word_letter = wc; + break; + + case G_UNICODE_DECIMAL_NUMBER: + case G_UNICODE_LETTER_NUMBER: + case G_UNICODE_OTHER_NUMBER: + last_word_letter = wc; + break; + + default: + /* Punctuation, control/format chars, etc. all end a word. */ + attrs[i].is_word_end = TRUE; + current_word_type = WordNone; + break; + } + } + else + { + /* Check for a word start */ + switch ((int) type) + { + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: + current_word_type = WordLetters; + last_word_letter = wc; + attrs[i].is_word_start = TRUE; + break; + + case G_UNICODE_DECIMAL_NUMBER: + case G_UNICODE_LETTER_NUMBER: + case G_UNICODE_OTHER_NUMBER: + current_word_type = WordNumbers; + last_word_letter = wc; + attrs[i].is_word_start = TRUE; + break; + + default: + /* No word here */ + break; + } + } + + /* ---- Sentence breaks ---- */ + { + + /* default to not a sentence start/end */ + attrs[i].is_sentence_start = FALSE; + attrs[i].is_sentence_end = FALSE; + + /* maybe start sentence */ + if (last_sentence_start == -1 && !is_sentence_boundary) + last_sentence_start = i - 1; + + /* remember last non space character position */ + if (i > 0 && !attrs[i - 1].is_white) + last_non_space = i; + + /* meets sentence end, mark both sentence start and end */ + if (last_sentence_start != -1 && is_sentence_boundary) { + if (last_non_space != -1) { + attrs[last_sentence_start].is_sentence_start = TRUE; + attrs[last_non_space].is_sentence_end = TRUE; + } + + last_sentence_start = -1; + last_non_space = -1; + } + + /* meets space character, move sentence start */ + if (last_sentence_start != -1 && + last_sentence_start == i - 1 && + attrs[i - 1].is_white) + last_sentence_start++; + + } + + prev_wc = wc; + + /* wc might not be a valid Unicode base character, but really all we + * need to know is the last non-combining character */ + if (type != G_UNICODE_SPACING_MARK && + type != G_UNICODE_ENCLOSING_MARK && + type != G_UNICODE_NON_SPACING_MARK) + base_character = wc; + } + + i--; + + attrs[i].is_cursor_position = TRUE; /* Rule GB2 */ + attrs[0].is_cursor_position = TRUE; /* Rule GB1 */ + + attrs[i].is_word_boundary = TRUE; /* Rule WB2 */ + attrs[0].is_word_boundary = TRUE; /* Rule WB1 */ + + attrs[i].is_line_break = TRUE; /* Rule LB3 */ + attrs[0].is_line_break = FALSE; /* Rule LB2 */ + +} + +static gboolean +tailor_break (const gchar *text, + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) +{ + if (analysis->lang_engine && PANGO_ENGINE_LANG_GET_CLASS (analysis->lang_engine)->script_break) + { + if (length < 0) + length = strlen (text); + else if (text == NULL) + text = ""; + + PANGO_ENGINE_LANG_GET_CLASS (analysis->lang_engine)->script_break (analysis->lang_engine, text, length, analysis, attrs, attrs_len); + return TRUE; + } + return FALSE; +} + +/** + * pango_break: + * @text: the text to process + * @length: length of @text in bytes (may be -1 if @text is nul-terminated) + * @analysis: #PangoAnalysis structure from pango_itemize() + * @attrs: (array length=attrs_len): an array to store character + * information in + * @attrs_len: size of the array passed as @attrs + * + * Determines possible line, word, and character breaks + * for a string of Unicode text with a single analysis. For most + * purposes you may want to use pango_get_log_attrs(). + */ +void +pango_break (const gchar *text, + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) +{ + g_return_if_fail (analysis != NULL); + g_return_if_fail (attrs != NULL); + + pango_default_break (text, length, analysis, attrs, attrs_len); + tailor_break (text, length, analysis, attrs, attrs_len); +} + +/** + * pango_find_paragraph_boundary: + * @text: UTF-8 text + * @length: length of @text in bytes, or -1 if nul-terminated + * @paragraph_delimiter_index: (out): return location for index of + * delimiter + * @next_paragraph_start: (out): return location for start of next + * paragraph + * + * Locates a paragraph boundary in @text. A boundary is caused by + * delimiter characters, such as a newline, carriage return, carriage + * return-newline pair, or Unicode paragraph separator character. The + * index of the run of delimiters is returned in + * @paragraph_delimiter_index. The index of the start of the paragraph + * (index after all delimiters) is stored in @next_paragraph_start. + * + * If no delimiters are found, both @paragraph_delimiter_index and + * @next_paragraph_start are filled with the length of @text (an index one + * off the end). + **/ +void +pango_find_paragraph_boundary (const gchar *text, + gint length, + gint *paragraph_delimiter_index, + gint *next_paragraph_start) +{ + const gchar *p = text; + const gchar *end; + const gchar *start = NULL; + const gchar *delimiter = NULL; + + /* Only one character has type G_UNICODE_PARAGRAPH_SEPARATOR in + * Unicode 5.0; update the following code if that changes. + */ + + /* prev_sep is the first byte of the previous separator. Since + * the valid separators are \r, \n, and PARAGRAPH_SEPARATOR, the + * first byte is enough to identify it. + */ + gchar prev_sep; + + + if (length < 0) + length = strlen (text); + + end = text + length; + + if (paragraph_delimiter_index) + *paragraph_delimiter_index = length; + + if (next_paragraph_start) + *next_paragraph_start = length; + + if (length == 0) + return; + + prev_sep = 0; + + while (p < end) + { + if (prev_sep == '\n' || + prev_sep == PARAGRAPH_SEPARATOR_STRING[0]) + { + g_assert (delimiter); + start = p; + break; + } + else if (prev_sep == '\r') + { + /* don't break between \r and \n */ + if (*p != '\n') + { + g_assert (delimiter); + start = p; + break; + } + } + + if (*p == '\n' || + *p == '\r' || + !strncmp(p, PARAGRAPH_SEPARATOR_STRING, + strlen(PARAGRAPH_SEPARATOR_STRING))) + { + if (delimiter == NULL) + delimiter = p; + prev_sep = *p; + } + else + prev_sep = 0; + + p = g_utf8_next_char (p); + } + + if (delimiter && paragraph_delimiter_index) + *paragraph_delimiter_index = delimiter - text; + + if (start && next_paragraph_start) + *next_paragraph_start = start - text; +} + +static int +tailor_segment (const char *range_start, + const char *range_end, + int chars_broken, + PangoAnalysis *analysis, + PangoLogAttr *log_attrs) +{ + int chars_in_range; + PangoLogAttr *start = log_attrs + chars_broken; + PangoLogAttr attr_before = *start; + + chars_in_range = pango_utf8_strlen (range_start, range_end - range_start); + + if (tailor_break (range_start, + range_end - range_start, + analysis, + start, + chars_in_range + 1)) + { + /* if tailored, we enforce some of the attrs from before tailoring at + * the boundary + */ + + start->backspace_deletes_character = attr_before.backspace_deletes_character; + + start->is_line_break |= attr_before.is_line_break; + start->is_mandatory_break |= attr_before.is_mandatory_break; + start->is_cursor_position |= attr_before.is_cursor_position; + } + + return chars_in_range; +} + +/** + * pango_get_log_attrs: + * @text: text to process + * @length: length in bytes of @text + * @level: embedding level, or -1 if unknown + * @language: language tag + * @log_attrs: (array length=attrs_len): array with one #PangoLogAttr + * per character in @text, plus one extra, to be filled in + * @attrs_len: length of @log_attrs array + * + * Computes a #PangoLogAttr for each character in @text. The @log_attrs + * array must have one #PangoLogAttr for each position in @text; if + * @text contains N characters, it has N+1 positions, including the + * last position at the end of the text. @text should be an entire + * paragraph; logical attributes can't be computed without context + * (for example you need to see spaces on either side of a word to know + * the word is a word). + */ +void +pango_get_log_attrs (const char *text, + int length, + int level, + PangoLanguage *language, + PangoLogAttr *log_attrs, + int attrs_len) +{ + int chars_broken; + PangoAnalysis analysis = { NULL }; + PangoScriptIter iter; + + g_return_if_fail (length == 0 || text != NULL); + g_return_if_fail (log_attrs != NULL); + + analysis.level = level; + analysis.lang_engine = _pango_get_language_engine (); + + pango_default_break (text, length, &analysis, log_attrs, attrs_len); + + chars_broken = 0; + + _pango_script_iter_init (&iter, text, length); + do + { + const char *run_start, *run_end; + PangoScript script; + + pango_script_iter_get_range (&iter, &run_start, &run_end, &script); + analysis.script = script; + + chars_broken += tailor_segment (run_start, run_end, chars_broken, &analysis, log_attrs); + } + while (pango_script_iter_next (&iter)); + _pango_script_iter_fini (&iter); + + if (chars_broken + 1 > attrs_len) + g_warning ("pango_get_log_attrs: attrs_len should have been at least %d, but was %d. Expect corrupted memory.", + chars_broken + 1, + attrs_len); +} + +#include "break-arabic.c" +#include "break-indic.c" +#include "break-thai.c" + +static void +break_script (const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) +{ + switch (analysis->script) + { + case PANGO_SCRIPT_ARABIC: + break_arabic (item_text, item_length, analysis, attrs, attrs_len); + break; + + case PANGO_SCRIPT_DEVANAGARI: + case PANGO_SCRIPT_BENGALI: + case PANGO_SCRIPT_GURMUKHI: + case PANGO_SCRIPT_GUJARATI: + case PANGO_SCRIPT_ORIYA: + case PANGO_SCRIPT_TAMIL: + case PANGO_SCRIPT_TELUGU: + case PANGO_SCRIPT_KANNADA: + case PANGO_SCRIPT_MALAYALAM: + case PANGO_SCRIPT_SINHALA: + break_indic (item_text, item_length, analysis, attrs, attrs_len); + break; + + case PANGO_SCRIPT_THAI: + break_thai (item_text, item_length, analysis, attrs, attrs_len); + break; + } +} + + +/* Wrap language breaker in PangoEngineLang to pass it through old API, + * from times when there were modules and engines. */ +typedef PangoEngineLang PangoLanguageEngine; +typedef PangoEngineLangClass PangoLanguageEngineClass; +static GType pango_language_engine_get_type (void) G_GNUC_CONST; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +G_DEFINE_TYPE (PangoLanguageEngine, pango_language_engine, PANGO_TYPE_ENGINE_LANG); +G_GNUC_END_IGNORE_DEPRECATIONS +static void +_pango_language_engine_break (PangoEngineLang *engine G_GNUC_UNUSED, + const char *item_text, + int item_length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) +{ + break_script (item_text, item_length, analysis, attrs, attrs_len); +} +static void +pango_language_engine_class_init (PangoEngineLangClass *class) +{ + class->script_break = _pango_language_engine_break; +} +static void +pango_language_engine_init (PangoEngineLang *object) +{ +} + +PangoEngineLang * +_pango_get_language_engine (void) +{ + static PangoEngineLang *engine; + if (g_once_init_enter (&engine)) + g_once_init_leave (&engine, g_object_new (pango_language_engine_get_type(), NULL)); + return engine; +} diff --git a/pango/ellipsize.c b/pango/ellipsize.c new file mode 100644 index 0000000..ade33ec --- /dev/null +++ b/pango/ellipsize.c @@ -0,0 +1,760 @@ +/* Pango + * ellipsize.c: Routine to ellipsize layout lines + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include + +#include "pango-glyph-item.h" +#include "pango-layout-private.h" +#include "pango-engine-private.h" +#include "pango-impl-utils.h" + +typedef struct _EllipsizeState EllipsizeState; +typedef struct _RunInfo RunInfo; +typedef struct _LineIter LineIter; + + +/* Overall, the way we ellipsize is we grow a "gap" out from an original + * gap center position until: + * + * line_width - gap_width + ellipsize_width <= goal_width + * + * Line: [-------------------------------------------] + * Runs: [------)[---------------)[------------------] + * Gap center: * + * Gap: [----------------------] + * + * The gap center may be at the start or end in which case the gap grows + * in only one direction. + * + * Note the line and last run are logically closed at the end; this allows + * us to use a gap position at x=line_width and still have it be part of + * of a run. + * + * We grow the gap out one "span" at a time, where a span is simply a + * consecutive run of clusters that we can't interrupt with an ellipsis. + * + * When choosing whether to grow the gap at the start or the end, we + * calculate the next span to remove in both directions and see which + * causes the smaller increase in: + * + * MAX (gap_end - gap_center, gap_start - gap_center) + * + * All computations are done using logical order; the ellipsization + * process occurs before the runs are ordered into visual order. + */ + +/* Keeps information about a single run */ +struct _RunInfo +{ + PangoGlyphItem *run; + int start_offset; /* Character offset of run start */ + int width; /* Width of run in Pango units */ +}; + +/* Iterator to a position within the ellipsized line */ +struct _LineIter +{ + PangoGlyphItemIter run_iter; + int run_index; +}; + +/* State of ellipsization process */ +struct _EllipsizeState +{ + PangoLayout *layout; /* Layout being ellipsized */ + PangoAttrList *attrs; /* Attributes used for itemization/shaping */ + + RunInfo *run_info; /* Array of information about each run */ + int n_runs; + + int total_width; /* Original width of line in Pango units */ + int gap_center; /* Goal for center of gap */ + + PangoGlyphItem *ellipsis_run; /* Run created to hold ellipsis */ + int ellipsis_width; /* Width of ellipsis, in Pango units */ + int ellipsis_is_cjk; /* Whether the first character in the ellipsized + * is wide; this triggers us to try to use a + * mid-line ellipsis instead of a baseline + */ + + PangoAttrIterator *line_start_attr; /* Cached PangoAttrIterator for the start of the run */ + + LineIter gap_start_iter; /* Iteratator pointig to the first cluster in gap */ + int gap_start_x; /* x position of start of gap, in Pango units */ + PangoAttrIterator *gap_start_attr; /* Attribute iterator pointing to a range containing + * the first character in gap */ + + LineIter gap_end_iter; /* Iterator pointing to last cluster in gap */ + int gap_end_x; /* x position of end of gap, in Pango units */ +}; + +/* Compute global information needed for the itemization process + */ +static void +init_state (EllipsizeState *state, + PangoLayoutLine *line, + PangoAttrList *attrs) +{ + GSList *l; + int i; + int start_offset; + + state->layout = line->layout; + state->attrs = attrs; + + state->n_runs = g_slist_length (line->runs); + state->run_info = g_new (RunInfo, state->n_runs); + + start_offset = pango_utf8_strlen (line->layout->text, + line->start_index); + + state->total_width = 0; + for (l = line->runs, i = 0; l; l = l->next, i++) + { + PangoGlyphItem *run = l->data; + int width = pango_glyph_string_get_width (run->glyphs); + state->run_info[i].run = run; + state->run_info[i].width = width; + state->run_info[i].start_offset = start_offset; + state->total_width += width; + + start_offset += run->item->num_chars; + } + + state->ellipsis_run = NULL; + state->ellipsis_is_cjk = FALSE; + state->line_start_attr = NULL; + state->gap_start_attr = NULL; +} + +/* Cleanup memory allocation + */ +static void +free_state (EllipsizeState *state) +{ + if (state->line_start_attr) + pango_attr_iterator_destroy (state->line_start_attr); + if (state->gap_start_attr) + pango_attr_iterator_destroy (state->gap_start_attr); + g_free (state->run_info); +} + +/* Computes the width of a single cluster + */ +static int +get_cluster_width (LineIter *iter) +{ + PangoGlyphItemIter *run_iter = &iter->run_iter; + PangoGlyphString *glyphs = run_iter->glyph_item->glyphs; + int width = 0; + int i; + + if (run_iter->start_glyph < run_iter->end_glyph) /* LTR */ + { + for (i = run_iter->start_glyph; i < run_iter->end_glyph; i++) + width += glyphs->glyphs[i].geometry.width; + } + else /* RTL */ + { + for (i = run_iter->start_glyph; i > run_iter->end_glyph; i--) + width += glyphs->glyphs[i].geometry.width; + } + + return width; +} + +/* Move forward one cluster. Returns %FALSE if we were already at the end + */ +static gboolean +line_iter_next_cluster (EllipsizeState *state, + LineIter *iter) +{ + if (!pango_glyph_item_iter_next_cluster (&iter->run_iter)) + { + if (iter->run_index == state->n_runs - 1) + return FALSE; + else + { + iter->run_index++; + pango_glyph_item_iter_init_start (&iter->run_iter, + state->run_info[iter->run_index].run, + state->layout->text); + } + } + + return TRUE; +} + +/* Move backward one cluster. Returns %FALSE if we were already at the end + */ +static gboolean +line_iter_prev_cluster (EllipsizeState *state, + LineIter *iter) +{ + if (!pango_glyph_item_iter_prev_cluster (&iter->run_iter)) + { + if (iter->run_index == 0) + return FALSE; + else + { + iter->run_index--; + pango_glyph_item_iter_init_end (&iter->run_iter, + state->run_info[iter->run_index].run, + state->layout->text); + } + } + + return TRUE; +} + +/* + * An ellipsization boundary is defined by two things + * + * - Starts a cluster - forced by structure of code + * - Starts a grapheme - checked here + * + * In the future we'd also like to add a check for cursive connectivity here. + * This should be an addition to #PangoGlyphVisAttr + * + */ + +/* Checks if there is a ellipsization boundary before the cluster @iter points to + */ +static gboolean +starts_at_ellipsization_boundary (EllipsizeState *state, + LineIter *iter) +{ + RunInfo *run_info = &state->run_info[iter->run_index]; + + if (iter->run_iter.start_char == 0 && iter->run_index == 0) + return TRUE; + + return state->layout->log_attrs[run_info->start_offset + iter->run_iter.start_char].is_cursor_position; +} + +/* Checks if there is a ellipsization boundary after the cluster @iter points to + */ +static gboolean +ends_at_ellipsization_boundary (EllipsizeState *state, + LineIter *iter) +{ + RunInfo *run_info = &state->run_info[iter->run_index]; + + if (iter->run_iter.end_char == run_info->run->item->num_chars && iter->run_index == state->n_runs - 1) + return TRUE; + + return state->layout->log_attrs[run_info->start_offset + iter->run_iter.end_char + 1].is_cursor_position; +} + +/* Helper function to re-itemize a string of text + */ +static PangoItem * +itemize_text (EllipsizeState *state, + const char *text, + PangoAttrList *attrs) +{ + GList *items; + PangoItem *item; + + items = pango_itemize (state->layout->context, text, 0, strlen (text), attrs, NULL); + g_assert (g_list_length (items) == 1); + + item = items->data; + g_list_free (items); + + return item; +} + +/* Shapes the ellipsis using the font and is_cjk information computed by + * update_ellipsis_shape() from the first character in the gap. + */ +static void +shape_ellipsis (EllipsizeState *state) +{ + PangoAttrList *attrs = pango_attr_list_new (); + GSList *run_attrs; + PangoItem *item; + PangoGlyphString *glyphs; + GSList *l; + PangoAttribute *fallback; + const char *ellipsis_text; + int i; + + /* Create/reset state->ellipsis_run + */ + if (!state->ellipsis_run) + { + state->ellipsis_run = g_slice_new (PangoGlyphItem); + state->ellipsis_run->glyphs = pango_glyph_string_new (); + state->ellipsis_run->item = NULL; + } + + if (state->ellipsis_run->item) + { + pango_item_free (state->ellipsis_run->item); + state->ellipsis_run->item = NULL; + } + + /* Create an attribute list + */ + run_attrs = pango_attr_iterator_get_attrs (state->gap_start_attr); + for (l = run_attrs; l; l = l->next) + { + PangoAttribute *attr = l->data; + attr->start_index = 0; + attr->end_index = G_MAXINT; + + pango_attr_list_insert (attrs, attr); + } + + g_slist_free (run_attrs); + + fallback = pango_attr_fallback_new (FALSE); + fallback->start_index = 0; + fallback->end_index = G_MAXINT; + pango_attr_list_insert (attrs, fallback); + + /* First try using a specific ellipsis character in the best matching font + */ + if (state->ellipsis_is_cjk) + ellipsis_text = "\342\213\257"; /* U+22EF: MIDLINE HORIZONTAL ELLIPSIS, used for CJK */ + else + ellipsis_text = "\342\200\246"; /* U+2026: HORIZONTAL ELLIPSIS */ + + item = itemize_text (state, ellipsis_text, attrs); + + /* If that fails we use "..." in the first matching font + */ + if (!item->analysis.font || + !_pango_engine_shape_covers (item->analysis.shape_engine, item->analysis.font, + item->analysis.language, g_utf8_get_char (ellipsis_text))) + { + pango_item_free (item); + + /* Modify the fallback iter while it is inside the PangoAttrList; Don't try this at home + */ + ((PangoAttrInt *)fallback)->value = TRUE; + + ellipsis_text = "..."; + item = itemize_text (state, ellipsis_text, attrs); + } + + pango_attr_list_unref (attrs); + + state->ellipsis_run->item = item; + + /* Now shape + */ + glyphs = state->ellipsis_run->glyphs; + + pango_shape (ellipsis_text, strlen (ellipsis_text), + &item->analysis, glyphs); + + state->ellipsis_width = 0; + for (i = 0; i < glyphs->num_glyphs; i++) + state->ellipsis_width += glyphs->glyphs[i].geometry.width; +} + +/* Helper function to advance a PangoAttrIterator to a particular + * byte index. + */ +static void +advance_iterator_to (PangoAttrIterator *iter, + int new_index) +{ + int start, end; + + do + { + pango_attr_iterator_range (iter, &start, &end); + if (end > new_index) + break; + } + while (pango_attr_iterator_next (iter)); +} + +/* Updates the shaping of the ellipsis if necessary when we move the + * position of the start of the gap. + * + * The shaping of the ellipsis is determined by two things: + * + * - The font attributes applied to the first character in the gap + * - Whether the first character in the gap is wide or not. If the + * first character is wide, then we assume that we are ellipsizing + * East-Asian text, so prefer a mid-line ellipsizes to a baseline + * ellipsis, since that's typical practice for Chinese/Japanese/Korean. + */ +static void +update_ellipsis_shape (EllipsizeState *state) +{ + gboolean recompute = FALSE; + gunichar start_wc; + gboolean is_cjk; + + /* Unfortunately, we can only advance PangoAttrIterator forward; so each + * time we back up we need to go forward to find the new position. To make + * this not utterly slow, we cache an iterator at the start of the line + */ + if (!state->line_start_attr) + { + state->line_start_attr = pango_attr_list_get_iterator (state->attrs); + advance_iterator_to (state->line_start_attr, state->run_info[0].run->item->offset); + } + + if (state->gap_start_attr) + { + /* See if the current attribute range contains the new start position + */ + int start, end; + + pango_attr_iterator_range (state->gap_start_attr, &start, &end); + + if (state->gap_start_iter.run_iter.start_index < start) + { + pango_attr_iterator_destroy (state->gap_start_attr); + state->gap_start_attr = NULL; + } + } + + /* Check whether we need to recompute the ellipsis because of new font attributes + */ + if (!state->gap_start_attr) + { + state->gap_start_attr = pango_attr_iterator_copy (state->line_start_attr); + advance_iterator_to (state->gap_start_attr, + state->run_info[state->gap_start_iter.run_index].run->item->offset); + + recompute = TRUE; + } + + /* Check whether we need to recompute the ellipsis because we switch from CJK to not + * or vice-versa + */ + start_wc = g_utf8_get_char (state->layout->text + state->gap_start_iter.run_iter.start_index); + is_cjk = g_unichar_iswide (start_wc); + + if (is_cjk != state->ellipsis_is_cjk) + { + state->ellipsis_is_cjk = is_cjk; + recompute = TRUE; + } + + if (recompute) + shape_ellipsis (state); +} + +/* Computes the position of the gap center and finds the smallest span containing it + */ +static void +find_initial_span (EllipsizeState *state) +{ + PangoGlyphItem *glyph_item; + PangoGlyphItemIter *run_iter; + gboolean have_cluster; + int i; + int x; + int cluster_width; + + switch (state->layout->ellipsize) + { + case PANGO_ELLIPSIZE_NONE: + default: + g_assert_not_reached (); + case PANGO_ELLIPSIZE_START: + state->gap_center = 0; + break; + case PANGO_ELLIPSIZE_MIDDLE: + state->gap_center = state->total_width / 2; + break; + case PANGO_ELLIPSIZE_END: + state->gap_center = state->total_width; + break; + } + + /* Find the run containing the gap center + */ + x = 0; + for (i = 0; i < state->n_runs; i++) + { + if (x + state->run_info[i].width > state->gap_center) + break; + + x += state->run_info[i].width; + } + + if (i == state->n_runs) /* Last run is a closed interval, so back off one run */ + { + i--; + x -= state->run_info[i].width; + } + + /* Find the cluster containing the gap center + */ + state->gap_start_iter.run_index = i; + run_iter = &state->gap_start_iter.run_iter; + glyph_item = state->run_info[i].run; + + cluster_width = 0; /* Quiet GCC, the line must have at least one cluster */ + for (have_cluster = pango_glyph_item_iter_init_start (run_iter, glyph_item, state->layout->text); + have_cluster; + have_cluster = pango_glyph_item_iter_next_cluster (run_iter)) + { + cluster_width = get_cluster_width (&state->gap_start_iter); + + if (x + cluster_width > state->gap_center) + break; + + x += cluster_width; + } + + if (!have_cluster) /* Last cluster is a closed interval, so back off one cluster */ + x -= cluster_width; + + state->gap_end_iter = state->gap_start_iter; + + state->gap_start_x = x; + state->gap_end_x = x + cluster_width; + + /* Expand the gap to a full span + */ + while (!starts_at_ellipsization_boundary (state, &state->gap_start_iter)) + { + line_iter_prev_cluster (state, &state->gap_start_iter); + state->gap_start_x -= get_cluster_width (&state->gap_start_iter); + } + + while (!ends_at_ellipsization_boundary (state, &state->gap_end_iter)) + { + line_iter_next_cluster (state, &state->gap_end_iter); + state->gap_end_x += get_cluster_width (&state->gap_end_iter); + } + + update_ellipsis_shape (state); +} + +/* Removes one run from the start or end of the gap. Returns FALSE + * if there's nothing left to remove in either direction. + */ +static gboolean +remove_one_span (EllipsizeState *state) +{ + LineIter new_gap_start_iter; + LineIter new_gap_end_iter; + int new_gap_start_x; + int new_gap_end_x; + int width; + + /* Find one span backwards and forward from the gap + */ + new_gap_start_iter = state->gap_start_iter; + new_gap_start_x = state->gap_start_x; + do + { + if (!line_iter_prev_cluster (state, &new_gap_start_iter)) + break; + width = get_cluster_width (&new_gap_start_iter); + new_gap_start_x -= width; + } + while (!starts_at_ellipsization_boundary (state, &new_gap_start_iter) || + width == 0); + + new_gap_end_iter = state->gap_end_iter; + new_gap_end_x = state->gap_end_x; + do + { + if (!line_iter_next_cluster (state, &new_gap_end_iter)) + break; + width = get_cluster_width (&new_gap_end_iter); + new_gap_end_x += width; + } + while (!ends_at_ellipsization_boundary (state, &new_gap_end_iter) || + width == 0); + + if (state->gap_end_x == new_gap_end_x && state->gap_start_x == new_gap_start_x) + return FALSE; + + /* In the case where we could remove a span from either end of the + * gap, we look at which causes the smaller increase in the + * MAX (gap_end - gap_center, gap_start - gap_center) + */ + if (state->gap_end_x == new_gap_end_x || + (state->gap_start_x != new_gap_start_x && + state->gap_center - new_gap_start_x < new_gap_end_x - state->gap_center)) + { + state->gap_start_iter = new_gap_start_iter; + state->gap_start_x = new_gap_start_x; + + update_ellipsis_shape (state); + } + else + { + state->gap_end_iter = new_gap_end_iter; + state->gap_end_x = new_gap_end_x; + } + + return TRUE; +} + +/* Fixes up the properties of the ellipsis run once we've determined the final extents + * of the gap + */ +static void +fixup_ellipsis_run (EllipsizeState *state) +{ + PangoGlyphString *glyphs = state->ellipsis_run->glyphs; + PangoItem *item = state->ellipsis_run->item; + int level; + int i; + + /* Make the entire glyphstring into a single logical cluster */ + for (i = 0; i < glyphs->num_glyphs; i++) + { + glyphs->log_clusters[i] = 0; + glyphs->glyphs[i].attr.is_cluster_start = FALSE; + } + + glyphs->glyphs[0].attr.is_cluster_start = TRUE; + + /* Fix up the item to point to the entire elided text */ + item->offset = state->gap_start_iter.run_iter.start_index; + item->length = state->gap_end_iter.run_iter.end_index - item->offset; + item->num_chars = pango_utf8_strlen (state->layout->text + item->offset, item->length); + + /* The level for the item is the minimum level of the elided text */ + level = G_MAXINT; + for (i = state->gap_start_iter.run_index; i <= state->gap_end_iter.run_index; i++) + level = MIN (level, state->run_info[i].run->item->analysis.level); + + item->analysis.level = level; + + item->analysis.flags |= PANGO_ANALYSIS_FLAG_IS_ELLIPSIS; +} + +/* Computes the new list of runs for the line + */ +static GSList * +get_run_list (EllipsizeState *state) +{ + PangoGlyphItem *partial_start_run = NULL; + PangoGlyphItem *partial_end_run = NULL; + GSList *result = NULL; + RunInfo *run_info; + PangoGlyphItemIter *run_iter; + int i; + + /* We first cut out the pieces of the starting and ending runs we want to + * preserve; we do the end first in case the end and the start are + * the same. Doing the start first would disturb the indices for the end. + */ + run_info = &state->run_info[state->gap_end_iter.run_index]; + run_iter = &state->gap_end_iter.run_iter; + if (run_iter->end_char != run_info->run->item->num_chars) + { + partial_end_run = run_info->run; + run_info->run = pango_glyph_item_split (run_info->run, state->layout->text, + run_iter->end_index - run_info->run->item->offset); + } + + run_info = &state->run_info[state->gap_start_iter.run_index]; + run_iter = &state->gap_start_iter.run_iter; + if (run_iter->start_char != 0) + { + partial_start_run = pango_glyph_item_split (run_info->run, state->layout->text, + run_iter->start_index - run_info->run->item->offset); + } + + /* Now assemble the new list of runs + */ + for (i = 0; i < state->gap_start_iter.run_index; i++) + result = g_slist_prepend (result, state->run_info[i].run); + + if (partial_start_run) + result = g_slist_prepend (result, partial_start_run); + + result = g_slist_prepend (result, state->ellipsis_run); + + if (partial_end_run) + result = g_slist_prepend (result, partial_end_run); + + for (i = state->gap_end_iter.run_index + 1; i < state->n_runs; i++) + result = g_slist_prepend (result, state->run_info[i].run); + + /* And free the ones we didn't use + */ + for (i = state->gap_start_iter.run_index; i <= state->gap_end_iter.run_index; i++) + pango_glyph_item_free (state->run_info[i].run); + + return g_slist_reverse (result); +} + +/* Computes the width of the line as currently ellipsized + */ +static int +current_width (EllipsizeState *state) +{ + return state->total_width - (state->gap_end_x - state->gap_start_x) + state->ellipsis_width; +} + +/** + * _pango_layout_line_ellipsize: + * @line: a #PangoLayoutLine + * @attrs: Attributes being used for itemization/shaping + * + * Given a #PangoLayoutLine with the runs still in logical order, ellipsize + * it according the layout's policy to fit within the set width of the layout. + * + * Return value: whether the line had to be ellipsized + **/ +gboolean +_pango_layout_line_ellipsize (PangoLayoutLine *line, + PangoAttrList *attrs, + int goal_width) +{ + EllipsizeState state; + gboolean is_ellipsized = FALSE; + + g_return_val_if_fail (line->layout->ellipsize != PANGO_ELLIPSIZE_NONE && goal_width >= 0, is_ellipsized); + + init_state (&state, line, attrs); + + if (state.total_width <= goal_width) + goto out; + + find_initial_span (&state); + + while (current_width (&state) > goal_width) + { + if (!remove_one_span (&state)) + break; + } + + fixup_ellipsis_run (&state); + + g_slist_free (line->runs); + line->runs = get_run_list (&state); + is_ellipsized = TRUE; + + out: + free_state (&state); + + return is_ellipsized; +} diff --git a/pango/fonts.c b/pango/fonts.c new file mode 100644 index 0000000..d9a07c0 --- /dev/null +++ b/pango/fonts.c @@ -0,0 +1,2263 @@ +/* Pango + * fonts.c: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:fonts + * @short_description:Structures representing abstract fonts + * @title: Fonts + * + * Pango supports a flexible architecture where a + * particular rendering architecture can supply an + * implementation of fonts. The #PangoFont structure + * represents an abstract rendering-system-independent font. + * Pango provides routines to list available fonts, and + * to load a font of a given description. + */ + +#include "config.h" +#include +#include +#include + +#include "pango-types.h" +#include "pango-font.h" +#include "pango-fontmap.h" +#include "pango-impl-utils.h" + +struct _PangoFontDescription +{ + char *family_name; + + PangoStyle style; + PangoVariant variant; + PangoWeight weight; + PangoStretch stretch; + PangoGravity gravity; + + char *variations; + + guint16 mask; + guint static_family : 1; + guint static_variations : 1; + guint size_is_absolute : 1; + + int size; +}; + +G_DEFINE_BOXED_TYPE (PangoFontDescription, pango_font_description, + pango_font_description_copy, + pango_font_description_free); + +static const PangoFontDescription pfd_defaults = { + NULL, /* family_name */ + + PANGO_STYLE_NORMAL, /* style */ + PANGO_VARIANT_NORMAL, /* variant */ + PANGO_WEIGHT_NORMAL, /* weight */ + PANGO_STRETCH_NORMAL, /* stretch */ + PANGO_GRAVITY_SOUTH, /* gravity */ + NULL, /* variations */ + + 0, /* mask */ + 0, /* static_family */ + 0, /* static_variations*/ + 0, /* size_is_absolute */ + + 0, /* size */ +}; + +/** + * pango_font_description_new: + * + * Creates a new font description structure with all fields unset. + * + * Return value: the newly allocated #PangoFontDescription, which + * should be freed using pango_font_description_free(). + **/ +PangoFontDescription * +pango_font_description_new (void) +{ + PangoFontDescription *desc = g_slice_new (PangoFontDescription); + + *desc = pfd_defaults; + + return desc; +} + +/** + * pango_font_description_set_family: + * @desc: a #PangoFontDescription. + * @family: a string representing the family name. + * + * Sets the family name field of a font description. The family + * name represents a family of related font styles, and will + * resolve to a particular #PangoFontFamily. In some uses of + * #PangoFontDescription, it is also possible to use a comma + * separated list of family names for this field. + **/ +void +pango_font_description_set_family (PangoFontDescription *desc, + const char *family) +{ + g_return_if_fail (desc != NULL); + + pango_font_description_set_family_static (desc, family ? g_strdup (family) : NULL); + if (family) + desc->static_family = FALSE; +} + +/** + * pango_font_description_set_family_static: + * @desc: a #PangoFontDescription + * @family: a string representing the family name. + * + * Like pango_font_description_set_family(), except that no + * copy of @family is made. The caller must make sure that the + * string passed in stays around until @desc has been freed + * or the name is set again. This function can be used if + * @family is a static string such as a C string literal, or + * if @desc is only needed temporarily. + **/ +void +pango_font_description_set_family_static (PangoFontDescription *desc, + const char *family) +{ + g_return_if_fail (desc != NULL); + + if (desc->family_name == family) + return; + + if (desc->family_name && !desc->static_family) + g_free (desc->family_name); + + if (family) + { + desc->family_name = (char *)family; + desc->static_family = TRUE; + desc->mask |= PANGO_FONT_MASK_FAMILY; + } + else + { + desc->family_name = pfd_defaults.family_name; + desc->static_family = pfd_defaults.static_family; + desc->mask &= ~PANGO_FONT_MASK_FAMILY; + } +} + +/** + * pango_font_description_get_family: + * @desc: a #PangoFontDescription. + * + * Gets the family name field of a font description. See + * pango_font_description_set_family(). + * + * Return value: (nullable): the family name field for the font + * description, or %NULL if not previously set. This + * has the same life-time as the font description itself + * and should not be freed. + **/ +const char * +pango_font_description_get_family (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, NULL); + + return desc->family_name; +} + +/** + * pango_font_description_set_style: + * @desc: a #PangoFontDescription + * @style: the style for the font description + * + * Sets the style field of a #PangoFontDescription. The + * #PangoStyle enumeration describes whether the font is slanted and + * the manner in which it is slanted; it can be either + * #PANGO_STYLE_NORMAL, #PANGO_STYLE_ITALIC, or #PANGO_STYLE_OBLIQUE. + * Most fonts will either have a italic style or an oblique + * style, but not both, and font matching in Pango will + * match italic specifications with oblique fonts and vice-versa + * if an exact match is not found. + **/ +void +pango_font_description_set_style (PangoFontDescription *desc, + PangoStyle style) +{ + g_return_if_fail (desc != NULL); + + desc->style = style; + desc->mask |= PANGO_FONT_MASK_STYLE; +} + +/** + * pango_font_description_get_style: + * @desc: a #PangoFontDescription + * + * Gets the style field of a #PangoFontDescription. See + * pango_font_description_set_style(). + * + * Return value: the style field for the font description. + * Use pango_font_description_get_set_fields() to find out if + * the field was explicitly set or not. + **/ +PangoStyle +pango_font_description_get_style (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.style); + + return desc->style; +} + +/** + * pango_font_description_set_variant: + * @desc: a #PangoFontDescription + * @variant: the variant type for the font description. + * + * Sets the variant field of a font description. The #PangoVariant + * can either be %PANGO_VARIANT_NORMAL or %PANGO_VARIANT_SMALL_CAPS. + **/ +void +pango_font_description_set_variant (PangoFontDescription *desc, + PangoVariant variant) +{ + g_return_if_fail (desc != NULL); + + desc->variant = variant; + desc->mask |= PANGO_FONT_MASK_VARIANT; +} + +/** + * pango_font_description_get_variant: + * @desc: a #PangoFontDescription. + * + * Gets the variant field of a #PangoFontDescription. See + * pango_font_description_set_variant(). + * + * Return value: the variant field for the font description. Use + * pango_font_description_get_set_fields() to find out if + * the field was explicitly set or not. + **/ +PangoVariant +pango_font_description_get_variant (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.variant); + + return desc->variant; +} + +/** + * pango_font_description_set_weight: + * @desc: a #PangoFontDescription + * @weight: the weight for the font description. + * + * Sets the weight field of a font description. The weight field + * specifies how bold or light the font should be. In addition + * to the values of the #PangoWeight enumeration, other intermediate + * numeric values are possible. + **/ +void +pango_font_description_set_weight (PangoFontDescription *desc, + PangoWeight weight) +{ + g_return_if_fail (desc != NULL); + + desc->weight = weight; + desc->mask |= PANGO_FONT_MASK_WEIGHT; +} + +/** + * pango_font_description_get_weight: + * @desc: a #PangoFontDescription + * + * Gets the weight field of a font description. See + * pango_font_description_set_weight(). + * + * Return value: the weight field for the font description. Use + * pango_font_description_get_set_fields() to find out if + * the field was explicitly set or not. + **/ +PangoWeight +pango_font_description_get_weight (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.weight); + + return desc->weight; +} + +/** + * pango_font_description_set_stretch: + * @desc: a #PangoFontDescription + * @stretch: the stretch for the font description + * + * Sets the stretch field of a font description. The stretch field + * specifies how narrow or wide the font should be. + **/ +void +pango_font_description_set_stretch (PangoFontDescription *desc, + PangoStretch stretch) +{ + g_return_if_fail (desc != NULL); + + desc->stretch = stretch; + desc->mask |= PANGO_FONT_MASK_STRETCH; +} + +/** + * pango_font_description_get_stretch: + * @desc: a #PangoFontDescription. + * + * Gets the stretch field of a font description. + * See pango_font_description_set_stretch(). + * + * Return value: the stretch field for the font description. Use + * pango_font_description_get_set_fields() to find out if + * the field was explicitly set or not. + **/ +PangoStretch +pango_font_description_get_stretch (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.stretch); + + return desc->stretch; +} + +/** + * pango_font_description_set_size: + * @desc: a #PangoFontDescription + * @size: the size of the font in points, scaled by PANGO_SCALE. (That is, + * a @size value of 10 * PANGO_SCALE is a 10 point font. The conversion + * factor between points and device units depends on system configuration + * and the output device. For screen display, a logical DPI of 96 is + * common, in which case a 10 point font corresponds to a 10 * (96 / 72) = 13.3 + * pixel font. Use pango_font_description_set_absolute_size() if you need + * a particular size in device units. + * + * Sets the size field of a font description in fractional points. This is mutually + * exclusive with pango_font_description_set_absolute_size(). + **/ +void +pango_font_description_set_size (PangoFontDescription *desc, + gint size) +{ + g_return_if_fail (desc != NULL); + g_return_if_fail (size >= 0); + + desc->size = size; + desc->size_is_absolute = FALSE; + desc->mask |= PANGO_FONT_MASK_SIZE; +} + +/** + * pango_font_description_get_size: + * @desc: a #PangoFontDescription + * + * Gets the size field of a font description. + * See pango_font_description_set_size(). + * + * Return value: the size field for the font description in points or device units. + * You must call pango_font_description_get_size_is_absolute() + * to find out which is the case. Returns 0 if the size field has not + * previously been set or it has been set to 0 explicitly. + * Use pango_font_description_get_set_fields() to + * find out if the field was explicitly set or not. + **/ +gint +pango_font_description_get_size (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.size); + + return desc->size; +} + +/** + * pango_font_description_set_absolute_size: + * @desc: a #PangoFontDescription + * @size: the new size, in Pango units. There are %PANGO_SCALE Pango units in one + * device unit. For an output backend where a device unit is a pixel, a @size + * value of 10 * PANGO_SCALE gives a 10 pixel font. + * + * Sets the size field of a font description, in device units. This is mutually + * exclusive with pango_font_description_set_size() which sets the font size + * in points. + * + * Since: 1.8 + **/ +void +pango_font_description_set_absolute_size (PangoFontDescription *desc, + double size) +{ + g_return_if_fail (desc != NULL); + g_return_if_fail (size >= 0); + + desc->size = size; + desc->size_is_absolute = TRUE; + desc->mask |= PANGO_FONT_MASK_SIZE; +} + +/** + * pango_font_description_get_size_is_absolute: + * @desc: a #PangoFontDescription + * + * Determines whether the size of the font is in points (not absolute) or device units (absolute). + * See pango_font_description_set_size() and pango_font_description_set_absolute_size(). + * + * Return value: whether the size for the font description is in + * points or device units. Use pango_font_description_get_set_fields() to + * find out if the size field of the font description was explicitly set or not. + * + * Since: 1.8 + **/ +gboolean +pango_font_description_get_size_is_absolute (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.size_is_absolute); + + return desc->size_is_absolute; +} + +/** + * pango_font_description_set_gravity: + * @desc: a #PangoFontDescription + * @gravity: the gravity for the font description. + * + * Sets the gravity field of a font description. The gravity field + * specifies how the glyphs should be rotated. If @gravity is + * %PANGO_GRAVITY_AUTO, this actually unsets the gravity mask on + * the font description. + * + * This function is seldom useful to the user. Gravity should normally + * be set on a #PangoContext. + * + * Since: 1.16 + **/ +void +pango_font_description_set_gravity (PangoFontDescription *desc, + PangoGravity gravity) +{ + g_return_if_fail (desc != NULL); + + if (gravity == PANGO_GRAVITY_AUTO) + { + pango_font_description_unset_fields (desc, PANGO_FONT_MASK_GRAVITY); + return; + } + + desc->gravity = gravity; + desc->mask |= PANGO_FONT_MASK_GRAVITY; +} + +/** + * pango_font_description_get_gravity: + * @desc: a #PangoFontDescription + * + * Gets the gravity field of a font description. See + * pango_font_description_set_gravity(). + * + * Return value: the gravity field for the font description. Use + * pango_font_description_get_set_fields() to find out if + * the field was explicitly set or not. + * + * Since: 1.16 + **/ +PangoGravity +pango_font_description_get_gravity (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.gravity); + + return desc->gravity; +} + +/** + * pango_font_description_set_variations_static: + * @desc: a #PangoFontDescription + * @variations: a string representing the variations + * + * Like pango_font_description_set_variations(), except that no + * copy of @variations is made. The caller must make sure that the + * string passed in stays around until @desc has been freed + * or the name is set again. This function can be used if + * @variations is a static string such as a C string literal, or + * if @desc is only needed temporarily. + * + * Since: 1.42 + **/ +void +pango_font_description_set_variations_static (PangoFontDescription *desc, + const char *variations) +{ + g_return_if_fail (desc != NULL); + + if (desc->variations == variations) + return; + + if (desc->variations && !desc->static_variations) + g_free (desc->variations); + + if (variations) + { + desc->variations = (char *)variations; + desc->static_variations = TRUE; + desc->mask |= PANGO_FONT_MASK_VARIATIONS; + } + else + { + desc->variations = pfd_defaults.variations; + desc->static_variations = pfd_defaults.static_variations; + desc->mask &= ~PANGO_FONT_MASK_VARIATIONS; + } +} + +/** + * pango_font_description_set_variations: + * @desc: a #PangoFontDescription. + * @variations: a string representing the variations + * + * Sets the variations field of a font description. OpenType + * font variations allow to select a font instance by specifying + * values for a number of axes, such as width or weight. + * + * The format of the variations string is AXIS1=VALUE,AXIS2=VALUE..., + * with each AXIS a 4 character tag that identifies a font axis, + * and each VALUE a floating point number. Unknown axes are ignored, + * and values are clamped to their allowed range. + * + * Pango does not currently have a way to find supported axes of + * a font. Both harfbuzz or freetype have API for this. + * + * Since: 1.42 + **/ +void +pango_font_description_set_variations (PangoFontDescription *desc, + const char *variations) +{ + g_return_if_fail (desc != NULL); + + pango_font_description_set_variations_static (desc, g_strdup (variations)); + if (variations) + desc->static_variations = FALSE; +} + +/** + * pango_font_description_get_variations: + * @desc: a #PangoFontDescription + * + * Gets the variations field of a font description. See + * pango_font_description_set_variations(). + * + * Return value: (nullable): the varitions field for the font + * description, or %NULL if not previously set. This + * has the same life-time as the font description itself + * and should not be freed. + * + * Since: 1.42 + **/ +const char * +pango_font_description_get_variations (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, NULL); + + return desc->variations; +} + +/** + * pango_font_description_get_set_fields: + * @desc: a #PangoFontDescription + * + * Determines which fields in a font description have been set. + * + * Return value: a bitmask with bits set corresponding to the + * fields in @desc that have been set. + **/ +PangoFontMask +pango_font_description_get_set_fields (const PangoFontDescription *desc) +{ + g_return_val_if_fail (desc != NULL, pfd_defaults.mask); + + return desc->mask; +} + +/** + * pango_font_description_unset_fields: + * @desc: a #PangoFontDescription + * @to_unset: bitmask of fields in the @desc to unset. + * + * Unsets some of the fields in a #PangoFontDescription. The unset + * fields will get back to their default values. + **/ +void +pango_font_description_unset_fields (PangoFontDescription *desc, + PangoFontMask to_unset) +{ + PangoFontDescription unset_desc; + + g_return_if_fail (desc != NULL); + + unset_desc = pfd_defaults; + unset_desc.mask = to_unset; + + pango_font_description_merge_static (desc, &unset_desc, TRUE); + + desc->mask &= ~to_unset; +} + +/** + * pango_font_description_merge: + * @desc: a #PangoFontDescription + * @desc_to_merge: (allow-none): the #PangoFontDescription to merge from, or %NULL + * @replace_existing: if %TRUE, replace fields in @desc with the + * corresponding values from @desc_to_merge, even if they + * are already exist. + * + * Merges the fields that are set in @desc_to_merge into the fields in + * @desc. If @replace_existing is %FALSE, only fields in @desc that + * are not already set are affected. If %TRUE, then fields that are + * already set will be replaced as well. + * + * If @desc_to_merge is %NULL, this function performs nothing. + **/ +void +pango_font_description_merge (PangoFontDescription *desc, + const PangoFontDescription *desc_to_merge, + gboolean replace_existing) +{ + gboolean family_merged; + gboolean variations_merged; + + g_return_if_fail (desc != NULL); + + if (desc_to_merge == NULL) + return; + + family_merged = desc_to_merge->family_name && (replace_existing || !desc->family_name); + variations_merged = desc_to_merge->variations && (replace_existing || !desc->variations); + + pango_font_description_merge_static (desc, desc_to_merge, replace_existing); + + if (family_merged) + { + desc->family_name = g_strdup (desc->family_name); + desc->static_family = FALSE; + } + + if (variations_merged) + { + desc->variations = g_strdup (desc->variations); + desc->static_variations = FALSE; + } +} + +/** + * pango_font_description_merge_static: + * @desc: a #PangoFontDescription + * @desc_to_merge: the #PangoFontDescription to merge from + * @replace_existing: if %TRUE, replace fields in @desc with the + * corresponding values from @desc_to_merge, even if they + * are already exist. + * + * Like pango_font_description_merge(), but only a shallow copy is made + * of the family name and other allocated fields. @desc can only be + * used until @desc_to_merge is modified or freed. This is meant + * to be used when the merged font description is only needed temporarily. + **/ +void +pango_font_description_merge_static (PangoFontDescription *desc, + const PangoFontDescription *desc_to_merge, + gboolean replace_existing) +{ + PangoFontMask new_mask; + + g_return_if_fail (desc != NULL); + g_return_if_fail (desc_to_merge != NULL); + + if (replace_existing) + new_mask = desc_to_merge->mask; + else + new_mask = desc_to_merge->mask & ~desc->mask; + + if (new_mask & PANGO_FONT_MASK_FAMILY) + pango_font_description_set_family_static (desc, desc_to_merge->family_name); + if (new_mask & PANGO_FONT_MASK_STYLE) + desc->style = desc_to_merge->style; + if (new_mask & PANGO_FONT_MASK_VARIANT) + desc->variant = desc_to_merge->variant; + if (new_mask & PANGO_FONT_MASK_WEIGHT) + desc->weight = desc_to_merge->weight; + if (new_mask & PANGO_FONT_MASK_STRETCH) + desc->stretch = desc_to_merge->stretch; + if (new_mask & PANGO_FONT_MASK_SIZE) + { + desc->size = desc_to_merge->size; + desc->size_is_absolute = desc_to_merge->size_is_absolute; + } + if (new_mask & PANGO_FONT_MASK_GRAVITY) + desc->gravity = desc_to_merge->gravity; + if (new_mask & PANGO_FONT_MASK_VARIATIONS) + pango_font_description_set_variations_static (desc, desc_to_merge->variations); + + desc->mask |= new_mask; +} + +static gint +compute_distance (const PangoFontDescription *a, + const PangoFontDescription *b) +{ + if (a->style == b->style) + { + return abs((int)(a->weight) - (int)(b->weight)); + } + else if (a->style != PANGO_STYLE_NORMAL && + b->style != PANGO_STYLE_NORMAL) + { + /* Equate oblique and italic, but with a big penalty + */ + return 1000000 + abs ((int)(a->weight) - (int)(b->weight)); + } + else + return G_MAXINT; +} + +/** + * pango_font_description_better_match: + * @desc: a #PangoFontDescription + * @old_match: (allow-none): a #PangoFontDescription, or %NULL + * @new_match: a #PangoFontDescription + * + * Determines if the style attributes of @new_match are a closer match + * for @desc than those of @old_match are, or if @old_match is %NULL, + * determines if @new_match is a match at all. + * Approximate matching is done for + * weight and style; other style attributes must match exactly. + * Style attributes are all attributes other than family and size-related + * attributes. Approximate matching for style considers PANGO_STYLE_OBLIQUE + * and PANGO_STYLE_ITALIC as matches, but not as good a match as when the + * styles are equal. + * + * Note that @old_match must match @desc. + * + * Return value: %TRUE if @new_match is a better match + **/ +gboolean +pango_font_description_better_match (const PangoFontDescription *desc, + const PangoFontDescription *old_match, + const PangoFontDescription *new_match) +{ + g_return_val_if_fail (desc != NULL, G_MAXINT); + g_return_val_if_fail (new_match != NULL, G_MAXINT); + + if (new_match->variant == desc->variant && + new_match->stretch == desc->stretch && + new_match->gravity == desc->gravity) + { + int old_distance = old_match ? compute_distance (desc, old_match) : G_MAXINT; + int new_distance = compute_distance (desc, new_match); + + if (new_distance < old_distance) + return TRUE; + } + + return FALSE; +} + +/** + * pango_font_description_copy: + * @desc: (nullable): a #PangoFontDescription, may be %NULL + * + * Make a copy of a #PangoFontDescription. + * + * Return value: (nullable): the newly allocated + * #PangoFontDescription, which should be freed with + * pango_font_description_free(), or %NULL if @desc was + * %NULL. + **/ +PangoFontDescription * +pango_font_description_copy (const PangoFontDescription *desc) +{ + PangoFontDescription *result; + + if (desc == NULL) + return NULL; + + result = g_slice_new (PangoFontDescription); + + *result = *desc; + + if (result->family_name) + { + result->family_name = g_strdup (result->family_name); + result->static_family = FALSE; + } + + result->variations = g_strdup (result->variations); + result->static_variations = FALSE; + + return result; +} + +/** + * pango_font_description_copy_static: + * @desc: (nullable): a #PangoFontDescription, may be %NULL + * + * Like pango_font_description_copy(), but only a shallow copy is made + * of the family name and other allocated fields. The result can only + * be used until @desc is modified or freed. This is meant to be used + * when the copy is only needed temporarily. + * + * Return value: (nullable): the newly allocated + * #PangoFontDescription, which should be freed with + * pango_font_description_free(), or %NULL if @desc was + * %NULL. + **/ +PangoFontDescription * +pango_font_description_copy_static (const PangoFontDescription *desc) +{ + PangoFontDescription *result; + + if (desc == NULL) + return NULL; + + result = g_slice_new (PangoFontDescription); + + *result = *desc; + if (result->family_name) + result->static_family = TRUE; + + + if (result->variations) + result->static_variations = TRUE; + + return result; +} + +/** + * pango_font_description_equal: + * @desc1: a #PangoFontDescription + * @desc2: another #PangoFontDescription + * + * Compares two font descriptions for equality. Two font descriptions + * are considered equal if the fonts they describe are provably identical. + * This means that their masks do not have to match, as long as other fields + * are all the same. (Two font descriptions may result in identical fonts + * being loaded, but still compare %FALSE.) + * + * Return value: %TRUE if the two font descriptions are identical, + * %FALSE otherwise. + **/ +gboolean +pango_font_description_equal (const PangoFontDescription *desc1, + const PangoFontDescription *desc2) +{ + g_return_val_if_fail (desc1 != NULL, FALSE); + g_return_val_if_fail (desc2 != NULL, FALSE); + + return desc1->style == desc2->style && + desc1->variant == desc2->variant && + desc1->weight == desc2->weight && + desc1->stretch == desc2->stretch && + desc1->size == desc2->size && + desc1->size_is_absolute == desc2->size_is_absolute && + desc1->gravity == desc2->gravity && + (desc1->family_name == desc2->family_name || + (desc1->family_name && desc2->family_name && g_ascii_strcasecmp (desc1->family_name, desc2->family_name) == 0)) && + (g_strcmp0 (desc1->variations, desc2->variations) == 0); +} + +#define TOLOWER(c) \ + (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c)) + +static guint +case_insensitive_hash (const char *key) +{ + const char *p = key; + guint h = TOLOWER (*p); + + if (h) + { + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + TOLOWER (*p); + } + + return h; +} + +/** + * pango_font_description_hash: + * @desc: a #PangoFontDescription + * + * Computes a hash of a #PangoFontDescription structure suitable + * to be used, for example, as an argument to g_hash_table_new(). + * The hash value is independent of @desc->mask. + * + * Return value: the hash value. + **/ +guint +pango_font_description_hash (const PangoFontDescription *desc) +{ + guint hash = 0; + + g_return_val_if_fail (desc != NULL, 0); + + if (desc->family_name) + hash = case_insensitive_hash (desc->family_name); + if (desc->variations) + hash ^= g_str_hash (desc->variations); + hash ^= desc->size; + hash ^= desc->size_is_absolute ? 0xc33ca55a : 0; + hash ^= desc->style << 16; + hash ^= desc->variant << 18; + hash ^= desc->weight << 16; + hash ^= desc->stretch << 26; + hash ^= desc->gravity << 28; + + return hash; +} + +/** + * pango_font_description_free: + * @desc: (nullable): a #PangoFontDescription, may be %NULL + * + * Frees a font description. + **/ +void +pango_font_description_free (PangoFontDescription *desc) +{ + if (desc == NULL) + return; + + if (desc->family_name && !desc->static_family) + g_free (desc->family_name); + + if (desc->variations && !desc->static_variations) + g_free (desc->variations); + + g_slice_free (PangoFontDescription, desc); +} + +/** + * pango_font_descriptions_free: + * @descs: (allow-none) (array length=n_descs) (transfer full): a pointer + * to an array of #PangoFontDescription, may be %NULL + * @n_descs: number of font descriptions in @descs + * + * Frees an array of font descriptions. + **/ +void +pango_font_descriptions_free (PangoFontDescription **descs, + int n_descs) +{ + int i; + + if (descs == NULL) + return; + + for (i = 0; i= 0 && val == i) + { + if (out) + *out = i; + + return TRUE; + } + + return FALSE; +} + +static gboolean +find_field (const char *what, + const FieldMap *map, + int n_elements, + const char *str, + int len, + int *val) +{ + int i; + gboolean had_prefix = FALSE; + + if (what) + { + i = strlen (what); + if (len > i && 0 == strncmp (what, str, i) && str[i] == '=') + { + str += i + 1; + len -= i + 1; + had_prefix = TRUE; + } + } + + for (i=0; iNAME : NULL)) \ + { \ + if (desc) \ + desc->mask |= MASK; \ + return TRUE; \ + } \ + } G_STMT_END + + FIELD (weight, PANGO_FONT_MASK_WEIGHT); + FIELD (style, PANGO_FONT_MASK_STYLE); + FIELD (stretch, PANGO_FONT_MASK_STRETCH); + FIELD (variant, PANGO_FONT_MASK_VARIANT); + FIELD (gravity, PANGO_FONT_MASK_GRAVITY); + +#undef FIELD + + return FALSE; +} + +static const char * +getword (const char *str, const char *last, size_t *wordlen, const char *stop) +{ + const char *result; + + while (last > str && g_ascii_isspace (*(last - 1))) + last--; + + result = last; + while (result > str && !g_ascii_isspace (*(result - 1)) && !strchr (stop, *(result - 1))) + result--; + + *wordlen = last - result; + + return result; +} + +static gboolean +parse_size (const char *word, + size_t wordlen, + int *pango_size, + gboolean *size_is_absolute) +{ + char *end; + double size = g_ascii_strtod (word, &end); + + if (end != word && + (end == word + wordlen || + (end + 2 == word + wordlen && !strncmp (end, "px", 2)) + ) && size >= 0 && size <= 1000000) /* word is a valid float */ + { + if (pango_size) + *pango_size = (int)(size * PANGO_SCALE + 0.5); + + if (size_is_absolute) + *size_is_absolute = end < word + wordlen; + + return TRUE; + } + + return FALSE; +} + +static gboolean +parse_variations (const char *word, + size_t wordlen, + char **variations) +{ + if (word[0] != '@') + { + *variations = NULL; + return FALSE; + } + + /* XXX: actually validate here */ + *variations = g_strndup (word + 1, wordlen - 1); + + return TRUE; +} + +/** + * pango_font_description_from_string: + * @str: string representation of a font description. + * + * Creates a new font description from a string representation in the + * form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a + * comma separated list of families optionally terminated by a comma, + * STYLE_OPTIONS is a whitespace separated list of words where each word + * describes one of style, variant, weight, stretch, or gravity, and SIZE + * is a decimal number (size in points) or optionally followed by the + * unit modifier "px" for absolute size. Any one of the options may + * be absent. If FAMILY-LIST is absent, then the family_name field of + * the resulting font description will be initialized to %NULL. If + * STYLE-OPTIONS is missing, then all style options will be set to the + * default values. If SIZE is missing, the size in the resulting font + * description will be set to 0. + * + * Return value: a new #PangoFontDescription. + **/ +PangoFontDescription * +pango_font_description_from_string (const char *str) +{ + PangoFontDescription *desc; + const char *p, *last; + size_t len, wordlen; + + g_return_val_if_fail (str != NULL, NULL); + + desc = pango_font_description_new (); + + desc->mask = PANGO_FONT_MASK_STYLE | + PANGO_FONT_MASK_WEIGHT | + PANGO_FONT_MASK_VARIANT | + PANGO_FONT_MASK_STRETCH; + + len = strlen (str); + last = str + len; + p = getword (str, last, &wordlen, ""); + /* Look for variations at the end of the string */ + if (wordlen != 0) + { + if (parse_variations (p, wordlen, &desc->variations)) + { + desc->mask |= PANGO_FONT_MASK_VARIATIONS; + last = p; + } + } + + p = getword (str, last, &wordlen, ","); + /* Look for a size */ + if (wordlen != 0) + { + gboolean size_is_absolute; + if (parse_size (p, wordlen, &desc->size, &size_is_absolute)) + { + desc->size_is_absolute = size_is_absolute; + desc->mask |= PANGO_FONT_MASK_SIZE; + last = p; + } + } + + /* Now parse style words + */ + p = getword (str, last, &wordlen, ","); + while (wordlen != 0) + { + if (!find_field_any (p, wordlen, desc)) + break; + else + { + last = p; + p = getword (str, last, &wordlen, ","); + } + } + + /* Remainder (str => p) is family list. Trim off trailing commas and leading and trailing white space + */ + + while (last > str && g_ascii_isspace (*(last - 1))) + last--; + + if (last > str && *(last - 1) == ',') + last--; + + while (last > str && g_ascii_isspace (*(last - 1))) + last--; + + while (last > str && g_ascii_isspace (*str)) + str++; + + if (str != last) + { + int i; + char **families; + + desc->family_name = g_strndup (str, last - str); + + /* Now sanitize it to trim space from around individual family names. + * bug #499624 */ + + families = g_strsplit (desc->family_name, ",", -1); + + for (i = 0; families[i]; i++) + g_strstrip (families[i]); + + g_free (desc->family_name); + desc->family_name = g_strjoinv (",", families); + g_strfreev (families); + + desc->mask |= PANGO_FONT_MASK_FAMILY; + } + + return desc; +} + +static void +append_field (GString *str, const char *what, const FieldMap *map, int n_elements, int val) +{ + int i; + for (i=0; ilen > 0 && str->str[str->len -1] != ' ')) + g_string_append_c (str, ' '); + g_string_append (str, map[i].str); + } + return; + } + + if (G_LIKELY (str->len > 0 || str->str[str->len -1] != ' ')) + g_string_append_c (str, ' '); + g_string_append_printf (str, "%s=%d", what, val); +} + +/** + * pango_font_description_to_string: + * @desc: a #PangoFontDescription + * + * Creates a string representation of a font description. See + * pango_font_description_from_string() for a description of the + * format of the string representation. The family list in the + * string description will only have a terminating comma if the + * last word of the list is a valid style option. + * + * Return value: a new string that must be freed with g_free(). + **/ +char * +pango_font_description_to_string (const PangoFontDescription *desc) +{ + GString *result; + + g_return_val_if_fail (desc != NULL, NULL); + + result = g_string_new (NULL); + + if (G_LIKELY (desc->family_name && desc->mask & PANGO_FONT_MASK_FAMILY)) + { + const char *p; + size_t wordlen; + + g_string_append (result, desc->family_name); + + /* We need to add a trailing comma if the family name ends + * in a keyword like "Bold", or if the family name ends in + * a number and no keywords will be added. + */ + p = getword (desc->family_name, desc->family_name + strlen(desc->family_name), &wordlen, ","); + if (wordlen != 0 && + (find_field_any (p, wordlen, NULL) || + (parse_size (p, wordlen, NULL, NULL) && + desc->weight == PANGO_WEIGHT_NORMAL && + desc->style == PANGO_STYLE_NORMAL && + desc->stretch == PANGO_STRETCH_NORMAL && + desc->variant == PANGO_VARIANT_NORMAL && + (desc->mask & (PANGO_FONT_MASK_GRAVITY | PANGO_FONT_MASK_SIZE)) == 0))) + g_string_append_c (result, ','); + } + +#define FIELD(NAME, MASK) \ + append_field (result, G_STRINGIFY (NAME), NAME##_map, G_N_ELEMENTS (NAME##_map), desc->NAME) + + FIELD (weight, PANGO_FONT_MASK_WEIGHT); + FIELD (style, PANGO_FONT_MASK_STYLE); + FIELD (stretch, PANGO_FONT_MASK_STRETCH); + FIELD (variant, PANGO_FONT_MASK_VARIANT); + if (desc->mask & PANGO_FONT_MASK_GRAVITY) + FIELD (gravity, PANGO_FONT_MASK_GRAVITY); + +#undef FIELD + + if (result->len == 0) + g_string_append (result, "Normal"); + + if (desc->mask & PANGO_FONT_MASK_SIZE) + { + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + + if (result->len > 0 || result->str[result->len -1] != ' ') + g_string_append_c (result, ' '); + + g_ascii_dtostr (buf, sizeof (buf), (double)desc->size / PANGO_SCALE); + g_string_append (result, buf); + + if (desc->size_is_absolute) + g_string_append (result, "px"); + } + + if (desc->variations && desc->mask & PANGO_FONT_MASK_VARIATIONS) + { + g_string_append (result, " @"); + g_string_append (result, desc->variations); + } + + return g_string_free (result, FALSE); +} + +/** + * pango_font_description_to_filename: + * @desc: a #PangoFontDescription + * + * Creates a filename representation of a font description. The + * filename is identical to the result from calling + * pango_font_description_to_string(), but with underscores instead of + * characters that are untypical in filenames, and in lower case only. + * + * Return value: a new string that must be freed with g_free(). + **/ +char * +pango_font_description_to_filename (const PangoFontDescription *desc) +{ + char *result; + char *p; + + g_return_val_if_fail (desc != NULL, NULL); + + result = pango_font_description_to_string (desc); + + p = result; + while (*p) + { + if (G_UNLIKELY ((guchar) *p >= 128)) + /* skip over non-ASCII chars */; + else if (strchr ("-+_.", *p) == NULL && !g_ascii_isalnum (*p)) + *p = '_'; + else + *p = g_ascii_tolower (*p); + p++; + } + + return result; +} + + +static gboolean +parse_field (const char *what, + const FieldMap *map, + int n_elements, + const char *str, + int *val, + gboolean warn) +{ + gboolean found; + int len = strlen (str); + + if (G_UNLIKELY (*str == '\0')) + return FALSE; + + if (field_matches ("Normal", str, len)) + { + /* find the map entry with empty string */ + int i; + + for (i = 0; i < n_elements; i++) + if (map[i].str[0] == '\0') + { + *val = map[i].value; + return TRUE; + } + + *val = 0; + return TRUE; + } + + found = find_field (NULL, map, n_elements, str, len, val); + + if (!found && warn) + { + int i; + GString *s = g_string_new (NULL); + + for (i = 0; i < n_elements; i++) + { + if (i) + g_string_append_c (s, '/'); + g_string_append (s, map[i].str[0] == '\0' ? "Normal" : map[i].str); + } + + g_warning ("%s must be one of %s or a number", + what, + s->str); + + g_string_free (s, TRUE); + } + + return found; +} + +#define FIELD(NAME, MASK) \ + parse_field (G_STRINGIFY (NAME), NAME##_map, G_N_ELEMENTS (NAME##_map), str, (int *)(void *)NAME, warn) + +/** + * pango_parse_style: + * @str: a string to parse. + * @style: (out caller-allocates): a #PangoStyle to store the result + * in. + * @warn: if %TRUE, issue a g_warning() on bad input. + * + * Parses a font style. The allowed values are "normal", + * "italic" and "oblique", case variations being + * ignored. + * + * Return value: %TRUE if @str was successfully parsed. + **/ +gboolean +pango_parse_style (const char *str, + PangoStyle *style, + gboolean warn) +{ + return FIELD (style, PANGO_FONT_MASK_STYLE); +} + +/** + * pango_parse_variant: + * @str: a string to parse. + * @variant: (out caller-allocates): a #PangoVariant to store the + * result in. + * @warn: if %TRUE, issue a g_warning() on bad input. + * + * Parses a font variant. The allowed values are "normal" + * and "smallcaps" or "small_caps", case variations being + * ignored. + * + * Return value: %TRUE if @str was successfully parsed. + **/ +gboolean +pango_parse_variant (const char *str, + PangoVariant *variant, + gboolean warn) +{ + return FIELD (variant, PANGO_FONT_MASK_VARIANT); +} + +/** + * pango_parse_weight: + * @str: a string to parse. + * @weight: (out caller-allocates): a #PangoWeight to store the result + * in. + * @warn: if %TRUE, issue a g_warning() on bad input. + * + * Parses a font weight. The allowed values are "heavy", + * "ultrabold", "bold", "normal", "light", "ultraleight" + * and integers. Case variations are ignored. + * + * Return value: %TRUE if @str was successfully parsed. + **/ +gboolean +pango_parse_weight (const char *str, + PangoWeight *weight, + gboolean warn) +{ + return FIELD (weight, PANGO_FONT_MASK_WEIGHT); +} + +/** + * pango_parse_stretch: + * @str: a string to parse. + * @stretch: (out caller-allocates): a #PangoStretch to store the + * result in. + * @warn: if %TRUE, issue a g_warning() on bad input. + * + * Parses a font stretch. The allowed values are + * "ultra_condensed", "extra_condensed", "condensed", + * "semi_condensed", "normal", "semi_expanded", "expanded", + * "extra_expanded" and "ultra_expanded". Case variations are + * ignored and the '_' characters may be omitted. + * + * Return value: %TRUE if @str was successfully parsed. + **/ +gboolean +pango_parse_stretch (const char *str, + PangoStretch *stretch, + gboolean warn) +{ + return FIELD (stretch, PANGO_FONT_MASK_STRETCH); +} + + + + +/* + * PangoFont + */ + +G_DEFINE_ABSTRACT_TYPE (PangoFont, pango_font, G_TYPE_OBJECT) + +static void +pango_font_class_init (PangoFontClass *class G_GNUC_UNUSED) +{ +} + +static void +pango_font_init (PangoFont *font G_GNUC_UNUSED) +{ +} + +/** + * pango_font_describe: + * @font: a #PangoFont + * + * Returns a description of the font, with font size set in points. + * Use pango_font_describe_with_absolute_size() if you want the font + * size in device units. + * + * Return value: a newly-allocated #PangoFontDescription object. + **/ +PangoFontDescription * +pango_font_describe (PangoFont *font) +{ + g_return_val_if_fail (font != NULL, NULL); + + return PANGO_FONT_GET_CLASS (font)->describe (font); +} + +/** + * pango_font_describe_with_absolute_size: + * @font: a #PangoFont + * + * Returns a description of the font, with absolute font size set + * (in device units). Use pango_font_describe() if you want the font + * size in points. + * + * Return value: a newly-allocated #PangoFontDescription object. + * + * Since: 1.14 + **/ +PangoFontDescription * +pango_font_describe_with_absolute_size (PangoFont *font) +{ + g_return_val_if_fail (font != NULL, NULL); + + if (G_UNLIKELY (!PANGO_FONT_GET_CLASS (font)->describe_absolute)) + { + g_warning ("describe_absolute not implemented for this font class, report this as a bug"); + return pango_font_describe (font); + } + + return PANGO_FONT_GET_CLASS (font)->describe_absolute (font); +} + +/** + * pango_font_get_coverage: + * @font: a #PangoFont + * @language: the language tag + * + * Computes the coverage map for a given font and language tag. + * + * Return value: (transfer full): a newly-allocated #PangoCoverage + * object. + **/ +PangoCoverage * +pango_font_get_coverage (PangoFont *font, + PangoLanguage *language) +{ + g_return_val_if_fail (font != NULL, NULL); + + return PANGO_FONT_GET_CLASS (font)->get_coverage (font, language); +} + +/** + * pango_font_find_shaper: + * @font: a #PangoFont + * @language: the language tag + * @ch: a Unicode character. + * + * Finds the best matching shaper for a font for a particular + * language tag and character point. + * + * Return value: (transfer none): the best matching shaper. + **/ +PangoEngineShape * +pango_font_find_shaper (PangoFont *font, + PangoLanguage *language, + guint32 ch) +{ + PangoEngineShape* shaper; + + if (G_UNLIKELY (!font)) + return NULL; + + shaper = PANGO_FONT_GET_CLASS (font)->find_shaper (font, language, ch); + + return shaper; +} + +/** + * pango_font_get_glyph_extents: + * @font: (nullable): a #PangoFont + * @glyph: the glyph index + * @ink_rect: (out) (allow-none): rectangle used to store the extents of the glyph + * as drawn or %NULL to indicate that the result is not needed. + * @logical_rect: (out) (allow-none): rectangle used to store the logical extents of + * the glyph or %NULL to indicate that the result is not needed. + * + * Gets the logical and ink extents of a glyph within a font. The + * coordinate system for each rectangle has its origin at the + * base line and horizontal origin of the character with increasing + * coordinates extending to the right and down. The macros PANGO_ASCENT(), + * PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING() can be used to convert + * from the extents rectangle to more traditional font metrics. The units + * of the rectangles are in 1/PANGO_SCALE of a device unit. + * + * If @font is %NULL, this function gracefully sets some sane values in the + * output variables and returns. + **/ +void +pango_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + if (G_UNLIKELY (!font)) + { + if (ink_rect) + { + ink_rect->x = PANGO_SCALE; + ink_rect->y = - (PANGO_UNKNOWN_GLYPH_HEIGHT - 1) * PANGO_SCALE; + ink_rect->height = (PANGO_UNKNOWN_GLYPH_HEIGHT - 2) * PANGO_SCALE; + ink_rect->width = (PANGO_UNKNOWN_GLYPH_WIDTH - 2) * PANGO_SCALE; + } + if (logical_rect) + { + logical_rect->x = logical_rect->y = 0; + logical_rect->y = - PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE; + logical_rect->height = PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE; + logical_rect->width = PANGO_UNKNOWN_GLYPH_WIDTH * PANGO_SCALE; + } + return; + } + + PANGO_FONT_GET_CLASS (font)->get_glyph_extents (font, glyph, ink_rect, logical_rect); +} + +/** + * pango_font_get_metrics: + * @font: (nullable): a #PangoFont + * @language: (allow-none): language tag used to determine which script to get the metrics + * for, or %NULL to indicate to get the metrics for the entire font. + * + * Gets overall metric information for a font. Since the metrics may be + * substantially different for different scripts, a language tag can + * be provided to indicate that the metrics should be retrieved that + * correspond to the script(s) used by that language. + * + * If @font is %NULL, this function gracefully sets some sane values in the + * output variables and returns. + * + * Return value: a #PangoFontMetrics object. The caller must call pango_font_metrics_unref() + * when finished using the object. + **/ +PangoFontMetrics * +pango_font_get_metrics (PangoFont *font, + PangoLanguage *language) +{ + if (G_UNLIKELY (!font)) + { + PangoFontMetrics *metrics = pango_font_metrics_new (); + + metrics->ascent = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_HEIGHT; + metrics->descent = 0; + metrics->approximate_char_width = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_WIDTH; + metrics->approximate_digit_width = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_WIDTH; + metrics->underline_position = -PANGO_SCALE; + metrics->underline_thickness = PANGO_SCALE; + metrics->strikethrough_position = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_HEIGHT / 2; + metrics->strikethrough_thickness = PANGO_SCALE; + + return metrics; + } + + return PANGO_FONT_GET_CLASS (font)->get_metrics (font, language); +} + +/** + * pango_font_get_font_map: + * @font: (nullable): a #PangoFont, or %NULL + * + * Gets the font map for which the font was created. + * + * Note that the font maintains a weak reference + * to the font map, so if all references to font map are dropped, the font + * map will be finalized even if there are fonts created with the font + * map that are still alive. In that case this function will return %NULL. + * It is the responsibility of the user to ensure that the font map is kept + * alive. In most uses this is not an issue as a #PangoContext holds + * a reference to the font map. + * + * Return value: (transfer none) (nullable): the #PangoFontMap for the + * font, or %NULL if @font is %NULL. + * + * Since: 1.10 + **/ +PangoFontMap * +pango_font_get_font_map (PangoFont *font) +{ + if (G_UNLIKELY (!font)) + return NULL; + + if (PANGO_FONT_GET_CLASS (font)->get_font_map) + return PANGO_FONT_GET_CLASS (font)->get_font_map (font); + else + return NULL; +} + +G_DEFINE_BOXED_TYPE (PangoFontMetrics, pango_font_metrics, + pango_font_metrics_ref, + pango_font_metrics_unref); + +/** + * pango_font_metrics_new: + * + * Creates a new #PangoFontMetrics structure. This is only for + * internal use by Pango backends and there is no public way + * to set the fields of the structure. + * + * Return value: a newly-created #PangoFontMetrics structure + * with a reference count of 1. + **/ +PangoFontMetrics * +pango_font_metrics_new (void) +{ + PangoFontMetrics *metrics = g_slice_new0 (PangoFontMetrics); + metrics->ref_count = 1; + + return metrics; +} + +/** + * pango_font_metrics_ref: + * @metrics: (nullable): a #PangoFontMetrics structure, may be %NULL + * + * Increase the reference count of a font metrics structure by one. + * + * Return value: (nullable): @metrics + **/ +PangoFontMetrics * +pango_font_metrics_ref (PangoFontMetrics *metrics) +{ + if (metrics == NULL) + return NULL; + + g_atomic_int_inc ((int *) &metrics->ref_count); + + return metrics; +} + +/** + * pango_font_metrics_unref: + * @metrics: (nullable): a #PangoFontMetrics structure, may be %NULL + * + * Decrease the reference count of a font metrics structure by one. If + * the result is zero, frees the structure and any associated + * memory. + **/ +void +pango_font_metrics_unref (PangoFontMetrics *metrics) +{ + if (metrics == NULL) + return; + + g_return_if_fail (metrics->ref_count > 0 ); + + if (g_atomic_int_dec_and_test ((int *) &metrics->ref_count)) + g_slice_free (PangoFontMetrics, metrics); +} + +/** + * pango_font_metrics_get_ascent: + * @metrics: a #PangoFontMetrics structure + * + * Gets the ascent from a font metrics structure. The ascent is + * the distance from the baseline to the logical top of a line + * of text. (The logical top may be above or below the top of the + * actual drawn ink. It is necessary to lay out the text to figure + * where the ink will be.) + * + * Return value: the ascent, in Pango units. + **/ +int +pango_font_metrics_get_ascent (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->ascent; +} + +/** + * pango_font_metrics_get_descent: + * @metrics: a #PangoFontMetrics structure + * + * Gets the descent from a font metrics structure. The descent is + * the distance from the baseline to the logical bottom of a line + * of text. (The logical bottom may be above or below the bottom of the + * actual drawn ink. It is necessary to lay out the text to figure + * where the ink will be.) + * + * Return value: the descent, in Pango units. + **/ +int +pango_font_metrics_get_descent (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->descent; +} + +/** + * pango_font_metrics_get_approximate_char_width: + * @metrics: a #PangoFontMetrics structure + * + * Gets the approximate character width for a font metrics structure. + * This is merely a representative value useful, for example, for + * determining the initial size for a window. Actual characters in + * text will be wider and narrower than this. + * + * Return value: the character width, in Pango units. + **/ +int +pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->approximate_char_width; +} + +/** + * pango_font_metrics_get_approximate_digit_width: + * @metrics: a #PangoFontMetrics structure + * + * Gets the approximate digit width for a font metrics structure. + * This is merely a representative value useful, for example, for + * determining the initial size for a window. Actual digits in + * text can be wider or narrower than this, though this value + * is generally somewhat more accurate than the result of + * pango_font_metrics_get_approximate_char_width() for digits. + * + * Return value: the digit width, in Pango units. + **/ +int +pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->approximate_digit_width; +} + +/** + * pango_font_metrics_get_underline_position: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested position to draw the underline. + * The value returned is the distance above the + * baseline of the top of the underline. Since most fonts have + * underline positions beneath the baseline, this value is typically + * negative. + * + * Return value: the suggested underline position, in Pango units. + * + * Since: 1.6 + **/ +int +pango_font_metrics_get_underline_position (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->underline_position; +} + +/** + * pango_font_metrics_get_underline_thickness: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested thickness to draw for the underline. + * + * Return value: the suggested underline thickness, in Pango units. + * + * Since: 1.6 + **/ +int +pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->underline_thickness; +} + +/** + * pango_font_metrics_get_strikethrough_position: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested position to draw the strikethrough. + * The value returned is the distance above the + * baseline of the top of the strikethrough. + * + * Return value: the suggested strikethrough position, in Pango units. + * + * Since: 1.6 + **/ +int +pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->strikethrough_position; +} + +/** + * pango_font_metrics_get_strikethrough_thickness: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested thickness to draw for the strikethrough. + * + * Return value: the suggested strikethrough thickness, in Pango units. + * + * Since: 1.6 + **/ +int +pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->strikethrough_thickness; +} + +/* + * PangoFontFamily + */ + +G_DEFINE_ABSTRACT_TYPE (PangoFontFamily, pango_font_family, G_TYPE_OBJECT) + +static void +pango_font_family_class_init (PangoFontFamilyClass *class G_GNUC_UNUSED) +{ +} + +static void +pango_font_family_init (PangoFontFamily *family G_GNUC_UNUSED) +{ +} + +/** + * pango_font_family_get_name: + * @family: a #PangoFontFamily + * + * Gets the name of the family. The name is unique among all + * fonts for the font backend and can be used in a #PangoFontDescription + * to specify that a face from this family is desired. + * + * Return value: the name of the family. This string is owned + * by the family object and must not be modified or freed. + **/ +const char * +pango_font_family_get_name (PangoFontFamily *family) +{ + g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), NULL); + + return PANGO_FONT_FAMILY_GET_CLASS (family)->get_name (family); +} + +/** + * pango_font_family_list_faces: + * @family: a #PangoFontFamily + * @faces: (out) (allow-none) (array length=n_faces) (transfer container): + * location to store an array of pointers to #PangoFontFace objects, + * or %NULL. This array should be freed with g_free() when it is no + * longer needed. + * @n_faces: (out): location to store number of elements in @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. + **/ +void +pango_font_family_list_faces (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces) +{ + g_return_if_fail (PANGO_IS_FONT_FAMILY (family)); + + PANGO_FONT_FAMILY_GET_CLASS (family)->list_faces (family, faces, n_faces); +} + +/** + * pango_font_family_is_monospace: + * @family: a #PangoFontFamily + * + * A monospace font is a font designed for text display where the the + * characters form a regular grid. For Western languages this would + * mean that the advance width of all characters are the same, but + * this categorization also includes Asian fonts which include + * double-width characters: characters that occupy two grid cells. + * g_unichar_iswide() returns a result that indicates whether a + * character is typically double-width in a monospace font. + * + * The best way to find out the grid-cell size is to call + * pango_font_metrics_get_approximate_digit_width(), since the results + * of pango_font_metrics_get_approximate_char_width() may be affected + * by double-width characters. + * + * Return value: %TRUE if the family is monospace. + * + * Since: 1.4 + **/ +gboolean +pango_font_family_is_monospace (PangoFontFamily *family) +{ + g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE); + + if (PANGO_FONT_FAMILY_GET_CLASS (family)->is_monospace) + return PANGO_FONT_FAMILY_GET_CLASS (family)->is_monospace (family); + else + return FALSE; +} + +/* + * PangoFontFace + */ + +G_DEFINE_ABSTRACT_TYPE (PangoFontFace, pango_font_face, G_TYPE_OBJECT) + +static void +pango_font_face_class_init (PangoFontFaceClass *class G_GNUC_UNUSED) +{ +} + +static void +pango_font_face_init (PangoFontFace *face G_GNUC_UNUSED) +{ +} + +/** + * pango_font_face_describe: + * @face: a #PangoFontFace + * + * Returns the family, style, variant, weight and stretch of + * a #PangoFontFace. The size field of the resulting font description + * will be unset. + * + * Return value: a newly-created #PangoFontDescription structure + * holding the description of the face. Use pango_font_description_free() + * to free the result. + **/ +PangoFontDescription * +pango_font_face_describe (PangoFontFace *face) +{ + g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL); + + return PANGO_FONT_FACE_GET_CLASS (face)->describe (face); +} + +/** + * pango_font_face_is_synthesized: + * @face: a #PangoFontFace + * + * Returns whether a #PangoFontFace is synthesized by the underlying + * font rendering engine from another face, perhaps by shearing, emboldening, + * or lightening it. + * + * Return value: whether @face is synthesized. + * + * Since: 1.18 + **/ +gboolean +pango_font_face_is_synthesized (PangoFontFace *face) +{ + g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE); + + if (PANGO_FONT_FACE_GET_CLASS (face)->is_synthesized != NULL) + return PANGO_FONT_FACE_GET_CLASS (face)->is_synthesized (face); + else + return FALSE; +} + +/** + * pango_font_face_get_face_name: + * @face: a #PangoFontFace. + * + * Gets a name representing the style of this face among the + * different faces in the #PangoFontFamily for the face. This + * name is unique among all faces in the family and is suitable + * for displaying to users. + * + * Return value: the face name for the face. This string is + * owned by the face object and must not be modified or freed. + **/ +const char * +pango_font_face_get_face_name (PangoFontFace *face) +{ + g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL); + + return PANGO_FONT_FACE_GET_CLASS (face)->get_face_name (face); +} + +/** + * pango_font_face_list_sizes: + * @face: a #PangoFontFace. + * @sizes: (out) (array length=n_sizes) (nullable) (optional): + * location to store a pointer to an array of int. This array + * should be freed with g_free(). + * @n_sizes: location to store the number of elements in @sizes + * + * List the available sizes for a font. This is only applicable to bitmap + * fonts. For scalable fonts, stores %NULL at the location pointed to by + * @sizes and 0 at the location pointed to by @n_sizes. The sizes returned + * are in Pango units and are sorted in ascending order. + * + * Since: 1.4 + **/ +void +pango_font_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes) +{ + g_return_if_fail (PANGO_IS_FONT_FACE (face)); + g_return_if_fail (sizes == NULL || n_sizes != NULL); + + if (n_sizes == NULL) + return; + + if (PANGO_FONT_FACE_GET_CLASS (face)->list_sizes != NULL) + PANGO_FONT_FACE_GET_CLASS (face)->list_sizes (face, sizes, n_sizes); + else + { + if (sizes != NULL) + *sizes = NULL; + *n_sizes = 0; + } +} diff --git a/pango/glyphstring.c b/pango/glyphstring.c new file mode 100644 index 0000000..007f8a3 --- /dev/null +++ b/pango/glyphstring.c @@ -0,0 +1,654 @@ +/* Pango + * glyphstring.c: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include "pango-glyph.h" +#include "pango-font.h" +#include "pango-impl-utils.h" + +/** + * pango_glyph_string_new: + * + * Create a new #PangoGlyphString. + * + * Return value: the newly allocated #PangoGlyphString, which + * should be freed with pango_glyph_string_free(). + */ +PangoGlyphString * +pango_glyph_string_new (void) +{ + PangoGlyphString *string = g_slice_new (PangoGlyphString); + + string->num_glyphs = 0; + string->space = 0; + string->glyphs = NULL; + string->log_clusters = NULL; + + return string; +} + +/** + * pango_glyph_string_set_size: + * @string: a #PangoGlyphString. + * @new_len: the new length of the string. + * + * Resize a glyph string to the given length. + */ +void +pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) +{ + g_return_if_fail (new_len >= 0); + + while (new_len > string->space) + { + if (string->space == 0) + { + string->space = 4; + } + else + { + const guint max_space = + MIN (G_MAXINT, G_MAXSIZE / MAX (sizeof(PangoGlyphInfo), sizeof(gint))); + + guint more_space = (guint)string->space * 2; + + if (more_space > max_space) + { + more_space = max_space; + + if ((guint)new_len > max_space) + { + g_error ("%s: failed to allocate glyph string of length %i\n", + G_STRLOC, new_len); + } + } + + string->space = more_space; + } + } + + string->glyphs = g_realloc (string->glyphs, string->space * sizeof (PangoGlyphInfo)); + string->log_clusters = g_realloc (string->log_clusters, string->space * sizeof (gint)); + string->num_glyphs = new_len; +} + +G_DEFINE_BOXED_TYPE (PangoGlyphString, pango_glyph_string, + pango_glyph_string_copy, + pango_glyph_string_free); + +/** + * pango_glyph_string_copy: + * @string: (nullable): a #PangoGlyphString, may be %NULL + * + * Copy a glyph string and associated storage. + * + * Return value: (nullable): the newly allocated #PangoGlyphString, + * which should be freed with pango_glyph_string_free(), + * or %NULL if @string was %NULL. + */ +PangoGlyphString * +pango_glyph_string_copy (PangoGlyphString *string) +{ + PangoGlyphString *new_string; + + if (string == NULL) + return NULL; + + new_string = g_slice_new (PangoGlyphString); + + *new_string = *string; + + new_string->glyphs = g_memdup (string->glyphs, + string->space * sizeof (PangoGlyphInfo)); + new_string->log_clusters = g_memdup (string->log_clusters, + string->space * sizeof (gint)); + + return new_string; +} + +/** + * pango_glyph_string_free: + * @string: (nullable): a #PangoGlyphString, may be %NULL + * + * Free a glyph string and associated storage. + */ +void +pango_glyph_string_free (PangoGlyphString *string) +{ + if (string == NULL) + return; + + g_free (string->glyphs); + g_free (string->log_clusters); + g_slice_free (PangoGlyphString, string); +} + +/** + * pango_glyph_string_extents_range: + * @glyphs: a #PangoGlyphString + * @start: start index + * @end: end index (the range is the set of bytes with + indices such that start <= index < end) + * @font: a #PangoFont + * @ink_rect: (out caller-allocates) (optional): rectangle used to + * store the extents of the glyph string range as drawn or + * %NULL to indicate that the result is not needed. + * @logical_rect: (out caller-allocates) (optional): rectangle used to + * store the logical extents of the glyph string range or + * %NULL to indicate that the result is not needed. + * + * Computes the extents of a sub-portion of a glyph string. The extents are + * relative to the start of the glyph string range (the origin of their + * coordinate system is at the start of the range, not at the start of the entire + * glyph string). + **/ +void +pango_glyph_string_extents_range (PangoGlyphString *glyphs, + int start, + int end, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + int x_pos = 0; + int i; + + /* Note that the handling of empty rectangles for ink + * and logical rectangles is different. A zero-height ink + * rectangle makes no contribution to the overall ink rect, + * while a zero-height logical rect still reserves horizontal + * width. Also, we may return zero-width, positive height + * logical rectangles, while we'll never do that for the + * ink rect. + */ + g_return_if_fail (start <= end); + + if (G_UNLIKELY (!ink_rect && !logical_rect)) + return; + + if (ink_rect) + { + ink_rect->x = 0; + ink_rect->y = 0; + ink_rect->width = 0; + ink_rect->height = 0; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = 0; + logical_rect->width = 0; + logical_rect->height = 0; + } + + for (i = start; i < end; i++) + { + PangoRectangle glyph_ink; + PangoRectangle glyph_logical; + + PangoGlyphGeometry *geometry = &glyphs->glyphs[i].geometry; + + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, + ink_rect ? &glyph_ink : NULL, + logical_rect ? &glyph_logical : NULL); + + if (ink_rect && glyph_ink.width != 0 && glyph_ink.height != 0) + { + if (ink_rect->width == 0 || ink_rect->height == 0) + { + ink_rect->x = x_pos + glyph_ink.x + geometry->x_offset; + ink_rect->width = glyph_ink.width; + ink_rect->y = glyph_ink.y + geometry->y_offset; + ink_rect->height = glyph_ink.height; + } + else + { + int new_x, new_y; + + new_x = MIN (ink_rect->x, x_pos + glyph_ink.x + geometry->x_offset); + ink_rect->width = MAX (ink_rect->x + ink_rect->width, + x_pos + glyph_ink.x + glyph_ink.width + geometry->x_offset) - new_x; + ink_rect->x = new_x; + + new_y = MIN (ink_rect->y, glyph_ink.y + geometry->y_offset); + ink_rect->height = MAX (ink_rect->y + ink_rect->height, + glyph_ink.y + glyph_ink.height + geometry->y_offset) - new_y; + ink_rect->y = new_y; + } + } + + if (logical_rect) + { + logical_rect->width += geometry->width; + + if (i == start) + { + logical_rect->y = glyph_logical.y; + logical_rect->height = glyph_logical.height; + } + else + { + int new_y = MIN (logical_rect->y, glyph_logical.y); + logical_rect->height = MAX (logical_rect->y + logical_rect->height, + glyph_logical.y + glyph_logical.height) - new_y; + logical_rect->y = new_y; + } + } + + x_pos += geometry->width; + } +} + +/** + * pango_glyph_string_extents: + * @glyphs: a #PangoGlyphString + * @font: a #PangoFont + * @ink_rect: (out) (allow-none): rectangle used to store the extents of the glyph string + * as drawn or %NULL to indicate that the result is not needed. + * @logical_rect: (out) (allow-none): rectangle used to store the logical extents of the + * glyph string or %NULL to indicate that the result is not needed. + * + * Compute the logical and ink extents of a glyph string. See the documentation + * for pango_font_get_glyph_extents() for details about the interpretation + * of the rectangles. + */ +void +pango_glyph_string_extents (PangoGlyphString *glyphs, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, + font, ink_rect, logical_rect); +} + +/** + * pango_glyph_string_get_width: + * @glyphs: a #PangoGlyphString + * + * Computes the logical width of the glyph string as can also be computed + * using pango_glyph_string_extents(). However, since this only computes the + * width, it's much faster. This is in fact only a convenience function that + * computes the sum of geometry.width for each glyph in the @glyphs. + * + * Return value: the logical width of the glyph string. + * + * Since: 1.14 + */ +int +pango_glyph_string_get_width (PangoGlyphString *glyphs) +{ + int i; + int width = 0; + + for (i = 0; i < glyphs->num_glyphs; i++) + width += glyphs->glyphs[i].geometry.width; + + return width; +} + +/** + * pango_glyph_string_get_logical_widths: + * @glyphs: a #PangoGlyphString + * @text: the text corresponding to the glyphs + * @length: the length of @text, in bytes + * @embedding_level: the embedding level of the string + * @logical_widths: (array): an array whose length is the number of + * characters in text (equal to g_utf8_strlen (text, + * length) unless text has NUL bytes) to be filled in + * with the resulting character widths. + * + * Given a #PangoGlyphString resulting from pango_shape() and the corresponding + * text, determine the screen width corresponding to each character. When + * multiple characters compose a single cluster, the width of the entire + * cluster is divided equally among the characters. + * + * See also pango_glyph_item_get_logical_widths(). + **/ +void +pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, + const char *text, + int length, + int embedding_level, + int *logical_widths) +{ + /* Build a PangoGlyphItem and call the other API */ + PangoItem item = {0, length, pango_utf8_strlen (text, length), + {NULL, NULL, NULL, + embedding_level, PANGO_GRAVITY_AUTO, 0, + PANGO_SCRIPT_UNKNOWN, NULL, + NULL}}; + PangoGlyphItem glyph_item = {&item, glyphs}; + + pango_glyph_item_get_logical_widths (&glyph_item, text, logical_widths); +} + +/* The initial implementation here is script independent, + * but it might actually need to be virtualized into the + * rendering modules. Otherwise, we probably will end up + * enforcing unnatural cursor behavior for some languages. + * + * The only distinction that Uniscript makes is whether + * cursor positioning is allowed within clusters or not. + */ + +/** + * pango_glyph_string_index_to_x: + * @glyphs: the glyphs return from pango_shape() + * @text: the text for the run + * @length: the number of bytes (not characters) in @text. + * @analysis: the analysis information return from pango_itemize() + * @index_: the byte index within @text + * @trailing: whether we should compute the result for the beginning (%FALSE) + * or end (%TRUE) of the character. + * @x_pos: (out): location to store result + * + * Converts from character position to x position. (X position + * is measured from the left edge of the run). Character positions + * are computed by dividing up each cluster into equal portions. + */ + +void +pango_glyph_string_index_to_x (PangoGlyphString *glyphs, + char *text, + int length, + PangoAnalysis *analysis, + int index, + gboolean trailing, + int *x_pos) +{ + int i; + int start_xpos = 0; + int end_xpos = 0; + int width = 0; + + int start_index = -1; + int end_index = -1; + + int cluster_chars = 0; + int cluster_offset = 0; + + char *p; + + g_return_if_fail (glyphs != NULL); + g_return_if_fail (length >= 0); + g_return_if_fail (length == 0 || text != NULL); + + if (!x_pos) /* Allow the user to do the useless */ + return; + + if (glyphs->num_glyphs == 0) + { + *x_pos = 0; + return; + } + + /* Calculate the starting and ending character positions + * and x positions for the cluster + */ + if (analysis->level % 2) /* Right to left */ + { + for (i = glyphs->num_glyphs - 1; i >= 0; i--) + width += glyphs->glyphs[i].geometry.width; + + for (i = glyphs->num_glyphs - 1; i >= 0; i--) + { + if (glyphs->log_clusters[i] > index) + { + end_index = glyphs->log_clusters[i]; + end_xpos = width; + break; + } + + if (glyphs->log_clusters[i] != start_index) + { + start_index = glyphs->log_clusters[i]; + start_xpos = width; + } + + width -= glyphs->glyphs[i].geometry.width; + } + } + else /* Left to right */ + { + for (i = 0; i < glyphs->num_glyphs; i++) + { + if (glyphs->log_clusters[i] > index) + { + end_index = glyphs->log_clusters[i]; + end_xpos = width; + break; + } + + if (glyphs->log_clusters[i] != start_index) + { + start_index = glyphs->log_clusters[i]; + start_xpos = width; + } + + width += glyphs->glyphs[i].geometry.width; + } + } + + if (end_index == -1) + { + end_index = length; + end_xpos = (analysis->level % 2) ? 0 : width; + } + + /* Calculate offset of character within cluster */ + + p = text + start_index; + while (p < text + end_index) + { + if (p < text + index) + cluster_offset++; + cluster_chars++; + p = g_utf8_next_char (p); + } + + if (trailing) + cluster_offset += 1; + + if (G_UNLIKELY (!cluster_chars)) /* pedantic */ + { + *x_pos = start_xpos; + return; + } + + *x_pos = ((cluster_chars - cluster_offset) * start_xpos + + cluster_offset * end_xpos) / cluster_chars; +} + +/** + * pango_glyph_string_x_to_index: + * @glyphs: the glyphs returned from pango_shape() + * @text: the text for the run + * @length: the number of bytes (not characters) in text. + * @analysis: the analysis information return from pango_itemize() + * @x_pos: the x offset (in Pango units) + * @index_: (out): location to store calculated byte index within @text + * @trailing: (out): location to store a boolean indicating + * whether the user clicked on the leading or trailing + * edge of the character. + * + * Convert from x offset to character position. Character positions + * are computed by dividing up each cluster into equal portions. + * In scripts where positioning within a cluster is not allowed + * (such as Thai), the returned value may not be a valid cursor + * position; the caller must combine the result with the logical + * attributes for the text to compute the valid cursor position. + */ +void +pango_glyph_string_x_to_index (PangoGlyphString *glyphs, + char *text, + int length, + PangoAnalysis *analysis, + int x_pos, + int *index, + gboolean *trailing) +{ + int i; + int start_xpos = 0; + int end_xpos = 0; + int width = 0; + + int start_index = -1; + int end_index = -1; + + int cluster_chars = 0; + char *p; + + gboolean found = FALSE; + + /* Find the cluster containing the position */ + + width = 0; + + if (analysis->level % 2) /* Right to left */ + { + for (i = glyphs->num_glyphs - 1; i >= 0; i--) + width += glyphs->glyphs[i].geometry.width; + + for (i = glyphs->num_glyphs - 1; i >= 0; i--) + { + if (glyphs->log_clusters[i] != start_index) + { + if (found) + { + end_index = glyphs->log_clusters[i]; + end_xpos = width; + break; + } + else + { + start_index = glyphs->log_clusters[i]; + start_xpos = width; + } + } + + width -= glyphs->glyphs[i].geometry.width; + + if (width <= x_pos && x_pos < width + glyphs->glyphs[i].geometry.width) + found = TRUE; + } + } + else /* Left to right */ + { + for (i = 0; i < glyphs->num_glyphs; i++) + { + if (glyphs->log_clusters[i] != start_index) + { + if (found) + { + end_index = glyphs->log_clusters[i]; + end_xpos = width; + break; + } + else + { + start_index = glyphs->log_clusters[i]; + start_xpos = width; + } + } + + if (width <= x_pos && x_pos < width + glyphs->glyphs[i].geometry.width) + found = TRUE; + + width += glyphs->glyphs[i].geometry.width; + } + } + + if (end_index == -1) + { + end_index = length; + end_xpos = (analysis->level % 2) ? 0 : width; + } + + /* Calculate number of chars within cluster */ + p = text + start_index; + while (p < text + end_index) + { + p = g_utf8_next_char (p); + cluster_chars++; + } + + if (start_xpos == end_xpos) + { + if (index) + *index = start_index; + if (trailing) + *trailing = FALSE; + } + else + { + double cp = ((double)(x_pos - start_xpos) * cluster_chars) / (end_xpos - start_xpos); + + /* LTR and right-to-left have to be handled separately + * here because of the edge condition when we are exactly + * at a pixel boundary; end_xpos goes with the next + * character for LTR, with the previous character for RTL. + */ + if (start_xpos < end_xpos) /* Left-to-right */ + { + if (index) + { + char *p = text + start_index; + int i = 0; + + while (i + 1 <= cp) + { + p = g_utf8_next_char (p); + i++; + } + + *index = (p - text); + } + + if (trailing) + *trailing = (cp - (int)cp >= 0.5) ? TRUE : FALSE; + } + else /* Right-to-left */ + { + if (index) + { + char *p = text + start_index; + int i = 0; + + while (i + 1 < cp) + { + p = g_utf8_next_char (p); + i++; + } + + *index = (p - text); + } + + if (trailing) + { + double cp_flip = cluster_chars - cp; + *trailing = (cp_flip - (int)cp_flip >= 0.5) ? FALSE : TRUE; + } + } + } +} diff --git a/pango/meson.build b/pango/meson.build new file mode 100644 index 0000000..c44853d --- /dev/null +++ b/pango/meson.build @@ -0,0 +1,452 @@ +pango_sources = [ + 'break.c', + 'ellipsize.c', + 'fonts.c', + 'glyphstring.c', + 'modules.c', + 'pango-attributes.c', + 'pango-bidi-type.c', + 'pango-color.c', + 'pango-context.c', + 'pango-coverage.c', + 'pango-emoji.c', + 'pango-engine.c', + 'pango-fontmap.c', + 'pango-fontset.c', + 'pango-glyph-item.c', + 'pango-gravity.c', + 'pango-item.c', + 'pango-language.c', + 'pango-layout.c', + 'pango-markup.c', + 'pango-matrix.c', + 'pango-renderer.c', + 'pango-script.c', + 'pango-tabs.c', + 'pango-utils.c', + 'reorder-items.c', + 'shape.c', +] + +pango_headers = [ + 'pango.h', + 'pango-attributes.h', + 'pango-bidi-type.h', + 'pango-break.h', + 'pango-context.h', + 'pango-coverage.h', + 'pango-engine.h', + 'pango-font.h', + 'pango-fontmap.h', + 'pango-fontset.h', + 'pango-glyph.h', + 'pango-glyph-item.h', + 'pango-gravity.h', + 'pango-item.h', + 'pango-language.h', + 'pango-layout.h', + 'pango-matrix.h', + 'pango-modules.h', + 'pango-renderer.h', + 'pango-script.h', + 'pango-tabs.h', + 'pango-types.h', + 'pango-utils.h', + 'pango-version-macros.h', +] + +install_headers(pango_headers, subdir: pango_api_path) + +# Features header +pango_features_conf = configuration_data() +pango_features_conf.set('PANGO_VERSION_MAJOR', pango_major_version) +pango_features_conf.set('PANGO_VERSION_MINOR', pango_minor_version) +pango_features_conf.set('PANGO_VERSION_MICRO', pango_micro_version) +pango_features_conf.set('PANGO_API_VERSION', pango_api_version) +pango_features_conf.set('PANGO_CURRENT_MINUS_AGE', '0') + +configure_file( + input: 'pango-features.h.meson', + output: 'pango-features.h', + configuration: pango_features_conf, + install: true, + install_dir: join_paths(pango_includedir, pango_api_path), +) + +# Enumerations for GType +pango_enums = gnome.mkenums( + 'pango-enum-types', + sources: pango_headers, + c_template: 'pango-enum-types.c.template', + h_template: 'pango-enum-types.h.template', + install_dir: join_paths(pango_includedir, pango_api_path), + install_header: true, +) +pango_enum_h = pango_enums[1] + +if host_system == 'windows' + pango_rc = configure_file( + input: 'pango.rc.in', + output: 'pango.rc', + configuration: pango_features_conf, + ) + pango_res = import('windows').compile_resources(pango_rc) + pango_sources += pango_res +endif + +pango_cflags = [ + '-DG_LOG_DOMAIN="Pango"', + '-DG_LOG_USE_STRUCTURED=1', + '-DPANGO_COMPILATION', + '-DPANGO_ENABLE_BACKEND', + '-DPANGO_ENABLE_ENGINE', + '-DSYSCONFDIR="@0@"'.format(pango_sysconfdir), + '-DLIBDIR="@0@"'.format(pango_libdir), +] + +pango_inc = include_directories('.') + +libpango = library( + 'pango-@0@'.format(pango_api_version), + sources: pango_sources + pango_enums, + version: pango_libversion, + soversion: pango_soversion, + install: true, + dependencies: [ gobject_dep, mathlib_dep, thai_dep, fribidi_dep ], + include_directories: [ root_inc, pango_inc ], + c_args: common_cflags + pango_debug_cflags + pango_cflags, + link_args: common_ldflags, +) + +pango_dep_sources = [pango_enum_h] + +build_gir = get_option('gir') + +if build_gir + gir_args = [ + '--quiet', + '-DPANGO_ENABLE_BACKEND', + '-DPANGO_ENABLE_ENGINE', + ] + + pango_gir = gnome.generate_gir( + libpango, + sources: pango_sources + pango_headers + [ pango_enum_h ], + namespace: 'Pango', + nsversion: pango_api_version, + identifier_prefix: 'Pango', + symbol_prefix: 'pango', + export_packages: 'pango', + includes: [ 'GObject-2.0', 'cairo-1.0', ], + header: 'pango/pango.h', + install: true, + extra_args: gir_args, + ) + pango_gir_dep = declare_dependency(sources: pango_gir) + pango_dep_sources += pango_gir +endif + +libpango_dep = declare_dependency( + link_with: libpango, + include_directories: pango_inc, + dependencies: pango_deps, + sources: pango_dep_sources, +) + +# FreeType +if build_pangoft2 + pangoft2_headers = [ + 'pango-ot.h', + 'pangofc-font.h', + 'pangofc-fontmap.h', + 'pangofc-decoder.h', + 'pangoft2.h', + ] + + pangoft2_public_sources = [ + 'pangofc-font.c', + 'pangofc-fontmap.c', + 'pangofc-decoder.c', + 'pangofc-shape.c', + 'pangoft2.c', + ] + + pangoft2_sources = pangoft2_public_sources + [ + 'pangoft2-fontmap.c', + 'pangoft2-render.c', + 'pango-ot-buffer.c', + 'pango-ot-info.c', + 'pango-ot-ruleset.c', + 'pango-ot-tag.c', + ] + + if host_system == 'windows' + pangoft2_rc = configure_file( + input: 'pangoft2.rc.in', + output: 'pangoft2.rc', + configuration: pango_features_conf, + ) + pangoft2_res = import('windows').compile_resources(pangoft2_rc) + pangoft2_sources += pangoft2_res + endif + + install_headers(pangoft2_headers, subdir: pango_api_path) + + libpangoft2 = library( + 'pangoft2-@0@'.format(pango_api_version), + sources: pangoft2_sources, + version: pango_libversion, + soversion: pango_soversion, + install: true, + dependencies: pango_deps + [ libpango_dep ], + include_directories: [ root_inc, pango_inc ], + c_args: common_cflags + pango_debug_cflags + pango_cflags + [ + '-DPANGO_DISABLE_DEPRECATION_WARNINGS', + ], + link_args: common_ldflags, + ) + + pangoft2_dep_sources = [] + + if build_gir + pangoft2_gir = gnome.generate_gir( + libpangoft2, + sources: pangoft2_headers + pangoft2_public_sources, + dependencies: [ libpango_dep, pango_gir_dep ], + namespace: 'PangoFT2', + nsversion: pango_api_version, + identifier_prefix: 'PangoFT2', + symbol_prefix: 'pango_ft2', + export_packages: 'pangoft2', + includes: [ pango_gir[0], 'GObject-2.0', 'cairo-1.0', 'freetype2-2.0', 'fontconfig-2.0', ], + header: 'pango/pangoft2.h', + install: true, + extra_args: gir_args, + ) + pangoft2_gir_dep = declare_dependency(sources: pangoft2_gir) + pangoft2_dep_sources += pangoft2_gir + endif + + libpangoft2_dep = declare_dependency( + link_with: libpangoft2, + include_directories: pango_inc, + dependencies: pango_deps + [ libpango_dep ], + sources: pangoft2_dep_sources, + ) +else + # For usage as a subproject + libpangoft2_dep = dependency('', required : false) +endif + +# Xft +if xft_dep.found() + pangoxft_headers = [ + 'pangoxft.h', + 'pangoxft-render.h', + ] + + pangoxft_sources = [ + 'pangoxft-font.c', + 'pangoxft-fontmap.c', + 'pangoxft-render.c', + ] + + install_headers(pangoxft_headers, subdir: pango_api_path) + + libpangoxft = library( + 'pangoxft-@0@'.format(pango_api_version), + sources: pangoxft_sources, + version: pango_libversion, + soversion: pango_soversion, + install: true, + dependencies: pango_deps + [ libpango_dep, libpangoft2_dep ], + include_directories: [ root_inc, pango_inc ], + c_args: common_cflags + pango_debug_cflags + pango_cflags + [ + '-DPANGO_DISABLE_DEPRECATION_WARNINGS', + ], + link_args: common_ldflags, + ) + pangoxft_dep_sources = [] + + if build_gir + pangoxft_gir = gnome.generate_gir( + libpangoxft, + sources: pangoxft_headers + pangoxft_sources, + dependencies: [ libpango_dep, libpangoft2_dep, pango_gir_dep, pangoft2_gir_dep ], + namespace: 'PangoXft', + nsversion: pango_api_version, + identifier_prefix: 'PangoXft', + symbol_prefix: 'pango_xft', + export_packages: 'pangoxft', + includes: [ pango_gir[0], pangoft2_gir[0], 'GObject-2.0', 'xft-2.0', 'xlib-2.0' ], + header: 'pango/pangoxft.h', + install: true, + extra_args: gir_args, + ) + pangoxft_dep_sources += pangoxft_gir + endif + + libpangoxft_dep = declare_dependency( + link_with: libpangoxft, + include_directories: root_inc, + dependencies: pango_deps + [ libpango_dep, libpangoft2_dep ], + sources: pangoxft_dep_sources, + ) +else + # For usage as a subproject + libpangoxft_dep = dependency('', required: false) +endif + +# Win32 +if host_system == 'windows' + pangowin32_headers = [ + 'pangowin32.h', + ] + + pangowin32_sources = [ + 'pangowin32.c', + 'pangowin32-fontcache.c', + 'pangowin32-fontmap.c', + 'pangowin32-shape.c', + ] + + # usp10 needs to be before gdi32 + # see https://bugzilla.gnome.org/show_bug.cgi?id=795045#c0 + pangowin32_deps = pango_deps + [ + libpango_dep, + cc.find_library('usp10'), + cc.find_library('gdi32'), + ] + + pangowin32_rc = configure_file( + input: 'pangowin32.rc.in', + output: 'pangowin32.rc', + configuration: pango_features_conf, + ) + pangowin32_res = import('windows').compile_resources(pangowin32_rc) + pangowin32_sources += pangowin32_res + + install_headers(pangowin32_headers, subdir: pango_api_path) + + libpangowin32 = library( + 'pangowin32-@0@'.format(pango_api_version), + sources: pangowin32_sources, + version: pango_libversion, + soversion: pango_soversion, + install: true, + dependencies: pangowin32_deps, + include_directories: [ root_inc, pango_inc ], + c_args: common_cflags + pango_debug_cflags + pango_cflags + [ + '-DPANGO_DISABLE_DEPRECATION_WARNINGS', + ], + link_args: common_ldflags, + ) + + libpangowin32_dep = declare_dependency( + link_with: libpangowin32, + include_directories: root_inc, + dependencies: pango_deps + [ libpango_dep ], + ) +else + # For usage as a subproject + libpangowin32_dep = dependency('', required: false) +endif + +# Cairo +if cairo_dep.found() + pangocairo_headers = [ + 'pangocairo.h', + ] + + pangocairo_sources = [ + 'pangocairo-context.c', + 'pangocairo-font.c', + 'pangocairo-fontmap.c', + 'pangocairo-render.c', + ] + + pangocairo_deps = pango_deps + [ libpango_dep ] + + if pango_font_backends.contains('freetype') + pangocairo_sources += [ + 'pangocairo-fcfont.c', + 'pangocairo-fcfontmap.c', + ] + + pangocairo_deps += libpangoft2_dep + endif + + if host_system == 'windows' and pango_font_backends.contains('win32') + pangocairo_sources += [ + 'pangocairo-win32font.c', + 'pangocairo-win32fontmap.c', + ] + + pangocairo_rc = configure_file( + input: 'pangocairo.rc.in', + output: 'pangocairo.rc', + configuration: pango_features_conf, + ) + pangocairo_res = import('windows').compile_resources(pangocairo_rc) + pangocairo_sources += pangocairo_res + + pangocairo_deps += cc.find_library('gdi32') + pangocairo_deps += libpangowin32_dep + endif + + if host_system == 'darwin' and pango_font_backends.contains('quartz') + pangocairo_sources += [ + 'pangocoretext.c', + 'pangocoretext-fontmap.c', + 'pangocoretext-shape.c', + 'pangocairo-coretextfont.c', + 'pangocairo-coretextfontmap.c', + ] + pangocairo_deps += dependency('appleframeworks', modules: [ 'CoreFoundation', 'ApplicationServices' ]) + endif + + install_headers(pangocairo_headers, subdir: pango_api_path) + + libpangocairo = library( + 'pangocairo-@0@'.format(pango_api_version), + sources: pangocairo_sources, + version: pango_libversion, + soversion: pango_soversion, + install: true, + dependencies: pango_deps + pangocairo_deps, + include_directories: [ root_inc, pango_inc ], + c_args: common_cflags + pango_debug_cflags + pango_cflags + [ + '-DPANGO_DISABLE_DEPRECATION_WARNINGS', + ], + link_args: common_ldflags + ) + pangocairo_dep_sources = [] + + if build_gir + pangocairo_gir = gnome.generate_gir( + libpangocairo, + sources: pangocairo_headers + pangocairo_sources, + dependencies: [ pangocairo_deps, pango_gir_dep ], + namespace: 'PangoCairo', + nsversion: pango_api_version, + identifier_prefix: 'PangoCairo', + symbol_prefix: 'pango_cairo', + export_packages: 'pangocairo', + includes: [ pango_gir[0], 'GObject-2.0', 'cairo-1.0' ], + header: 'pango/pangocairo.h', + install: true, + extra_args: gir_args, + ) + pangocairo_dep_sources += pangocairo_gir + endif + + libpangocairo_dep = declare_dependency( + link_with: libpangocairo, + include_directories: root_inc, + dependencies: pango_deps + [ libpango_dep ], + sources: pangocairo_dep_sources, + ) +else + # For usage as a subproject + libpangocairo_dep = dependency('', required: false) +endif diff --git a/pango/modules.c b/pango/modules.c new file mode 100644 index 0000000..35ab2a3 --- /dev/null +++ b/pango/modules.c @@ -0,0 +1,109 @@ +/* Pango + * modules.c: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:modules + * @short_description:Support for loadable modules + * @title:Modules + * + * Functions and macros in this section are used to support loading dynamic + * modules that add engines to Pango at run time. + */ +#include "config.h" + +#include "pango-modules.h" + +/** + * pango_find_map: + * @language: the language tag for which to find the map + * @engine_type_id: the engine type for the map to find + * @render_type_id: the render type for the map to find + * + * Do not use. Does not do anything. + * + * Return value: %NULL. + * + * Deprecated: 1.38 + **/ +PangoMap * +pango_find_map (PangoLanguage *language G_GNUC_UNUSED, + guint engine_type_id G_GNUC_UNUSED, + guint render_type_id G_GNUC_UNUSED) +{ + return NULL; +} + +/** + * pango_map_get_engine: (skip) + * @map: a #PangoMap + * @script: a #PangoScript + * + * Do not use. Does not do anything. + * + * Return value: %NULL. + * + * Deprecated: 1.38 + **/ +PangoEngine * +pango_map_get_engine (PangoMap *map G_GNUC_UNUSED, + PangoScript script G_GNUC_UNUSED) +{ + return NULL; +} + +/** + * pango_map_get_engines: (skip) + * @map: a #PangoMap + * @script: a #PangoScript + * @exact_engines: location to store list of engines that exactly + * handle this script. + * @fallback_engines: location to store list of engines that approximately + * handle this script. + * + * Do not use. Does not do anything. + * + * Since: 1.4 + * Deprecated: 1.38 + **/ +void +pango_map_get_engines (PangoMap *map G_GNUC_UNUSED, + PangoScript script G_GNUC_UNUSED, + GSList **exact_engines, + GSList **fallback_engines) +{ + if (exact_engines) + *exact_engines = NULL; + if (fallback_engines) + *fallback_engines = NULL; +} + +/** + * pango_module_register: + * @module: a #PangoIncludedModule + * + * Do not use. Does not do anything. + * + * Deprecated: 1.38 + **/ +void +pango_module_register (PangoIncludedModule *module G_GNUC_UNUSED) +{ +} diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c new file mode 100644 index 0000000..df3104f --- /dev/null +++ b/pango/pango-attributes.c @@ -0,0 +1,2143 @@ +/* Pango + * pango-attributes.c: Attributed text + * + * Copyright (C) 2000-2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:text-attributes + * @short_description:Font and other attributes for annotating text + * @title:Text Attributes + * + * Attributed text is used in a number of places in Pango. It + * is used as the input to the itemization process and also when + * creating a #PangoLayout. The data types and functions in + * this section are used to represent and manipulate sets + * of attributes applied to a portion of text. + */ +#include "config.h" +#include + +#include "pango-attributes.h" +#include "pango-impl-utils.h" + +struct _PangoAttrList +{ + guint ref_count; + GSList *attributes; + GSList *attributes_tail; +}; + +struct _PangoAttrIterator +{ + GSList *next_attribute; + GList *attribute_stack; + guint start_index; + guint end_index; +}; + +static PangoAttribute *pango_attr_color_new (const PangoAttrClass *klass, + guint16 red, + guint16 green, + guint16 blue); +static PangoAttribute *pango_attr_string_new (const PangoAttrClass *klass, + const char *str); +static PangoAttribute *pango_attr_int_new (const PangoAttrClass *klass, + int value); +static PangoAttribute *pango_attr_float_new (const PangoAttrClass *klass, + double value); +static PangoAttribute *pango_attr_size_new_internal (int size, + gboolean absolute); + + +G_LOCK_DEFINE_STATIC (attr_type); +static GHashTable *name_map = NULL; /* MT-safe */ + +/** + * pango_attr_type_register: + * @name: an identifier for the type + * + * Allocate a new attribute type ID. The attribute type name can be accessed + * later by using pango_attr_type_get_name(). + * + * Return value: the new type ID. + **/ +PangoAttrType +pango_attr_type_register (const gchar *name) +{ + static guint current_type = 0x1000000; /* MT-safe */ + guint type; + + G_LOCK (attr_type); + + type = current_type++; + + if (name) + { + if (G_UNLIKELY (!name_map)) + name_map = g_hash_table_new (NULL, NULL); + + g_hash_table_insert (name_map, GUINT_TO_POINTER (type), (gpointer) g_intern_string (name)); + } + + G_UNLOCK (attr_type); + + return type; +} + +/** + * pango_attr_type_get_name: + * @type: an attribute type ID to fetch the name for + * + * Fetches the attribute type name passed in when registering the type using + * pango_attr_type_register(). + * + * The returned value is an interned string (see g_intern_string() for what + * that means) that should not be modified or freed. + * + * Return value: (nullable): the type ID name (which may be %NULL), or + * %NULL if @type is a built-in Pango attribute type or invalid. + * + * Since: 1.22 + **/ +const char * +pango_attr_type_get_name (PangoAttrType type) +{ + const char *result = NULL; + + G_LOCK (attr_type); + + if (name_map) + result = g_hash_table_lookup (name_map, GUINT_TO_POINTER ((guint) type)); + + G_UNLOCK (attr_type); + + return result; +} + +/** + * pango_attribute_init: + * @attr: a #PangoAttribute + * @klass: a #PangoAttrClass + * + * Initializes @attr's klass to @klass, + * it's start_index to %PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING + * and end_index to %PANGO_ATTR_INDEX_TO_TEXT_END + * such that the attribute applies + * to the entire text by default. + * + * Since: 1.20 + **/ +void +pango_attribute_init (PangoAttribute *attr, + const PangoAttrClass *klass) +{ + g_return_if_fail (attr != NULL); + g_return_if_fail (klass != NULL); + + attr->klass = klass; + attr->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING; + attr->end_index = PANGO_ATTR_INDEX_TO_TEXT_END; +} + +/** + * pango_attribute_copy: + * @attr: a #PangoAttribute + * + * Make a copy of an attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attribute_copy (const PangoAttribute *attr) +{ + PangoAttribute *result; + + g_return_val_if_fail (attr != NULL, NULL); + + result = attr->klass->copy (attr); + result->start_index = attr->start_index; + result->end_index = attr->end_index; + + return result; +} + +/** + * pango_attribute_destroy: + * @attr: a #PangoAttribute. + * + * Destroy a #PangoAttribute and free all associated memory. + **/ +void +pango_attribute_destroy (PangoAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + attr->klass->destroy (attr); +} + +/** + * pango_attribute_equal: + * @attr1: a #PangoAttribute + * @attr2: another #PangoAttribute + * + * Compare two attributes for equality. This compares only the + * actual value of the two attributes and not the ranges that the + * attributes apply to. + * + * Return value: %TRUE if the two attributes have the same value. + **/ +gboolean +pango_attribute_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + g_return_val_if_fail (attr1 != NULL, FALSE); + g_return_val_if_fail (attr2 != NULL, FALSE); + + if (attr1->klass->type != attr2->klass->type) + return FALSE; + + return attr1->klass->equal (attr1, attr2); +} + +static PangoAttribute * +pango_attr_string_copy (const PangoAttribute *attr) +{ + return pango_attr_string_new (attr->klass, ((PangoAttrString *)attr)->value); +} + +static void +pango_attr_string_destroy (PangoAttribute *attr) +{ + PangoAttrString *sattr = (PangoAttrString *)attr; + + g_free (sattr->value); + g_slice_free (PangoAttrString, sattr); +} + +static gboolean +pango_attr_string_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + return strcmp (((PangoAttrString *)attr1)->value, ((PangoAttrString *)attr2)->value) == 0; +} + +static PangoAttribute * +pango_attr_string_new (const PangoAttrClass *klass, + const char *str) +{ + PangoAttrString *result = g_slice_new (PangoAttrString); + pango_attribute_init (&result->attr, klass); + result->value = g_strdup (str); + + return (PangoAttribute *)result; +} + +/** + * pango_attr_family_new: + * @family: the family or comma separated list of families + * + * Create a new font family attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_family_new (const char *family) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FAMILY, + pango_attr_string_copy, + pango_attr_string_destroy, + pango_attr_string_equal + }; + + g_return_val_if_fail (family != NULL, NULL); + + return pango_attr_string_new (&klass, family); +} + +static PangoAttribute * +pango_attr_language_copy (const PangoAttribute *attr) +{ + return pango_attr_language_new (((PangoAttrLanguage *)attr)->value); +} + +static void +pango_attr_language_destroy (PangoAttribute *attr) +{ + PangoAttrLanguage *lattr = (PangoAttrLanguage *)attr; + + g_slice_free (PangoAttrLanguage, lattr); +} + +static gboolean +pango_attr_language_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + return ((PangoAttrLanguage *)attr1)->value == ((PangoAttrLanguage *)attr2)->value; +} + +/** + * pango_attr_language_new: + * @language: language tag + * + * Create a new language tag attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_language_new (PangoLanguage *language) +{ + PangoAttrLanguage *result; + + static const PangoAttrClass klass = { + PANGO_ATTR_LANGUAGE, + pango_attr_language_copy, + pango_attr_language_destroy, + pango_attr_language_equal + }; + + result = g_slice_new (PangoAttrLanguage); + pango_attribute_init (&result->attr, &klass); + result->value = language; + + return (PangoAttribute *)result; +} + +static PangoAttribute * +pango_attr_color_copy (const PangoAttribute *attr) +{ + const PangoAttrColor *color_attr = (PangoAttrColor *)attr; + + return pango_attr_color_new (attr->klass, + color_attr->color.red, + color_attr->color.green, + color_attr->color.blue); +} + +static void +pango_attr_color_destroy (PangoAttribute *attr) +{ + PangoAttrColor *cattr = (PangoAttrColor *)attr; + + g_slice_free (PangoAttrColor, cattr); +} + +static gboolean +pango_attr_color_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrColor *color_attr1 = (const PangoAttrColor *)attr1; + const PangoAttrColor *color_attr2 = (const PangoAttrColor *)attr2; + + return (color_attr1->color.red == color_attr2->color.red && + color_attr1->color.blue == color_attr2->color.blue && + color_attr1->color.green == color_attr2->color.green); +} + +static PangoAttribute * +pango_attr_color_new (const PangoAttrClass *klass, + guint16 red, + guint16 green, + guint16 blue) +{ + PangoAttrColor *result = g_slice_new (PangoAttrColor); + pango_attribute_init (&result->attr, klass); + result->color.red = red; + result->color.green = green; + result->color.blue = blue; + + return (PangoAttribute *)result; +} + +/** + * pango_attr_foreground_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new foreground color attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_foreground_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FOREGROUND, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +/** + * pango_attr_background_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new background color attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_background_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_BACKGROUND, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +static PangoAttribute * +pango_attr_int_copy (const PangoAttribute *attr) +{ + const PangoAttrInt *int_attr = (PangoAttrInt *)attr; + + return pango_attr_int_new (attr->klass, int_attr->value); +} + +static void +pango_attr_int_destroy (PangoAttribute *attr) +{ + PangoAttrInt *iattr = (PangoAttrInt *)attr; + + g_slice_free (PangoAttrInt, iattr); +} + +static gboolean +pango_attr_int_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrInt *int_attr1 = (const PangoAttrInt *)attr1; + const PangoAttrInt *int_attr2 = (const PangoAttrInt *)attr2; + + return (int_attr1->value == int_attr2->value); +} + +static PangoAttribute * +pango_attr_int_new (const PangoAttrClass *klass, + int value) +{ + PangoAttrInt *result = g_slice_new (PangoAttrInt); + pango_attribute_init (&result->attr, klass); + result->value = value; + + return (PangoAttribute *)result; +} + +static PangoAttribute * +pango_attr_float_copy (const PangoAttribute *attr) +{ + const PangoAttrFloat *float_attr = (PangoAttrFloat *)attr; + + return pango_attr_float_new (attr->klass, float_attr->value); +} + +static void +pango_attr_float_destroy (PangoAttribute *attr) +{ + PangoAttrFloat *fattr = (PangoAttrFloat *)attr; + + g_slice_free (PangoAttrFloat, fattr); +} + +static gboolean +pango_attr_float_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrFloat *float_attr1 = (const PangoAttrFloat *)attr1; + const PangoAttrFloat *float_attr2 = (const PangoAttrFloat *)attr2; + + return (float_attr1->value == float_attr2->value); +} + +static PangoAttribute* +pango_attr_float_new (const PangoAttrClass *klass, + double value) +{ + PangoAttrFloat *result = g_slice_new (PangoAttrFloat); + pango_attribute_init (&result->attr, klass); + result->value = value; + + return (PangoAttribute *)result; +} + +static PangoAttribute * +pango_attr_size_copy (const PangoAttribute *attr) +{ + const PangoAttrSize *size_attr = (PangoAttrSize *)attr; + + if (attr->klass->type == PANGO_ATTR_ABSOLUTE_SIZE) + return pango_attr_size_new_absolute (size_attr->size); + else + return pango_attr_size_new (size_attr->size); +} + +static void +pango_attr_size_destroy (PangoAttribute *attr) +{ + PangoAttrSize *sattr = (PangoAttrSize *)attr; + + g_slice_free (PangoAttrSize, sattr); +} + +static gboolean +pango_attr_size_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrSize *size_attr1 = (const PangoAttrSize *)attr1; + const PangoAttrSize *size_attr2 = (const PangoAttrSize *)attr2; + + return size_attr1->size == size_attr2->size; +} + +static PangoAttribute * +pango_attr_size_new_internal (int size, + gboolean absolute) +{ + PangoAttrSize *result; + + static const PangoAttrClass klass = { + PANGO_ATTR_SIZE, + pango_attr_size_copy, + pango_attr_size_destroy, + pango_attr_size_equal + }; + static const PangoAttrClass absolute_klass = { + PANGO_ATTR_ABSOLUTE_SIZE, + pango_attr_size_copy, + pango_attr_size_destroy, + pango_attr_size_equal + }; + + result = g_slice_new (PangoAttrSize); + pango_attribute_init (&result->attr, absolute ? &absolute_klass : &klass); + result->size = size; + result->absolute = absolute; + + return (PangoAttribute *)result; +} + +/** + * pango_attr_size_new: + * @size: the font size, in %PANGO_SCALEths of a point. + * + * Create a new font-size attribute in fractional points. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_size_new (int size) +{ + return pango_attr_size_new_internal (size, FALSE); +} + +/** + * pango_attr_size_new_absolute: + * @size: the font size, in %PANGO_SCALEths of a device unit. + * + * Create a new font-size attribute in device units. + * + * Return value: the newly allocated #PangoAttribute, which should be + * freed with pango_attribute_destroy(). + * + * Since: 1.8 + **/ +PangoAttribute * +pango_attr_size_new_absolute (int size) +{ + return pango_attr_size_new_internal (size, TRUE); +} + +/** + * pango_attr_style_new: + * @style: the slant style + * + * Create a new font slant style attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_style_new (PangoStyle style) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_STYLE, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)style); +} + +/** + * pango_attr_weight_new: + * @weight: the weight + * + * Create a new font weight attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_weight_new (PangoWeight weight) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_WEIGHT, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)weight); +} + +/** + * pango_attr_variant_new: + * @variant: the variant + * + * Create a new font variant attribute (normal or small caps) + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_variant_new (PangoVariant variant) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_VARIANT, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)variant); +} + +/** + * pango_attr_stretch_new: + * @stretch: the stretch + * + * Create a new font stretch attribute + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_stretch_new (PangoStretch stretch) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_STRETCH, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)stretch); +} + +static PangoAttribute * +pango_attr_font_desc_copy (const PangoAttribute *attr) +{ + const PangoAttrFontDesc *desc_attr = (const PangoAttrFontDesc *)attr; + + return pango_attr_font_desc_new (desc_attr->desc); +} + +static void +pango_attr_font_desc_destroy (PangoAttribute *attr) +{ + PangoAttrFontDesc *desc_attr = (PangoAttrFontDesc *)attr; + + pango_font_description_free (desc_attr->desc); + g_slice_free (PangoAttrFontDesc, desc_attr); +} + +static gboolean +pango_attr_font_desc_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrFontDesc *desc_attr1 = (const PangoAttrFontDesc *)attr1; + const PangoAttrFontDesc *desc_attr2 = (const PangoAttrFontDesc *)attr2; + + return pango_font_description_get_set_fields (desc_attr1->desc) == + pango_font_description_get_set_fields (desc_attr2->desc) && + pango_font_description_equal (desc_attr1->desc, desc_attr2->desc); +} + +/** + * pango_attr_font_desc_new: + * @desc: the font description + * + * Create a new font description attribute. This attribute + * allows setting family, style, weight, variant, stretch, + * and size simultaneously. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_font_desc_new (const PangoFontDescription *desc) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FONT_DESC, + pango_attr_font_desc_copy, + pango_attr_font_desc_destroy, + pango_attr_font_desc_equal + }; + + PangoAttrFontDesc *result = g_slice_new (PangoAttrFontDesc); + pango_attribute_init (&result->attr, &klass); + result->desc = pango_font_description_copy (desc); + + return (PangoAttribute *)result; +} + + +/** + * pango_attr_underline_new: + * @underline: the underline style. + * + * Create a new underline-style attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_underline_new (PangoUnderline underline) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_UNDERLINE, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)underline); +} + +/** + * pango_attr_underline_color_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new underline color attribute. This attribute + * modifies the color of underlines. If not set, underlines + * will use the foreground color. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.8 + **/ +PangoAttribute * +pango_attr_underline_color_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_UNDERLINE_COLOR, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +/** + * pango_attr_strikethrough_new: + * @strikethrough: %TRUE if the text should be struck-through. + * + * Create a new strike-through attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_strikethrough_new (gboolean strikethrough) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_STRIKETHROUGH, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)strikethrough); +} + +/** + * pango_attr_strikethrough_color_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new strikethrough color attribute. This attribute + * modifies the color of strikethrough lines. If not set, strikethrough + * lines will use the foreground color. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.8 + **/ +PangoAttribute * +pango_attr_strikethrough_color_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_STRIKETHROUGH_COLOR, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +/** + * pango_attr_rise_new: + * @rise: the amount that the text should be displaced vertically, + * in Pango units. Positive values displace the text upwards. + * + * Create a new baseline displacement attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_rise_new (int rise) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_RISE, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)rise); +} + +/** + * pango_attr_scale_new: + * @scale_factor: factor to scale the font + * + * Create a new font size scale attribute. The base font for the + * affected text will have its size multiplied by @scale_factor. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute* +pango_attr_scale_new (double scale_factor) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_SCALE, + pango_attr_float_copy, + pango_attr_float_destroy, + pango_attr_float_equal + }; + + return pango_attr_float_new (&klass, scale_factor); +} + +/** + * pango_attr_fallback_new: + * @enable_fallback: %TRUE if we should fall back on other fonts + * for characters the active font is missing. + * + * Create a new font fallback attribute. + * + * If fallback is disabled, characters will only be used from the + * closest matching font on the system. No fallback will be done to + * other fonts on the system that might contain the characters in the + * text. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.4 + **/ +PangoAttribute * +pango_attr_fallback_new (gboolean enable_fallback) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FALLBACK, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal, + }; + + return pango_attr_int_new (&klass, (int)enable_fallback); +} + +/** + * pango_attr_letter_spacing_new: + * @letter_spacing: amount of extra space to add between graphemes + * of the text, in Pango units. + * + * Create a new letter-spacing attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.6 + **/ +PangoAttribute * +pango_attr_letter_spacing_new (int letter_spacing) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_LETTER_SPACING, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, letter_spacing); +} + +static PangoAttribute * +pango_attr_shape_copy (const PangoAttribute *attr) +{ + const PangoAttrShape *shape_attr = (PangoAttrShape *)attr; + gpointer data; + + if (shape_attr->copy_func) + data = shape_attr->copy_func (shape_attr->data); + else + data = shape_attr->data; + + return pango_attr_shape_new_with_data (&shape_attr->ink_rect, &shape_attr->logical_rect, + data, shape_attr->copy_func, shape_attr->destroy_func); +} + +static void +pango_attr_shape_destroy (PangoAttribute *attr) +{ + PangoAttrShape *shape_attr = (PangoAttrShape *)attr; + + if (shape_attr->destroy_func) + shape_attr->destroy_func (shape_attr->data); + + g_slice_free (PangoAttrShape, shape_attr); +} + +static gboolean +pango_attr_shape_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) +{ + const PangoAttrShape *shape_attr1 = (const PangoAttrShape *)attr1; + const PangoAttrShape *shape_attr2 = (const PangoAttrShape *)attr2; + + return (shape_attr1->logical_rect.x == shape_attr2->logical_rect.x && + shape_attr1->logical_rect.y == shape_attr2->logical_rect.y && + shape_attr1->logical_rect.width == shape_attr2->logical_rect.width && + shape_attr1->logical_rect.height == shape_attr2->logical_rect.height && + shape_attr1->ink_rect.x == shape_attr2->ink_rect.x && + shape_attr1->ink_rect.y == shape_attr2->ink_rect.y && + shape_attr1->ink_rect.width == shape_attr2->ink_rect.width && + shape_attr1->ink_rect.height == shape_attr2->ink_rect.height && + shape_attr1->data == shape_attr2->data); +} + +/** + * pango_attr_shape_new_with_data: + * @ink_rect: ink rectangle to assign to each character + * @logical_rect: logical rectangle to assign to each character + * @data: user data pointer + * @copy_func: (allow-none): function to copy @data when the + * attribute is copied. If %NULL, @data is simply + * copied as a pointer. + * @destroy_func: (allow-none): function to free @data when the + * attribute is freed, or %NULL + * + * Like pango_attr_shape_new(), but a user data pointer is also + * provided; this pointer can be accessed when later + * rendering the glyph. + * + * Return value: the newly allocated #PangoAttribute, which should be + * freed with pango_attribute_destroy(). + * + * Since: 1.8 + **/ +PangoAttribute * +pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect, + gpointer data, + PangoAttrDataCopyFunc copy_func, + GDestroyNotify destroy_func) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_SHAPE, + pango_attr_shape_copy, + pango_attr_shape_destroy, + pango_attr_shape_equal + }; + + PangoAttrShape *result; + + g_return_val_if_fail (ink_rect != NULL, NULL); + g_return_val_if_fail (logical_rect != NULL, NULL); + + result = g_slice_new (PangoAttrShape); + pango_attribute_init (&result->attr, &klass); + result->ink_rect = *ink_rect; + result->logical_rect = *logical_rect; + result->data = data; + result->copy_func = copy_func; + result->destroy_func = destroy_func; + + return (PangoAttribute *)result; +} + +/** + * pango_attr_shape_new: + * @ink_rect: ink rectangle to assign to each character + * @logical_rect: logical rectangle to assign to each character + * + * Create a new shape attribute. A shape is used to impose a + * particular ink and logical rectangle on the result of shaping a + * particular glyph. This might be used, for instance, for + * embedding a picture or a widget inside a #PangoLayout. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + **/ +PangoAttribute * +pango_attr_shape_new (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect) +{ + g_return_val_if_fail (ink_rect != NULL, NULL); + g_return_val_if_fail (logical_rect != NULL, NULL); + + return pango_attr_shape_new_with_data (ink_rect, logical_rect, + NULL, NULL, NULL); +} + +/** + * pango_attr_gravity_new: + * @gravity: the gravity value; should not be %PANGO_GRAVITY_AUTO. + * + * Create a new gravity attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.16 + **/ +PangoAttribute * +pango_attr_gravity_new (PangoGravity gravity) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_GRAVITY, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + g_return_val_if_fail (gravity != PANGO_GRAVITY_AUTO, NULL); + + return pango_attr_int_new (&klass, (int)gravity); +} + +/** + * pango_attr_gravity_hint_new: + * @hint: the gravity hint value. + * + * Create a new gravity hint attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.16 + **/ +PangoAttribute * +pango_attr_gravity_hint_new (PangoGravityHint hint) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_GRAVITY_HINT, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)hint); +} + +/** + * pango_attr_font_features_new: + * @features: a string with OpenType font features, in CSS syntax + * + * Create a new font features tag attribute. + * + * Return value: (transfer full): the newly allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.38 + **/ +PangoAttribute * +pango_attr_font_features_new (const gchar *features) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FONT_FEATURES, + pango_attr_string_copy, + pango_attr_string_destroy, + pango_attr_string_equal + }; + + g_return_val_if_fail (features != NULL, NULL); + + return pango_attr_string_new (&klass, features); +} + +/** + * pango_attr_foreground_alpha_new: + * @alpha: the alpha value, between 1 and 65536 + * + * Create a new foreground alpha attribute. + * + * Return value: (transfer full): the new allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.38 + */ +PangoAttribute * +pango_attr_foreground_alpha_new (guint16 alpha) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_FOREGROUND_ALPHA, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)alpha); +} + +/** + * pango_attr_background_alpha_new: + * @alpha: the alpha value, between 1 and 65536 + * + * Create a new background alpha attribute. + * + * Return value: (transfer full): the new allocated #PangoAttribute, + * which should be freed with pango_attribute_destroy(). + * + * Since: 1.38 + */ +PangoAttribute * +pango_attr_background_alpha_new (guint16 alpha) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_BACKGROUND_ALPHA, + pango_attr_int_copy, + pango_attr_int_destroy, + pango_attr_int_equal + }; + + return pango_attr_int_new (&klass, (int)alpha); +} + +/* + * Attribute List + */ + +G_DEFINE_BOXED_TYPE (PangoAttrList, pango_attr_list, + pango_attr_list_copy, + pango_attr_list_unref); + +/** + * pango_attr_list_new: + * + * Create a new empty attribute list with a reference count of one. + * + * Return value: (transfer full): the newly allocated #PangoAttrList, + * which should be freed with pango_attr_list_unref(). + **/ +PangoAttrList * +pango_attr_list_new (void) +{ + PangoAttrList *list = g_slice_new (PangoAttrList); + + list->ref_count = 1; + list->attributes = NULL; + list->attributes_tail = NULL; + + return list; +} + +/** + * pango_attr_list_ref: + * @list: (nullable): a #PangoAttrList, may be %NULL + * + * Increase the reference count of the given attribute list by one. + * + * Return value: The attribute list passed in + * + * Since: 1.10 + **/ +PangoAttrList * +pango_attr_list_ref (PangoAttrList *list) +{ + if (list == NULL) + return NULL; + + g_atomic_int_inc ((int *) &list->ref_count); + + return list; +} + +/** + * pango_attr_list_unref: + * @list: (nullable): a #PangoAttrList, may be %NULL + * + * Decrease the reference count of the given attribute list by one. + * If the result is zero, free the attribute list and the attributes + * it contains. + **/ +void +pango_attr_list_unref (PangoAttrList *list) +{ + GSList *tmp_list; + + if (list == NULL) + return; + + g_return_if_fail (list->ref_count > 0); + + if (g_atomic_int_dec_and_test ((int *) &list->ref_count)) + { + tmp_list = list->attributes; + while (tmp_list) + { + PangoAttribute *attr = tmp_list->data; + tmp_list = tmp_list->next; + + attr->klass->destroy (attr); + } + + g_slist_free (list->attributes); + + g_slice_free (PangoAttrList, list); + } +} + +/** + * pango_attr_list_copy: + * @list: (nullable): a #PangoAttrList, may be %NULL + * + * Copy @list and return an identical new list. + * + * Return value: (nullable): the newly allocated #PangoAttrList, with a + * reference count of one, which should + * be freed with pango_attr_list_unref(). + * Returns %NULL if @list was %NULL. + **/ +PangoAttrList * +pango_attr_list_copy (PangoAttrList *list) +{ + PangoAttrList *new; + GSList *iter; + GSList *new_attrs; + + if (list == NULL) + return NULL; + + new = pango_attr_list_new (); + + iter = list->attributes; + new_attrs = NULL; + while (iter != NULL) + { + new_attrs = g_slist_prepend (new_attrs, + pango_attribute_copy (iter->data)); + + iter = g_slist_next (iter); + } + + /* we're going to reverse the nodes, so head becomes tail */ + new->attributes_tail = new_attrs; + new->attributes = g_slist_reverse (new_attrs); + + return new; +} + +static void +pango_attr_list_insert_internal (PangoAttrList *list, + PangoAttribute *attr, + gboolean before) +{ + GSList *tmp_list, *prev, *link; + guint start_index = attr->start_index; + + if (!list->attributes) + { + list->attributes = g_slist_prepend (NULL, attr); + list->attributes_tail = list->attributes; + } + else if (((PangoAttribute *)list->attributes_tail->data)->start_index < start_index || + (!before && ((PangoAttribute *)list->attributes_tail->data)->start_index == start_index)) + { + list->attributes_tail = g_slist_append (list->attributes_tail, attr); + list->attributes_tail = list->attributes_tail->next; + g_assert (list->attributes_tail); + } + else + { + prev = NULL; + tmp_list = list->attributes; + while (1) + { + PangoAttribute *tmp_attr = tmp_list->data; + + if (tmp_attr->start_index > start_index || + (before && tmp_attr->start_index == start_index)) + { + link = g_slist_alloc (); + link->next = tmp_list; + link->data = attr; + + if (prev) + prev->next = link; + else + list->attributes = link; + + break; + } + + prev = tmp_list; + tmp_list = tmp_list->next; + } + } +} + +/** + * pango_attr_list_insert: + * @list: a #PangoAttrList + * @attr: (transfer full): the attribute to insert. Ownership of this + * value is assumed by the list. + * + * Insert the given attribute into the #PangoAttrList. It will + * be inserted after all other attributes with a matching + * @start_index. + **/ +void +pango_attr_list_insert (PangoAttrList *list, + PangoAttribute *attr) +{ + g_return_if_fail (list != NULL); + g_return_if_fail (attr != NULL); + + pango_attr_list_insert_internal (list, attr, FALSE); +} + +/** + * pango_attr_list_insert_before: + * @list: a #PangoAttrList + * @attr: (transfer full): the attribute to insert. Ownership of this + * value is assumed by the list. + * + * Insert the given attribute into the #PangoAttrList. It will + * be inserted before all other attributes with a matching + * @start_index. + **/ +void +pango_attr_list_insert_before (PangoAttrList *list, + PangoAttribute *attr) +{ + g_return_if_fail (list != NULL); + g_return_if_fail (attr != NULL); + + pango_attr_list_insert_internal (list, attr, TRUE); +} + +/** + * pango_attr_list_change: + * @list: a #PangoAttrList + * @attr: (transfer full): the attribute to insert. Ownership of this + * value is assumed by the list. + * + * Insert the given attribute into the #PangoAttrList. It will + * replace any attributes of the same type on that segment + * and be merged with any adjoining attributes that are identical. + * + * This function is slower than pango_attr_list_insert() for + * creating a attribute list in order (potentially much slower + * for large lists). However, pango_attr_list_insert() is not + * suitable for continually changing a set of attributes + * since it never removes or combines existing attributes. + **/ +void +pango_attr_list_change (PangoAttrList *list, + PangoAttribute *attr) +{ + GSList *tmp_list, *prev, *link; + guint start_index = attr->start_index; + guint end_index = attr->end_index; + + g_return_if_fail (list != NULL); + + if (start_index == end_index) /* empty, nothing to do */ + { + pango_attribute_destroy (attr); + return; + } + + tmp_list = list->attributes; + prev = NULL; + while (1) + { + PangoAttribute *tmp_attr; + + if (!tmp_list || + ((PangoAttribute *)tmp_list->data)->start_index > start_index) + { + /* We need to insert a new attribute + */ + link = g_slist_alloc (); + link->next = tmp_list; + link->data = attr; + + if (prev) + prev->next = link; + else + list->attributes = link; + + if (!tmp_list) + list->attributes_tail = link; + + prev = link; + tmp_list = prev->next; + break; + } + + tmp_attr = tmp_list->data; + + if (tmp_attr->klass->type == attr->klass->type && + tmp_attr->end_index >= start_index) + { + /* We overlap with an existing attribute */ + if (pango_attribute_equal (tmp_attr, attr)) + { + /* We can merge the new attribute with this attribute + */ + if (tmp_attr->end_index >= end_index) + { + /* We are totally overlapping the previous attribute. + * No action is needed. + */ + pango_attribute_destroy (attr); + return; + } + tmp_attr->end_index = end_index; + pango_attribute_destroy (attr); + + attr = tmp_attr; + + prev = tmp_list; + tmp_list = tmp_list->next; + + break; + } + else + { + /* Split, truncate, or remove the old attribute + */ + if (tmp_attr->end_index > attr->end_index) + { + PangoAttribute *end_attr = pango_attribute_copy (tmp_attr); + + end_attr->start_index = attr->end_index; + pango_attr_list_insert (list, end_attr); + } + + if (tmp_attr->start_index == attr->start_index) + { + pango_attribute_destroy (tmp_attr); + tmp_list->data = attr; + + prev = tmp_list; + tmp_list = tmp_list->next; + break; + } + else + { + tmp_attr->end_index = attr->start_index; + } + } + } + prev = tmp_list; + tmp_list = tmp_list->next; + } + /* At this point, prev points to the list node with attr in it, + * tmp_list points to prev->next. + */ + + g_assert (prev->data == attr); + g_assert (prev->next == tmp_list); + + /* We now have the range inserted into the list one way or the + * other. Fix up the remainder + */ + while (tmp_list) + { + PangoAttribute *tmp_attr = tmp_list->data; + + if (tmp_attr->start_index > end_index) + break; + else if (tmp_attr->klass->type == attr->klass->type) + { + if (tmp_attr->end_index <= attr->end_index || + pango_attribute_equal (tmp_attr, attr)) + { + /* We can merge the new attribute with this attribute. + */ + attr->end_index = MAX (end_index, tmp_attr->end_index); + + pango_attribute_destroy (tmp_attr); + prev->next = tmp_list->next; + + if (!prev->next) + list->attributes_tail = prev; + + g_slist_free_1 (tmp_list); + tmp_list = prev->next; + + continue; + } + else + { + /* Trim the start of this attribute that it begins at the end + * of the new attribute. This may involve moving + * it in the list to maintain the required non-decreasing + * order of start indices + */ + GSList *tmp_list2; + GSList *prev2; + + tmp_attr->start_index = attr->end_index; + + tmp_list2 = tmp_list->next; + prev2 = tmp_list; + + while (tmp_list2) + { + PangoAttribute *tmp_attr2 = tmp_list2->data; + + if (tmp_attr2->start_index >= tmp_attr->start_index) + break; + + prev2 = tmp_list2; + tmp_list2 = tmp_list2->next; + } + + /* Now remove and insert before tmp_list2. We'll + * hit this attribute again later, but that's harmless. + */ + if (prev2 != tmp_list) + { + GSList *old_next = tmp_list->next; + + prev->next = old_next; + prev2->next = tmp_list; + tmp_list->next = tmp_list2; + + if (!tmp_list->next) + list->attributes_tail = tmp_list; + + tmp_list = old_next; + + continue; + } + } + } + + prev = tmp_list; + tmp_list = tmp_list->next; + } +} + +/** + * pango_attr_list_splice: + * @list: a #PangoAttrList + * @other: another #PangoAttrList + * @pos: the position in @list at which to insert @other + * @len: the length of the spliced segment. (Note that this + * must be specified since the attributes in @other + * may only be present at some subsection of this range) + * + * This function opens up a hole in @list, fills it in with attributes from + * the left, and then merges @other on top of the hole. + * + * This operation is equivalent to stretching every attribute + * that applies at position @pos in @list by an amount @len, + * and then calling pango_attr_list_change() with a copy + * of each attribute in @other in sequence (offset in position by @pos). + * + * This operation proves useful for, for instance, inserting + * a pre-edit string in the middle of an edit buffer. + **/ +void +pango_attr_list_splice (PangoAttrList *list, + PangoAttrList *other, + gint pos, + gint len) +{ + GSList *tmp_list; + guint upos, ulen; + + g_return_if_fail (list != NULL); + g_return_if_fail (other != NULL); + g_return_if_fail (pos >= 0); + g_return_if_fail (len >= 0); + + upos = (guint)pos; + ulen = (guint)len; + +/* This definition only works when a and b are unsigned; overflow + * isn't defined in the C standard for signed integers + */ +#define CLAMP_ADD(a,b) (((a) + (b) < (a)) ? G_MAXUINT : (a) + (b)) + + tmp_list = list->attributes; + while (tmp_list) + { + PangoAttribute *attr = tmp_list->data; + + if (attr->start_index <= upos) + { + if (attr->end_index > upos) + attr->end_index = CLAMP_ADD (attr->end_index, ulen); + } + else + { + /* This could result in a zero length attribute if it + * gets squashed up against G_MAXUINT, but deleting such + * an element could (in theory) suprise the caller, so + * we don't delete it. + */ + attr->start_index = CLAMP_ADD (attr->start_index, ulen); + attr->end_index = CLAMP_ADD (attr->end_index, ulen); + } + + tmp_list = tmp_list->next; + } + + tmp_list = other->attributes; + while (tmp_list) + { + PangoAttribute *attr = pango_attribute_copy (tmp_list->data); + attr->start_index = CLAMP_ADD (attr->start_index, upos); + attr->end_index = CLAMP_ADD (attr->end_index, upos); + + /* Same as above, the attribute could be squashed to zero-length; here + * pango_attr_list_change() will take care of deleting it. + */ + pango_attr_list_change (list, attr); + + tmp_list = tmp_list->next; + } +#undef CLAMP_ADD +} + +/** + * pango_attr_list_get_iterator: + * @list: a #PangoAttrList + * + * Create a iterator initialized to the beginning of the list. + * @list must not be modified until this iterator is freed. + * + * Return value: (transfer full): the newly allocated #PangoAttrIterator, which should + * be freed with pango_attr_iterator_destroy(). + **/ +PangoAttrIterator * +pango_attr_list_get_iterator (PangoAttrList *list) +{ + PangoAttrIterator *iterator; + + g_return_val_if_fail (list != NULL, NULL); + + iterator = g_slice_new (PangoAttrIterator); + iterator->next_attribute = list->attributes; + iterator->attribute_stack = NULL; + + iterator->start_index = 0; + iterator->end_index = 0; + + if (!pango_attr_iterator_next (iterator)) + iterator->end_index = G_MAXUINT; + + return iterator; +} + +/** + * pango_attr_iterator_range: + * @iterator: a #PangoAttrIterator + * @start: (out): location to store the start of the range + * @end: (out): location to store the end of the range + * + * Get the range of the current segment. Note that the + * stored return values are signed, not unsigned like + * the values in #PangoAttribute. To deal with this API + * oversight, stored return values that wouldn't fit into + * a signed integer are clamped to %G_MAXINT. + **/ +void +pango_attr_iterator_range (PangoAttrIterator *iterator, + gint *start, + gint *end) +{ + g_return_if_fail (iterator != NULL); + + if (start) + *start = MIN (iterator->start_index, G_MAXINT); + if (end) + *end = MIN (iterator->end_index, G_MAXINT); +} + +/** + * pango_attr_iterator_next: + * @iterator: a #PangoAttrIterator + * + * Advance the iterator until the next change of style. + * + * Return value: %FALSE if the iterator is at the end of the list, otherwise %TRUE + **/ +gboolean +pango_attr_iterator_next (PangoAttrIterator *iterator) +{ + GList *tmp_list; + + g_return_val_if_fail (iterator != NULL, FALSE); + + if (!iterator->next_attribute && !iterator->attribute_stack) + return FALSE; + + iterator->start_index = iterator->end_index; + iterator->end_index = G_MAXUINT; + + tmp_list = iterator->attribute_stack; + while (tmp_list) + { + GList *next = tmp_list->next; + PangoAttribute *attr = tmp_list->data; + + if (attr->end_index == iterator->start_index) + { + iterator->attribute_stack = g_list_remove_link (iterator->attribute_stack, tmp_list); + g_list_free_1 (tmp_list); + } + else + { + iterator->end_index = MIN (iterator->end_index, attr->end_index); + } + + tmp_list = next; + } + + while (iterator->next_attribute && + ((PangoAttribute *)iterator->next_attribute->data)->start_index == iterator->start_index) + { + if (((PangoAttribute *)iterator->next_attribute->data)->end_index > iterator->start_index) + { + iterator->attribute_stack = g_list_prepend (iterator->attribute_stack, iterator->next_attribute->data); + iterator->end_index = MIN (iterator->end_index, ((PangoAttribute *)iterator->next_attribute->data)->end_index); + } + iterator->next_attribute = iterator->next_attribute->next; + } + + if (iterator->next_attribute) + iterator->end_index = MIN (iterator->end_index, ((PangoAttribute *)iterator->next_attribute->data)->start_index); + + return TRUE; +} + +/** + * pango_attr_iterator_copy: + * @iterator: a #PangoAttrIterator. + * + * Copy a #PangoAttrIterator + * + * Return value: (transfer full): the newly allocated + * #PangoAttrIterator, which should be freed with + * pango_attr_iterator_destroy(). + **/ +PangoAttrIterator * +pango_attr_iterator_copy (PangoAttrIterator *iterator) +{ + PangoAttrIterator *copy; + + g_return_val_if_fail (iterator != NULL, NULL); + + copy = g_slice_new (PangoAttrIterator); + + *copy = *iterator; + + copy->attribute_stack = g_list_copy (iterator->attribute_stack); + + return copy; +} + +/** + * pango_attr_iterator_destroy: + * @iterator: a #PangoAttrIterator. + * + * Destroy a #PangoAttrIterator and free all associated memory. + **/ +void +pango_attr_iterator_destroy (PangoAttrIterator *iterator) +{ + g_return_if_fail (iterator != NULL); + + g_list_free (iterator->attribute_stack); + g_slice_free (PangoAttrIterator, iterator); +} + +/** + * pango_attr_iterator_get: + * @iterator: a #PangoAttrIterator + * @type: the type of attribute to find. + * + * Find the current attribute of a particular type at the iterator + * location. When multiple attributes of the same type overlap, + * the attribute whose range starts closest to the current location + * is used. + * + * Return value: (nullable): the current attribute of the given type, + * or %NULL if no attribute of that type applies to the + * current location. + **/ +PangoAttribute * +pango_attr_iterator_get (PangoAttrIterator *iterator, + PangoAttrType type) +{ + GList *tmp_list; + + g_return_val_if_fail (iterator != NULL, NULL); + + tmp_list = iterator->attribute_stack; + while (tmp_list) + { + PangoAttribute *attr = tmp_list->data; + + if (attr->klass->type == type) + return attr; + + tmp_list = tmp_list->next; + } + + return NULL; +} + +/** + * pango_attr_iterator_get_font: + * @iterator: a #PangoAttrIterator + * @desc: a #PangoFontDescription to fill in with the current values. + * The family name in this structure will be set using + * pango_font_description_set_family_static() using values from + * an attribute in the #PangoAttrList associated with the iterator, + * so if you plan to keep it around, you must call: + * pango_font_description_set_family (desc, pango_font_description_get_family (desc)). + * @language: (allow-none): if non-%NULL, location to store language tag for item, or %NULL + * if none is found. + * @extra_attrs: (allow-none) (element-type Pango.Attribute) (transfer full): if non-%NULL, + * location in which to store a list of non-font + * attributes at the the current position; only the highest priority + * value of each attribute will be added to this list. In order + * to free this value, you must call pango_attribute_destroy() on + * each member. + * + * Get the font and other attributes at the current iterator position. + **/ +void +pango_attr_iterator_get_font (PangoAttrIterator *iterator, + PangoFontDescription *desc, + PangoLanguage **language, + GSList **extra_attrs) +{ + GList *tmp_list1; + GSList *tmp_list2; + + PangoFontMask mask = 0; + gboolean have_language = FALSE; + gdouble scale = 0; + gboolean have_scale = FALSE; + + g_return_if_fail (iterator != NULL); + g_return_if_fail (desc != NULL); + + if (language) + *language = NULL; + + if (extra_attrs) + *extra_attrs = NULL; + + tmp_list1 = iterator->attribute_stack; + while (tmp_list1) + { + PangoAttribute *attr = tmp_list1->data; + tmp_list1 = tmp_list1->next; + + switch ((int) attr->klass->type) + { + case PANGO_ATTR_FONT_DESC: + { + PangoFontMask new_mask = pango_font_description_get_set_fields (((PangoAttrFontDesc *)attr)->desc) & ~mask; + mask |= new_mask; + pango_font_description_unset_fields (desc, new_mask); + pango_font_description_merge_static (desc, ((PangoAttrFontDesc *)attr)->desc, FALSE); + + break; + } + case PANGO_ATTR_FAMILY: + if (!(mask & PANGO_FONT_MASK_FAMILY)) + { + mask |= PANGO_FONT_MASK_FAMILY; + pango_font_description_set_family (desc, ((PangoAttrString *)attr)->value); + } + break; + case PANGO_ATTR_STYLE: + if (!(mask & PANGO_FONT_MASK_STYLE)) + { + mask |= PANGO_FONT_MASK_STYLE; + pango_font_description_set_style (desc, ((PangoAttrInt *)attr)->value); + } + break; + case PANGO_ATTR_VARIANT: + if (!(mask & PANGO_FONT_MASK_VARIANT)) + { + mask |= PANGO_FONT_MASK_VARIANT; + pango_font_description_set_variant (desc, ((PangoAttrInt *)attr)->value); + } + break; + case PANGO_ATTR_WEIGHT: + if (!(mask & PANGO_FONT_MASK_WEIGHT)) + { + mask |= PANGO_FONT_MASK_WEIGHT; + pango_font_description_set_weight (desc, ((PangoAttrInt *)attr)->value); + } + break; + case PANGO_ATTR_STRETCH: + if (!(mask & PANGO_FONT_MASK_STRETCH)) + { + mask |= PANGO_FONT_MASK_STRETCH; + pango_font_description_set_stretch (desc, ((PangoAttrInt *)attr)->value); + } + break; + case PANGO_ATTR_SIZE: + if (!(mask & PANGO_FONT_MASK_SIZE)) + { + mask |= PANGO_FONT_MASK_SIZE; + pango_font_description_set_size (desc, ((PangoAttrSize *)attr)->size); + } + break; + case PANGO_ATTR_ABSOLUTE_SIZE: + if (!(mask & PANGO_FONT_MASK_SIZE)) + { + mask |= PANGO_FONT_MASK_SIZE; + pango_font_description_set_absolute_size (desc, ((PangoAttrSize *)attr)->size); + } + break; + case PANGO_ATTR_SCALE: + if (!have_scale) + { + have_scale = TRUE; + scale = ((PangoAttrFloat *)attr)->value; + } + break; + case PANGO_ATTR_LANGUAGE: + if (language) + { + if (!have_language) + { + have_language = TRUE; + *language = ((PangoAttrLanguage *)attr)->value; + } + } + break; + default: + if (extra_attrs) + { + gboolean found = FALSE; + + tmp_list2 = *extra_attrs; + /* Hack: special-case FONT_FEATURES. We don't want them to + * override each other, so we never merge them. This should + * be fixed when we implement attr-merging. */ + if (attr->klass->type != PANGO_ATTR_FONT_FEATURES) + while (tmp_list2) + { + PangoAttribute *old_attr = tmp_list2->data; + if (attr->klass->type == old_attr->klass->type) + { + found = TRUE; + break; + } + + tmp_list2 = tmp_list2->next; + } + + if (!found) + *extra_attrs = g_slist_prepend (*extra_attrs, pango_attribute_copy (attr)); + } + } + } + + if (have_scale) + { + if (pango_font_description_get_size_is_absolute (desc)) + pango_font_description_set_absolute_size (desc, scale * pango_font_description_get_size (desc)); + else + pango_font_description_set_size (desc, scale * pango_font_description_get_size (desc)); + } +} + +/** + * pango_attr_list_filter: + * @list: a #PangoAttrList + * @func: (scope call) (closure data): callback function; returns %TRUE + * if an attribute should be filtered out. + * @data: (closure): Data to be passed to @func + * + * Given a #PangoAttrList and callback function, removes any elements + * of @list for which @func returns %TRUE and inserts them into + * a new list. + * + * Return value: (transfer full) (nullable): the new #PangoAttrList or + * %NULL if no attributes of the given types were found. + * + * Since: 1.2 + **/ +PangoAttrList * +pango_attr_list_filter (PangoAttrList *list, + PangoAttrFilterFunc func, + gpointer data) + +{ + PangoAttrList *new = NULL; + GSList *tmp_list; + GSList *prev; + + g_return_val_if_fail (list != NULL, NULL); + + tmp_list = list->attributes; + prev = NULL; + while (tmp_list) + { + GSList *next = tmp_list->next; + PangoAttribute *tmp_attr = tmp_list->data; + + if ((*func) (tmp_attr, data)) + { + if (!tmp_list->next) + list->attributes_tail = prev; + + if (prev) + prev->next = tmp_list->next; + else + list->attributes = tmp_list->next; + + tmp_list->next = NULL; + + if (!new) + { + new = pango_attr_list_new (); + new->attributes = new->attributes_tail = tmp_list; + } + else + { + new->attributes_tail->next = tmp_list; + new->attributes_tail = tmp_list; + } + + goto next_attr; + } + + prev = tmp_list; + + next_attr: + tmp_list = next; + } + + return new; +} + +/** + * pango_attr_iterator_get_attrs: + * @iterator: a #PangoAttrIterator + * + * Gets a list of all attributes at the current position of the + * iterator. + * + * Return value: (element-type Pango.Attribute) (transfer full): a list of + * all attributes for the current range. + * To free this value, call pango_attribute_destroy() on + * each value and g_slist_free() on the list. + * + * Since: 1.2 + **/ +GSList * +pango_attr_iterator_get_attrs (PangoAttrIterator *iterator) +{ + GSList *attrs = NULL; + GList *tmp_list; + + for (tmp_list = iterator->attribute_stack; tmp_list; tmp_list = tmp_list->next) + { + PangoAttribute *attr = tmp_list->data; + GSList *tmp_list2; + gboolean found = FALSE; + + for (tmp_list2 = attrs; tmp_list2; tmp_list2 = tmp_list2->next) + { + PangoAttribute *old_attr = tmp_list2->data; + if (attr->klass->type == old_attr->klass->type) + { + found = TRUE; + break; + } + } + + if (!found) + attrs = g_slist_prepend (attrs, pango_attribute_copy (attr)); + } + + return attrs; +} diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h new file mode 100644 index 0000000..e9b1957 --- /dev/null +++ b/pango/pango-attributes.h @@ -0,0 +1,598 @@ +/* Pango + * pango-attributes.h: Attributed text + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_ATTRIBUTES_H__ +#define __PANGO_ATTRIBUTES_H__ + +#include +#include + +G_BEGIN_DECLS + +/* PangoColor */ + +typedef struct _PangoColor PangoColor; + +/** + * PangoColor: + * @red: value of red component + * @green: value of green component + * @blue: value of blue component + * + * The #PangoColor structure is used to + * represent a color in an uncalibrated RGB color-space. + */ +struct _PangoColor +{ + guint16 red; + guint16 green; + guint16 blue; +}; + +/** + * PANGO_TYPE_COLOR: + * + * The #GObject type for #PangoColor. + */ +#define PANGO_TYPE_COLOR pango_color_get_type () +PANGO_AVAILABLE_IN_ALL +GType pango_color_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoColor *pango_color_copy (const PangoColor *src); +PANGO_AVAILABLE_IN_ALL +void pango_color_free (PangoColor *color); +PANGO_AVAILABLE_IN_ALL +gboolean pango_color_parse (PangoColor *color, + const char *spec); +PANGO_AVAILABLE_IN_1_16 +gchar *pango_color_to_string(const PangoColor *color); + + +/* Attributes */ + +typedef struct _PangoAttribute PangoAttribute; +typedef struct _PangoAttrClass PangoAttrClass; + +typedef struct _PangoAttrString PangoAttrString; +typedef struct _PangoAttrLanguage PangoAttrLanguage; +typedef struct _PangoAttrInt PangoAttrInt; +typedef struct _PangoAttrSize PangoAttrSize; +typedef struct _PangoAttrFloat PangoAttrFloat; +typedef struct _PangoAttrColor PangoAttrColor; +typedef struct _PangoAttrFontDesc PangoAttrFontDesc; +typedef struct _PangoAttrShape PangoAttrShape; +typedef struct _PangoAttrFontFeatures PangoAttrFontFeatures; + +/** + * PANGO_TYPE_ATTR_LIST: + * + * The #GObject type for #PangoAttrList. + */ +#define PANGO_TYPE_ATTR_LIST pango_attr_list_get_type () +/** + * PangoAttrIterator: + * + * The #PangoAttrIterator structure is used to represent an + * iterator through a #PangoAttrList. A new iterator is created + * with pango_attr_list_get_iterator(). Once the iterator + * is created, it can be advanced through the style changes + * in the text using pango_attr_iterator_next(). At each + * style change, the range of the current style segment and the + * attributes currently in effect can be queried. + */ +/** + * PangoAttrList: + * + * The #PangoAttrList structure represents a list of attributes + * that apply to a section of text. The attributes are, in general, + * allowed to overlap in an arbitrary fashion, however, if the + * attributes are manipulated only through pango_attr_list_change(), + * the overlap between properties will meet stricter criteria. + * + * Since the #PangoAttrList structure is stored as a linear list, + * it is not suitable for storing attributes for large amounts + * of text. In general, you should not use a single #PangoAttrList + * for more than one paragraph of text. + */ +typedef struct _PangoAttrList PangoAttrList; +typedef struct _PangoAttrIterator PangoAttrIterator; + +/** + * PangoAttrType: + * @PANGO_ATTR_INVALID: does not happen + * @PANGO_ATTR_LANGUAGE: language (#PangoAttrLanguage) + * @PANGO_ATTR_FAMILY: font family name list (#PangoAttrString) + * @PANGO_ATTR_STYLE: font slant style (#PangoAttrInt) + * @PANGO_ATTR_WEIGHT: font weight (#PangoAttrInt) + * @PANGO_ATTR_VARIANT: font variant (normal or small caps) (#PangoAttrInt) + * @PANGO_ATTR_STRETCH: font stretch (#PangoAttrInt) + * @PANGO_ATTR_SIZE: font size in points scaled by %PANGO_SCALE (#PangoAttrInt) + * @PANGO_ATTR_FONT_DESC: font description (#PangoAttrFontDesc) + * @PANGO_ATTR_FOREGROUND: foreground color (#PangoAttrColor) + * @PANGO_ATTR_BACKGROUND: background color (#PangoAttrColor) + * @PANGO_ATTR_UNDERLINE: whether the text has an underline (#PangoAttrInt) + * @PANGO_ATTR_STRIKETHROUGH: whether the text is struck-through (#PangoAttrInt) + * @PANGO_ATTR_RISE: baseline displacement (#PangoAttrInt) + * @PANGO_ATTR_SHAPE: shape (#PangoAttrShape) + * @PANGO_ATTR_SCALE: font size scale factor (#PangoAttrFloat) + * @PANGO_ATTR_FALLBACK: whether fallback is enabled (#PangoAttrInt) + * @PANGO_ATTR_LETTER_SPACING: letter spacing (#PangoAttrInt) + * @PANGO_ATTR_UNDERLINE_COLOR: underline color (#PangoAttrColor) + * @PANGO_ATTR_STRIKETHROUGH_COLOR: strikethrough color (#PangoAttrColor) + * @PANGO_ATTR_ABSOLUTE_SIZE: font size in pixels scaled by %PANGO_SCALE (#PangoAttrInt) + * @PANGO_ATTR_GRAVITY: base text gravity (#PangoAttrInt) + * @PANGO_ATTR_GRAVITY_HINT: gravity hint (#PangoAttrInt) + * @PANGO_ATTR_FONT_FEATURES: OpenType font features (#PangoAttrString). Since 1.38 + * @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha (#PangoAttrInt). Since 1.38 + * @PANGO_ATTR_BACKGROUND_ALPHA: background alpha (#PangoAttrInt). Since 1.38 + * + * The #PangoAttrType + * distinguishes between different types of attributes. Along with the + * predefined values, it is possible to allocate additional values + * for custom attributes using pango_attr_type_register(). The predefined + * values are given below. The type of structure used to store the + * attribute is listed in parentheses after the description. + */ +typedef enum +{ + PANGO_ATTR_INVALID, /* 0 is an invalid attribute type */ + PANGO_ATTR_LANGUAGE, /* PangoAttrLanguage */ + PANGO_ATTR_FAMILY, /* PangoAttrString */ + PANGO_ATTR_STYLE, /* PangoAttrInt */ + PANGO_ATTR_WEIGHT, /* PangoAttrInt */ + PANGO_ATTR_VARIANT, /* PangoAttrInt */ + PANGO_ATTR_STRETCH, /* PangoAttrInt */ + PANGO_ATTR_SIZE, /* PangoAttrSize */ + PANGO_ATTR_FONT_DESC, /* PangoAttrFontDesc */ + PANGO_ATTR_FOREGROUND, /* PangoAttrColor */ + PANGO_ATTR_BACKGROUND, /* PangoAttrColor */ + PANGO_ATTR_UNDERLINE, /* PangoAttrInt */ + PANGO_ATTR_STRIKETHROUGH, /* PangoAttrInt */ + PANGO_ATTR_RISE, /* PangoAttrInt */ + PANGO_ATTR_SHAPE, /* PangoAttrShape */ + PANGO_ATTR_SCALE, /* PangoAttrFloat */ + PANGO_ATTR_FALLBACK, /* PangoAttrInt */ + PANGO_ATTR_LETTER_SPACING, /* PangoAttrInt */ + PANGO_ATTR_UNDERLINE_COLOR, /* PangoAttrColor */ + PANGO_ATTR_STRIKETHROUGH_COLOR,/* PangoAttrColor */ + PANGO_ATTR_ABSOLUTE_SIZE, /* PangoAttrSize */ + PANGO_ATTR_GRAVITY, /* PangoAttrInt */ + PANGO_ATTR_GRAVITY_HINT, /* PangoAttrInt */ + PANGO_ATTR_FONT_FEATURES, /* PangoAttrString */ + PANGO_ATTR_FOREGROUND_ALPHA, /* PangoAttrInt */ + PANGO_ATTR_BACKGROUND_ALPHA /* PangoAttrInt */ +} PangoAttrType; + +/** + * PangoUnderline: + * @PANGO_UNDERLINE_NONE: no underline should be drawn + * @PANGO_UNDERLINE_SINGLE: a single underline should be drawn + * @PANGO_UNDERLINE_DOUBLE: a double underline should be drawn + * @PANGO_UNDERLINE_LOW: a single underline should be drawn at a position + * beneath the ink extents of the text being + * underlined. This should be used only for underlining + * single characters, such as for keyboard + * accelerators. %PANGO_UNDERLINE_SINGLE should + * be used for extended portions of text. + * @PANGO_UNDERLINE_ERROR: a wavy underline should be drawn below. + * This underline is typically used to indicate + * an error such as a possilble mispelling; in some + * cases a contrasting color may automatically + * be used. This type of underlining is available since Pango 1.4. + * + * The #PangoUnderline enumeration is used to specify + * whether text should be underlined, and if so, the type + * of underlining. + */ +typedef enum { + PANGO_UNDERLINE_NONE, + PANGO_UNDERLINE_SINGLE, + PANGO_UNDERLINE_DOUBLE, + PANGO_UNDERLINE_LOW, + PANGO_UNDERLINE_ERROR +} PangoUnderline; + +/** + * PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING: + * + * This value can be used to set the start_index member of a #PangoAttribute + * such that the attribute covers from the beginning of the text. + * + * Since: 1.24 + */ +/** + * PANGO_ATTR_INDEX_TO_TEXT_END: + * + * This value can be used to set the end_index member of a #PangoAttribute + * such that the attribute covers to the end of the text. + * + * Since: 1.24 + */ +#define PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING 0 +#define PANGO_ATTR_INDEX_TO_TEXT_END G_MAXUINT + +/** + * PangoAttribute: + * @klass: the class structure holding information about the type of the attribute + * @start_index: the start index of the range (in bytes). + * @end_index: end index of the range (in bytes). The character at this index + * is not included in the range. + * + * The #PangoAttribute structure represents the common portions of all + * attributes. Particular types of attributes include this structure + * as their initial portion. The common portion of the attribute holds + * the range to which the value in the type-specific part of the attribute + * applies and should be initialized using pango_attribute_init(). + * By default an attribute will have an all-inclusive range of [0,%G_MAXUINT]. + */ +struct _PangoAttribute +{ + const PangoAttrClass *klass; + guint start_index; /* in bytes */ + guint end_index; /* in bytes. The character at this index is not included */ +}; + +/** + * PangoAttrFilterFunc: + * @attribute: a Pango attribute + * @user_data: user data passed to the function + * + * Type of a function filtering a list of attributes. + * + * Return value: %TRUE if the attribute should be selected for + * filtering, %FALSE otherwise. + **/ +typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute, + gpointer user_data); + +/** + * PangoAttrDataCopyFunc: + * @user_data: user data to copy + * + * Type of a function that can duplicate user data for an attribute. + * + * Return value: new copy of @user_data. + **/ +typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data); + +/** + * PangoAttrClass: + * @type: the type ID for this attribute + * @copy: function to duplicate an attribute of this type (see pango_attribute_copy()) + * @destroy: function to free an attribute of this type (see pango_attribute_destroy()) + * @equal: function to check two attributes of this type for equality (see pango_attribute_equal()) + * + * The #PangoAttrClass structure stores the type and operations for + * a particular type of attribute. The functions in this structure should + * not be called directly. Instead, one should use the wrapper functions + * provided for #PangoAttribute. + */ +struct _PangoAttrClass +{ + /*< public >*/ + PangoAttrType type; + PangoAttribute * (*copy) (const PangoAttribute *attr); + void (*destroy) (PangoAttribute *attr); + gboolean (*equal) (const PangoAttribute *attr1, const PangoAttribute *attr2); +}; + +/** + * PangoAttrString: + * @attr: the common portion of the attribute + * @value: the string which is the value of the attribute + * + * The #PangoAttrString structure is used to represent attributes with + * a string value. + */ +struct _PangoAttrString +{ + PangoAttribute attr; + char *value; +}; +/** + * PangoAttrLanguage: + * @attr: the common portion of the attribute + * @value: the #PangoLanguage which is the value of the attribute + * + * The #PangoAttrLanguage structure is used to represent attributes that + * are languages. + */ +struct _PangoAttrLanguage +{ + PangoAttribute attr; + PangoLanguage *value; +}; +/** + * PangoAttrInt: + * @attr: the common portion of the attribute + * @value: the value of the attribute + * + * The #PangoAttrInt structure is used to represent attributes with + * an integer or enumeration value. + */ +struct _PangoAttrInt +{ + PangoAttribute attr; + int value; +}; +/** + * PangoAttrFloat: + * @attr: the common portion of the attribute + * @value: the value of the attribute + * + * The #PangoAttrFloat structure is used to represent attributes with + * a float or double value. + */ +struct _PangoAttrFloat +{ + PangoAttribute attr; + double value; +}; +/** + * PangoAttrColor: + * @attr: the common portion of the attribute + * @color: the #PangoColor which is the value of the attribute + * + * The #PangoAttrColor structure is used to represent attributes that + * are colors. + */ +struct _PangoAttrColor +{ + PangoAttribute attr; + PangoColor color; +}; + +/** + * PangoAttrSize: + * @attr: the common portion of the attribute + * @size: size of font, in units of 1/%PANGO_SCALE of a point (for + * %PANGO_ATTR_SIZE) or of a device uni (for %PANGO_ATTR_ABSOLUTE_SIZE) + * @absolute: whether the font size is in device units or points. + * This field is only present for compatibility with Pango-1.8.0 + * (%PANGO_ATTR_ABSOLUTE_SIZE was added in 1.8.1); and always will + * be %FALSE for %PANGO_ATTR_SIZE and %TRUE for %PANGO_ATTR_ABSOLUTE_SIZE. + * + * The #PangoAttrSize structure is used to represent attributes which + * set font size. + */ +struct _PangoAttrSize +{ + PangoAttribute attr; + int size; + guint absolute : 1; +}; + +/** + * PangoAttrShape: + * @attr: the common portion of the attribute + * @ink_rect: the ink rectangle to restrict to + * @logical_rect: the logical rectangle to restrict to + * @data: user data set (see pango_attr_shape_new_with_data()) + * @copy_func: copy function for the user data + * @destroy_func: destroy function for the user data + * + * The #PangoAttrShape structure is used to represent attributes which + * impose shape restrictions. + */ +struct _PangoAttrShape +{ + PangoAttribute attr; + PangoRectangle ink_rect; + PangoRectangle logical_rect; + + gpointer data; + PangoAttrDataCopyFunc copy_func; + GDestroyNotify destroy_func; +}; + +/** + * PangoAttrFontDesc: + * @attr: the common portion of the attribute + * @desc: the font description which is the value of this attribute + * + * The #PangoAttrFontDesc structure is used to store an attribute that + * sets all aspects of the font description at once. + */ +struct _PangoAttrFontDesc +{ + PangoAttribute attr; + PangoFontDescription *desc; +}; + +/** + * PangoAttrFontFeatures: + * @attr: the common portion of the attribute + * @features: the featues, as a string in CSS syntax + * + * The #PangoAttrFontFeatures structure is used to represent OpenType + * font features as an attribute. + * + * Since: 1.38 + */ +struct _PangoAttrFontFeatures +{ + PangoAttribute attr; + gchar *features; +}; + +PANGO_AVAILABLE_IN_ALL +PangoAttrType pango_attr_type_register (const gchar *name); +PANGO_AVAILABLE_IN_1_22 +const char * pango_attr_type_get_name (PangoAttrType type) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_20 +void pango_attribute_init (PangoAttribute *attr, + const PangoAttrClass *klass); +PANGO_AVAILABLE_IN_ALL +PangoAttribute * pango_attribute_copy (const PangoAttribute *attr); +PANGO_AVAILABLE_IN_ALL +void pango_attribute_destroy (PangoAttribute *attr); +PANGO_AVAILABLE_IN_ALL +gboolean pango_attribute_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) G_GNUC_PURE; + +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_language_new (PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_family_new (const char *family); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_foreground_new (guint16 red, + guint16 green, + guint16 blue); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_background_new (guint16 red, + guint16 green, + guint16 blue); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_size_new (int size); +PANGO_AVAILABLE_IN_1_8 +PangoAttribute *pango_attr_size_new_absolute (int size); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_style_new (PangoStyle style); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_weight_new (PangoWeight weight); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_variant_new (PangoVariant variant); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_stretch_new (PangoStretch stretch); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_font_desc_new (const PangoFontDescription *desc); + +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_underline_new (PangoUnderline underline); +PANGO_AVAILABLE_IN_1_8 +PangoAttribute *pango_attr_underline_color_new (guint16 red, + guint16 green, + guint16 blue); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_strikethrough_new (gboolean strikethrough); +PANGO_AVAILABLE_IN_1_8 +PangoAttribute *pango_attr_strikethrough_color_new (guint16 red, + guint16 green, + guint16 blue); + +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_rise_new (int rise); +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_scale_new (double scale_factor); +PANGO_AVAILABLE_IN_1_4 +PangoAttribute *pango_attr_fallback_new (gboolean enable_fallback); +PANGO_AVAILABLE_IN_1_6 +PangoAttribute *pango_attr_letter_spacing_new (int letter_spacing); + +PANGO_AVAILABLE_IN_ALL +PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_1_8 +PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect, + gpointer data, + PangoAttrDataCopyFunc copy_func, + GDestroyNotify destroy_func); + +PANGO_AVAILABLE_IN_1_16 +PangoAttribute *pango_attr_gravity_new (PangoGravity gravity); +PANGO_AVAILABLE_IN_1_16 +PangoAttribute *pango_attr_gravity_hint_new (PangoGravityHint hint); +PANGO_AVAILABLE_IN_1_38 +PangoAttribute *pango_attr_font_features_new (const gchar *features); +PANGO_AVAILABLE_IN_1_38 +PangoAttribute *pango_attr_foreground_alpha_new (guint16 alpha); +PANGO_AVAILABLE_IN_1_38 +PangoAttribute *pango_attr_background_alpha_new (guint16 alpha); + +PANGO_AVAILABLE_IN_ALL +GType pango_attr_list_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoAttrList * pango_attr_list_new (void); +PANGO_AVAILABLE_IN_1_10 +PangoAttrList * pango_attr_list_ref (PangoAttrList *list); +PANGO_AVAILABLE_IN_ALL +void pango_attr_list_unref (PangoAttrList *list); +PANGO_AVAILABLE_IN_ALL +PangoAttrList * pango_attr_list_copy (PangoAttrList *list); +PANGO_AVAILABLE_IN_ALL +void pango_attr_list_insert (PangoAttrList *list, + PangoAttribute *attr); +PANGO_AVAILABLE_IN_ALL +void pango_attr_list_insert_before (PangoAttrList *list, + PangoAttribute *attr); +PANGO_AVAILABLE_IN_ALL +void pango_attr_list_change (PangoAttrList *list, + PangoAttribute *attr); +PANGO_AVAILABLE_IN_ALL +void pango_attr_list_splice (PangoAttrList *list, + PangoAttrList *other, + gint pos, + gint len); + +PANGO_AVAILABLE_IN_1_2 +PangoAttrList *pango_attr_list_filter (PangoAttrList *list, + PangoAttrFilterFunc func, + gpointer data); + +PANGO_AVAILABLE_IN_ALL +PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list); + +PANGO_AVAILABLE_IN_ALL +void pango_attr_iterator_range (PangoAttrIterator *iterator, + gint *start, + gint *end); +PANGO_AVAILABLE_IN_ALL +gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); +PANGO_AVAILABLE_IN_ALL +PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator); +PANGO_AVAILABLE_IN_ALL +void pango_attr_iterator_destroy (PangoAttrIterator *iterator); +PANGO_AVAILABLE_IN_ALL +PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator, + PangoAttrType type); +PANGO_AVAILABLE_IN_ALL +void pango_attr_iterator_get_font (PangoAttrIterator *iterator, + PangoFontDescription *desc, + PangoLanguage **language, + GSList **extra_attrs); +PANGO_AVAILABLE_IN_1_2 +GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator); + + +PANGO_AVAILABLE_IN_ALL +gboolean pango_parse_markup (const char *markup_text, + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); + +PANGO_AVAILABLE_IN_1_32 +GMarkupParseContext * pango_markup_parser_new (gunichar accel_marker); +PANGO_AVAILABLE_IN_1_32 +gboolean pango_markup_parser_finish (GMarkupParseContext *context, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); + +G_END_DECLS + +#endif /* __PANGO_ATTRIBUTES_H__ */ diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c new file mode 100644 index 0000000..a49e06d --- /dev/null +++ b/pango/pango-bidi-type.c @@ -0,0 +1,329 @@ +/* Pango + * pango-bidi-type.c: Bidirectional Character Types + * + * Copyright (C) 2008 Jürg Billeter + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:bidi + * @short_description:Types and functions to help with handling bidirectional text + * @title:Bidirectional Text + * @see_also: + * pango_context_get_base_dir(), + * pango_context_set_base_dir(), + * pango_itemize_with_base_dir() + * + * Pango supports bidirectional text (like Arabic and Hebrew) automatically. + * Some applications however, need some help to correctly handle bidirectional text. + * + * The #PangoDirection type can be used with pango_context_set_base_dir() to + * instruct Pango about direction of text, though in most cases Pango detects + * that correctly and automatically. The rest of the facilities in this section + * are used internally by Pango already, and are provided to help applications + * that need more direct control over bidirectional setting of text. + */ +#include "config.h" + +#include + +#include + +#include "pango-bidi-type.h" +#include "pango-utils.h" + +#if FRIBIDI_MAJOR_VERSION >= 1 +#define USE_FRIBIDI_EX_API +#endif + +/** + * pango_bidi_type_for_unichar: + * @ch: a Unicode character + * + * Determines the normative bidirectional character type of a + * character, as specified in the Unicode Character Database. + * + * A simplified version of this function is available as + * pango_unichar_direction(). + * + * Return value: the bidirectional character type, as used in the + * Unicode bidirectional algorithm. + * + * Since: 1.22 + */ +PangoBidiType +pango_bidi_type_for_unichar (gunichar ch) +{ + FriBidiCharType fribidi_ch_type; + + G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar)); + + fribidi_ch_type = fribidi_get_bidi_type (ch); + + switch (fribidi_ch_type) + { + case FRIBIDI_TYPE_LTR: return PANGO_BIDI_TYPE_L; + case FRIBIDI_TYPE_LRE: return PANGO_BIDI_TYPE_LRE; + case FRIBIDI_TYPE_LRO: return PANGO_BIDI_TYPE_LRO; + case FRIBIDI_TYPE_RTL: return PANGO_BIDI_TYPE_R; + case FRIBIDI_TYPE_AL: return PANGO_BIDI_TYPE_AL; + case FRIBIDI_TYPE_RLE: return PANGO_BIDI_TYPE_RLE; + case FRIBIDI_TYPE_RLO: return PANGO_BIDI_TYPE_RLO; + case FRIBIDI_TYPE_PDF: return PANGO_BIDI_TYPE_PDF; + case FRIBIDI_TYPE_EN: return PANGO_BIDI_TYPE_EN; + case FRIBIDI_TYPE_ES: return PANGO_BIDI_TYPE_ES; + case FRIBIDI_TYPE_ET: return PANGO_BIDI_TYPE_ET; + case FRIBIDI_TYPE_AN: return PANGO_BIDI_TYPE_AN; + case FRIBIDI_TYPE_CS: return PANGO_BIDI_TYPE_CS; + case FRIBIDI_TYPE_NSM: return PANGO_BIDI_TYPE_NSM; + case FRIBIDI_TYPE_BN: return PANGO_BIDI_TYPE_BN; + case FRIBIDI_TYPE_BS: return PANGO_BIDI_TYPE_B; + case FRIBIDI_TYPE_SS: return PANGO_BIDI_TYPE_S; + case FRIBIDI_TYPE_WS: return PANGO_BIDI_TYPE_WS; + case FRIBIDI_TYPE_ON: return PANGO_BIDI_TYPE_ON; + default: + /* TODO + * This function has not been updated for latest FriBidi. + * Should add new types and / or deprecate this function. */ + return PANGO_BIDI_TYPE_ON; + } +} + +/* Some bidi-related functions */ + +/** + * pango_log2vis_get_embedding_levels: + * @text: the text to itemize. + * @length: the number of bytes (not characters) to process, or -1 + * if @text is nul-terminated and the length should be calculated. + * @pbase_dir: input base direction, and output resolved direction. + * + * This will return the bidirectional embedding levels of the input paragraph + * as defined by the Unicode Bidirectional Algorithm available at: + * + * http://www.unicode.org/reports/tr9/ + * + * If the input base direction is a weak direction, the direction of the + * characters in the text will determine the final resolved direction. + * + * Return value: a newly allocated array of embedding levels, one item per + * character (not byte), that should be freed using g_free. + * + * Since: 1.4 + */ +guint8 * +pango_log2vis_get_embedding_levels (const gchar *text, + int length, + PangoDirection *pbase_dir) +{ + glong n_chars, i; + guint8 *embedding_levels_list; + const gchar *p; + FriBidiParType fribidi_base_dir; + FriBidiCharType *bidi_types; +#ifdef USE_FRIBIDI_EX_API + FriBidiBracketType *bracket_types; +#endif + FriBidiLevel max_level; + FriBidiCharType ored_types = 0; + FriBidiCharType anded_strongs = FRIBIDI_TYPE_RLE; + + G_STATIC_ASSERT (sizeof (FriBidiLevel) == sizeof (guint8)); + G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar)); + + switch (*pbase_dir) + { + case PANGO_DIRECTION_LTR: + case PANGO_DIRECTION_TTB_RTL: + fribidi_base_dir = FRIBIDI_PAR_LTR; + break; + case PANGO_DIRECTION_RTL: + case PANGO_DIRECTION_TTB_LTR: + fribidi_base_dir = FRIBIDI_PAR_RTL; + break; + case PANGO_DIRECTION_WEAK_RTL: + fribidi_base_dir = FRIBIDI_PAR_WRTL; + break; + case PANGO_DIRECTION_WEAK_LTR: + case PANGO_DIRECTION_NEUTRAL: + default: + fribidi_base_dir = FRIBIDI_PAR_WLTR; + break; + } + + if (length < 0) + length = strlen (text); + + n_chars = g_utf8_strlen (text, length); + + bidi_types = g_new (FriBidiCharType, n_chars); +#ifdef USE_FRIBIDI_EX_API + bracket_types = g_new (FriBidiBracketType, n_chars); +#endif + embedding_levels_list = g_new (guint8, n_chars); + + for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++) + { + gunichar ch = g_utf8_get_char (p); + FriBidiCharType char_type; + char_type = fribidi_get_bidi_type (ch); + bidi_types[i] = char_type; + ored_types |= char_type; + if (FRIBIDI_IS_STRONG (char_type)) + anded_strongs &= char_type; +#ifdef USE_FRIBIDI_EX_API + if (G_UNLIKELY(bidi_types[i] == FRIBIDI_TYPE_ON)) + bracket_types[i] = fribidi_get_bracket (ch); + else + bracket_types[i] = FRIBIDI_NO_BRACKET; +#endif + } + + /* Short-circuit (malloc-expensive) FriBidi call for unidirectional + * text. + * + * For details see: + * https://bugzilla.gnome.org/show_bug.cgi?id=590183 + */ + +#ifndef FRIBIDI_IS_ISOLATE +#define FRIBIDI_IS_ISOLATE(x) 0 +#endif + /* The case that all resolved levels will be ltr. + * No isolates, all strongs be LTR, there should be no Arabic numbers + * (or letters for that matter), and one of the following: + * + * o base_dir doesn't have an RTL taste. + * o there are letters, and base_dir is weak. + */ + if (!FRIBIDI_IS_ISOLATE (ored_types) && + !FRIBIDI_IS_RTL (ored_types) && + !FRIBIDI_IS_ARABIC (ored_types) && + (!FRIBIDI_IS_RTL (fribidi_base_dir) || + (FRIBIDI_IS_WEAK (fribidi_base_dir) && + FRIBIDI_IS_LETTER (ored_types)) + )) + { + /* all LTR */ + fribidi_base_dir = FRIBIDI_PAR_LTR; + memset (embedding_levels_list, 0, n_chars); + goto resolved; + } + /* The case that all resolved levels will be RTL is much more complex. + * No isolates, no numbers, all strongs are RTL, and one of + * the following: + * + * o base_dir has an RTL taste (may be weak). + * o there are letters, and base_dir is weak. + */ + else if (!FRIBIDI_IS_ISOLATE (ored_types) && + !FRIBIDI_IS_NUMBER (ored_types) && + FRIBIDI_IS_RTL (anded_strongs) && + (FRIBIDI_IS_RTL (fribidi_base_dir) || + (FRIBIDI_IS_WEAK (fribidi_base_dir) && + FRIBIDI_IS_LETTER (ored_types)) + )) + { + /* all RTL */ + fribidi_base_dir = FRIBIDI_PAR_RTL; + memset (embedding_levels_list, 1, n_chars); + goto resolved; + } + + +#ifdef USE_FRIBIDI_EX_API + max_level = fribidi_get_par_embedding_levels_ex (bidi_types, bracket_types, n_chars, + &fribidi_base_dir, + (FriBidiLevel*)embedding_levels_list); +#else + max_level = fribidi_get_par_embedding_levels (bidi_types, n_chars, + &fribidi_base_dir, + (FriBidiLevel*)embedding_levels_list); +#endif + + if (G_UNLIKELY(max_level == 0)) + { + /* fribidi_get_par_embedding_levels() failed. */ + memset (embedding_levels_list, 0, length); + } + +resolved: + g_free (bidi_types); + +#ifdef USE_FRIBIDI_EX_API + g_free (bracket_types); +#endif + + *pbase_dir = (fribidi_base_dir == FRIBIDI_PAR_LTR) ? PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL; + + return embedding_levels_list; +} + +/** + * pango_unichar_direction: + * @ch: a Unicode character + * + * Determines the inherent direction of a character; either + * %PANGO_DIRECTION_LTR, %PANGO_DIRECTION_RTL, or + * %PANGO_DIRECTION_NEUTRAL. + * + * This function is useful to categorize characters into left-to-right + * letters, right-to-left letters, and everything else. If full + * Unicode bidirectional type of a character is needed, + * pango_bidi_type_for_unichar() can be used instead. + * + * Return value: the direction of the character. + */ +PangoDirection +pango_unichar_direction (gunichar ch) +{ + FriBidiCharType fribidi_ch_type; + + G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar)); + + fribidi_ch_type = fribidi_get_bidi_type (ch); + + if (!FRIBIDI_IS_STRONG (fribidi_ch_type)) + return PANGO_DIRECTION_NEUTRAL; + else if (FRIBIDI_IS_RTL (fribidi_ch_type)) + return PANGO_DIRECTION_RTL; + else + return PANGO_DIRECTION_LTR; +} + +/** + * pango_get_mirror_char: + * @ch: a Unicode character + * @mirrored_ch: location to store the mirrored character + * + * If @ch has the Unicode mirrored property and there is another Unicode + * character that typically has a glyph that is the mirror image of @ch's + * glyph, puts that character in the address pointed to by @mirrored_ch. + * + * Use g_unichar_get_mirror_char() instead; the docs for that function + * provide full details. + * + * Return value: %TRUE if @ch has a mirrored character and @mirrored_ch is + * filled in, %FALSE otherwise + **/ +gboolean +pango_get_mirror_char (gunichar ch, + gunichar *mirrored_ch) +{ + return g_unichar_get_mirror_char (ch, mirrored_ch); +} + diff --git a/pango/pango-bidi-type.h b/pango/pango-bidi-type.h new file mode 100644 index 0000000..db0c1e0 --- /dev/null +++ b/pango/pango-bidi-type.h @@ -0,0 +1,140 @@ +/* Pango + * pango-bidi-type.h: Bidirectional Character Types + * + * Copyright (C) 2008 Jürg Billeter + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_BIDI_TYPE_H__ +#define __PANGO_BIDI_TYPE_H__ + +#include + +#include +G_BEGIN_DECLS + +/** + * PangoBidiType: + * @PANGO_BIDI_TYPE_L: Left-to-Right + * @PANGO_BIDI_TYPE_LRE: Left-to-Right Embedding + * @PANGO_BIDI_TYPE_LRO: Left-to-Right Override + * @PANGO_BIDI_TYPE_R: Right-to-Left + * @PANGO_BIDI_TYPE_AL: Right-to-Left Arabic + * @PANGO_BIDI_TYPE_RLE: Right-to-Left Embedding + * @PANGO_BIDI_TYPE_RLO: Right-to-Left Override + * @PANGO_BIDI_TYPE_PDF: Pop Directional Format + * @PANGO_BIDI_TYPE_EN: European Number + * @PANGO_BIDI_TYPE_ES: European Number Separator + * @PANGO_BIDI_TYPE_ET: European Number Terminator + * @PANGO_BIDI_TYPE_AN: Arabic Number + * @PANGO_BIDI_TYPE_CS: Common Number Separator + * @PANGO_BIDI_TYPE_NSM: Nonspacing Mark + * @PANGO_BIDI_TYPE_BN: Boundary Neutral + * @PANGO_BIDI_TYPE_B: Paragraph Separator + * @PANGO_BIDI_TYPE_S: Segment Separator + * @PANGO_BIDI_TYPE_WS: Whitespace + * @PANGO_BIDI_TYPE_ON: Other Neutrals + * + * The #PangoBidiType type represents the bidirectional character + * type of a Unicode character as specified by the + * Unicode bidirectional algorithm. + * + * Since: 1.22 + **/ +typedef enum { + /* Strong types */ + PANGO_BIDI_TYPE_L, + PANGO_BIDI_TYPE_LRE, + PANGO_BIDI_TYPE_LRO, + PANGO_BIDI_TYPE_R, + PANGO_BIDI_TYPE_AL, + PANGO_BIDI_TYPE_RLE, + PANGO_BIDI_TYPE_RLO, + + /* Weak types */ + PANGO_BIDI_TYPE_PDF, + PANGO_BIDI_TYPE_EN, + PANGO_BIDI_TYPE_ES, + PANGO_BIDI_TYPE_ET, + PANGO_BIDI_TYPE_AN, + PANGO_BIDI_TYPE_CS, + PANGO_BIDI_TYPE_NSM, + PANGO_BIDI_TYPE_BN, + + /* Neutral types */ + PANGO_BIDI_TYPE_B, + PANGO_BIDI_TYPE_S, + PANGO_BIDI_TYPE_WS, + PANGO_BIDI_TYPE_ON +} PangoBidiType; + +PANGO_AVAILABLE_IN_1_22 +PangoBidiType pango_bidi_type_for_unichar (gunichar ch) G_GNUC_CONST; + +/** + * PangoDirection: + * @PANGO_DIRECTION_LTR: A strong left-to-right direction + * @PANGO_DIRECTION_RTL: A strong right-to-left direction + * @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the + * same as %PANGO_DIRECTION_RTL. + * @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the + * same as %PANGO_DIRECTION_LTR + * @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction + * @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction + * @PANGO_DIRECTION_NEUTRAL: No direction specified + * + * The #PangoDirection type represents a direction in the + * Unicode bidirectional algorithm; not every value in this + * enumeration makes sense for every usage of #PangoDirection; + * for example, the return value of pango_unichar_direction() + * and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR + * or %PANGO_DIRECTION_WEAK_RTL, since every character is either + * neutral or has a strong direction; on the other hand + * %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass + * to pango_itemize_with_base_dir(). + * + * The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL + * values come from an earlier interpretation of this + * enumeration as the writing direction of a block of + * text and are no longer used; See #PangoGravity for how + * vertical text is handled in Pango. + **/ +typedef enum { + PANGO_DIRECTION_LTR, + PANGO_DIRECTION_RTL, + PANGO_DIRECTION_TTB_LTR, + PANGO_DIRECTION_TTB_RTL, + PANGO_DIRECTION_WEAK_LTR, + PANGO_DIRECTION_WEAK_RTL, + PANGO_DIRECTION_NEUTRAL +} PangoDirection; + +PANGO_AVAILABLE_IN_ALL +PangoDirection pango_unichar_direction (gunichar ch) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_4 +PangoDirection pango_find_base_dir (const gchar *text, + gint length); + +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(g_unichar_get_mirror_char) +gboolean pango_get_mirror_char (gunichar ch, + gunichar *mirrored_ch); +#endif + +G_END_DECLS + +#endif /* __PANGO_BIDI_TYPE_H__ */ diff --git a/pango/pango-break.h b/pango/pango-break.h new file mode 100644 index 0000000..4c2cec8 --- /dev/null +++ b/pango/pango-break.h @@ -0,0 +1,177 @@ +/* Pango + * pango-break.h: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_BREAK_H__ +#define __PANGO_BREAK_H__ + +#include + +G_BEGIN_DECLS + +#include + +/* Logical attributes of a character. + */ +/** + * PangoLogAttr: + * @is_line_break: if set, can break line in front of character + * @is_mandatory_break: if set, must break line in front of character + * @is_char_break: if set, can break here when doing character wrapping + * @is_white: is whitespace character + * @is_cursor_position: if set, cursor can appear in front of character. + * i.e. this is a grapheme boundary, or the first character + * in the text. + * This flag implements Unicode's + * Grapheme + * Cluster Boundaries semantics. + * @is_word_start: is first character in a word + * @is_word_end: is first non-word char after a word + * Note that in degenerate cases, you could have both @is_word_start + * and @is_word_end set for some character. + * @is_sentence_boundary: is a sentence boundary. + * There are two ways to divide sentences. The first assigns all + * inter-sentence whitespace/control/format chars to some sentence, + * so all chars are in some sentence; @is_sentence_boundary denotes + * the boundaries there. The second way doesn't assign + * between-sentence spaces, etc. to any sentence, so + * @is_sentence_start/@is_sentence_end mark the boundaries of those sentences. + * @is_sentence_start: is first character in a sentence + * @is_sentence_end: is first char after a sentence. + * Note that in degenerate cases, you could have both @is_sentence_start + * and @is_sentence_end set for some character. (e.g. no space after a + * period, so the next sentence starts right away) + * @backspace_deletes_character: if set, backspace deletes one character + * rather than the entire grapheme cluster. This + * field is only meaningful on grapheme + * boundaries (where @is_cursor_position is + * set). In some languages, the full grapheme + * (e.g. letter + diacritics) is considered a + * unit, while in others, each decomposed + * character in the grapheme is a unit. In the + * default implementation of pango_break(), this + * bit is set on all grapheme boundaries except + * those following Latin, Cyrillic or Greek base characters. + * @is_expandable_space: is a whitespace character that can possibly be + * expanded for justification purposes. (Since: 1.18) + * @is_word_boundary: is a word boundary. + * More specifically, means that this is not a position in the middle + * of a word. For example, both sides of a punctuation mark are + * considered word boundaries. This flag is particularly useful when + * selecting text word-by-word. + * This flag implements Unicode's + * Word + * Boundaries semantics. (Since: 1.22) + * + * The #PangoLogAttr structure stores information + * about the attributes of a single character. + */ +struct _PangoLogAttr +{ + guint is_line_break : 1; /* Can break line in front of character */ + + guint is_mandatory_break : 1; /* Must break line in front of character */ + + guint is_char_break : 1; /* Can break here when doing char wrap */ + + guint is_white : 1; /* Whitespace character */ + + /* Cursor can appear in front of character (i.e. this is a grapheme + * boundary, or the first character in the text). + */ + guint is_cursor_position : 1; + + /* Note that in degenerate cases, you could have both start/end set on + * some text, most likely for sentences (e.g. no space after a period, so + * the next sentence starts right away). + */ + + guint is_word_start : 1; /* first character in a word */ + guint is_word_end : 1; /* is first non-word char after a word */ + + /* There are two ways to divide sentences. The first assigns all + * intersentence whitespace/control/format chars to some sentence, + * so all chars are in some sentence; is_sentence_boundary denotes + * the boundaries there. The second way doesn't assign + * between-sentence spaces, etc. to any sentence, so + * is_sentence_start/is_sentence_end mark the boundaries of those + * sentences. + */ + guint is_sentence_boundary : 1; + guint is_sentence_start : 1; /* first character in a sentence */ + guint is_sentence_end : 1; /* first non-sentence char after a sentence */ + + /* If set, backspace deletes one character rather than + * the entire grapheme cluster. + */ + guint backspace_deletes_character : 1; + + /* Only few space variants (U+0020 and U+00A0) have variable + * width during justification. + */ + guint is_expandable_space : 1; + + /* Word boundary as defined by UAX#29 */ + guint is_word_boundary : 1; /* is NOT in the middle of a word */ +}; + +/* Determine information about cluster/word/line breaks in a string + * of Unicode text. + */ +PANGO_AVAILABLE_IN_ALL +void pango_break (const gchar *text, + int length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len); + +PANGO_AVAILABLE_IN_ALL +void pango_find_paragraph_boundary (const gchar *text, + gint length, + gint *paragraph_delimiter_index, + gint *next_paragraph_start); + +PANGO_AVAILABLE_IN_ALL +void pango_get_log_attrs (const char *text, + int length, + int level, + PangoLanguage *language, + PangoLogAttr *log_attrs, + int attrs_len); + +#ifdef PANGO_ENABLE_ENGINE + +/* This is the default break algorithm, used if no language + * engine overrides it. Normally you should use pango_break() + * instead; this function is mostly useful for chaining up + * from a language engine override. + */ +PANGO_AVAILABLE_IN_ALL +void pango_default_break (const gchar *text, + int length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len); + +#endif /* PANGO_ENABLE_ENGINE */ + +G_END_DECLS + +#endif /* __PANGO_BREAK_H__ */ diff --git a/pango/pango-color-table.h b/pango/pango-color-table.h new file mode 100644 index 0000000..a3b9592 --- /dev/null +++ b/pango/pango-color-table.h @@ -0,0 +1,1349 @@ +/* pango-color-table.h: Generated by gen-color-table.pl from rgb.txt + * + * Date: Thu May 5 15:35:35 2016 + * + * Do not edit. + */ +static const char color_names[] = + "AliceBlue\0" + "AntiqueWhite\0" + "AntiqueWhite1\0" + "AntiqueWhite2\0" + "AntiqueWhite3\0" + "AntiqueWhite4\0" + "aqua\0" + "aquamarine\0" + "aquamarine1\0" + "aquamarine2\0" + "aquamarine3\0" + "aquamarine4\0" + "azure\0" + "azure1\0" + "azure2\0" + "azure3\0" + "azure4\0" + "beige\0" + "bisque\0" + "bisque1\0" + "bisque2\0" + "bisque3\0" + "bisque4\0" + "black\0" + "BlanchedAlmond\0" + "blue\0" + "blue1\0" + "blue2\0" + "blue3\0" + "blue4\0" + "BlueViolet\0" + "brown\0" + "brown1\0" + "brown2\0" + "brown3\0" + "brown4\0" + "burlywood\0" + "burlywood1\0" + "burlywood2\0" + "burlywood3\0" + "burlywood4\0" + "CadetBlue\0" + "CadetBlue1\0" + "CadetBlue2\0" + "CadetBlue3\0" + "CadetBlue4\0" + "chartreuse\0" + "chartreuse1\0" + "chartreuse2\0" + "chartreuse3\0" + "chartreuse4\0" + "chocolate\0" + "chocolate1\0" + "chocolate2\0" + "chocolate3\0" + "chocolate4\0" + "coral\0" + "coral1\0" + "coral2\0" + "coral3\0" + "coral4\0" + "CornflowerBlue\0" + "cornsilk\0" + "cornsilk1\0" + "cornsilk2\0" + "cornsilk3\0" + "cornsilk4\0" + "crimson\0" + "cyan\0" + "cyan1\0" + "cyan2\0" + "cyan3\0" + "cyan4\0" + "DarkBlue\0" + "DarkCyan\0" + "DarkGoldenrod\0" + "DarkGoldenrod1\0" + "DarkGoldenrod2\0" + "DarkGoldenrod3\0" + "DarkGoldenrod4\0" + "DarkGray\0" + "DarkGreen\0" + "DarkGrey\0" + "DarkKhaki\0" + "DarkMagenta\0" + "DarkOliveGreen\0" + "DarkOliveGreen1\0" + "DarkOliveGreen2\0" + "DarkOliveGreen3\0" + "DarkOliveGreen4\0" + "DarkOrange\0" + "DarkOrange1\0" + "DarkOrange2\0" + "DarkOrange3\0" + "DarkOrange4\0" + "DarkOrchid\0" + "DarkOrchid1\0" + "DarkOrchid2\0" + "DarkOrchid3\0" + "DarkOrchid4\0" + "DarkRed\0" + "DarkSalmon\0" + "DarkSeaGreen\0" + "DarkSeaGreen1\0" + "DarkSeaGreen2\0" + "DarkSeaGreen3\0" + "DarkSeaGreen4\0" + "DarkSlateBlue\0" + "DarkSlateGray\0" + "DarkSlateGray1\0" + "DarkSlateGray2\0" + "DarkSlateGray3\0" + "DarkSlateGray4\0" + "DarkSlateGrey\0" + "DarkTurquoise\0" + "DarkViolet\0" + "DeepPink\0" + "DeepPink1\0" + "DeepPink2\0" + "DeepPink3\0" + "DeepPink4\0" + "DeepSkyBlue\0" + "DeepSkyBlue1\0" + "DeepSkyBlue2\0" + "DeepSkyBlue3\0" + "DeepSkyBlue4\0" + "DimGray\0" + "DimGrey\0" + "DodgerBlue\0" + "DodgerBlue1\0" + "DodgerBlue2\0" + "DodgerBlue3\0" + "DodgerBlue4\0" + "firebrick\0" + "firebrick1\0" + "firebrick2\0" + "firebrick3\0" + "firebrick4\0" + "FloralWhite\0" + "ForestGreen\0" + "fuchsia\0" + "gainsboro\0" + "GhostWhite\0" + "gold\0" + "gold1\0" + "gold2\0" + "gold3\0" + "gold4\0" + "goldenrod\0" + "goldenrod1\0" + "goldenrod2\0" + "goldenrod3\0" + "goldenrod4\0" + "gray\0" + "gray0\0" + "gray1\0" + "gray10\0" + "gray100\0" + "gray11\0" + "gray12\0" + "gray13\0" + "gray14\0" + "gray15\0" + "gray16\0" + "gray17\0" + "gray18\0" + "gray19\0" + "gray2\0" + "gray20\0" + "gray21\0" + "gray22\0" + "gray23\0" + "gray24\0" + "gray25\0" + "gray26\0" + "gray27\0" + "gray28\0" + "gray29\0" + "gray3\0" + "gray30\0" + "gray31\0" + "gray32\0" + "gray33\0" + "gray34\0" + "gray35\0" + "gray36\0" + "gray37\0" + "gray38\0" + "gray39\0" + "gray4\0" + "gray40\0" + "gray41\0" + "gray42\0" + "gray43\0" + "gray44\0" + "gray45\0" + "gray46\0" + "gray47\0" + "gray48\0" + "gray49\0" + "gray5\0" + "gray50\0" + "gray51\0" + "gray52\0" + "gray53\0" + "gray54\0" + "gray55\0" + "gray56\0" + "gray57\0" + "gray58\0" + "gray59\0" + "gray6\0" + "gray60\0" + "gray61\0" + "gray62\0" + "gray63\0" + "gray64\0" + "gray65\0" + "gray66\0" + "gray67\0" + "gray68\0" + "gray69\0" + "gray7\0" + "gray70\0" + "gray71\0" + "gray72\0" + "gray73\0" + "gray74\0" + "gray75\0" + "gray76\0" + "gray77\0" + "gray78\0" + "gray79\0" + "gray8\0" + "gray80\0" + "gray81\0" + "gray82\0" + "gray83\0" + "gray84\0" + "gray85\0" + "gray86\0" + "gray87\0" + "gray88\0" + "gray89\0" + "gray9\0" + "gray90\0" + "gray91\0" + "gray92\0" + "gray93\0" + "gray94\0" + "gray95\0" + "gray96\0" + "gray97\0" + "gray98\0" + "gray99\0" + "green\0" + "green1\0" + "green2\0" + "green3\0" + "green4\0" + "GreenYellow\0" + "grey\0" + "grey0\0" + "grey1\0" + "grey10\0" + "grey100\0" + "grey11\0" + "grey12\0" + "grey13\0" + "grey14\0" + "grey15\0" + "grey16\0" + "grey17\0" + "grey18\0" + "grey19\0" + "grey2\0" + "grey20\0" + "grey21\0" + "grey22\0" + "grey23\0" + "grey24\0" + "grey25\0" + "grey26\0" + "grey27\0" + "grey28\0" + "grey29\0" + "grey3\0" + "grey30\0" + "grey31\0" + "grey32\0" + "grey33\0" + "grey34\0" + "grey35\0" + "grey36\0" + "grey37\0" + "grey38\0" + "grey39\0" + "grey4\0" + "grey40\0" + "grey41\0" + "grey42\0" + "grey43\0" + "grey44\0" + "grey45\0" + "grey46\0" + "grey47\0" + "grey48\0" + "grey49\0" + "grey5\0" + "grey50\0" + "grey51\0" + "grey52\0" + "grey53\0" + "grey54\0" + "grey55\0" + "grey56\0" + "grey57\0" + "grey58\0" + "grey59\0" + "grey6\0" + "grey60\0" + "grey61\0" + "grey62\0" + "grey63\0" + "grey64\0" + "grey65\0" + "grey66\0" + "grey67\0" + "grey68\0" + "grey69\0" + "grey7\0" + "grey70\0" + "grey71\0" + "grey72\0" + "grey73\0" + "grey74\0" + "grey75\0" + "grey76\0" + "grey77\0" + "grey78\0" + "grey79\0" + "grey8\0" + "grey80\0" + "grey81\0" + "grey82\0" + "grey83\0" + "grey84\0" + "grey85\0" + "grey86\0" + "grey87\0" + "grey88\0" + "grey89\0" + "grey9\0" + "grey90\0" + "grey91\0" + "grey92\0" + "grey93\0" + "grey94\0" + "grey95\0" + "grey96\0" + "grey97\0" + "grey98\0" + "grey99\0" + "honeydew\0" + "honeydew1\0" + "honeydew2\0" + "honeydew3\0" + "honeydew4\0" + "HotPink\0" + "HotPink1\0" + "HotPink2\0" + "HotPink3\0" + "HotPink4\0" + "IndianRed\0" + "IndianRed1\0" + "IndianRed2\0" + "IndianRed3\0" + "IndianRed4\0" + "indigo\0" + "ivory\0" + "ivory1\0" + "ivory2\0" + "ivory3\0" + "ivory4\0" + "khaki\0" + "khaki1\0" + "khaki2\0" + "khaki3\0" + "khaki4\0" + "lavender\0" + "LavenderBlush\0" + "LavenderBlush1\0" + "LavenderBlush2\0" + "LavenderBlush3\0" + "LavenderBlush4\0" + "LawnGreen\0" + "LemonChiffon\0" + "LemonChiffon1\0" + "LemonChiffon2\0" + "LemonChiffon3\0" + "LemonChiffon4\0" + "LightBlue\0" + "LightBlue1\0" + "LightBlue2\0" + "LightBlue3\0" + "LightBlue4\0" + "LightCoral\0" + "LightCyan\0" + "LightCyan1\0" + "LightCyan2\0" + "LightCyan3\0" + "LightCyan4\0" + "LightGoldenrod\0" + "LightGoldenrod1\0" + "LightGoldenrod2\0" + "LightGoldenrod3\0" + "LightGoldenrod4\0" + "LightGoldenrodYellow\0" + "LightGray\0" + "LightGreen\0" + "LightGrey\0" + "LightPink\0" + "LightPink1\0" + "LightPink2\0" + "LightPink3\0" + "LightPink4\0" + "LightSalmon\0" + "LightSalmon1\0" + "LightSalmon2\0" + "LightSalmon3\0" + "LightSalmon4\0" + "LightSeaGreen\0" + "LightSkyBlue\0" + "LightSkyBlue1\0" + "LightSkyBlue2\0" + "LightSkyBlue3\0" + "LightSkyBlue4\0" + "LightSlateBlue\0" + "LightSlateGray\0" + "LightSlateGrey\0" + "LightSteelBlue\0" + "LightSteelBlue1\0" + "LightSteelBlue2\0" + "LightSteelBlue3\0" + "LightSteelBlue4\0" + "LightYellow\0" + "LightYellow1\0" + "LightYellow2\0" + "LightYellow3\0" + "LightYellow4\0" + "lime\0" + "LimeGreen\0" + "linen\0" + "magenta\0" + "magenta1\0" + "magenta2\0" + "magenta3\0" + "magenta4\0" + "maroon\0" + "maroon1\0" + "maroon2\0" + "maroon3\0" + "maroon4\0" + "MediumAquamarine\0" + "MediumBlue\0" + "MediumOrchid\0" + "MediumOrchid1\0" + "MediumOrchid2\0" + "MediumOrchid3\0" + "MediumOrchid4\0" + "MediumPurple\0" + "MediumPurple1\0" + "MediumPurple2\0" + "MediumPurple3\0" + "MediumPurple4\0" + "MediumSeaGreen\0" + "MediumSlateBlue\0" + "MediumSpringGreen\0" + "MediumTurquoise\0" + "MediumVioletRed\0" + "MidnightBlue\0" + "MintCream\0" + "MistyRose\0" + "MistyRose1\0" + "MistyRose2\0" + "MistyRose3\0" + "MistyRose4\0" + "moccasin\0" + "NavajoWhite\0" + "NavajoWhite1\0" + "NavajoWhite2\0" + "NavajoWhite3\0" + "NavajoWhite4\0" + "navy\0" + "NavyBlue\0" + "OldLace\0" + "olive\0" + "OliveDrab\0" + "OliveDrab1\0" + "OliveDrab2\0" + "OliveDrab3\0" + "OliveDrab4\0" + "orange\0" + "orange1\0" + "orange2\0" + "orange3\0" + "orange4\0" + "OrangeRed\0" + "OrangeRed1\0" + "OrangeRed2\0" + "OrangeRed3\0" + "OrangeRed4\0" + "orchid\0" + "orchid1\0" + "orchid2\0" + "orchid3\0" + "orchid4\0" + "PaleGoldenrod\0" + "PaleGreen\0" + "PaleGreen1\0" + "PaleGreen2\0" + "PaleGreen3\0" + "PaleGreen4\0" + "PaleTurquoise\0" + "PaleTurquoise1\0" + "PaleTurquoise2\0" + "PaleTurquoise3\0" + "PaleTurquoise4\0" + "PaleVioletRed\0" + "PaleVioletRed1\0" + "PaleVioletRed2\0" + "PaleVioletRed3\0" + "PaleVioletRed4\0" + "PapayaWhip\0" + "PeachPuff\0" + "PeachPuff1\0" + "PeachPuff2\0" + "PeachPuff3\0" + "PeachPuff4\0" + "peru\0" + "pink\0" + "pink1\0" + "pink2\0" + "pink3\0" + "pink4\0" + "plum\0" + "plum1\0" + "plum2\0" + "plum3\0" + "plum4\0" + "PowderBlue\0" + "purple\0" + "purple1\0" + "purple2\0" + "purple3\0" + "purple4\0" + "rebeccapurple\0" + "red\0" + "red1\0" + "red2\0" + "red3\0" + "red4\0" + "RosyBrown\0" + "RosyBrown1\0" + "RosyBrown2\0" + "RosyBrown3\0" + "RosyBrown4\0" + "RoyalBlue\0" + "RoyalBlue1\0" + "RoyalBlue2\0" + "RoyalBlue3\0" + "RoyalBlue4\0" + "SaddleBrown\0" + "salmon\0" + "salmon1\0" + "salmon2\0" + "salmon3\0" + "salmon4\0" + "SandyBrown\0" + "SeaGreen\0" + "SeaGreen1\0" + "SeaGreen2\0" + "SeaGreen3\0" + "SeaGreen4\0" + "seashell\0" + "seashell1\0" + "seashell2\0" + "seashell3\0" + "seashell4\0" + "sienna\0" + "sienna1\0" + "sienna2\0" + "sienna3\0" + "sienna4\0" + "silver\0" + "SkyBlue\0" + "SkyBlue1\0" + "SkyBlue2\0" + "SkyBlue3\0" + "SkyBlue4\0" + "SlateBlue\0" + "SlateBlue1\0" + "SlateBlue2\0" + "SlateBlue3\0" + "SlateBlue4\0" + "SlateGray\0" + "SlateGray1\0" + "SlateGray2\0" + "SlateGray3\0" + "SlateGray4\0" + "SlateGrey\0" + "snow\0" + "snow1\0" + "snow2\0" + "snow3\0" + "snow4\0" + "SpringGreen\0" + "SpringGreen1\0" + "SpringGreen2\0" + "SpringGreen3\0" + "SpringGreen4\0" + "SteelBlue\0" + "SteelBlue1\0" + "SteelBlue2\0" + "SteelBlue3\0" + "SteelBlue4\0" + "tan\0" + "tan1\0" + "tan2\0" + "tan3\0" + "tan4\0" + "teal\0" + "thistle\0" + "thistle1\0" + "thistle2\0" + "thistle3\0" + "thistle4\0" + "tomato\0" + "tomato1\0" + "tomato2\0" + "tomato3\0" + "tomato4\0" + "turquoise\0" + "turquoise1\0" + "turquoise2\0" + "turquoise3\0" + "turquoise4\0" + "violet\0" + "VioletRed\0" + "VioletRed1\0" + "VioletRed2\0" + "VioletRed3\0" + "VioletRed4\0" + "wheat\0" + "wheat1\0" + "wheat2\0" + "wheat3\0" + "wheat4\0" + "white\0" + "WhiteSmoke\0" + "yellow\0" + "yellow1\0" + "yellow2\0" + "yellow3\0" + "yellow4\0" + "YellowGreen\0"; + +typedef struct { + guint16 name_offset; + guchar red; + guchar green; + guchar blue; +} ColorEntry; + +static const ColorEntry color_entries[] = { + { 0, 240, 248, 255 }, + { 10, 250, 235, 215 }, + { 23, 255, 239, 219 }, + { 37, 238, 223, 204 }, + { 51, 205, 192, 176 }, + { 65, 139, 131, 120 }, + { 79, 0, 255, 255 }, + { 84, 127, 255, 212 }, + { 95, 127, 255, 212 }, + { 107, 118, 238, 198 }, + { 119, 102, 205, 170 }, + { 131, 69, 139, 116 }, + { 143, 240, 255, 255 }, + { 149, 240, 255, 255 }, + { 156, 224, 238, 238 }, + { 163, 193, 205, 205 }, + { 170, 131, 139, 139 }, + { 177, 245, 245, 220 }, + { 183, 255, 228, 196 }, + { 190, 255, 228, 196 }, + { 198, 238, 213, 183 }, + { 206, 205, 183, 158 }, + { 214, 139, 125, 107 }, + { 222, 0, 0, 0 }, + { 228, 255, 235, 205 }, + { 243, 0, 0, 255 }, + { 248, 0, 0, 255 }, + { 254, 0, 0, 238 }, + { 260, 0, 0, 205 }, + { 266, 0, 0, 139 }, + { 272, 138, 43, 226 }, + { 283, 165, 42, 42 }, + { 289, 255, 64, 64 }, + { 296, 238, 59, 59 }, + { 303, 205, 51, 51 }, + { 310, 139, 35, 35 }, + { 317, 222, 184, 135 }, + { 327, 255, 211, 155 }, + { 338, 238, 197, 145 }, + { 349, 205, 170, 125 }, + { 360, 139, 115, 85 }, + { 371, 95, 158, 160 }, + { 381, 152, 245, 255 }, + { 392, 142, 229, 238 }, + { 403, 122, 197, 205 }, + { 414, 83, 134, 139 }, + { 425, 127, 255, 0 }, + { 436, 127, 255, 0 }, + { 448, 118, 238, 0 }, + { 460, 102, 205, 0 }, + { 472, 69, 139, 0 }, + { 484, 210, 105, 30 }, + { 494, 255, 127, 36 }, + { 505, 238, 118, 33 }, + { 516, 205, 102, 29 }, + { 527, 139, 69, 19 }, + { 538, 255, 127, 80 }, + { 544, 255, 114, 86 }, + { 551, 238, 106, 80 }, + { 558, 205, 91, 69 }, + { 565, 139, 62, 47 }, + { 572, 100, 149, 237 }, + { 587, 255, 248, 220 }, + { 596, 255, 248, 220 }, + { 606, 238, 232, 205 }, + { 616, 205, 200, 177 }, + { 626, 139, 136, 120 }, + { 636, 220, 20, 60 }, + { 644, 0, 255, 255 }, + { 649, 0, 255, 255 }, + { 655, 0, 238, 238 }, + { 661, 0, 205, 205 }, + { 667, 0, 139, 139 }, + { 673, 0, 0, 139 }, + { 682, 0, 139, 139 }, + { 691, 184, 134, 11 }, + { 705, 255, 185, 15 }, + { 720, 238, 173, 14 }, + { 735, 205, 149, 12 }, + { 750, 139, 101, 8 }, + { 765, 169, 169, 169 }, + { 774, 0, 100, 0 }, + { 784, 169, 169, 169 }, + { 793, 189, 183, 107 }, + { 803, 139, 0, 139 }, + { 815, 85, 107, 47 }, + { 830, 202, 255, 112 }, + { 846, 188, 238, 104 }, + { 862, 162, 205, 90 }, + { 878, 110, 139, 61 }, + { 894, 255, 140, 0 }, + { 905, 255, 127, 0 }, + { 917, 238, 118, 0 }, + { 929, 205, 102, 0 }, + { 941, 139, 69, 0 }, + { 953, 153, 50, 204 }, + { 964, 191, 62, 255 }, + { 976, 178, 58, 238 }, + { 988, 154, 50, 205 }, + { 1000, 104, 34, 139 }, + { 1012, 139, 0, 0 }, + { 1020, 233, 150, 122 }, + { 1031, 143, 188, 143 }, + { 1044, 193, 255, 193 }, + { 1058, 180, 238, 180 }, + { 1072, 155, 205, 155 }, + { 1086, 105, 139, 105 }, + { 1100, 72, 61, 139 }, + { 1114, 47, 79, 79 }, + { 1128, 151, 255, 255 }, + { 1143, 141, 238, 238 }, + { 1158, 121, 205, 205 }, + { 1173, 82, 139, 139 }, + { 1188, 47, 79, 79 }, + { 1202, 0, 206, 209 }, + { 1216, 148, 0, 211 }, + { 1227, 255, 20, 147 }, + { 1236, 255, 20, 147 }, + { 1246, 238, 18, 137 }, + { 1256, 205, 16, 118 }, + { 1266, 139, 10, 80 }, + { 1276, 0, 191, 255 }, + { 1288, 0, 191, 255 }, + { 1301, 0, 178, 238 }, + { 1314, 0, 154, 205 }, + { 1327, 0, 104, 139 }, + { 1340, 105, 105, 105 }, + { 1348, 105, 105, 105 }, + { 1356, 30, 144, 255 }, + { 1367, 30, 144, 255 }, + { 1379, 28, 134, 238 }, + { 1391, 24, 116, 205 }, + { 1403, 16, 78, 139 }, + { 1415, 178, 34, 34 }, + { 1425, 255, 48, 48 }, + { 1436, 238, 44, 44 }, + { 1447, 205, 38, 38 }, + { 1458, 139, 26, 26 }, + { 1469, 255, 250, 240 }, + { 1481, 34, 139, 34 }, + { 1493, 255, 0, 255 }, + { 1501, 220, 220, 220 }, + { 1511, 248, 248, 255 }, + { 1522, 255, 215, 0 }, + { 1527, 255, 215, 0 }, + { 1533, 238, 201, 0 }, + { 1539, 205, 173, 0 }, + { 1545, 139, 117, 0 }, + { 1551, 218, 165, 32 }, + { 1561, 255, 193, 37 }, + { 1572, 238, 180, 34 }, + { 1583, 205, 155, 29 }, + { 1594, 139, 105, 20 }, + { 1605, 128, 128, 128 }, + { 1610, 0, 0, 0 }, + { 1616, 3, 3, 3 }, + { 1622, 26, 26, 26 }, + { 1629, 255, 255, 255 }, + { 1637, 28, 28, 28 }, + { 1644, 31, 31, 31 }, + { 1651, 33, 33, 33 }, + { 1658, 36, 36, 36 }, + { 1665, 38, 38, 38 }, + { 1672, 41, 41, 41 }, + { 1679, 43, 43, 43 }, + { 1686, 46, 46, 46 }, + { 1693, 48, 48, 48 }, + { 1700, 5, 5, 5 }, + { 1706, 51, 51, 51 }, + { 1713, 54, 54, 54 }, + { 1720, 56, 56, 56 }, + { 1727, 59, 59, 59 }, + { 1734, 61, 61, 61 }, + { 1741, 64, 64, 64 }, + { 1748, 66, 66, 66 }, + { 1755, 69, 69, 69 }, + { 1762, 71, 71, 71 }, + { 1769, 74, 74, 74 }, + { 1776, 8, 8, 8 }, + { 1782, 77, 77, 77 }, + { 1789, 79, 79, 79 }, + { 1796, 82, 82, 82 }, + { 1803, 84, 84, 84 }, + { 1810, 87, 87, 87 }, + { 1817, 89, 89, 89 }, + { 1824, 92, 92, 92 }, + { 1831, 94, 94, 94 }, + { 1838, 97, 97, 97 }, + { 1845, 99, 99, 99 }, + { 1852, 10, 10, 10 }, + { 1858, 102, 102, 102 }, + { 1865, 105, 105, 105 }, + { 1872, 107, 107, 107 }, + { 1879, 110, 110, 110 }, + { 1886, 112, 112, 112 }, + { 1893, 115, 115, 115 }, + { 1900, 117, 117, 117 }, + { 1907, 120, 120, 120 }, + { 1914, 122, 122, 122 }, + { 1921, 125, 125, 125 }, + { 1928, 13, 13, 13 }, + { 1934, 127, 127, 127 }, + { 1941, 130, 130, 130 }, + { 1948, 133, 133, 133 }, + { 1955, 135, 135, 135 }, + { 1962, 138, 138, 138 }, + { 1969, 140, 140, 140 }, + { 1976, 143, 143, 143 }, + { 1983, 145, 145, 145 }, + { 1990, 148, 148, 148 }, + { 1997, 150, 150, 150 }, + { 2004, 15, 15, 15 }, + { 2010, 153, 153, 153 }, + { 2017, 156, 156, 156 }, + { 2024, 158, 158, 158 }, + { 2031, 161, 161, 161 }, + { 2038, 163, 163, 163 }, + { 2045, 166, 166, 166 }, + { 2052, 168, 168, 168 }, + { 2059, 171, 171, 171 }, + { 2066, 173, 173, 173 }, + { 2073, 176, 176, 176 }, + { 2080, 18, 18, 18 }, + { 2086, 179, 179, 179 }, + { 2093, 181, 181, 181 }, + { 2100, 184, 184, 184 }, + { 2107, 186, 186, 186 }, + { 2114, 189, 189, 189 }, + { 2121, 191, 191, 191 }, + { 2128, 194, 194, 194 }, + { 2135, 196, 196, 196 }, + { 2142, 199, 199, 199 }, + { 2149, 201, 201, 201 }, + { 2156, 20, 20, 20 }, + { 2162, 204, 204, 204 }, + { 2169, 207, 207, 207 }, + { 2176, 209, 209, 209 }, + { 2183, 212, 212, 212 }, + { 2190, 214, 214, 214 }, + { 2197, 217, 217, 217 }, + { 2204, 219, 219, 219 }, + { 2211, 222, 222, 222 }, + { 2218, 224, 224, 224 }, + { 2225, 227, 227, 227 }, + { 2232, 23, 23, 23 }, + { 2238, 229, 229, 229 }, + { 2245, 232, 232, 232 }, + { 2252, 235, 235, 235 }, + { 2259, 237, 237, 237 }, + { 2266, 240, 240, 240 }, + { 2273, 242, 242, 242 }, + { 2280, 245, 245, 245 }, + { 2287, 247, 247, 247 }, + { 2294, 250, 250, 250 }, + { 2301, 252, 252, 252 }, + { 2308, 0, 128, 0 }, + { 2314, 0, 255, 0 }, + { 2321, 0, 238, 0 }, + { 2328, 0, 205, 0 }, + { 2335, 0, 139, 0 }, + { 2342, 173, 255, 47 }, + { 2354, 128, 128, 128 }, + { 2359, 0, 0, 0 }, + { 2365, 3, 3, 3 }, + { 2371, 26, 26, 26 }, + { 2378, 255, 255, 255 }, + { 2386, 28, 28, 28 }, + { 2393, 31, 31, 31 }, + { 2400, 33, 33, 33 }, + { 2407, 36, 36, 36 }, + { 2414, 38, 38, 38 }, + { 2421, 41, 41, 41 }, + { 2428, 43, 43, 43 }, + { 2435, 46, 46, 46 }, + { 2442, 48, 48, 48 }, + { 2449, 5, 5, 5 }, + { 2455, 51, 51, 51 }, + { 2462, 54, 54, 54 }, + { 2469, 56, 56, 56 }, + { 2476, 59, 59, 59 }, + { 2483, 61, 61, 61 }, + { 2490, 64, 64, 64 }, + { 2497, 66, 66, 66 }, + { 2504, 69, 69, 69 }, + { 2511, 71, 71, 71 }, + { 2518, 74, 74, 74 }, + { 2525, 8, 8, 8 }, + { 2531, 77, 77, 77 }, + { 2538, 79, 79, 79 }, + { 2545, 82, 82, 82 }, + { 2552, 84, 84, 84 }, + { 2559, 87, 87, 87 }, + { 2566, 89, 89, 89 }, + { 2573, 92, 92, 92 }, + { 2580, 94, 94, 94 }, + { 2587, 97, 97, 97 }, + { 2594, 99, 99, 99 }, + { 2601, 10, 10, 10 }, + { 2607, 102, 102, 102 }, + { 2614, 105, 105, 105 }, + { 2621, 107, 107, 107 }, + { 2628, 110, 110, 110 }, + { 2635, 112, 112, 112 }, + { 2642, 115, 115, 115 }, + { 2649, 117, 117, 117 }, + { 2656, 120, 120, 120 }, + { 2663, 122, 122, 122 }, + { 2670, 125, 125, 125 }, + { 2677, 13, 13, 13 }, + { 2683, 127, 127, 127 }, + { 2690, 130, 130, 130 }, + { 2697, 133, 133, 133 }, + { 2704, 135, 135, 135 }, + { 2711, 138, 138, 138 }, + { 2718, 140, 140, 140 }, + { 2725, 143, 143, 143 }, + { 2732, 145, 145, 145 }, + { 2739, 148, 148, 148 }, + { 2746, 150, 150, 150 }, + { 2753, 15, 15, 15 }, + { 2759, 153, 153, 153 }, + { 2766, 156, 156, 156 }, + { 2773, 158, 158, 158 }, + { 2780, 161, 161, 161 }, + { 2787, 163, 163, 163 }, + { 2794, 166, 166, 166 }, + { 2801, 168, 168, 168 }, + { 2808, 171, 171, 171 }, + { 2815, 173, 173, 173 }, + { 2822, 176, 176, 176 }, + { 2829, 18, 18, 18 }, + { 2835, 179, 179, 179 }, + { 2842, 181, 181, 181 }, + { 2849, 184, 184, 184 }, + { 2856, 186, 186, 186 }, + { 2863, 189, 189, 189 }, + { 2870, 191, 191, 191 }, + { 2877, 194, 194, 194 }, + { 2884, 196, 196, 196 }, + { 2891, 199, 199, 199 }, + { 2898, 201, 201, 201 }, + { 2905, 20, 20, 20 }, + { 2911, 204, 204, 204 }, + { 2918, 207, 207, 207 }, + { 2925, 209, 209, 209 }, + { 2932, 212, 212, 212 }, + { 2939, 214, 214, 214 }, + { 2946, 217, 217, 217 }, + { 2953, 219, 219, 219 }, + { 2960, 222, 222, 222 }, + { 2967, 224, 224, 224 }, + { 2974, 227, 227, 227 }, + { 2981, 23, 23, 23 }, + { 2987, 229, 229, 229 }, + { 2994, 232, 232, 232 }, + { 3001, 235, 235, 235 }, + { 3008, 237, 237, 237 }, + { 3015, 240, 240, 240 }, + { 3022, 242, 242, 242 }, + { 3029, 245, 245, 245 }, + { 3036, 247, 247, 247 }, + { 3043, 250, 250, 250 }, + { 3050, 252, 252, 252 }, + { 3057, 240, 255, 240 }, + { 3066, 240, 255, 240 }, + { 3076, 224, 238, 224 }, + { 3086, 193, 205, 193 }, + { 3096, 131, 139, 131 }, + { 3106, 255, 105, 180 }, + { 3114, 255, 110, 180 }, + { 3123, 238, 106, 167 }, + { 3132, 205, 96, 144 }, + { 3141, 139, 58, 98 }, + { 3150, 205, 92, 92 }, + { 3160, 255, 106, 106 }, + { 3171, 238, 99, 99 }, + { 3182, 205, 85, 85 }, + { 3193, 139, 58, 58 }, + { 3204, 75, 0, 130 }, + { 3211, 255, 255, 240 }, + { 3217, 255, 255, 240 }, + { 3224, 238, 238, 224 }, + { 3231, 205, 205, 193 }, + { 3238, 139, 139, 131 }, + { 3245, 240, 230, 140 }, + { 3251, 255, 246, 143 }, + { 3258, 238, 230, 133 }, + { 3265, 205, 198, 115 }, + { 3272, 139, 134, 78 }, + { 3279, 230, 230, 250 }, + { 3288, 255, 240, 245 }, + { 3302, 255, 240, 245 }, + { 3317, 238, 224, 229 }, + { 3332, 205, 193, 197 }, + { 3347, 139, 131, 134 }, + { 3362, 124, 252, 0 }, + { 3372, 255, 250, 205 }, + { 3385, 255, 250, 205 }, + { 3399, 238, 233, 191 }, + { 3413, 205, 201, 165 }, + { 3427, 139, 137, 112 }, + { 3441, 173, 216, 230 }, + { 3451, 191, 239, 255 }, + { 3462, 178, 223, 238 }, + { 3473, 154, 192, 205 }, + { 3484, 104, 131, 139 }, + { 3495, 240, 128, 128 }, + { 3506, 224, 255, 255 }, + { 3516, 224, 255, 255 }, + { 3527, 209, 238, 238 }, + { 3538, 180, 205, 205 }, + { 3549, 122, 139, 139 }, + { 3560, 238, 221, 130 }, + { 3575, 255, 236, 139 }, + { 3591, 238, 220, 130 }, + { 3607, 205, 190, 112 }, + { 3623, 139, 129, 76 }, + { 3639, 250, 250, 210 }, + { 3660, 211, 211, 211 }, + { 3670, 144, 238, 144 }, + { 3681, 211, 211, 211 }, + { 3691, 255, 182, 193 }, + { 3701, 255, 174, 185 }, + { 3712, 238, 162, 173 }, + { 3723, 205, 140, 149 }, + { 3734, 139, 95, 101 }, + { 3745, 255, 160, 122 }, + { 3757, 255, 160, 122 }, + { 3770, 238, 149, 114 }, + { 3783, 205, 129, 98 }, + { 3796, 139, 87, 66 }, + { 3809, 32, 178, 170 }, + { 3823, 135, 206, 250 }, + { 3836, 176, 226, 255 }, + { 3850, 164, 211, 238 }, + { 3864, 141, 182, 205 }, + { 3878, 96, 123, 139 }, + { 3892, 132, 112, 255 }, + { 3907, 119, 136, 153 }, + { 3922, 119, 136, 153 }, + { 3937, 176, 196, 222 }, + { 3952, 202, 225, 255 }, + { 3968, 188, 210, 238 }, + { 3984, 162, 181, 205 }, + { 4000, 110, 123, 139 }, + { 4016, 255, 255, 224 }, + { 4028, 255, 255, 224 }, + { 4041, 238, 238, 209 }, + { 4054, 205, 205, 180 }, + { 4067, 139, 139, 122 }, + { 4080, 0, 255, 0 }, + { 4085, 50, 205, 50 }, + { 4095, 250, 240, 230 }, + { 4101, 255, 0, 255 }, + { 4109, 255, 0, 255 }, + { 4118, 238, 0, 238 }, + { 4127, 205, 0, 205 }, + { 4136, 139, 0, 139 }, + { 4145, 128, 0, 0 }, + { 4152, 255, 52, 179 }, + { 4160, 238, 48, 167 }, + { 4168, 205, 41, 144 }, + { 4176, 139, 28, 98 }, + { 4184, 102, 205, 170 }, + { 4201, 0, 0, 205 }, + { 4212, 186, 85, 211 }, + { 4225, 224, 102, 255 }, + { 4239, 209, 95, 238 }, + { 4253, 180, 82, 205 }, + { 4267, 122, 55, 139 }, + { 4281, 147, 112, 219 }, + { 4294, 171, 130, 255 }, + { 4308, 159, 121, 238 }, + { 4322, 137, 104, 205 }, + { 4336, 93, 71, 139 }, + { 4350, 60, 179, 113 }, + { 4365, 123, 104, 238 }, + { 4381, 0, 250, 154 }, + { 4399, 72, 209, 204 }, + { 4415, 199, 21, 133 }, + { 4431, 25, 25, 112 }, + { 4444, 245, 255, 250 }, + { 4454, 255, 228, 225 }, + { 4464, 255, 228, 225 }, + { 4475, 238, 213, 210 }, + { 4486, 205, 183, 181 }, + { 4497, 139, 125, 123 }, + { 4508, 255, 228, 181 }, + { 4517, 255, 222, 173 }, + { 4529, 255, 222, 173 }, + { 4542, 238, 207, 161 }, + { 4555, 205, 179, 139 }, + { 4568, 139, 121, 94 }, + { 4581, 0, 0, 128 }, + { 4586, 0, 0, 128 }, + { 4595, 253, 245, 230 }, + { 4603, 128, 128, 0 }, + { 4609, 107, 142, 35 }, + { 4619, 192, 255, 62 }, + { 4630, 179, 238, 58 }, + { 4641, 154, 205, 50 }, + { 4652, 105, 139, 34 }, + { 4663, 255, 165, 0 }, + { 4670, 255, 165, 0 }, + { 4678, 238, 154, 0 }, + { 4686, 205, 133, 0 }, + { 4694, 139, 90, 0 }, + { 4702, 255, 69, 0 }, + { 4712, 255, 69, 0 }, + { 4723, 238, 64, 0 }, + { 4734, 205, 55, 0 }, + { 4745, 139, 37, 0 }, + { 4756, 218, 112, 214 }, + { 4763, 255, 131, 250 }, + { 4771, 238, 122, 233 }, + { 4779, 205, 105, 201 }, + { 4787, 139, 71, 137 }, + { 4795, 238, 232, 170 }, + { 4809, 152, 251, 152 }, + { 4819, 154, 255, 154 }, + { 4830, 144, 238, 144 }, + { 4841, 124, 205, 124 }, + { 4852, 84, 139, 84 }, + { 4863, 175, 238, 238 }, + { 4877, 187, 255, 255 }, + { 4892, 174, 238, 238 }, + { 4907, 150, 205, 205 }, + { 4922, 102, 139, 139 }, + { 4937, 219, 112, 147 }, + { 4951, 255, 130, 171 }, + { 4966, 238, 121, 159 }, + { 4981, 205, 104, 137 }, + { 4996, 139, 71, 93 }, + { 5011, 255, 239, 213 }, + { 5022, 255, 218, 185 }, + { 5032, 255, 218, 185 }, + { 5043, 238, 203, 173 }, + { 5054, 205, 175, 149 }, + { 5065, 139, 119, 101 }, + { 5076, 205, 133, 63 }, + { 5081, 255, 192, 203 }, + { 5086, 255, 181, 197 }, + { 5092, 238, 169, 184 }, + { 5098, 205, 145, 158 }, + { 5104, 139, 99, 108 }, + { 5110, 221, 160, 221 }, + { 5115, 255, 187, 255 }, + { 5121, 238, 174, 238 }, + { 5127, 205, 150, 205 }, + { 5133, 139, 102, 139 }, + { 5139, 176, 224, 230 }, + { 5150, 128, 0, 128 }, + { 5157, 155, 48, 255 }, + { 5165, 145, 44, 238 }, + { 5173, 125, 38, 205 }, + { 5181, 85, 26, 139 }, + { 5189, 102, 51, 153 }, + { 5203, 255, 0, 0 }, + { 5207, 255, 0, 0 }, + { 5212, 238, 0, 0 }, + { 5217, 205, 0, 0 }, + { 5222, 139, 0, 0 }, + { 5227, 188, 143, 143 }, + { 5237, 255, 193, 193 }, + { 5248, 238, 180, 180 }, + { 5259, 205, 155, 155 }, + { 5270, 139, 105, 105 }, + { 5281, 65, 105, 225 }, + { 5291, 72, 118, 255 }, + { 5302, 67, 110, 238 }, + { 5313, 58, 95, 205 }, + { 5324, 39, 64, 139 }, + { 5335, 139, 69, 19 }, + { 5347, 250, 128, 114 }, + { 5354, 255, 140, 105 }, + { 5362, 238, 130, 98 }, + { 5370, 205, 112, 84 }, + { 5378, 139, 76, 57 }, + { 5386, 244, 164, 96 }, + { 5397, 46, 139, 87 }, + { 5406, 84, 255, 159 }, + { 5416, 78, 238, 148 }, + { 5426, 67, 205, 128 }, + { 5436, 46, 139, 87 }, + { 5446, 255, 245, 238 }, + { 5455, 255, 245, 238 }, + { 5465, 238, 229, 222 }, + { 5475, 205, 197, 191 }, + { 5485, 139, 134, 130 }, + { 5495, 160, 82, 45 }, + { 5502, 255, 130, 71 }, + { 5510, 238, 121, 66 }, + { 5518, 205, 104, 57 }, + { 5526, 139, 71, 38 }, + { 5534, 192, 192, 192 }, + { 5541, 135, 206, 235 }, + { 5549, 135, 206, 255 }, + { 5558, 126, 192, 238 }, + { 5567, 108, 166, 205 }, + { 5576, 74, 112, 139 }, + { 5585, 106, 90, 205 }, + { 5595, 131, 111, 255 }, + { 5606, 122, 103, 238 }, + { 5617, 105, 89, 205 }, + { 5628, 71, 60, 139 }, + { 5639, 112, 128, 144 }, + { 5649, 198, 226, 255 }, + { 5660, 185, 211, 238 }, + { 5671, 159, 182, 205 }, + { 5682, 108, 123, 139 }, + { 5693, 112, 128, 144 }, + { 5703, 255, 250, 250 }, + { 5708, 255, 250, 250 }, + { 5714, 238, 233, 233 }, + { 5720, 205, 201, 201 }, + { 5726, 139, 137, 137 }, + { 5732, 0, 255, 127 }, + { 5744, 0, 255, 127 }, + { 5757, 0, 238, 118 }, + { 5770, 0, 205, 102 }, + { 5783, 0, 139, 69 }, + { 5796, 70, 130, 180 }, + { 5806, 99, 184, 255 }, + { 5817, 92, 172, 238 }, + { 5828, 79, 148, 205 }, + { 5839, 54, 100, 139 }, + { 5850, 210, 180, 140 }, + { 5854, 255, 165, 79 }, + { 5859, 238, 154, 73 }, + { 5864, 205, 133, 63 }, + { 5869, 139, 90, 43 }, + { 5874, 0, 128, 128 }, + { 5879, 216, 191, 216 }, + { 5887, 255, 225, 255 }, + { 5896, 238, 210, 238 }, + { 5905, 205, 181, 205 }, + { 5914, 139, 123, 139 }, + { 5923, 255, 99, 71 }, + { 5930, 255, 99, 71 }, + { 5938, 238, 92, 66 }, + { 5946, 205, 79, 57 }, + { 5954, 139, 54, 38 }, + { 5962, 64, 224, 208 }, + { 5972, 0, 245, 255 }, + { 5983, 0, 229, 238 }, + { 5994, 0, 197, 205 }, + { 6005, 0, 134, 139 }, + { 6016, 238, 130, 238 }, + { 6023, 208, 32, 144 }, + { 6033, 255, 62, 150 }, + { 6044, 238, 58, 140 }, + { 6055, 205, 50, 120 }, + { 6066, 139, 34, 82 }, + { 6077, 245, 222, 179 }, + { 6083, 255, 231, 186 }, + { 6090, 238, 216, 174 }, + { 6097, 205, 186, 150 }, + { 6104, 139, 126, 102 }, + { 6111, 255, 255, 255 }, + { 6117, 245, 245, 245 }, + { 6128, 255, 255, 0 }, + { 6135, 255, 255, 0 }, + { 6143, 238, 238, 0 }, + { 6151, 205, 205, 0 }, + { 6159, 139, 139, 0 }, + { 6167, 154, 205, 50 } +}; diff --git a/pango/pango-color.c b/pango/pango-color.c new file mode 100644 index 0000000..3c37c3d --- /dev/null +++ b/pango/pango-color.c @@ -0,0 +1,320 @@ +/* pango + * pango-color.c: Color handling + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include + +#include "pango-attributes.h" +#include "pango-impl-utils.h" +#include "pango-utils-internal.h" + +G_DEFINE_BOXED_TYPE (PangoColor, pango_color, + pango_color_copy, + pango_color_free); + +/** + * pango_color_copy: + * @src: (nullable): color to copy, may be %NULL + * + * Creates a copy of @src, which should be freed with + * pango_color_free(). Primarily used by language bindings, + * not that useful otherwise (since colors can just be copied + * by assignment in C). + * + * Return value: (nullable): the newly allocated #PangoColor, which + * should be freed with pango_color_free(), or %NULL if + * @src was %NULL. + **/ +PangoColor* +pango_color_copy (const PangoColor *src) +{ + PangoColor *ret; + + if (src == NULL) + return NULL; + + ret = g_slice_new (PangoColor); + + *ret = *src; + + return ret; +} + +/** + * pango_color_free: + * @color: (nullable): an allocated #PangoColor, may be %NULL + * + * Frees a color allocated by pango_color_copy(). + **/ +void +pango_color_free (PangoColor *color) +{ + if (color == NULL) + return; + + g_slice_free (PangoColor, color); +} + +/** + * pango_color_to_string: + * @color: a #PangoColor + * + * Returns a textual specification of @color in the hexadecimal form + * #rrrrggggbbbb, where r, + * g and b are hex digits representing + * the red, green, and blue components respectively. + * + * Return value: a newly-allocated text string that must be freed with g_free(). + * + * Since: 1.16 + **/ +gchar * +pango_color_to_string (const PangoColor *color) +{ + g_return_val_if_fail (color != NULL, NULL); + + return g_strdup_printf ("#%04x%04x%04x", color->red, color->green, color->blue); +} + +/* Color parsing + */ + +/* The following 2 routines (parse_color, find_color) come from Tk, via the Win32 + * port of GDK. The licensing terms on these (longer than the functions) is: + * + * This software is copyrighted by the Regents of the University of + * California, Sun Microsystems, Inc., and other parties. The following + * terms apply to all files associated with the software unless explicitly + * disclaimed in individual files. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + * + * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + * DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + * IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + * NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + * MODIFICATIONS. + * + * GOVERNMENT USE: If you are acquiring this software on behalf of the + * U.S. government, the Government shall have only "Restricted Rights" + * in the software and related documentation as defined in the Federal + * Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you + * are acquiring the software on behalf of the Department of Defense, the + * software shall be classified as "Commercial Computer Software" and the + * Government shall have only "Restricted Rights" as defined in Clause + * 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the + * authors grant the U.S. Government and others acting in its behalf + * permission to use and distribute the software in accordance with the + * terms specified in this license. + */ + +#include "pango-color-table.h" + +#define ISUPPER(c) ((c) >= 'A' && (c) <= 'Z') +#define TOLOWER(c) (ISUPPER (c) ? (c) - 'A' + 'a' : (c)) + +static int +compare_xcolor_entries (const void *a, const void *b) +{ + const guchar *s1 = (const guchar *) a; + const guchar *s2 = (const guchar *) (color_names + ((const ColorEntry *) b)->name_offset); + + while (*s1 && *s2) + { + int c1, c2; + while (*s1 == ' ') s1++; + while (*s2 == ' ') s1++; + c1 = (gint)(guchar) TOLOWER (*s1); + c2 = (gint)(guchar) TOLOWER (*s2); + if (c1 != c2) + return (c1 - c2); + s1++; s2++; + } + + return ((gint) *s1) - ((gint) *s2); +} + +static gboolean +find_color(const char *name, + PangoColor *color) +{ + ColorEntry *found; + + found = bsearch (name, color_entries, G_N_ELEMENTS (color_entries), + sizeof (ColorEntry), + compare_xcolor_entries); + if (found == NULL) + return FALSE; + + if (color) + { + color->red = (found->red * 65535) / 255; + color->green = (found->green * 65535) / 255; + color->blue = (found->blue * 65535) / 255; + } + + return TRUE; +} + +static gboolean +hex (const char *spec, + int len, + unsigned int *c) +{ + const char *end; + *c = 0; + for (end = spec + len; spec != end; spec++) + if (g_ascii_isxdigit (*spec)) + *c = (*c << 4) | g_ascii_xdigit_value (*spec); + else + return FALSE; + return TRUE; +} + + +/* Like pango_color_parse, but allow strings of the form + * '#rgba', '#rrggbbaa', '#rrrrggggbbbbaaaa', + * if alpha is not NULL. If no alpha component is found + * in the string, *alpha is set to 0. + */ +gboolean +_pango_color_parse_with_alpha (PangoColor *color, + guint16 *alpha, + const char *spec) +{ + g_return_val_if_fail (spec != NULL, FALSE); + + if (alpha) + *alpha = 0; + + if (spec[0] == '#') + { + size_t len; + unsigned int r, g, b, a; + gboolean has_alpha; + + spec++; + len = strlen (spec); + switch (len) + { + case 3: + case 6: + case 9: + case 12: + len /= 3; + has_alpha = FALSE; + break; + case 4: + case 8: + case 16: + if (!alpha) + return FALSE; + len /= 4; + has_alpha = TRUE; + break; + default: + return FALSE; + } + + if (!hex (spec, len, &r) || + !hex (spec + len, len, &g) || + !hex (spec + len * 2, len, &b) || + (has_alpha && !hex (spec + len * 3, len, &a))) + return FALSE; + + if (color) + { + int bits = len * 4; + r <<= 16 - bits; + g <<= 16 - bits; + b <<= 16 - bits; + while (bits < 16) + { + r |= (r >> bits); + g |= (g >> bits); + b |= (b >> bits); + bits *= 2; + } + color->red = r; + color->green = g; + color->blue = b; + } + + if (alpha && has_alpha) + { + int bits = len * 4; + a <<= 16 - bits; + while (bits < 16) + { + a |= (a >> bits); + bits *= 2; + } + *alpha = a; + } + } + else + { + if (!find_color (spec, color)) + return FALSE; + } + return TRUE; +} +/** + * pango_color_parse: + * @color: (nullable): a #PangoColor structure in which to store the + * result, or %NULL + * @spec: a string specifying the new color + * + * Fill in the fields of a color from a string specification. The + * string can either one of a large set of standard names. (Taken + * from the CSS specification), or it can be a hexadecimal + * value in the + * form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where + * 'r', 'g' and 'b' are hex digits of the red, green, and blue + * components of the color, respectively. (White in the four + * forms is '#fff' '#ffffff' '#fffffffff' and '#ffffffffffff') + * + * Return value: %TRUE if parsing of the specifier succeeded, + * otherwise false. + **/ +gboolean +pango_color_parse (PangoColor *color, + const char *spec) +{ + return _pango_color_parse_with_alpha (color, NULL, spec); +} diff --git a/pango/pango-context.c b/pango/pango-context.c new file mode 100644 index 0000000..b48b0ea --- /dev/null +++ b/pango/pango-context.c @@ -0,0 +1,1871 @@ +/* Pango + * pango-context.c: Contexts for itemization and shaping + * + * Copyright (C) 2000, 2006 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:main + * @title:Rendering + * @short_description:Functions to run the rendering pipeline + * + * The Pango rendering pipeline takes a string of + * Unicode characters and converts it into glyphs. + * The functions described in this section accomplish + * various steps of this process. + */ +#include "config.h" +#include +#include + +#include "pango-context.h" +#include "pango-impl-utils.h" + +#include "pango-engine-private.h" +#include "pango-script-private.h" +#include "pango-emoji-private.h" + +/** + * PangoContext: + * + * The #PangoContext structure stores global information + * used to control the itemization process. + */ +struct _PangoContext +{ + GObject parent_instance; + guint serial; + guint fontmap_serial; + + PangoLanguage *set_language; + PangoLanguage *language; + PangoDirection base_dir; + PangoGravity base_gravity; + PangoGravity resolved_gravity; + PangoGravityHint gravity_hint; + + PangoFontDescription *font_desc; + + PangoMatrix *matrix; + + PangoFontMap *font_map; +}; + +struct _PangoContextClass +{ + GObjectClass parent_class; + +}; + +static void pango_context_finalize (GObject *object); +static void context_changed (PangoContext *context); + +G_DEFINE_TYPE (PangoContext, pango_context, G_TYPE_OBJECT) + +static void +pango_context_init (PangoContext *context) +{ + context->base_dir = PANGO_DIRECTION_WEAK_LTR; + context->resolved_gravity = context->base_gravity = PANGO_GRAVITY_SOUTH; + context->gravity_hint = PANGO_GRAVITY_HINT_NATURAL; + + context->serial = 1; + context->set_language = NULL; + context->language = pango_language_get_default (); + context->font_map = NULL; + + context->font_desc = pango_font_description_new (); + pango_font_description_set_family_static (context->font_desc, "serif"); + pango_font_description_set_style (context->font_desc, PANGO_STYLE_NORMAL); + pango_font_description_set_variant (context->font_desc, PANGO_VARIANT_NORMAL); + pango_font_description_set_weight (context->font_desc, PANGO_WEIGHT_NORMAL); + pango_font_description_set_stretch (context->font_desc, PANGO_STRETCH_NORMAL); + pango_font_description_set_size (context->font_desc, 12 * PANGO_SCALE); +} + +static void +pango_context_class_init (PangoContextClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = pango_context_finalize; +} + +static void +pango_context_finalize (GObject *object) +{ + PangoContext *context; + + context = PANGO_CONTEXT (object); + + if (context->font_map) + g_object_unref (context->font_map); + + pango_font_description_free (context->font_desc); + if (context->matrix) + pango_matrix_free (context->matrix); + + G_OBJECT_CLASS (pango_context_parent_class)->finalize (object); +} + +/** + * pango_context_new: + * + * Creates a new #PangoContext initialized to default values. + * + * This function is not particularly useful as it should always + * be followed by a pango_context_set_font_map() call, and the + * function pango_font_map_create_context() does these two steps + * together and hence users are recommended to use that. + * + * If you are using Pango as part of a higher-level system, + * that system may have it's own way of create a #PangoContext. + * For instance, the GTK+ toolkit has, among others, + * gdk_pango_context_get_for_screen(), and + * gtk_widget_get_pango_context(). Use those instead. + * + * Return value: the newly allocated #PangoContext, which should + * be freed with g_object_unref(). + **/ +PangoContext * +pango_context_new (void) +{ + PangoContext *context; + + context = g_object_new (PANGO_TYPE_CONTEXT, NULL); + + return context; +} + +static void +update_resolved_gravity (PangoContext *context) +{ + if (context->base_gravity == PANGO_GRAVITY_AUTO) + context->resolved_gravity = pango_gravity_get_for_matrix (context->matrix); + else + context->resolved_gravity = context->base_gravity; +} + +/** + * pango_context_set_matrix: + * @context: a #PangoContext + * @matrix: (allow-none): a #PangoMatrix, or %NULL to unset any existing + * matrix. (No matrix set is the same as setting the identity matrix.) + * + * Sets the transformation matrix that will be applied when rendering + * with this context. Note that reported metrics are in the user space + * coordinates before the application of the matrix, not device-space + * coordinates after the application of the matrix. So, they don't scale + * with the matrix, though they may change slightly for different + * matrices, depending on how the text is fit to the pixel grid. + * + * Since: 1.6 + **/ +void +pango_context_set_matrix (PangoContext *context, + const PangoMatrix *matrix) +{ + g_return_if_fail (PANGO_IS_CONTEXT (context)); + + if (context->matrix || matrix) + context_changed (context); + + if (context->matrix) + pango_matrix_free (context->matrix); + if (matrix) + context->matrix = pango_matrix_copy (matrix); + else + context->matrix = NULL; + + update_resolved_gravity (context); +} + +/** + * pango_context_get_matrix: + * @context: a #PangoContext + * + * Gets the transformation matrix that will be applied when + * rendering with this context. See pango_context_set_matrix(). + * + * Return value: (nullable): the matrix, or %NULL if no matrix has + * been set (which is the same as the identity matrix). The returned + * matrix is owned by Pango and must not be modified or freed. + * + * Since: 1.6 + **/ +const PangoMatrix * +pango_context_get_matrix (PangoContext *context) +{ + g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + + return context->matrix; +} + +/** + * pango_context_set_font_map: + * @context: a #PangoContext + * @font_map: the #PangoFontMap to set. + * + * Sets the font map to be searched when fonts are looked-up in this context. + * This is only for internal use by Pango backends, a #PangoContext obtained + * via one of the recommended methods should already have a suitable font map. + **/ +void +pango_context_set_font_map (PangoContext *context, + PangoFontMap *font_map) +{ + g_return_if_fail (PANGO_IS_CONTEXT (context)); + g_return_if_fail (!font_map || PANGO_IS_FONT_MAP (font_map)); + + if (font_map == context->font_map) + return; + + context_changed (context); + + if (font_map) + g_object_ref (font_map); + + if (context->font_map) + g_object_unref (context->font_map); + + context->font_map = font_map; + context->fontmap_serial = pango_font_map_get_serial (font_map); +} + +/** + * pango_context_get_font_map: + * @context: a #PangoContext + * + * Gets the #PangoFontMap used to look up fonts for this context. + * + * Return value: (transfer none): the font map for the #PangoContext. + * This value is owned by Pango and should not be unreferenced. + * + * Since: 1.6 + **/ +PangoFontMap * +pango_context_get_font_map (PangoContext *context) +{ + g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + + return context->font_map; +} + +/** + * pango_context_list_families: + * @context: a #PangoContext + * @families: (out) (array length=n_families) (transfer container): location to store a pointer to + * an array of #PangoFontFamily *. This array should be freed + * with g_free(). + * @n_families: (out): location to store the number of elements in @descs + * + * List all families for a context. + **/ +void +pango_context_list_families (PangoContext *context, + PangoFontFamily ***families, + int *n_families) +{ + g_return_if_fail (context != NULL); + g_return_if_fail (families == NULL || n_families != NULL); + + if (n_families == NULL) + return; + + if (context->font_map == NULL) + { + *n_families = 0; + if (families) + *families = NULL; + + return; + } + else + pango_font_map_list_families (context->font_map, families, n_families); +} + +/** + * pango_context_load_font: + * @context: a #PangoContext + * @desc: a #PangoFontDescription describing the font to load + * + * Loads the font in one of the fontmaps in the context + * that is the closest match for @desc. + * + * Returns: (transfer full) (nullable): the newly allocated #PangoFont + * that was loaded, or %NULL if no font matched. + **/ +PangoFont * +pango_context_load_font (PangoContext *context, + const PangoFontDescription *desc) +{ + g_return_val_if_fail (context != NULL, NULL); + g_return_val_if_fail (context->font_map != NULL, NULL); + + return pango_font_map_load_font (context->font_map, context, desc); +} + +/** + * pango_context_load_fontset: + * @context: a #PangoContext + * @desc: a #PangoFontDescription describing the fonts to load + * @language: a #PangoLanguage the fonts will be used for + * + * Load a set of fonts in the context that can be used to render + * a font matching @desc. + * + * Returns: (transfer full) (nullable): the newly allocated + * #PangoFontset loaded, or %NULL if no font matched. + **/ +PangoFontset * +pango_context_load_fontset (PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + g_return_val_if_fail (context != NULL, NULL); + + return pango_font_map_load_fontset (context->font_map, context, desc, language); +} + +/** + * pango_context_set_font_description: + * @context: a #PangoContext + * @desc: the new pango font description + * + * Set the default font description for the context + **/ +void +pango_context_set_font_description (PangoContext *context, + const PangoFontDescription *desc) +{ + g_return_if_fail (context != NULL); + g_return_if_fail (desc != NULL); + + if (desc != context->font_desc && + (!desc || !context->font_desc || !pango_font_description_equal(desc, context->font_desc))) + { + context_changed (context); + + pango_font_description_free (context->font_desc); + context->font_desc = pango_font_description_copy (desc); + } +} + +/** + * pango_context_get_font_description: + * @context: a #PangoContext + * + * Retrieve the default font description for the context. + * + * Return value: (transfer none): a pointer to the context's default font + * description. This value must not be modified or freed. + **/ +PangoFontDescription * +pango_context_get_font_description (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, NULL); + + return context->font_desc; +} + +/** + * pango_context_set_language: + * @context: a #PangoContext + * @language: the new language tag. + * + * Sets the global language tag for the context. The default language + * for the locale of the running process can be found using + * pango_language_get_default(). + **/ +void +pango_context_set_language (PangoContext *context, + PangoLanguage *language) +{ + g_return_if_fail (context != NULL); + + if (language != context->language) + context_changed (context); + + context->set_language = language; + if (language) + context->language = language; + else + context->language = pango_language_get_default (); +} + +/** + * pango_context_get_language: + * @context: a #PangoContext + * + * Retrieves the global language tag for the context. + * + * Return value: the global language tag. + **/ +PangoLanguage * +pango_context_get_language (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, NULL); + + return context->set_language; +} + +/** + * pango_context_set_base_dir: + * @context: a #PangoContext + * @direction: the new base direction + * + * Sets the base direction for the context. + * + * The base direction is used in applying the Unicode bidirectional + * algorithm; if the @direction is %PANGO_DIRECTION_LTR or + * %PANGO_DIRECTION_RTL, then the value will be used as the paragraph + * direction in the Unicode bidirectional algorithm. A value of + * %PANGO_DIRECTION_WEAK_LTR or %PANGO_DIRECTION_WEAK_RTL is used only + * for paragraphs that do not contain any strong characters themselves. + **/ +void +pango_context_set_base_dir (PangoContext *context, + PangoDirection direction) +{ + g_return_if_fail (context != NULL); + + if (direction != context->base_dir) + context_changed (context); + + context->base_dir = direction; +} + +/** + * pango_context_get_base_dir: + * @context: a #PangoContext + * + * Retrieves the base direction for the context. See + * pango_context_set_base_dir(). + * + * Return value: the base direction for the context. + **/ +PangoDirection +pango_context_get_base_dir (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, PANGO_DIRECTION_LTR); + + return context->base_dir; +} + +/** + * pango_context_set_base_gravity: + * @context: a #PangoContext + * @gravity: the new base gravity + * + * Sets the base gravity for the context. + * + * The base gravity is used in laying vertical text out. + * + * Since: 1.16 + **/ +void +pango_context_set_base_gravity (PangoContext *context, + PangoGravity gravity) +{ + g_return_if_fail (context != NULL); + + if (gravity != context->base_gravity) + context_changed (context); + + context->base_gravity = gravity; + + update_resolved_gravity (context); +} + +/** + * pango_context_get_base_gravity: + * @context: a #PangoContext + * + * Retrieves the base gravity for the context. See + * pango_context_set_base_gravity(). + * + * Return value: the base gravity for the context. + * + * Since: 1.16 + **/ +PangoGravity +pango_context_get_base_gravity (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, PANGO_GRAVITY_SOUTH); + + return context->base_gravity; +} + +/** + * pango_context_get_gravity: + * @context: a #PangoContext + * + * Retrieves the gravity for the context. This is similar to + * pango_context_get_base_gravity(), except for when the base gravity + * is %PANGO_GRAVITY_AUTO for which pango_gravity_get_for_matrix() is used + * to return the gravity from the current context matrix. + * + * Return value: the resolved gravity for the context. + * + * Since: 1.16 + **/ +PangoGravity +pango_context_get_gravity (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, PANGO_GRAVITY_SOUTH); + + return context->resolved_gravity; +} + +/** + * pango_context_set_gravity_hint: + * @context: a #PangoContext + * @hint: the new gravity hint + * + * Sets the gravity hint for the context. + * + * The gravity hint is used in laying vertical text out, and is only relevant + * if gravity of the context as returned by pango_context_get_gravity() + * is set %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST. + * + * Since: 1.16 + **/ +void +pango_context_set_gravity_hint (PangoContext *context, + PangoGravityHint hint) +{ + g_return_if_fail (context != NULL); + + if (hint != context->gravity_hint) + context_changed (context); + + context->gravity_hint = hint; +} + +/** + * pango_context_get_gravity_hint: + * @context: a #PangoContext + * + * Retrieves the gravity hint for the context. See + * pango_context_set_gravity_hint() for details. + * + * Return value: the gravity hint for the context. + * + * Since: 1.16 + **/ +PangoGravityHint +pango_context_get_gravity_hint (PangoContext *context) +{ + g_return_val_if_fail (context != NULL, PANGO_GRAVITY_HINT_NATURAL); + + return context->gravity_hint; +} + +/**********************************************************************/ + +static gboolean +advance_attr_iterator_to (PangoAttrIterator *iterator, + int start_index) +{ + int start_range, end_range; + + pango_attr_iterator_range (iterator, &start_range, &end_range); + + while (start_index >= end_range) + { + if (!pango_attr_iterator_next (iterator)) + return FALSE; + pango_attr_iterator_range (iterator, &start_range, &end_range); + } + + if (start_range > start_index) + g_warning ("In pango_itemize(), the cached iterator passed in " + "had already moved beyond the start_index"); + + return TRUE; +} + +/*************************************************************************** + * We cache the results of character,fontset => font,shaper in a hash table + ***************************************************************************/ + +typedef struct { + GHashTable *hash; +} FontCache; + +typedef struct { + PangoFont *font; +} FontElement; + +static void +font_cache_destroy (FontCache *cache) +{ + g_hash_table_destroy (cache->hash); + g_slice_free (FontCache, cache); +} + +static void +font_element_destroy (FontElement *element) +{ + if (element->font) + g_object_unref (element->font); + g_slice_free (FontElement, element); +} + +static FontCache * +get_font_cache (PangoFontset *fontset) +{ + FontCache *cache; + + static GQuark cache_quark = 0; /* MT-safe */ + if (G_UNLIKELY (!cache_quark)) + cache_quark = g_quark_from_static_string ("pango-shaper-font-cache"); + +retry: + cache = g_object_get_qdata (G_OBJECT (fontset), cache_quark); + if (G_UNLIKELY (!cache)) + { + cache = g_slice_new (FontCache); + cache->hash = g_hash_table_new_full (g_direct_hash, NULL, + NULL, (GDestroyNotify)font_element_destroy); + if (!g_object_replace_qdata (G_OBJECT (fontset), cache_quark, NULL, + cache, (GDestroyNotify)font_cache_destroy, + NULL)) + { + font_cache_destroy (cache); + goto retry; + } + } + + return cache; +} + +static gboolean +font_cache_get (FontCache *cache, + gunichar wc, + PangoFont **font) +{ + FontElement *element; + + element = g_hash_table_lookup (cache->hash, GUINT_TO_POINTER (wc)); + if (element) + { + *font = element->font; + + return TRUE; + } + else + return FALSE; +} + +static void +font_cache_insert (FontCache *cache, + gunichar wc, + PangoFont *font) +{ + FontElement *element = g_slice_new (FontElement); + element->font = font ? g_object_ref (font) : NULL; + + g_hash_table_insert (cache->hash, GUINT_TO_POINTER (wc), element); +} + +/**********************************************************************/ + +typedef enum { + EMBEDDING_CHANGED = 1 << 0, + SCRIPT_CHANGED = 1 << 1, + LANG_CHANGED = 1 << 2, + FONT_CHANGED = 1 << 3, + DERIVED_LANG_CHANGED = 1 << 4, + WIDTH_CHANGED = 1 << 5, + EMOJI_CHANGED = 1 << 6, +} ChangedFlags; + + + +typedef struct _PangoWidthIter PangoWidthIter; + +struct _PangoWidthIter +{ + const gchar *text_start; + const gchar *text_end; + const gchar *start; + const gchar *end; + gboolean wide; +}; + +typedef struct _ItemizeState ItemizeState; + + + +struct _ItemizeState +{ + PangoContext *context; + const char *text; + const char *end; + + const char *run_start; + const char *run_end; + + GList *result; + PangoItem *item; + + guint8 *embedding_levels; + int embedding_end_offset; + const char *embedding_end; + guint8 embedding; + + PangoGravity gravity; + PangoGravityHint gravity_hint; + PangoGravity resolved_gravity; + PangoGravity font_desc_gravity; + gboolean centered_baseline; + + PangoAttrIterator *attr_iter; + gboolean free_attr_iter; + const char *attr_end; + PangoFontDescription *font_desc; + PangoFontDescription *emoji_font_desc; + PangoLanguage *lang; + GSList *extra_attrs; + gboolean copy_extra_attrs; + + ChangedFlags changed; + + PangoScriptIter script_iter; + const char *script_end; + PangoScript script; + + PangoWidthIter width_iter; + PangoEmojiIter emoji_iter; + + PangoLanguage *derived_lang; + PangoEngineLang *lang_engine; + + PangoFontset *current_fonts; + FontCache *cache; + PangoFont *base_font; + gboolean enable_fallback; +}; + +static void +update_embedding_end (ItemizeState *state) +{ + state->embedding = state->embedding_levels[state->embedding_end_offset]; + while (state->embedding_end < state->end && + state->embedding_levels[state->embedding_end_offset] == state->embedding) + { + state->embedding_end_offset++; + state->embedding_end = g_utf8_next_char (state->embedding_end); + } + + state->changed |= EMBEDDING_CHANGED; +} + +static PangoAttribute * +find_attribute (GSList *attr_list, + PangoAttrType type) +{ + GSList *node; + + for (node = attr_list; node; node = node->next) + if (((PangoAttribute *) node->data)->klass->type == type) + return (PangoAttribute *) node->data; + + return NULL; +} + +static void +update_attr_iterator (ItemizeState *state) +{ + PangoLanguage *old_lang; + PangoAttribute *attr; + int end_index; + + pango_attr_iterator_range (state->attr_iter, NULL, &end_index); + if (end_index < state->end - state->text) + state->attr_end = state->text + end_index; + else + state->attr_end = state->end; + + if (state->emoji_font_desc) + { + pango_font_description_free (state->emoji_font_desc); + state->emoji_font_desc = NULL; + } + + old_lang = state->lang; + if (state->font_desc) + pango_font_description_free (state->font_desc); + state->font_desc = pango_font_description_copy_static (state->context->font_desc); + pango_attr_iterator_get_font (state->attr_iter, state->font_desc, + &state->lang, &state->extra_attrs); + if (pango_font_description_get_set_fields (state->font_desc) & PANGO_FONT_MASK_GRAVITY) + state->font_desc_gravity = pango_font_description_get_gravity (state->font_desc); + else + state->font_desc_gravity = PANGO_GRAVITY_AUTO; + + state->copy_extra_attrs = FALSE; + + if (!state->lang) + state->lang = state->context->language; + + attr = find_attribute (state->extra_attrs, PANGO_ATTR_FALLBACK); + state->enable_fallback = (attr == NULL || ((PangoAttrInt *)attr)->value); + + attr = find_attribute (state->extra_attrs, PANGO_ATTR_GRAVITY); + state->gravity = attr == NULL ? PANGO_GRAVITY_AUTO : ((PangoAttrInt *)attr)->value; + + attr = find_attribute (state->extra_attrs, PANGO_ATTR_GRAVITY_HINT); + state->gravity_hint = attr == NULL ? state->context->gravity_hint : (PangoGravityHint)((PangoAttrInt *)attr)->value; + + state->changed |= FONT_CHANGED; + if (state->lang != old_lang) + state->changed |= LANG_CHANGED; +} + +static void +update_end (ItemizeState *state) +{ + state->run_end = state->embedding_end; + if (state->attr_end < state->run_end) + state->run_end = state->attr_end; + if (state->script_end < state->run_end) + state->run_end = state->script_end; + if (state->width_iter.end < state->run_end) + state->run_end = state->width_iter.end; + if (state->emoji_iter.end < state->run_end) + state->run_end = state->emoji_iter.end; +} + +/* g_unichar_iswide() uses EastAsianWidth, which is broken. + * We should switch to using VerticalTextLayout: + * http://www.unicode.org/reports/tr50/#Data50 + * + * In the mean time, fixup Hangul jamo to be all wide so we + * don't break run in the middle. The EastAsianWidth has + * 'W' for L-jamo, and 'N' for T and V jamo! + * + * https://bugzilla.gnome.org/show_bug.cgi?id=705727 + */ +static gboolean +width_iter_iswide (gunichar ch) +{ + if ((0x1100u <= ch && ch <= 0x11FFu) || + (0xA960u <= ch && ch <= 0xA97Cu) || + (0xD7B0u <= ch && ch <= 0xD7FBu)) + return TRUE; + + return g_unichar_iswide (ch); +} + +static void +width_iter_next(PangoWidthIter* iter) +{ + gboolean met_joiner = FALSE; + iter->start = iter->end; + + if (iter->end < iter->text_end) + { + gunichar ch = g_utf8_get_char (iter->end); + iter->wide = width_iter_iswide (ch); + } + + while (iter->end < iter->text_end) + { + gunichar ch = g_utf8_get_char (iter->end); + + /* for zero width joiner */ + if (ch == 0x200D) + { + iter->end = g_utf8_next_char (iter->end); + met_joiner = TRUE; + continue; + } + + /* ignore the wide check if met joiner */ + if (met_joiner) + { + iter->end = g_utf8_next_char (iter->end); + met_joiner = FALSE; + continue; + } + + /* for variation selector, tag and emoji modifier. */ + if (G_UNLIKELY(ch == 0xFE0EU || ch == 0xFE0FU + || (ch >= 0xE0020 && ch <= 0xE007F) + || (ch >= 0x1F3FB && ch <= 0x1F3FF))) + { + iter->end = g_utf8_next_char (iter->end); + continue; + } + + if (width_iter_iswide (ch) != iter->wide) + break; + iter->end = g_utf8_next_char (iter->end); + } +} + +static void +width_iter_init (PangoWidthIter* iter, const char* text, int length) +{ + iter->text_start = text; + iter->text_end = text + length; + iter->start = iter->end = text; + + width_iter_next (iter); +} + +static void +width_iter_fini (PangoWidthIter* iter) +{ +} + +static void +itemize_state_init (ItemizeState *state, + PangoContext *context, + const char *text, + PangoDirection base_dir, + int start_index, + int length, + PangoAttrList *attrs, + PangoAttrIterator *cached_iter, + const PangoFontDescription *desc) +{ + + state->context = context; + state->text = text; + state->end = text + start_index + length; + + state->result = NULL; + state->item = NULL; + + state->run_start = text + start_index; + + /* First, apply the bidirectional algorithm to break + * the text into directional runs. + */ + state->embedding_levels = pango_log2vis_get_embedding_levels (text + start_index, length, &base_dir); + + state->embedding_end_offset = 0; + state->embedding_end = text + start_index; + update_embedding_end (state); + + /* Initialize the attribute iterator + */ + if (cached_iter) + { + state->attr_iter = cached_iter; + state->free_attr_iter = FALSE; + } + else if (attrs) + { + state->attr_iter = pango_attr_list_get_iterator (attrs); + state->free_attr_iter = TRUE; + } + else + { + state->attr_iter = NULL; + state->free_attr_iter = FALSE; + } + + state->emoji_font_desc = NULL; + if (state->attr_iter) + { + state->font_desc = NULL; + state->lang = NULL; + + advance_attr_iterator_to (state->attr_iter, start_index); + update_attr_iterator (state); + } + else + { + state->font_desc = pango_font_description_copy_static (desc ? desc : state->context->font_desc); + state->lang = state->context->language; + state->extra_attrs = NULL; + state->copy_extra_attrs = FALSE; + + state->attr_end = state->end; + state->enable_fallback = TRUE; + } + + /* Initialize the script iterator + */ + _pango_script_iter_init (&state->script_iter, text + start_index, length); + pango_script_iter_get_range (&state->script_iter, NULL, + &state->script_end, &state->script); + + width_iter_init (&state->width_iter, text + start_index, length); + _pango_emoji_iter_init (&state->emoji_iter, text + start_index, length); + + update_end (state); + + if (pango_font_description_get_set_fields (state->font_desc) & PANGO_FONT_MASK_GRAVITY) + state->font_desc_gravity = pango_font_description_get_gravity (state->font_desc); + else + state->font_desc_gravity = PANGO_GRAVITY_AUTO; + + state->gravity = PANGO_GRAVITY_AUTO; + state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (state->context->resolved_gravity); + state->gravity_hint = state->context->gravity_hint; + state->resolved_gravity = PANGO_GRAVITY_AUTO; + state->derived_lang = NULL; + state->lang_engine = NULL; + state->current_fonts = NULL; + state->cache = NULL; + state->base_font = NULL; + + state->changed = EMBEDDING_CHANGED | SCRIPT_CHANGED | LANG_CHANGED | FONT_CHANGED | WIDTH_CHANGED | EMOJI_CHANGED; +} + +static gboolean +itemize_state_next (ItemizeState *state) +{ + if (state->run_end == state->end) + return FALSE; + + state->changed = 0; + + state->run_start = state->run_end; + + if (state->run_end == state->embedding_end) + { + update_embedding_end (state); + } + + if (state->run_end == state->attr_end) + { + pango_attr_iterator_next (state->attr_iter); + update_attr_iterator (state); + } + + if (state->run_end == state->script_end) + { + pango_script_iter_next (&state->script_iter); + pango_script_iter_get_range (&state->script_iter, NULL, + &state->script_end, &state->script); + state->changed |= SCRIPT_CHANGED; + } + if (state->run_end == state->width_iter.end) + { + width_iter_next (&state->width_iter); + state->changed |= WIDTH_CHANGED; + } + if (state->run_end == state->emoji_iter.end) + { + _pango_emoji_iter_next (&state->emoji_iter); + state->changed |= EMOJI_CHANGED; + } + + update_end (state); + + return TRUE; +} + +static GSList * +copy_attr_slist (GSList *attr_slist) +{ + GSList *new_list = NULL; + GSList *l; + + for (l = attr_slist; l; l = l->next) + new_list = g_slist_prepend (new_list, pango_attribute_copy (l->data)); + + return g_slist_reverse (new_list); +} + +static void +itemize_state_fill_shaper (ItemizeState *state, + PangoEngineShape *shape_engine, + PangoFont *font) +{ + GList *l; + + for (l = state->result; l; l = l->next) + { + PangoItem *item = l->data; + if (item->analysis.shape_engine) + break; + if (font) + item->analysis.font = g_object_ref (font); + else + item->analysis.font = NULL; + item->analysis.shape_engine = shape_engine; + } +} + +static void +itemize_state_add_character (ItemizeState *state, + PangoEngineShape *shape_engine, + PangoFont *font, + gboolean force_break, + const char *pos) +{ + if (state->item) + { + if (!state->item->analysis.shape_engine && shape_engine) + { + itemize_state_fill_shaper (state, shape_engine, font); + } + else if (state->item->analysis.shape_engine && !shape_engine) + { + font = state->item->analysis.font; + shape_engine = state->item->analysis.shape_engine; + } + + if (!force_break && + state->item->analysis.lang_engine == state->lang_engine && + state->item->analysis.shape_engine == shape_engine && + state->item->analysis.font == font) + { + state->item->num_chars++; + return; + } + + state->item->length = (pos - state->text) - state->item->offset; + } + + state->item = pango_item_new (); + state->item->offset = pos - state->text; + state->item->length = 0; + state->item->num_chars = 1; + state->item->analysis.shape_engine = shape_engine; + state->item->analysis.lang_engine = state->lang_engine; + + if (font) + g_object_ref (font); + state->item->analysis.font = font; + + state->item->analysis.level = state->embedding; + state->item->analysis.gravity = state->resolved_gravity; + + /* The level vs. gravity dance: + * - If gravity is SOUTH, leave level untouched. + * - If gravity is NORTH, step level one up, to + * not get mirrored upside-down text. + * - If gravity is EAST, step up to an even level, as + * it's a clockwise-rotated layout, so the rotated + * top is unrotated left. + * - If gravity is WEST, step up to an odd level, as + * it's a counter-clockwise-rotated layout, so the rotated + * top is unrotated right. + * + * A similar dance is performed in pango-layout.c: + * line_set_resolved_dir(). Keep in synch. + */ + switch (state->item->analysis.gravity) + { + case PANGO_GRAVITY_SOUTH: + default: + break; + case PANGO_GRAVITY_NORTH: + state->item->analysis.level++; + break; + case PANGO_GRAVITY_EAST: + state->item->analysis.level += 1; + state->item->analysis.level &= ~1; + break; + case PANGO_GRAVITY_WEST: + state->item->analysis.level |= 1; + break; + } + + state->item->analysis.flags = state->centered_baseline ? PANGO_ANALYSIS_FLAG_CENTERED_BASELINE : 0; + + state->item->analysis.script = state->script; + state->item->analysis.language = state->derived_lang; + + if (state->copy_extra_attrs) + { + state->item->analysis.extra_attrs = copy_attr_slist (state->extra_attrs); + } + else + { + state->item->analysis.extra_attrs = state->extra_attrs; + state->copy_extra_attrs = TRUE; + } + + state->result = g_list_prepend (state->result, state->item); +} + +typedef struct { + PangoLanguage *lang; + gunichar wc; + PangoFont *font; +} GetFontInfo; + +static gboolean +get_font_foreach (PangoFontset *fontset, + PangoFont *font, + gpointer data) +{ + GetFontInfo *info = data; + PangoEngineShape *engine; + PangoCoverageLevel level; + + if (G_UNLIKELY (!font)) + return FALSE; + + engine = pango_font_find_shaper (font, info->lang, info->wc), + level = _pango_engine_shape_covers (engine, font, info->lang, info->wc); + if (level != PANGO_COVERAGE_NONE) + { + info->font = font; + return TRUE; + } + + if (!fontset) + { + info->font = font; + return TRUE; + } + + return FALSE; +} + +static PangoFont * +get_base_font (ItemizeState *state) +{ + if (!state->base_font) + state->base_font = pango_font_map_load_font (state->context->font_map, + state->context, + state->font_desc); + return state->base_font; +} + +static PangoScript +get_script (ItemizeState *state) +{ + /* Always use a basic shaper for vertical layout (ie, east/west gravity) + * as none of our script shapers support vertical shaping right now. + * + * XXX Should move the knowledge into the shaper interface. + */ + + if (PANGO_GRAVITY_IS_VERTICAL (state->resolved_gravity)) + return PANGO_SCRIPT_COMMON; + else + return state->script; +} + +static gboolean +get_shaper_and_font (ItemizeState *state, + gunichar wc, + PangoEngineShape **shape_engine, + PangoFont **font) +{ + GetFontInfo info; + + /* We'd need a separate cache when fallback is disabled, but since lookup + * with fallback disabled is faster anyways, we just skip caching */ + if (state->enable_fallback && font_cache_get (state->cache, wc, font)) + { + *shape_engine = pango_font_find_shaper (*font, state->derived_lang, wc); + return TRUE; + } + + info.lang = state->derived_lang; + info.wc = wc; + info.font = NULL; + + if (state->enable_fallback) + pango_fontset_foreach (state->current_fonts, get_font_foreach, &info); + else + get_font_foreach (NULL, get_base_font (state), &info); + + *font = info.font; + *shape_engine = pango_font_find_shaper (*font, state->derived_lang, wc); + + /* skip caching if fallback disabled (see above) */ + if (state->enable_fallback) + font_cache_insert (state->cache, wc, *font); + + return TRUE; +} + +static PangoLanguage * +compute_derived_language (PangoLanguage *lang, + PangoScript script) +{ + PangoLanguage *derived_lang; + + /* Make sure the language tag is consistent with the derived + * script. There is no point in marking up a section of + * Arabic text with the "en" language tag. + */ + if (lang && pango_language_includes_script (lang, script)) + derived_lang = lang; + else + { + derived_lang = pango_script_get_sample_language (script); + /* If we don't find a sample language for the script, we + * use a language tag that shouldn't actually be used + * anywhere. This keeps fontconfig (for the PangoFc* + * backend) from using the language tag to affect the + * sort order. I don't have a reference for 'xx' being + * safe here, though Keith Packard claims it is. + */ + if (!derived_lang) + derived_lang = pango_language_from_string ("xx"); + } + + return derived_lang; +} + +static void +itemize_state_update_for_new_run (ItemizeState *state) +{ + /* This block should be moved to update_attr_iterator, but I'm too lazy to + * do it right now */ + if (state->changed & (FONT_CHANGED | SCRIPT_CHANGED | WIDTH_CHANGED)) + { + /* Font-desc gravity overrides everything */ + if (state->font_desc_gravity != PANGO_GRAVITY_AUTO) + { + state->resolved_gravity = state->font_desc_gravity; + } + else + { + PangoGravity gravity = state->gravity; + PangoGravityHint gravity_hint = state->gravity_hint; + + if (G_LIKELY (gravity == PANGO_GRAVITY_AUTO)) + gravity = state->context->resolved_gravity; + + state->resolved_gravity = pango_gravity_get_for_script_and_width (state->script, + state->width_iter.wide, + gravity, + gravity_hint); + } + + if (state->font_desc_gravity != state->resolved_gravity) + { + pango_font_description_set_gravity (state->font_desc, state->resolved_gravity); + state->changed |= FONT_CHANGED; + } + } + + if (state->changed & (SCRIPT_CHANGED | LANG_CHANGED)) + { + PangoLanguage *old_derived_lang = state->derived_lang; + state->derived_lang = compute_derived_language (state->lang, state->script); + if (old_derived_lang != state->derived_lang) + state->changed |= DERIVED_LANG_CHANGED; + } + + if ((state->changed & DERIVED_LANG_CHANGED) || !state->lang_engine) + { + state->lang_engine = _pango_get_language_engine (); + } + + if (state->changed & (EMOJI_CHANGED)) + { + state->changed |= FONT_CHANGED; + } + + if (state->changed & (FONT_CHANGED | DERIVED_LANG_CHANGED) && + state->current_fonts) + { + g_object_unref (state->current_fonts); + state->current_fonts = NULL; + state->cache = NULL; + } + + if (!state->current_fonts) + { + gboolean is_emoji = state->emoji_iter.is_emoji; + if (is_emoji && !state->emoji_font_desc) + { + state->emoji_font_desc = pango_font_description_copy_static (state->font_desc); + pango_font_description_set_family_static (state->emoji_font_desc, "emoji"); + } + state->current_fonts = pango_font_map_load_fontset (state->context->font_map, + state->context, + is_emoji ? state->emoji_font_desc : state->font_desc, + state->derived_lang); + state->cache = get_font_cache (state->current_fonts); + } + + if ((state->changed & FONT_CHANGED) && state->base_font) + { + g_object_unref (state->base_font); + state->base_font = NULL; + } +} + +static const char * +string_from_script (PangoScript script) +{ + static GEnumClass *class = NULL; /* MT-safe */ + GEnumValue *value; + if (g_once_init_enter (&class)) + g_once_init_leave(&class, (gpointer)g_type_class_ref (PANGO_TYPE_SCRIPT)); + + value = g_enum_get_value (class, script); + if (!value) + return string_from_script (PANGO_SCRIPT_INVALID_CODE); + + return value->value_nick; +} + +static void +itemize_state_process_run (ItemizeState *state) +{ + const char *p; + gboolean last_was_forced_break = FALSE; + + /* Only one character has type G_UNICODE_LINE_SEPARATOR in Unicode 4.0; + * update this if that changes. */ +#define LINE_SEPARATOR 0x2028 + + itemize_state_update_for_new_run (state); + + /* We should never get an empty run */ + g_assert (state->run_end != state->run_start); + + for (p = state->run_start; + p < state->run_end; + p = g_utf8_next_char (p)) + { + gunichar wc = g_utf8_get_char (p); + gboolean is_forced_break = (wc == '\t' || wc == LINE_SEPARATOR); + PangoEngineShape *shape_engine; + PangoFont *font; + GUnicodeType type; + + /* We don't want space characters to affect font selection; in general, + * it's always wrong to select a font just to render a space. + * We assume that all fonts have the ASCII space, and for other space + * characters if they don't, HarfBuzz will compatibility-decompose them + * to ASCII space... + * See bugs #355987 and #701652. + * + * We don't want to change fonts just for variation selectors. + * See bug #781123. + */ + type = g_unichar_type (wc); + if (G_UNLIKELY (type == G_UNICODE_CONTROL || + type == G_UNICODE_FORMAT || + type == G_UNICODE_SURROGATE || + (type == G_UNICODE_SPACE_SEPARATOR && wc != 0x1680u /* OGHAM SPACE MARK */) || + (wc >= 0xfe00u && wc <= 0xfe0fu) || + (wc >= 0xe0100u && wc <= 0xe01efu))) + { + shape_engine = NULL; + font = NULL; + } + else + { + get_shaper_and_font (state, wc, &shape_engine, &font); + } + + itemize_state_add_character (state, + shape_engine, font, + is_forced_break || last_was_forced_break, + p); + + last_was_forced_break = is_forced_break; + } + + /* Finish the final item from the current segment */ + state->item->length = (p - state->text) - state->item->offset; + if (!state->item->analysis.shape_engine) + { + PangoEngineShape *shape_engine; + PangoFont *font; + + if (G_UNLIKELY (!get_shaper_and_font (state, ' ', &shape_engine, &font))) + { + /* If no shaper was found, warn only once per fontmap/script pair */ + PangoFontMap *fontmap = state->context->font_map; + const char *script_name = string_from_script (get_script (state)); + + if (!g_object_get_data (G_OBJECT (fontmap), script_name)) + { +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_warning ("failed to choose a font, expect ugly output. engine-type='%s', script='%s'", + pango_font_map_get_shape_engine_type (fontmap), + script_name); +G_GNUC_END_IGNORE_DEPRECATIONS + + g_object_set_data_full (G_OBJECT (fontmap), script_name, + GINT_TO_POINTER (1), NULL); + } + + shape_engine = _pango_get_fallback_shaper (); + font = NULL; + } + + itemize_state_fill_shaper (state, shape_engine, font); + } + state->item = NULL; +} + +static void +itemize_state_finish (ItemizeState *state) +{ + g_free (state->embedding_levels); + if (state->free_attr_iter) + pango_attr_iterator_destroy (state->attr_iter); + _pango_script_iter_fini (&state->script_iter); + pango_font_description_free (state->font_desc); + pango_font_description_free (state->emoji_font_desc); + width_iter_fini (&state->width_iter); + _pango_emoji_iter_fini (&state->emoji_iter); + + if (state->current_fonts) + g_object_unref (state->current_fonts); + if (state->base_font) + g_object_unref (state->base_font); +} + +/** + * pango_itemize_with_base_dir: + * @context: a structure holding information that affects + * the itemization process. + * @base_dir: base direction to use for bidirectional processing + * @text: the text to itemize. + * @start_index: first byte in @text to process + * @length: the number of bytes (not characters) to process + * after @start_index. This must be >= 0. + * @attrs: the set of attributes that apply to @text. + * @cached_iter: (allow-none): Cached attribute iterator, or %NULL + * + * Like pango_itemize(), but the base direction to use when + * computing bidirectional levels (see pango_context_set_base_dir ()), + * is specified explicitly rather than gotten from the #PangoContext. + * + * Return value: (transfer full) (element-type Pango.Item): a #GList of + * #PangoItem structures. The items should be freed using + * pango_item_free() probably in combination with + * g_list_foreach(), and the list itself using g_list_free(). + * + * Since: 1.4 + */ +GList * +pango_itemize_with_base_dir (PangoContext *context, + PangoDirection base_dir, + const char *text, + int start_index, + int length, + PangoAttrList *attrs, + PangoAttrIterator *cached_iter) +{ + ItemizeState state; + + g_return_val_if_fail (context != NULL, NULL); + g_return_val_if_fail (start_index >= 0, NULL); + g_return_val_if_fail (length >= 0, NULL); + g_return_val_if_fail (length == 0 || text != NULL, NULL); + + if (length == 0) + return NULL; + + itemize_state_init (&state, context, text, base_dir, start_index, length, + attrs, cached_iter, NULL); + + do + itemize_state_process_run (&state); + while (itemize_state_next (&state)); + + itemize_state_finish (&state); + + return g_list_reverse (state.result); +} + +static GList * +itemize_with_font (PangoContext *context, + const char *text, + int start_index, + int length, + const PangoFontDescription *desc) +{ + ItemizeState state; + + if (length == 0) + return NULL; + + itemize_state_init (&state, context, text, context->base_dir, start_index, length, + NULL, NULL, desc); + + do + itemize_state_process_run (&state); + while (itemize_state_next (&state)); + + itemize_state_finish (&state); + + return g_list_reverse (state.result); +} + +/** + * pango_itemize: + * @context: a structure holding information that affects + the itemization process. + * @text: the text to itemize. + * @start_index: first byte in @text to process + * @length: the number of bytes (not characters) to process + * after @start_index. + * This must be >= 0. + * @attrs: the set of attributes that apply to @text. + * @cached_iter: (allow-none): Cached attribute iterator, or %NULL + * + * Breaks a piece of text into segments with consistent + * directional level and shaping engine. Each byte of @text will + * be contained in exactly one of the items in the returned list; + * the generated list of items will be in logical order (the start + * offsets of the items are ascending). + * + * @cached_iter should be an iterator over @attrs currently positioned at a + * range before or containing @start_index; @cached_iter will be advanced to + * the range covering the position just after @start_index + @length. + * (i.e. if itemizing in a loop, just keep passing in the same @cached_iter). + * + * Return value: (transfer full) (element-type Pango.Item): a #GList of #PangoItem + * structures. The items should be freed using pango_item_free() + * probably in combination with g_list_foreach(), and the list itself + * using g_list_free(). + */ +GList * +pango_itemize (PangoContext *context, + const char *text, + int start_index, + int length, + PangoAttrList *attrs, + PangoAttrIterator *cached_iter) +{ + g_return_val_if_fail (context != NULL, NULL); + g_return_val_if_fail (start_index >= 0, NULL); + g_return_val_if_fail (length >= 0, NULL); + g_return_val_if_fail (length == 0 || text != NULL, NULL); + + return pango_itemize_with_base_dir (context, context->base_dir, + text, start_index, length, attrs, cached_iter); +} + +static gboolean +get_first_metrics_foreach (PangoFontset *fontset, + PangoFont *font, + gpointer data) +{ + PangoFontMetrics *fontset_metrics = data; + PangoLanguage *language = PANGO_FONTSET_GET_CLASS (fontset)->get_language (fontset); + PangoFontMetrics *font_metrics = pango_font_get_metrics (font, language); + guint save_ref_count; + + /* Initialize the fontset metrics to metrics of the first font in the + * fontset; saving the refcount and restoring it is a bit of hack but avoids + * having to update this code for each metrics addition. + */ + save_ref_count = fontset_metrics->ref_count; + *fontset_metrics = *font_metrics; + fontset_metrics->ref_count = save_ref_count; + + pango_font_metrics_unref (font_metrics); + + return TRUE; /* Stops iteration */ +} + +static PangoFontMetrics * +get_base_metrics (PangoFontset *fontset) +{ + PangoFontMetrics *metrics = pango_font_metrics_new (); + + /* Initialize the metrics from the first font in the fontset */ + pango_fontset_foreach (fontset, get_first_metrics_foreach, metrics); + + return metrics; +} + +static void +update_metrics_from_items (PangoFontMetrics *metrics, + PangoLanguage *language, + const char *text, + unsigned int text_len, + GList *items) + +{ + GHashTable *fonts_seen = g_hash_table_new (NULL, NULL); + PangoGlyphString *glyphs = pango_glyph_string_new (); + GList *l; + glong text_width; + + /* This should typically be called with a sample text string. */ + g_return_if_fail (text_len > 0); + + metrics->approximate_char_width = 0; + + for (l = items; l; l = l->next) + { + PangoItem *item = l->data; + PangoFont *font = item->analysis.font; + + if (font != NULL && g_hash_table_lookup (fonts_seen, font) == NULL) + { + PangoFontMetrics *raw_metrics = pango_font_get_metrics (font, language); + g_hash_table_insert (fonts_seen, font, font); + + /* metrics will already be initialized from the first font in the fontset */ + metrics->ascent = MAX (metrics->ascent, raw_metrics->ascent); + metrics->descent = MAX (metrics->descent, raw_metrics->descent); + pango_font_metrics_unref (raw_metrics); + } + + pango_shape_full (text + item->offset, item->length, + text, text_len, + &item->analysis, glyphs); + metrics->approximate_char_width += pango_glyph_string_get_width (glyphs); + } + + pango_glyph_string_free (glyphs); + g_hash_table_destroy (fonts_seen); + + text_width = pango_utf8_strwidth (text); + g_assert (text_width > 0); + metrics->approximate_char_width /= text_width; +} + +/** + * pango_context_get_metrics: + * @context: a #PangoContext + * @desc: (allow-none): a #PangoFontDescription structure. %NULL means that the + * font description from the context will be used. + * @language: (allow-none): language tag used to determine which script to get + * the metrics for. %NULL means that the language tag from the context + * will be used. If no language tag is set on the context, metrics + * for the default language (as determined by pango_language_get_default()) + * will be returned. + * + * Get overall metric information for a particular font + * description. Since the metrics may be substantially different for + * different scripts, a language tag can be provided to indicate that + * the metrics should be retrieved that correspond to the script(s) + * used by that language. + * + * The #PangoFontDescription is interpreted in the same way as + * by pango_itemize(), and the family name may be a comma separated + * list of figures. If characters from multiple of these families + * would be used to render the string, then the returned fonts would + * be a composite of the metrics for the fonts loaded for the + * individual families. + * + * Return value: a #PangoFontMetrics object. The caller must call pango_font_metrics_unref() + * when finished using the object. + **/ +PangoFontMetrics * +pango_context_get_metrics (PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + PangoFontset *current_fonts = NULL; + PangoFontMetrics *metrics; + const char *sample_str; + unsigned int text_len; + GList *items; + + g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + + if (!desc) + desc = context->font_desc; + + if (!language) + language = context->language; + + current_fonts = pango_font_map_load_fontset (context->font_map, context, desc, language); + metrics = get_base_metrics (current_fonts); + + sample_str = pango_language_get_sample_string (language); + text_len = strlen (sample_str); + items = itemize_with_font (context, sample_str, 0, text_len, desc); + + update_metrics_from_items (metrics, language, sample_str, text_len, items); + + g_list_foreach (items, (GFunc)pango_item_free, NULL); + g_list_free (items); + + g_object_unref (current_fonts); + + return metrics; +} + +static void +context_changed (PangoContext *context) +{ + context->serial++; + if (context->serial == 0) + context->serial++; +} + +/** + * pango_context_changed: + * @context: a #PangoContext + * + * Forces a change in the context, which will cause any #PangoLayout + * using this context to re-layout. + * + * This function is only useful when implementing a new backend + * for Pango, something applications won't do. Backends should + * call this function if they have attached extra data to the context + * and such data is changed. + * + * Since: 1.32.4 + **/ +void +pango_context_changed (PangoContext *context) +{ + context_changed (context); +} + +static void +check_fontmap_changed (PangoContext *context) +{ + guint old_serial = context->fontmap_serial; + + if (!context->font_map) + return; + + context->fontmap_serial = pango_font_map_get_serial (context->font_map); + + if (old_serial != context->fontmap_serial) + context_changed (context); +} + +/** + * pango_context_get_serial: + * @context: a #PangoContext + * + * Returns the current serial number of @context. The serial number is + * initialized to an small number larger than zero when a new context + * is created and is increased whenever the context is changed using any + * of the setter functions, or the #PangoFontMap it uses to find fonts has + * changed. The serial may wrap, but will never have the value 0. Since it + * can wrap, never compare it with "less than", always use "not equals". + * + * This can be used to automatically detect changes to a #PangoContext, and + * is only useful when implementing objects that need update when their + * #PangoContext changes, like #PangoLayout. + * + * Return value: The current serial number of @context. + * + * Since: 1.32.4 + **/ +guint +pango_context_get_serial (PangoContext *context) +{ + check_fontmap_changed (context); + return context->serial; +} diff --git a/pango/pango-context.h b/pango/pango-context.h new file mode 100644 index 0000000..439d099 --- /dev/null +++ b/pango/pango-context.h @@ -0,0 +1,137 @@ +/* Pango + * pango-context.h: Rendering contexts + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_CONTEXT_H__ +#define __PANGO_CONTEXT_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +/* Sort of like a GC - application set information about how + * to handle scripts + */ + +/* PangoContext typedefed in pango-fontmap.h */ +typedef struct _PangoContextClass PangoContextClass; + +#define PANGO_TYPE_CONTEXT (pango_context_get_type ()) +#define PANGO_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CONTEXT, PangoContext)) +#define PANGO_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CONTEXT, PangoContextClass)) +#define PANGO_IS_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CONTEXT)) +#define PANGO_IS_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CONTEXT)) +#define PANGO_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CONTEXT, PangoContextClass)) + + +/* The PangoContext and PangoContextClass structs are private; if you + * need to create a subclass of these, file a bug. + */ + +PANGO_AVAILABLE_IN_ALL +GType pango_context_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoContext *pango_context_new (void); +PANGO_AVAILABLE_IN_1_32 +void pango_context_changed (PangoContext *context); +PANGO_AVAILABLE_IN_ALL +void pango_context_set_font_map (PangoContext *context, + PangoFontMap *font_map); +PANGO_AVAILABLE_IN_1_6 +PangoFontMap *pango_context_get_font_map (PangoContext *context); +PANGO_AVAILABLE_IN_1_32 +guint pango_context_get_serial (PangoContext *context); +PANGO_AVAILABLE_IN_ALL +void pango_context_list_families (PangoContext *context, + PangoFontFamily ***families, + int *n_families); +PANGO_AVAILABLE_IN_ALL +PangoFont * pango_context_load_font (PangoContext *context, + const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +PangoFontset *pango_context_load_fontset (PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); + +PANGO_AVAILABLE_IN_ALL +PangoFontMetrics *pango_context_get_metrics (PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); + +PANGO_AVAILABLE_IN_ALL +void pango_context_set_font_description (PangoContext *context, + const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +PangoFontDescription * pango_context_get_font_description (PangoContext *context); +PANGO_AVAILABLE_IN_ALL +PangoLanguage *pango_context_get_language (PangoContext *context); +PANGO_AVAILABLE_IN_ALL +void pango_context_set_language (PangoContext *context, + PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +void pango_context_set_base_dir (PangoContext *context, + PangoDirection direction); +PANGO_AVAILABLE_IN_ALL +PangoDirection pango_context_get_base_dir (PangoContext *context); +PANGO_AVAILABLE_IN_1_16 +void pango_context_set_base_gravity (PangoContext *context, + PangoGravity gravity); +PANGO_AVAILABLE_IN_1_16 +PangoGravity pango_context_get_base_gravity (PangoContext *context); +PANGO_AVAILABLE_IN_1_16 +PangoGravity pango_context_get_gravity (PangoContext *context); +PANGO_AVAILABLE_IN_1_16 +void pango_context_set_gravity_hint (PangoContext *context, + PangoGravityHint hint); +PANGO_AVAILABLE_IN_1_16 +PangoGravityHint pango_context_get_gravity_hint (PangoContext *context); + +PANGO_AVAILABLE_IN_1_6 +void pango_context_set_matrix (PangoContext *context, + const PangoMatrix *matrix); +PANGO_AVAILABLE_IN_1_6 +const PangoMatrix * pango_context_get_matrix (PangoContext *context); + +/* Break a string of Unicode characters into segments with + * consistent shaping/language engine and bidrectional level. + * Returns a #GList of #PangoItem's + */ +PANGO_AVAILABLE_IN_ALL +GList *pango_itemize (PangoContext *context, + const char *text, + int start_index, + int length, + PangoAttrList *attrs, + PangoAttrIterator *cached_iter); +PANGO_AVAILABLE_IN_1_4 +GList *pango_itemize_with_base_dir (PangoContext *context, + PangoDirection base_dir, + const char *text, + int start_index, + int length, + PangoAttrList *attrs, + PangoAttrIterator *cached_iter); + +G_END_DECLS + +#endif /* __PANGO_CONTEXT_H__ */ diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c new file mode 100644 index 0000000..80fded2 --- /dev/null +++ b/pango/pango-coverage.c @@ -0,0 +1,511 @@ +/* Pango + * pango-coverage.c: Coverage maps for fonts + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:coverage-maps + * @short_description:Unicode character range coverage storage + * @title:Coverage Maps + * + * It is often necessary in Pango to determine if a particular font can + * represent a particular character, and also how well it can represent + * that character. The #PangoCoverage is a data structure that is used + * to represent that information. + */ +#include "config.h" +#include + +#include "pango-coverage.h" + +typedef struct _PangoBlockInfo PangoBlockInfo; + +#define N_BLOCKS_INCREMENT 256 + +/* The structure of a PangoCoverage object is a two-level table, with blocks of size 256. + * each block is stored as a packed array of 2 bit values for each index, in LSB order. + */ + +struct _PangoBlockInfo +{ + guchar *data; + PangoCoverageLevel level; /* Used if data == NULL */ +}; + +struct _PangoCoverage +{ + guint ref_count; + int n_blocks; + + PangoBlockInfo *blocks; +}; + +/** + * pango_coverage_new: + * + * Create a new #PangoCoverage + * + * Return value: the newly allocated #PangoCoverage, + * initialized to %PANGO_COVERAGE_NONE + * with a reference count of one, which + * should be freed with pango_coverage_unref(). + **/ +PangoCoverage * +pango_coverage_new (void) +{ + PangoCoverage *coverage = g_slice_new (PangoCoverage); + + coverage->n_blocks = N_BLOCKS_INCREMENT; + coverage->blocks = g_new0 (PangoBlockInfo, coverage->n_blocks); + coverage->ref_count = 1; + + return coverage; +} + +/** + * pango_coverage_copy: + * @coverage: a #PangoCoverage + * + * Copy an existing #PangoCoverage. (This function may now be unnecessary + * since we refcount the structure. File a bug if you use it.) + * + * Return value: (transfer full): the newly allocated #PangoCoverage, + * with a reference count of one, which should be freed + * with pango_coverage_unref(). + **/ +PangoCoverage * +pango_coverage_copy (PangoCoverage *coverage) +{ + int i; + PangoCoverage *result; + + g_return_val_if_fail (coverage != NULL, NULL); + + result = g_slice_new (PangoCoverage); + result->n_blocks = coverage->n_blocks; + result->blocks = g_new (PangoBlockInfo, coverage->n_blocks); + result->ref_count = 1; + + for (i=0; in_blocks; i++) + { + if (coverage->blocks[i].data) + { + result->blocks[i].data = g_new (guchar, 64); + memcpy (result->blocks[i].data, coverage->blocks[i].data, 64); + } + else + result->blocks[i].data = NULL; + + result->blocks[i].level = coverage->blocks[i].level; + } + + return result; +} + +/** + * pango_coverage_ref: + * @coverage: a #PangoCoverage + * + * Increase the reference count on the #PangoCoverage by one + * + * Return value: @coverage + **/ +PangoCoverage * +pango_coverage_ref (PangoCoverage *coverage) +{ + g_return_val_if_fail (coverage != NULL, NULL); + + g_atomic_int_inc ((int *) &coverage->ref_count); + + return coverage; +} + +/** + * pango_coverage_unref: + * @coverage: a #PangoCoverage + * + * Decrease the reference count on the #PangoCoverage by one. + * If the result is zero, free the coverage and all associated memory. + **/ +void +pango_coverage_unref (PangoCoverage *coverage) +{ + int i; + + g_return_if_fail (coverage != NULL); + g_return_if_fail (coverage->ref_count > 0); + + if (g_atomic_int_dec_and_test ((int *) &coverage->ref_count)) + { + for (i=0; in_blocks; i++) + g_slice_free1 (64, coverage->blocks[i].data); + + g_free (coverage->blocks); + g_slice_free (PangoCoverage, coverage); + } +} + +/** + * pango_coverage_get: + * @coverage: a #PangoCoverage + * @index_: the index to check + * + * Determine whether a particular index is covered by @coverage + * + * Return value: the coverage level of @coverage for character @index_. + **/ +PangoCoverageLevel +pango_coverage_get (PangoCoverage *coverage, + int index) +{ + int block_index; + + g_return_val_if_fail (coverage != NULL, PANGO_COVERAGE_NONE); + + /* index should really have been defined unsigned. Work around + * it by just returning NONE. + */ + if (G_UNLIKELY (index < 0)) + return PANGO_COVERAGE_NONE; + + block_index = index / 256; + + if (block_index >= coverage->n_blocks) + return PANGO_COVERAGE_NONE; + else + { + guchar *data = coverage->blocks[block_index].data; + if (data) + { + int i = index % 256; + int shift = (i % 4) * 2; + + return (data[i/4] >> shift) & 0x3; + } + else + return coverage->blocks[block_index].level; + } +} + +/** + * pango_coverage_set: + * @coverage: a #PangoCoverage + * @index_: the index to modify + * @level: the new level for @index_ + * + * Modify a particular index within @coverage + **/ +void +pango_coverage_set (PangoCoverage *coverage, + int index, + PangoCoverageLevel level) +{ + int block_index, i; + guchar *data; + + g_return_if_fail (coverage != NULL); + g_return_if_fail (index >= 0); + g_return_if_fail ((guint) level <= 3); + + block_index = index / 256; + + if (block_index >= coverage->n_blocks) + { + int old_n_blocks = coverage->n_blocks; + + coverage->n_blocks = + N_BLOCKS_INCREMENT * ((block_index + N_BLOCKS_INCREMENT) / N_BLOCKS_INCREMENT); + + coverage->blocks = g_renew (PangoBlockInfo, coverage->blocks, coverage->n_blocks); + memset (coverage->blocks + old_n_blocks, 0, + sizeof (PangoBlockInfo) * (coverage->n_blocks - old_n_blocks)); + } + + data = coverage->blocks[block_index].data; + if (!data) + { + guchar byte; + + if (level == coverage->blocks[block_index].level) + return; + + data = g_slice_alloc (64); + coverage->blocks[block_index].data = data; + + byte = coverage->blocks[block_index].level | + (coverage->blocks[block_index].level << 2) | + (coverage->blocks[block_index].level << 4) | + (coverage->blocks[block_index].level << 6); + + memset (data, byte, 64); + } + + i = index % 256; + data[i/4] |= level << ((i % 4) * 2); +} + +/** + * pango_coverage_max: + * @coverage: a #PangoCoverage + * @other: another #PangoCoverage + * + * Set the coverage for each index in @coverage to be the max (better) + * value of the current coverage for the index and the coverage for + * the corresponding index in @other. + **/ +void +pango_coverage_max (PangoCoverage *coverage, + PangoCoverage *other) +{ + int block_index, i; + int old_blocks; + + g_return_if_fail (coverage != NULL); + + old_blocks = MIN (coverage->n_blocks, other->n_blocks); + + if (other->n_blocks > coverage->n_blocks) + { + coverage->n_blocks = other->n_blocks; + coverage->blocks = g_renew (PangoBlockInfo, coverage->blocks, coverage->n_blocks); + + for (block_index = old_blocks; block_index < coverage->n_blocks; block_index++) + { + if (other->blocks[block_index].data) + { + coverage->blocks[block_index].data = g_new (guchar, 64); + memcpy (coverage->blocks[block_index].data, other->blocks[block_index].data, 64); + } + else + coverage->blocks[block_index].data = NULL; + + coverage->blocks[block_index].level = other->blocks[block_index].level; + } + } + + for (block_index = 0; block_index < old_blocks; block_index++) + { + if (!coverage->blocks[block_index].data && !other->blocks[block_index].data) + { + coverage->blocks[block_index].level = MAX (coverage->blocks[block_index].level, other->blocks[block_index].level); + } + else if (coverage->blocks[block_index].data && other->blocks[block_index].data) + { + guchar *data = coverage->blocks[block_index].data; + + for (i=0; i<64; i++) + { + int byte1 = data[i]; + int byte2 = other->blocks[block_index].data[i]; + + /* There are almost certainly some clever logical ops to do this */ + data[i] = + MAX (byte1 & 0x3, byte2 & 0x3) | + MAX (byte1 & 0xc, byte2 & 0xc) | + MAX (byte1 & 0x30, byte2 & 0x30) | + MAX (byte1 & 0xc0, byte2 & 0xc0); + } + } + else + { + guchar *src, *dest; + int level, byte2; + + if (coverage->blocks[block_index].data) + { + src = dest = coverage->blocks[block_index].data; + level = other->blocks[block_index].level; + } + else + { + src = other->blocks[block_index].data; + dest = g_new (guchar, 64); + coverage->blocks[block_index].data = dest; + level = coverage->blocks[block_index].level; + } + + byte2 = level | (level << 2) | (level << 4) | (level << 6); + + for (i=0; i<64; i++) + { + int byte1 = src[i]; + + /* There are almost certainly some clever logical ops to do this */ + dest[i] = + MAX (byte1 & 0x3, byte2 & 0x3) | + MAX (byte1 & 0xc, byte2 & 0xc) | + MAX (byte1 & 0x30, byte2 & 0x30) | + MAX (byte1 & 0xc0, byte2 & 0xc0); + } + } + } +} + +#define PANGO_COVERAGE_MAGIC 0xc89dbd5e + +/** + * pango_coverage_to_bytes: + * @coverage: a #PangoCoverage + * @bytes: (out) (array length=n_bytes) (element-type guint8): + * location to store result (must be freed with g_free()) + * @n_bytes: (out): location to store size of result + * + * Convert a #PangoCoverage structure into a flat binary format + **/ +void +pango_coverage_to_bytes (PangoCoverage *coverage, + guchar **bytes, + int *n_bytes) +{ + int i, j; + int size = 8 + 4 * coverage->n_blocks; + guchar *data; + int offset; + + for (i=0; in_blocks; i++) + { + if (coverage->blocks[i].data) + size += 64; + } + + data = g_malloc (size); + + *(guint32 *)&data[0] = g_htonl (PANGO_COVERAGE_MAGIC); /* Magic */ + *(guint32 *)&data[4] = g_htonl (coverage->n_blocks); + offset = 8; + + for (i=0; in_blocks; i++) + { + guint32 header_val; + + /* Check for solid blocks. This is a sort of random place + * to do the optimization, but we care most about getting + * it right when storing it somewhere persistant. + */ + if (coverage->blocks[i].data != NULL) + { + guchar *data = coverage->blocks[i].data; + guchar first_val = data[0]; + + if (first_val == 0 || first_val == 0xff) + { + for (j = 1 ; j < 64; j++) + if (data[j] != first_val) + break; + + if (j == 64) + { + g_slice_free1 (64, data); + coverage->blocks[i].data = NULL; + coverage->blocks[i].level = first_val & 0x3; + } + } + } + + if (coverage->blocks[i].data != NULL) + header_val = (guint32)-1; + else + header_val = coverage->blocks[i].level; + + *(guint32 *)&data[offset] = g_htonl (header_val); + offset += 4; + + if (coverage->blocks[i].data) + { + memcpy (data + offset, coverage->blocks[i].data, 64); + offset += 64; + } + } + + *bytes = data; + *n_bytes = size; +} + +static guint32 +pango_coverage_get_uint32 (guchar **ptr) +{ + guint32 val; + + memcpy (&val, *ptr, 4); + *ptr += 4; + + return g_ntohl (val); +} + +/** + * pango_coverage_from_bytes: + * @bytes: (array length=n_bytes) (element-type guint8): binary data + * representing a #PangoCoverage + * @n_bytes: the size of @bytes in bytes + * + * Convert data generated from pango_coverage_to_bytes() back + * to a #PangoCoverage + * + * Return value: (transfer full) (nullable): a newly allocated + * #PangoCoverage, or %NULL if the data was invalid. + **/ +PangoCoverage * +pango_coverage_from_bytes (guchar *bytes, + int n_bytes) +{ + PangoCoverage *coverage = g_slice_new0 (PangoCoverage); + guchar *ptr = bytes; + int i; + + coverage->ref_count = 1; + + if (n_bytes < 8) + goto error; + + if (pango_coverage_get_uint32 (&ptr) != PANGO_COVERAGE_MAGIC) + goto error; + + coverage->n_blocks = pango_coverage_get_uint32 (&ptr); + coverage->blocks = g_new0 (PangoBlockInfo, coverage->n_blocks); + + for (i = 0; i < coverage->n_blocks; i++) + { + guint val; + + if (ptr + 4 > bytes + n_bytes) + goto error; + + val = pango_coverage_get_uint32 (&ptr); + if (val == (guint32)-1) + { + if (ptr + 64 > bytes + n_bytes) + goto error; + + coverage->blocks[i].data = g_new (guchar, 64); + memcpy (coverage->blocks[i].data, ptr, 64); + ptr += 64; + } + else + coverage->blocks[i].level = val; + } + + return coverage; + + error: + + pango_coverage_unref (coverage); + return NULL; +} + + diff --git a/pango/pango-coverage.h b/pango/pango-coverage.h new file mode 100644 index 0000000..b83d510 --- /dev/null +++ b/pango/pango-coverage.h @@ -0,0 +1,90 @@ +/* Pango + * pango-coverage.h: Coverage sets for fonts + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_COVERAGE_H__ +#define __PANGO_COVERAGE_H__ + +#include + +#include + +G_BEGIN_DECLS + +/** + * PangoCoverage: + * + * The #PangoCoverage structure represents a map from Unicode characters + * to #PangoCoverageLevel. It is an opaque structure with no public fields. + */ +typedef struct _PangoCoverage PangoCoverage; + +/** + * PangoCoverageLevel: + * @PANGO_COVERAGE_NONE: The character is not representable with the font. + * @PANGO_COVERAGE_FALLBACK: The character is represented in a way that may be + * comprehensible but is not the correct graphical form. + * For instance, a Hangul character represented as a + * a sequence of Jamos, or a Latin transliteration of a Cyrillic word. + * @PANGO_COVERAGE_APPROXIMATE: The character is represented as basically the correct + * graphical form, but with a stylistic variant inappropriate for + * the current script. + * @PANGO_COVERAGE_EXACT: The character is represented as the correct graphical form. + * + * Used to indicate how well a font can represent a particular Unicode + * character point for a particular script. + */ +typedef enum { + PANGO_COVERAGE_NONE, + PANGO_COVERAGE_FALLBACK, + PANGO_COVERAGE_APPROXIMATE, + PANGO_COVERAGE_EXACT +} PangoCoverageLevel; + +PANGO_AVAILABLE_IN_ALL +PangoCoverage * pango_coverage_new (void); +PANGO_AVAILABLE_IN_ALL +PangoCoverage * pango_coverage_ref (PangoCoverage *coverage); +PANGO_AVAILABLE_IN_ALL +void pango_coverage_unref (PangoCoverage *coverage); +PANGO_AVAILABLE_IN_ALL +PangoCoverage * pango_coverage_copy (PangoCoverage *coverage); +PANGO_AVAILABLE_IN_ALL +PangoCoverageLevel pango_coverage_get (PangoCoverage *coverage, + int index_); +PANGO_AVAILABLE_IN_ALL +void pango_coverage_set (PangoCoverage *coverage, + int index_, + PangoCoverageLevel level); +PANGO_AVAILABLE_IN_ALL +void pango_coverage_max (PangoCoverage *coverage, + PangoCoverage *other); + +PANGO_AVAILABLE_IN_ALL +void pango_coverage_to_bytes (PangoCoverage *coverage, + guchar **bytes, + int *n_bytes); +PANGO_AVAILABLE_IN_ALL +PangoCoverage *pango_coverage_from_bytes (guchar *bytes, + int n_bytes); + +G_END_DECLS + +#endif /* __PANGO_COVERAGE_H__ */ diff --git a/pango/pango-emoji-private.h b/pango/pango-emoji-private.h new file mode 100644 index 0000000..eb8a52a --- /dev/null +++ b/pango/pango-emoji-private.h @@ -0,0 +1,49 @@ +/* Pango + * pango-emoji-private.h: Emoji handling, private definitions + * + * Copyright (C) 2017 Google, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_EMOJI_PRIVATE_H__ +#define __PANGO_EMOJI_PRIVATE_H__ + +#include + +typedef struct _PangoEmojiIter PangoEmojiIter; + +struct _PangoEmojiIter +{ + const gchar *text_start; + const gchar *text_end; + const gchar *start; + const gchar *end; + gboolean is_emoji; +}; + +PangoEmojiIter * +_pango_emoji_iter_init (PangoEmojiIter *iter, + const char *text, + int length); + +gboolean +_pango_emoji_iter_next (PangoEmojiIter *iter); + +void +_pango_emoji_iter_fini (PangoEmojiIter *iter); + +#endif /* __PANGO_EMOJI_PRIVATE_H__ */ diff --git a/pango/pango-emoji-table.h b/pango/pango-emoji-table.h new file mode 100644 index 0000000..0f58f21 --- /dev/null +++ b/pango/pango-emoji-table.h @@ -0,0 +1,435 @@ +/* == Start of generated table == */ +/* + * The following tables are generated by running: + * + * ./gen-emoji-table.py emoji-data.txt + * + * on file with this header: + * + * # emoji-data.txt + * # Date: 2017-06-19, 11:13:24 GMT + * # © 2017 Unicode®, Inc. + * # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. + * # For terms of use, see http://www.unicode.org/terms_of_use.html + * # + * # Emoji Data for UTR #51 + * # Version: 5.0 + * # + * # For documentation and usage, see http://www.unicode.org/reports/tr51 + */ + +#ifndef PANGO_EMOJI_TABLE_H +#define PANGO_EMOJI_TABLE_H + +#include + +struct Interval { + gunichar start, end; +}; + +static const struct Interval _pango_Emoji_table[] = +{ + {0x0023, 0x0023}, + {0x002A, 0x002A}, + {0x0030, 0x0039}, + {0x00A9, 0x00A9}, + {0x00AE, 0x00AE}, + {0x203C, 0x203C}, + {0x2049, 0x2049}, + {0x2122, 0x2122}, + {0x2139, 0x2139}, + {0x2194, 0x2199}, + {0x21A9, 0x21AA}, + {0x231A, 0x231B}, + {0x2328, 0x2328}, + {0x23CF, 0x23CF}, + {0x23E9, 0x23F3}, + {0x23F8, 0x23FA}, + {0x24C2, 0x24C2}, + {0x25AA, 0x25AB}, + {0x25B6, 0x25B6}, + {0x25C0, 0x25C0}, + {0x25FB, 0x25FE}, + {0x2600, 0x2604}, + {0x260E, 0x260E}, + {0x2611, 0x2611}, + {0x2614, 0x2615}, + {0x2618, 0x2618}, + {0x261D, 0x261D}, + {0x2620, 0x2620}, + {0x2622, 0x2623}, + {0x2626, 0x2626}, + {0x262A, 0x262A}, + {0x262E, 0x262F}, + {0x2638, 0x263A}, + {0x2640, 0x2640}, + {0x2642, 0x2642}, + {0x2648, 0x2653}, + {0x2660, 0x2660}, + {0x2663, 0x2663}, + {0x2665, 0x2666}, + {0x2668, 0x2668}, + {0x267B, 0x267B}, + {0x267F, 0x267F}, + {0x2692, 0x2697}, + {0x2699, 0x2699}, + {0x269B, 0x269C}, + {0x26A0, 0x26A1}, + {0x26AA, 0x26AB}, + {0x26B0, 0x26B1}, + {0x26BD, 0x26BE}, + {0x26C4, 0x26C5}, + {0x26C8, 0x26C8}, + {0x26CE, 0x26CE}, + {0x26CF, 0x26CF}, + {0x26D1, 0x26D1}, + {0x26D3, 0x26D4}, + {0x26E9, 0x26EA}, + {0x26F0, 0x26F5}, + {0x26F7, 0x26FA}, + {0x26FD, 0x26FD}, + {0x2702, 0x2702}, + {0x2705, 0x2705}, + {0x2708, 0x2709}, + {0x270A, 0x270B}, + {0x270C, 0x270D}, + {0x270F, 0x270F}, + {0x2712, 0x2712}, + {0x2714, 0x2714}, + {0x2716, 0x2716}, + {0x271D, 0x271D}, + {0x2721, 0x2721}, + {0x2728, 0x2728}, + {0x2733, 0x2734}, + {0x2744, 0x2744}, + {0x2747, 0x2747}, + {0x274C, 0x274C}, + {0x274E, 0x274E}, + {0x2753, 0x2755}, + {0x2757, 0x2757}, + {0x2763, 0x2764}, + {0x2795, 0x2797}, + {0x27A1, 0x27A1}, + {0x27B0, 0x27B0}, + {0x27BF, 0x27BF}, + {0x2934, 0x2935}, + {0x2B05, 0x2B07}, + {0x2B1B, 0x2B1C}, + {0x2B50, 0x2B50}, + {0x2B55, 0x2B55}, + {0x3030, 0x3030}, + {0x303D, 0x303D}, + {0x3297, 0x3297}, + {0x3299, 0x3299}, + {0x1F004, 0x1F004}, + {0x1F0CF, 0x1F0CF}, + {0x1F170, 0x1F171}, + {0x1F17E, 0x1F17E}, + {0x1F17F, 0x1F17F}, + {0x1F18E, 0x1F18E}, + {0x1F191, 0x1F19A}, + {0x1F1E6, 0x1F1FF}, + {0x1F201, 0x1F202}, + {0x1F21A, 0x1F21A}, + {0x1F22F, 0x1F22F}, + {0x1F232, 0x1F23A}, + {0x1F250, 0x1F251}, + {0x1F300, 0x1F320}, + {0x1F321, 0x1F321}, + {0x1F324, 0x1F32C}, + {0x1F32D, 0x1F32F}, + {0x1F330, 0x1F335}, + {0x1F336, 0x1F336}, + {0x1F337, 0x1F37C}, + {0x1F37D, 0x1F37D}, + {0x1F37E, 0x1F37F}, + {0x1F380, 0x1F393}, + {0x1F396, 0x1F397}, + {0x1F399, 0x1F39B}, + {0x1F39E, 0x1F39F}, + {0x1F3A0, 0x1F3C4}, + {0x1F3C5, 0x1F3C5}, + {0x1F3C6, 0x1F3CA}, + {0x1F3CB, 0x1F3CE}, + {0x1F3CF, 0x1F3D3}, + {0x1F3D4, 0x1F3DF}, + {0x1F3E0, 0x1F3F0}, + {0x1F3F3, 0x1F3F5}, + {0x1F3F7, 0x1F3F7}, + {0x1F3F8, 0x1F3FF}, + {0x1F400, 0x1F43E}, + {0x1F43F, 0x1F43F}, + {0x1F440, 0x1F440}, + {0x1F441, 0x1F441}, + {0x1F442, 0x1F4F7}, + {0x1F4F8, 0x1F4F8}, + {0x1F4F9, 0x1F4FC}, + {0x1F4FD, 0x1F4FD}, + {0x1F4FF, 0x1F4FF}, + {0x1F500, 0x1F53D}, + {0x1F549, 0x1F54A}, + {0x1F54B, 0x1F54E}, + {0x1F550, 0x1F567}, + {0x1F56F, 0x1F570}, + {0x1F573, 0x1F579}, + {0x1F57A, 0x1F57A}, + {0x1F587, 0x1F587}, + {0x1F58A, 0x1F58D}, + {0x1F590, 0x1F590}, + {0x1F595, 0x1F596}, + {0x1F5A4, 0x1F5A4}, + {0x1F5A5, 0x1F5A5}, + {0x1F5A8, 0x1F5A8}, + {0x1F5B1, 0x1F5B2}, + {0x1F5BC, 0x1F5BC}, + {0x1F5C2, 0x1F5C4}, + {0x1F5D1, 0x1F5D3}, + {0x1F5DC, 0x1F5DE}, + {0x1F5E1, 0x1F5E1}, + {0x1F5E3, 0x1F5E3}, + {0x1F5E8, 0x1F5E8}, + {0x1F5EF, 0x1F5EF}, + {0x1F5F3, 0x1F5F3}, + {0x1F5FA, 0x1F5FA}, + {0x1F5FB, 0x1F5FF}, + {0x1F600, 0x1F600}, + {0x1F601, 0x1F610}, + {0x1F611, 0x1F611}, + {0x1F612, 0x1F614}, + {0x1F615, 0x1F615}, + {0x1F616, 0x1F616}, + {0x1F617, 0x1F617}, + {0x1F618, 0x1F618}, + {0x1F619, 0x1F619}, + {0x1F61A, 0x1F61A}, + {0x1F61B, 0x1F61B}, + {0x1F61C, 0x1F61E}, + {0x1F61F, 0x1F61F}, + {0x1F620, 0x1F625}, + {0x1F626, 0x1F627}, + {0x1F628, 0x1F62B}, + {0x1F62C, 0x1F62C}, + {0x1F62D, 0x1F62D}, + {0x1F62E, 0x1F62F}, + {0x1F630, 0x1F633}, + {0x1F634, 0x1F634}, + {0x1F635, 0x1F640}, + {0x1F641, 0x1F642}, + {0x1F643, 0x1F644}, + {0x1F645, 0x1F64F}, + {0x1F680, 0x1F6C5}, + {0x1F6CB, 0x1F6CF}, + {0x1F6D0, 0x1F6D0}, + {0x1F6D1, 0x1F6D2}, + {0x1F6E0, 0x1F6E5}, + {0x1F6E9, 0x1F6E9}, + {0x1F6EB, 0x1F6EC}, + {0x1F6F0, 0x1F6F0}, + {0x1F6F3, 0x1F6F3}, + {0x1F6F4, 0x1F6F6}, + {0x1F6F7, 0x1F6F8}, + {0x1F910, 0x1F918}, + {0x1F919, 0x1F91E}, + {0x1F91F, 0x1F91F}, + {0x1F920, 0x1F927}, + {0x1F928, 0x1F92F}, + {0x1F930, 0x1F930}, + {0x1F931, 0x1F932}, + {0x1F933, 0x1F93A}, + {0x1F93C, 0x1F93E}, + {0x1F940, 0x1F945}, + {0x1F947, 0x1F94B}, + {0x1F94C, 0x1F94C}, + {0x1F950, 0x1F95E}, + {0x1F95F, 0x1F96B}, + {0x1F980, 0x1F984}, + {0x1F985, 0x1F991}, + {0x1F992, 0x1F997}, + {0x1F9C0, 0x1F9C0}, + {0x1F9D0, 0x1F9E6}, +}; + +static const struct Interval _pango_Emoji_Presentation_table[] = +{ + {0x231A, 0x231B}, + {0x23E9, 0x23EC}, + {0x23F0, 0x23F0}, + {0x23F3, 0x23F3}, + {0x25FD, 0x25FE}, + {0x2614, 0x2615}, + {0x2648, 0x2653}, + {0x267F, 0x267F}, + {0x2693, 0x2693}, + {0x26A1, 0x26A1}, + {0x26AA, 0x26AB}, + {0x26BD, 0x26BE}, + {0x26C4, 0x26C5}, + {0x26CE, 0x26CE}, + {0x26D4, 0x26D4}, + {0x26EA, 0x26EA}, + {0x26F2, 0x26F3}, + {0x26F5, 0x26F5}, + {0x26FA, 0x26FA}, + {0x26FD, 0x26FD}, + {0x2705, 0x2705}, + {0x270A, 0x270B}, + {0x2728, 0x2728}, + {0x274C, 0x274C}, + {0x274E, 0x274E}, + {0x2753, 0x2755}, + {0x2757, 0x2757}, + {0x2795, 0x2797}, + {0x27B0, 0x27B0}, + {0x27BF, 0x27BF}, + {0x2B1B, 0x2B1C}, + {0x2B50, 0x2B50}, + {0x2B55, 0x2B55}, + {0x1F004, 0x1F004}, + {0x1F0CF, 0x1F0CF}, + {0x1F18E, 0x1F18E}, + {0x1F191, 0x1F19A}, + {0x1F1E6, 0x1F1FF}, + {0x1F201, 0x1F201}, + {0x1F21A, 0x1F21A}, + {0x1F22F, 0x1F22F}, + {0x1F232, 0x1F236}, + {0x1F238, 0x1F23A}, + {0x1F250, 0x1F251}, + {0x1F300, 0x1F320}, + {0x1F32D, 0x1F32F}, + {0x1F330, 0x1F335}, + {0x1F337, 0x1F37C}, + {0x1F37E, 0x1F37F}, + {0x1F380, 0x1F393}, + {0x1F3A0, 0x1F3C4}, + {0x1F3C5, 0x1F3C5}, + {0x1F3C6, 0x1F3CA}, + {0x1F3CF, 0x1F3D3}, + {0x1F3E0, 0x1F3F0}, + {0x1F3F4, 0x1F3F4}, + {0x1F3F8, 0x1F3FF}, + {0x1F400, 0x1F43E}, + {0x1F440, 0x1F440}, + {0x1F442, 0x1F4F7}, + {0x1F4F8, 0x1F4F8}, + {0x1F4F9, 0x1F4FC}, + {0x1F4FF, 0x1F4FF}, + {0x1F500, 0x1F53D}, + {0x1F54B, 0x1F54E}, + {0x1F550, 0x1F567}, + {0x1F57A, 0x1F57A}, + {0x1F595, 0x1F596}, + {0x1F5A4, 0x1F5A4}, + {0x1F5FB, 0x1F5FF}, + {0x1F600, 0x1F600}, + {0x1F601, 0x1F610}, + {0x1F611, 0x1F611}, + {0x1F612, 0x1F614}, + {0x1F615, 0x1F615}, + {0x1F616, 0x1F616}, + {0x1F617, 0x1F617}, + {0x1F618, 0x1F618}, + {0x1F619, 0x1F619}, + {0x1F61A, 0x1F61A}, + {0x1F61B, 0x1F61B}, + {0x1F61C, 0x1F61E}, + {0x1F61F, 0x1F61F}, + {0x1F620, 0x1F625}, + {0x1F626, 0x1F627}, + {0x1F628, 0x1F62B}, + {0x1F62C, 0x1F62C}, + {0x1F62D, 0x1F62D}, + {0x1F62E, 0x1F62F}, + {0x1F630, 0x1F633}, + {0x1F634, 0x1F634}, + {0x1F635, 0x1F640}, + {0x1F641, 0x1F642}, + {0x1F643, 0x1F644}, + {0x1F645, 0x1F64F}, + {0x1F680, 0x1F6C5}, + {0x1F6CC, 0x1F6CC}, + {0x1F6D0, 0x1F6D0}, + {0x1F6D1, 0x1F6D2}, + {0x1F6EB, 0x1F6EC}, + {0x1F6F4, 0x1F6F6}, + {0x1F6F7, 0x1F6F8}, + {0x1F910, 0x1F918}, + {0x1F919, 0x1F91E}, + {0x1F91F, 0x1F91F}, + {0x1F920, 0x1F927}, + {0x1F928, 0x1F92F}, + {0x1F930, 0x1F930}, + {0x1F931, 0x1F932}, + {0x1F933, 0x1F93A}, + {0x1F93C, 0x1F93E}, + {0x1F940, 0x1F945}, + {0x1F947, 0x1F94B}, + {0x1F94C, 0x1F94C}, + {0x1F950, 0x1F95E}, + {0x1F95F, 0x1F96B}, + {0x1F980, 0x1F984}, + {0x1F985, 0x1F991}, + {0x1F992, 0x1F997}, + {0x1F9C0, 0x1F9C0}, + {0x1F9D0, 0x1F9E6}, +}; + +static const struct Interval _pango_Emoji_Modifier_table[] = +{ + {0x1F3FB, 0x1F3FF}, +}; + +static const struct Interval _pango_Emoji_Modifier_Base_table[] = +{ + {0x261D, 0x261D}, + {0x26F9, 0x26F9}, + {0x270A, 0x270B}, + {0x270C, 0x270D}, + {0x1F385, 0x1F385}, + {0x1F3C2, 0x1F3C4}, + {0x1F3C7, 0x1F3C7}, + {0x1F3CA, 0x1F3CA}, + {0x1F3CB, 0x1F3CC}, + {0x1F442, 0x1F443}, + {0x1F446, 0x1F450}, + {0x1F466, 0x1F469}, + {0x1F46E, 0x1F46E}, + {0x1F470, 0x1F478}, + {0x1F47C, 0x1F47C}, + {0x1F481, 0x1F483}, + {0x1F485, 0x1F487}, + {0x1F4AA, 0x1F4AA}, + {0x1F574, 0x1F575}, + {0x1F57A, 0x1F57A}, + {0x1F590, 0x1F590}, + {0x1F595, 0x1F596}, + {0x1F645, 0x1F647}, + {0x1F64B, 0x1F64F}, + {0x1F6A3, 0x1F6A3}, + {0x1F6B4, 0x1F6B6}, + {0x1F6C0, 0x1F6C0}, + {0x1F6CC, 0x1F6CC}, + {0x1F918, 0x1F918}, + {0x1F919, 0x1F91C}, + {0x1F91E, 0x1F91E}, + {0x1F91F, 0x1F91F}, + {0x1F926, 0x1F926}, + {0x1F930, 0x1F930}, + {0x1F931, 0x1F932}, + {0x1F933, 0x1F939}, + {0x1F93D, 0x1F93E}, + {0x1F9D1, 0x1F9DD}, +}; + +static const struct Interval _pango_Emoji_Component_table[] = +{ + {0x0023, 0x0023}, + {0x002A, 0x002A}, + {0x0030, 0x0039}, + {0x1F1E6, 0x1F1FF}, + {0x1F3FB, 0x1F3FF}, +}; + +#endif /* PANGO_EMOJI_TABLE_H */ + +/* == End of generated table == */ diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c new file mode 100644 index 0000000..2947245 --- /dev/null +++ b/pango/pango-emoji.c @@ -0,0 +1,274 @@ +/* Pango + * pango-emoji.c: Emoji handling + * + * Copyright (C) 2017 Google, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Implementation of pango_emoji_iter is derived from Chromium: + * + * https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/fonts/FontFallbackPriority.h + * https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/text/CharacterEmoji.cpp + * https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/fonts/SymbolsIterator.cpp + * + * // Copyright 2015 The Chromium Authors. All rights reserved. + * // Use of this source code is governed by a BSD-style license that can be + * // found in the LICENSE file. + */ + +#include "config.h" +#include +#include + +#include "pango-emoji-private.h" +#include "pango-emoji-table.h" + + +static int +interval_compare (const void *key, const void *elt) +{ + gunichar c = GPOINTER_TO_UINT (key); + struct Interval *interval = (struct Interval *)elt; + + if (c < interval->start) + return -1; + if (c > interval->end) + return +1; + + return 0; +} + +#define DEFINE_pango_Is_(name) \ +static gboolean \ +_pango_Is_##name (gunichar ch) \ +{ \ + /* bsearch() is declared attribute(nonnull(1)) so we can't validly search \ + * for a NULL key */ \ + /* \ + if (G_UNLIKELY (ch == 0)) \ + return FALSE; \ + */ \ + \ + if (bsearch (GUINT_TO_POINTER (ch), \ + _pango_##name##_table, \ + G_N_ELEMENTS (_pango_##name##_table), \ + sizeof _pango_##name##_table[0], \ + interval_compare)) \ + return TRUE; \ + \ + return FALSE; \ +} + +DEFINE_pango_Is_(Emoji) +DEFINE_pango_Is_(Emoji_Presentation) +DEFINE_pango_Is_(Emoji_Modifier) +DEFINE_pango_Is_(Emoji_Modifier_Base) + + +static gboolean +_pango_Is_Emoji_Text_Default (gunichar ch) +{ + return _pango_Is_Emoji (ch) && !_pango_Is_Emoji_Presentation (ch); +} + +static gboolean +_pango_Is_Emoji_Emoji_Default (gunichar ch) +{ + return _pango_Is_Emoji_Presentation (ch); +} + +static gboolean +_pango_Is_Emoji_Keycap_Base (gunichar ch) +{ + return (ch >= '0' && ch <= '9') || ch == '#' || ch == '*'; +} + +static gboolean +_pango_Is_Regional_Indicator (gunichar ch) +{ + return (ch >= 0x1F1E6 && ch <= 0x1F1FF); +} + + +const gunichar kCombiningEnclosingCircleBackslashCharacter = 0x20E0; +const gunichar kCombiningEnclosingKeycapCharacter = 0x20E3; +const gunichar kEyeCharacter = 0x1F441; +const gunichar kFemaleSignCharacter = 0x2640; +const gunichar kLeftSpeechBubbleCharacter = 0x1F5E8; +const gunichar kMaleSignCharacter = 0x2642; +const gunichar kRainbowCharacter = 0x1F308; +const gunichar kStaffOfAesculapiusCharacter = 0x2695; +const gunichar kVariationSelector15Character = 0xFE0E; +const gunichar kVariationSelector16Character = 0xFE0F; +const gunichar kWavingWhiteFlagCharacter = 0x1F3F3; +const gunichar kZeroWidthJoinerCharacter = 0x200D; + + +typedef enum { + PANGO_EMOJI_TYPE_INVALID, + PANGO_EMOJI_TYPE_TEXT, /* For regular non-symbols text */ + PANGO_EMOJI_TYPE_EMOJI_TEXT, /* For emoji in text presentaiton */ + PANGO_EMOJI_TYPE_EMOJI_EMOJI /* For emoji in emoji presentation */ +} PangoEmojiType; + +static PangoEmojiType +_pango_get_emoji_type (gunichar codepoint) +{ + /* Those should only be Emoji presentation as combinations of two. */ + if (_pango_Is_Emoji_Keycap_Base (codepoint) || + _pango_Is_Regional_Indicator (codepoint)) + return PANGO_EMOJI_TYPE_TEXT; + + if (codepoint == kCombiningEnclosingKeycapCharacter) + return PANGO_EMOJI_TYPE_EMOJI_EMOJI; + + if (_pango_Is_Emoji_Emoji_Default (codepoint) || + _pango_Is_Emoji_Modifier_Base (codepoint) || + _pango_Is_Emoji_Modifier (codepoint)) + return PANGO_EMOJI_TYPE_EMOJI_EMOJI; + + if (_pango_Is_Emoji_Text_Default (codepoint)) + return PANGO_EMOJI_TYPE_EMOJI_TEXT; + + return PANGO_EMOJI_TYPE_TEXT; +} + + +PangoEmojiIter * +_pango_emoji_iter_init (PangoEmojiIter *iter, + const char *text, + int length) +{ + iter->text_start = text; + if (length >= 0) + iter->text_end = text + length; + else + iter->text_end = text + strlen (text); + + iter->start = text; + iter->end = text; + iter->is_emoji = (gboolean) 2; /* HACK */ + + _pango_emoji_iter_next (iter); + + return iter; +} + +void +_pango_emoji_iter_fini (PangoEmojiIter *iter) +{ +} + +#define PANGO_EMOJI_TYPE_IS_EMOJI(typ) ((typ) == PANGO_EMOJI_TYPE_EMOJI_EMOJI) + +gboolean +_pango_emoji_iter_next (PangoEmojiIter *iter) +{ + PangoEmojiType current_emoji_type = PANGO_EMOJI_TYPE_INVALID; + + if (iter->end == iter->text_end) + return FALSE; + + iter->start = iter->end; + + for (; iter->end < iter->text_end; iter->end = g_utf8_next_char (iter->end)) + { + gunichar ch = g_utf8_get_char (iter->end); + + /* Except at the beginning, ZWJ just carries over the emoji or neutral + * text type, VS15 & VS16 we just carry over as well, since we already + * resolved those through lookahead. Also, don't downgrade to text + * presentation for emoji that are part of a ZWJ sequence, example + * U+1F441 U+200D U+1F5E8, eye (text presentation) + ZWJ + left speech + * bubble, see below. */ + if ((!(ch == kZeroWidthJoinerCharacter && !iter->is_emoji) && + ch != kVariationSelector15Character && + ch != kVariationSelector16Character && + ch != kCombiningEnclosingCircleBackslashCharacter && + !_pango_Is_Regional_Indicator(ch) && + !((ch == kLeftSpeechBubbleCharacter || + ch == kRainbowCharacter || + ch == kMaleSignCharacter || + ch == kFemaleSignCharacter || + ch == kStaffOfAesculapiusCharacter) && + !iter->is_emoji)) || + current_emoji_type == PANGO_EMOJI_TYPE_INVALID) { + current_emoji_type = _pango_get_emoji_type (ch); + } + + if (g_utf8_next_char (iter->end) < iter->text_end) /* Optimize. */ + { + gunichar peek_char = g_utf8_get_char (g_utf8_next_char (iter->end)); + + /* Variation Selectors */ + if (current_emoji_type == + PANGO_EMOJI_TYPE_EMOJI_EMOJI && + peek_char == kVariationSelector15Character) { + current_emoji_type = PANGO_EMOJI_TYPE_EMOJI_TEXT; + } + + if ((current_emoji_type == + PANGO_EMOJI_TYPE_EMOJI_TEXT || + _pango_Is_Emoji_Keycap_Base(ch)) && + peek_char == kVariationSelector16Character) { + current_emoji_type = PANGO_EMOJI_TYPE_EMOJI_EMOJI; + } + + /* Combining characters Keycap... */ + if (_pango_Is_Emoji_Keycap_Base(ch) && + peek_char == kCombiningEnclosingKeycapCharacter) { + current_emoji_type = PANGO_EMOJI_TYPE_EMOJI_EMOJI; + }; + + /* Regional indicators */ + if (_pango_Is_Regional_Indicator(ch) && + _pango_Is_Regional_Indicator(peek_char)) { + current_emoji_type = PANGO_EMOJI_TYPE_EMOJI_EMOJI; + } + + /* Upgrade text presentation emoji to emoji presentation when followed by + * ZWJ, Example U+1F441 U+200D U+1F5E8, eye + ZWJ + left speech bubble. */ + if ((ch == kEyeCharacter || + ch == kWavingWhiteFlagCharacter) && + peek_char == kZeroWidthJoinerCharacter) { + current_emoji_type = PANGO_EMOJI_TYPE_EMOJI_EMOJI; + } + } + + if (iter->is_emoji == (gboolean) 2) + iter->is_emoji = !PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type); + if (iter->is_emoji == PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type)) + { + iter->is_emoji = !PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type); + + /* Make sure we make progress. Weird sequences, like a VC15 followed + * by VC16, can trick us into stalling otherwise. */ + if (iter->start == iter->end) + iter->end = g_utf8_next_char (iter->end); + + return TRUE; + } + } + + iter->is_emoji = PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type); + + return TRUE; +} + + +/********************************************************** + * End of code from Chromium + **********************************************************/ diff --git a/pango/pango-engine-private.h b/pango/pango-engine-private.h new file mode 100644 index 0000000..de54ee0 --- /dev/null +++ b/pango/pango-engine-private.h @@ -0,0 +1,50 @@ +/* Pango + * pango-engine-private.h: Private routines related to engines for + * script and language specific processing + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_ENGINE_PRIVATE_H__ +#define __PANGO_ENGINE_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + +void _pango_engine_shape_shape (PangoEngineShape *engine, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const char *paragraph_text, + unsigned int paragraph_len, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs); +PangoCoverageLevel _pango_engine_shape_covers (PangoEngineShape *engine, + PangoFont *font, + PangoLanguage *language, + gunichar wc); + +PangoEngineShape *_pango_get_fallback_shaper (void) /* XXX got to go when we switch to harfbuzz-only. */; + +PangoEngineLang *_pango_get_language_engine (void); + +G_END_DECLS + +#endif /* __PANGO_ENGINE_PRIVATE_H__ */ + diff --git a/pango/pango-engine.c b/pango/pango-engine.c new file mode 100644 index 0000000..a22270e --- /dev/null +++ b/pango/pango-engine.c @@ -0,0 +1,261 @@ +/* Pango + * pango-engine.c: Engines for script and language specific processing + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:engines + * @short_description:Language-specific and rendering-system-specific processing + * @title:Engines + * + * Pango utilizes a module architecture in which the language-specific + * and render-system-specific components are provided by loadable + * modules. Each loadable module supplies one or more + * engines. Each engine + * has an associated engine type and + * render type. These two types are represented by strings. + * + * Each dynamically-loaded module exports several functions which provide + * the public API. These functions are script_engine_list(), + * script_engine_init() and script_engine_exit, and + * script_engine_create(). The latter three functions are used when + * creating engines from the module at run time, while the first + * function is used when building a catalog of all available modules. + * + * Deprecated: 1.38 + */ +/** + * SECTION:pango-engine-lang + * @short_description:Rendering-system independent script engines + * @title:PangoEngineLang + * @stability:Unstable + * + * The language engines are rendering-system independent + * engines that determine line, word, and character breaks for character strings. + * These engines are used in pango_break(). + * + * Deprecated: 1.38 + */ +/** + * SECTION:pango-engine-shape + * @short_description:Rendering-system dependent script engines + * @title:PangoEngineShape + * @stability:Unstable + * + * The shape engines are rendering-system dependent + * engines that convert character strings into glyph strings. + * These engines are used in pango_shape(). + * + * Deprecated: 1.38 + */ +#include "config.h" + +#include "pango-engine.h" +#include "pango-engine-private.h" +#include "pango-impl-utils.h" + + +G_DEFINE_ABSTRACT_TYPE (PangoEngine, pango_engine, G_TYPE_OBJECT); + +static void +pango_engine_init (PangoEngine *self) +{ +} + +static void +pango_engine_class_init (PangoEngineClass *klass) +{ +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +G_DEFINE_ABSTRACT_TYPE (PangoEngineLang, pango_engine_lang, PANGO_TYPE_ENGINE); +G_GNUC_END_IGNORE_DEPRECATIONS + +static void +pango_engine_lang_init (PangoEngineLang *self) +{ +} + +static void +pango_engine_lang_class_init (PangoEngineLangClass *klass) +{ +} + + +static PangoCoverageLevel +pango_engine_shape_real_covers (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font, + PangoLanguage *language, + gunichar wc) +{ + PangoCoverage *coverage = pango_font_get_coverage (font, language); + PangoCoverageLevel result = pango_coverage_get (coverage, wc); + + pango_coverage_unref (coverage); + + return result; +} + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +G_DEFINE_ABSTRACT_TYPE (PangoEngineShape, pango_engine_shape, PANGO_TYPE_ENGINE); +G_GNUC_END_IGNORE_DEPRECATIONS + +static void +pango_engine_shape_init (PangoEngineShape *klass) +{ +} + +static void +pango_engine_shape_class_init (PangoEngineShapeClass *class) +{ + class->covers = pango_engine_shape_real_covers; +} + +void +_pango_engine_shape_shape (PangoEngineShape *engine, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const char *paragraph_text, + unsigned int paragraph_len, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) +{ + glyphs->num_glyphs = 0; + + PANGO_ENGINE_SHAPE_GET_CLASS (engine)->script_shape (engine, + font, + item_text, + item_length, + analysis, + glyphs, + paragraph_text, + paragraph_len); +} + +PangoCoverageLevel +_pango_engine_shape_covers (PangoEngineShape *engine, + PangoFont *font, + PangoLanguage *language, + gunichar wc) +{ + if (G_UNLIKELY (!engine || !font)) + return PANGO_COVERAGE_NONE; + + return PANGO_ENGINE_SHAPE_GET_CLASS (engine)->covers (engine, + font, + language, + wc); +} + +/* No extra fields needed */ +typedef PangoEngineShape PangoFallbackEngine; +typedef PangoEngineShapeClass PangoFallbackEngineClass; + +static void +fallback_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font G_GNUC_UNUSED, + const char *text, + unsigned int length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED) +{ + int n_chars; + const char *p; + int cluster = 0; + int i; + + n_chars = text ? pango_utf8_strlen (text, length) : 0; + + pango_glyph_string_set_size (glyphs, n_chars); + + p = text; + for (i = 0; i < n_chars; i++) + { + gunichar wc; + PangoGlyph glyph; + PangoRectangle logical_rect; + + wc = g_utf8_get_char (p); + + if (g_unichar_type (wc) != G_UNICODE_NON_SPACING_MARK) + cluster = p - text; + + if (pango_is_zero_width (wc)) + glyph = PANGO_GLYPH_EMPTY; + else + glyph = PANGO_GET_UNKNOWN_GLYPH (wc); + + pango_font_get_glyph_extents (analysis->font, glyph, NULL, &logical_rect); + + glyphs->glyphs[i].glyph = glyph; + + glyphs->glyphs[i].geometry.x_offset = 0; + glyphs->glyphs[i].geometry.y_offset = 0; + glyphs->glyphs[i].geometry.width = logical_rect.width; + + glyphs->log_clusters[i] = cluster; + + p = g_utf8_next_char (p); + } + + if (analysis->level & 1) + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); +} + +static PangoCoverageLevel +fallback_engine_covers (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font G_GNUC_UNUSED, + PangoLanguage *lang G_GNUC_UNUSED, + gunichar wc G_GNUC_UNUSED) +{ + return PANGO_COVERAGE_NONE; +} + + +static GType pango_fallback_engine_get_type (void); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +G_DEFINE_TYPE (PangoFallbackEngine, pango_fallback_engine, PANGO_TYPE_ENGINE_SHAPE); +G_GNUC_END_IGNORE_DEPRECATIONS + +static void +pango_fallback_engine_init (PangoFallbackEngine *self) +{ +} + +static void +pango_fallback_engine_class_init (PangoFallbackEngineClass *class) +{ + class->covers = fallback_engine_covers; + class->script_shape = fallback_engine_shape; +} + +PangoEngineShape * +_pango_get_fallback_shaper (void) +{ + static PangoEngineShape *fallback_shaper = NULL; /* MT-safe */ + if (g_once_init_enter (&fallback_shaper)) + g_once_init_leave(&fallback_shaper, g_object_new (pango_fallback_engine_get_type (), NULL)); + + return fallback_shaper; +} + diff --git a/pango/pango-engine.h b/pango/pango-engine.h new file mode 100644 index 0000000..a5c92d8 --- /dev/null +++ b/pango/pango-engine.h @@ -0,0 +1,451 @@ +/* Pango + * pango-engine.h: Engines for script and language specific processing + * + * Copyright (C) 2000,2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_ENGINE_H__ +#define __PANGO_ENGINE_H__ + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#ifdef PANGO_ENABLE_ENGINE + +/** + * PANGO_RENDER_TYPE_NONE: + * + * A string constant defining the render type + * for engines that are not rendering-system specific. + * + * Deprecated: 1.38 + */ +#define PANGO_RENDER_TYPE_NONE "PangoRenderNone" + +#define PANGO_TYPE_ENGINE (pango_engine_get_type ()) +#define PANGO_ENGINE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_ENGINE, PangoEngine)) +#define PANGO_IS_ENGINE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_ENGINE)) +#define PANGO_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_ENGINE, PangoEngineClass)) +#define PANGO_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_ENGINE)) +#define PANGO_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_ENGINE, PangoEngineClass)) + +typedef struct _PangoEngine PangoEngine; +typedef struct _PangoEngineClass PangoEngineClass; + +/** + * PangoEngine: + * + * #PangoEngine is the base class for all types of language and + * script specific engines. It has no functionality by itself. + * + * Deprecated: 1.38 + **/ +struct _PangoEngine +{ + /*< private >*/ + GObject parent_instance; +}; + +/** + * PangoEngineClass: + * + * Class structure for #PangoEngine + * + * Deprecated: 1.38 + **/ +struct _PangoEngineClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +PANGO_DEPRECATED_IN_1_38 +GType pango_engine_get_type (void) G_GNUC_CONST; + +/** + * PANGO_ENGINE_TYPE_LANG: + * + * A string constant defining the engine type for language engines. + * These engines derive from #PangoEngineLang. + * + * Deprecated: 1.38 + */ +#define PANGO_ENGINE_TYPE_LANG "PangoEngineLang" + +#define PANGO_TYPE_ENGINE_LANG (pango_engine_lang_get_type ()) +#define PANGO_ENGINE_LANG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_ENGINE_LANG, PangoEngineLang)) +#define PANGO_IS_ENGINE_LANG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_ENGINE_LANG)) +#define PANGO_ENGINE_LANG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_ENGINE_LANG, PangoEngineLangClass)) +#define PANGO_IS_ENGINE_LANG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_ENGINE_LANG)) +#define PANGO_ENGINE_LANG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_ENGINE_LANG, PangoEngineLangClass)) + +typedef struct _PangoEngineLangClass PangoEngineLangClass; + +/** + * PangoEngineLang: + * + * The #PangoEngineLang class is implemented by engines that + * customize the rendering-system independent part of the + * Pango pipeline for a particular script or language. For + * instance, a custom #PangoEngineLang could be provided for + * Thai to implement the dictionary-based word boundary + * lookups needed for that language. + * + * Deprecated: 1.38 + **/ +struct _PangoEngineLang +{ + /*< private >*/ + PangoEngine parent_instance; +}; + +/** + * PangoEngineLangClass: + * @script_break: (nullable): Provides a custom implementation of + * pango_break(). If %NULL, pango_default_break() is used instead. If + * not %NULL, for Pango versions before 1.16 (module interface version + * before 1.6.0), this was called instead of pango_default_break(), + * but in newer versions, pango_default_break() is always called and + * this is called after that to allow tailoring the breaking results. + * + * Class structure for #PangoEngineLang + * + * Deprecated: 1.38 + **/ +struct _PangoEngineLangClass +{ + /*< private >*/ + PangoEngineClass parent_class; + + /*< public >*/ + void (*script_break) (PangoEngineLang *engine, + const char *text, + int len, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len); +}; + +PANGO_DEPRECATED_IN_1_38 +GType pango_engine_lang_get_type (void) G_GNUC_CONST; + +/** + * PANGO_ENGINE_TYPE_SHAPE: + * + * A string constant defining the engine type for shaping engines. + * These engines derive from #PangoEngineShape. + * + * Deprecated: 1.38 + */ +#define PANGO_ENGINE_TYPE_SHAPE "PangoEngineShape" + +#define PANGO_TYPE_ENGINE_SHAPE (pango_engine_shape_get_type ()) +#define PANGO_ENGINE_SHAPE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_ENGINE_SHAPE, PangoEngineShape)) +#define PANGO_IS_ENGINE_SHAPE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_ENGINE_SHAPE)) +#define PANGO_ENGINE_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_ENGINE_SHAPE, PangoEngine_ShapeClass)) +#define PANGO_IS_ENGINE_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_ENGINE_SHAPE)) +#define PANGO_ENGINE_SHAPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_ENGINE_SHAPE, PangoEngineShapeClass)) + +typedef struct _PangoEngineShapeClass PangoEngineShapeClass; + +/** + * PangoEngineShape: + * + * The #PangoEngineShape class is implemented by engines that + * customize the rendering-system dependent part of the + * Pango pipeline for a particular script or language. + * A #PangoEngineShape implementation is then specific to both + * a particular rendering system or group of rendering systems + * and to a particular script. For instance, there is one + * #PangoEngineShape implementation to handle shaping Arabic + * for Fontconfig-based backends. + * + * Deprecated: 1.38 + **/ +struct _PangoEngineShape +{ + PangoEngine parent_instance; +}; + +/** + * PangoEngineShapeClass: + * @script_shape: Given a font, a piece of text, and a #PangoAnalysis + * structure, converts characters to glyphs and positions the + * resulting glyphs. The results are stored in the #PangoGlyphString + * that is passed in. (The implementation should resize it + * appropriately using pango_glyph_string_set_size()). All fields + * of the @log_clusters and @glyphs array must be filled in, with + * the exception that Pango will automatically generate + * glyphs->glyphs[i].attr.is_cluster_start + * using the @log_clusters array. Each input character must occur in one + * of the output logical clusters; + * if no rendering is desired for a character, this may involve + * inserting glyphs with the #PangoGlyph ID #PANGO_GLYPH_EMPTY, which + * is guaranteed never to render. If the shaping fails for any reason, + * the shaper should return with an empty (zero-size) glyph string. + * If the shaper has not set the size on the glyph string yet, simply + * returning signals the failure too. + * @covers: Returns the characters that this engine can cover + * with a given font for a given language. If not overridden, the default + * implementation simply returns the coverage information for the + * font itself unmodified. + * + * Class structure for #PangoEngineShape + * + * Deprecated: 1.38 + **/ +struct _PangoEngineShapeClass +{ + /*< private >*/ + PangoEngineClass parent_class; + + /*< public >*/ + void (*script_shape) (PangoEngineShape *engine, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length); + PangoCoverageLevel (*covers) (PangoEngineShape *engine, + PangoFont *font, + PangoLanguage *language, + gunichar wc); +}; + +PANGO_DEPRECATED_IN_1_38 +GType pango_engine_shape_get_type (void) G_GNUC_CONST; + +typedef struct _PangoEngineInfo PangoEngineInfo; +typedef struct _PangoEngineScriptInfo PangoEngineScriptInfo; + +/** + * PangoEngineScriptInfo: + * @script: a #PangoScript. The value %PANGO_SCRIPT_COMMON has + * the special meaning here of "all scripts" + * @langs: a semicolon separated list of languages that this + * engine handles for this script. This may be empty, + * in which case the engine is saying that it is a + * fallback choice for all languages for this range, + * but should not be used if another engine + * indicates that it is specific for the language for + * a given code point. An entry in this list of "*" + * indicates that this engine is specific to all + * languages for this range. + * + * The #PangoEngineScriptInfo structure contains + * information about how the shaper covers a particular script. + * + * Deprecated: 1.38 + */ +struct _PangoEngineScriptInfo +{ + PangoScript script; + const gchar *langs; +}; + +/** + * PangoEngineInfo: + * @id: a unique string ID for the engine. + * @engine_type: a string identifying the engine type. + * @render_type: a string identifying the render type. + * @scripts: array of scripts this engine supports. + * @n_scripts: number of items in @scripts. + * + * The #PangoEngineInfo structure contains information about a particular + * engine. It contains the following fields: + * + * Deprecated: 1.38 + */ +struct _PangoEngineInfo +{ + const gchar *id; + const gchar *engine_type; + const gchar *render_type; + PangoEngineScriptInfo *scripts; + gint n_scripts; +}; + +/** + * script_engine_list: (skip) + * @engines: location to store a pointer to an array of engines. + * @n_engines: location to store the number of elements in @engines. + * + * Do not use. + * + * Deprecated: 1.38 + **/ +PANGO_DEPRECATED_IN_1_38 +void script_engine_list (PangoEngineInfo **engines, + int *n_engines); + +/** + * script_engine_init: (skip) + * @module: a #GTypeModule structure used to associate any + * GObject types created in this module with the module. + * + * Do not use. + * + * Deprecated: 1.38 + **/ +PANGO_DEPRECATED_IN_1_38 +void script_engine_init (GTypeModule *module); + + +/** + * script_engine_exit: (skip) + * + * Do not use. + * + * Deprecated: 1.38 + **/ +PANGO_DEPRECATED_IN_1_38 +void script_engine_exit (void); + +/** + * script_engine_create: (skip) + * @id: the ID of an engine as reported by script_engine_list. + * + * Do not use. + * + * Deprecated: 1.38 + **/ +PANGO_DEPRECATED_IN_1_38 +PangoEngine *script_engine_create (const char *id); + +/* Utility macro used by PANGO_ENGINE_LANG_DEFINE_TYPE and + * PANGO_ENGINE_LANG_DEFINE_TYPE + */ +#define PANGO_ENGINE_DEFINE_TYPE(name, prefix, class_init, instance_init, parent_type) \ +static GType prefix ## _type; \ +static void \ +prefix ## _register_type (GTypeModule *module) \ +{ \ + const GTypeInfo object_info = \ + { \ + sizeof (name ## Class), \ + (GBaseInitFunc) NULL, \ + (GBaseFinalizeFunc) NULL, \ + (GClassInitFunc) class_init, \ + (GClassFinalizeFunc) NULL, \ + NULL, /* class_data */ \ + sizeof (name), \ + 0, /* n_prelocs */ \ + (GInstanceInitFunc) instance_init, \ + NULL /* value_table */ \ + }; \ + \ + prefix ## _type = g_type_module_register_type (module, parent_type, \ + # name, \ + &object_info, 0); \ +} + +/** + * PANGO_ENGINE_LANG_DEFINE_TYPE: + * @name: Name of the the type to register (for example:, ArabicEngineFc + * @prefix: Prefix for symbols that will be defined (for example:, arabic_engine_fc + * @class_init: (nullable): Class initialization function for the new type, or %NULL + * @instance_init: (nullable): Instance initialization function for the new type, or %NULL + * + * Outputs the necessary code for GObject type registration for a + * #PangoEngineLang class defined in a module. Two static symbols + * are defined. + * + * + * static GType prefix_type; + * static void prefix_register_type (GTypeModule module); + * + * + * The prefix_register_type() + * function should be called in your script_engine_init() function for + * each type that your module implements, and then your script_engine_create() + * function can create instances of the object as follows: + * + * + * PangoEngine *engine = g_object_new (prefix_type, NULL); + * + * + * Deprecated: 1.38 + **/ +#define PANGO_ENGINE_LANG_DEFINE_TYPE(name, prefix, class_init, instance_init) \ + PANGO_ENGINE_DEFINE_TYPE (name, prefix, \ + class_init, instance_init, \ + PANGO_TYPE_ENGINE_LANG) + +/** + * PANGO_ENGINE_SHAPE_DEFINE_TYPE: + * @name: Name of the the type to register (for example:, ArabicEngineFc + * @prefix: Prefix for symbols that will be defined (for example:, arabic_engine_fc + * @class_init: (nullable): Class initialization function for the new type, or %NULL + * @instance_init: (nullable): Instance initialization function for the new type, or %NULL + * + * Outputs the necessary code for GObject type registration for a + * #PangoEngineShape class defined in a module. Two static symbols + * are defined. + * + * + * static GType prefix_type; + * static void prefix_register_type (GTypeModule module); + * + * + * The prefix_register_type() + * function should be called in your script_engine_init() function for + * each type that your module implements, and then your script_engine_create() + * function can create instances of the object as follows: + * + * + * PangoEngine *engine = g_object_new (prefix_type, NULL); + * + * + * Deprecated: 1.38 + **/ +#define PANGO_ENGINE_SHAPE_DEFINE_TYPE(name, prefix, class_init, instance_init) \ + PANGO_ENGINE_DEFINE_TYPE (name, prefix, \ + class_init, instance_init, \ + PANGO_TYPE_ENGINE_SHAPE) + +/* Macro used for possibly builtin Pango modules. Not useful + * for externally build modules. If we are compiling a module standalone, + * then we name the entry points script_engine_list, etc. But if we + * are compiling it for inclusion directly in Pango, then we need them to + * to have distinct names for this module, so we prepend a prefix. + * + * The two intermediate macros are to deal with details of the C + * preprocessor; token pasting tokens must be function arguments, + * and macro substitution isn't used on function arguments that + * are used for token pasting. + */ +#ifdef PANGO_MODULE_PREFIX +#define PANGO_MODULE_ENTRY(func) _PANGO_MODULE_ENTRY2(PANGO_MODULE_PREFIX,func) +#define _PANGO_MODULE_ENTRY2(prefix,func) _PANGO_MODULE_ENTRY3(prefix,func) +#define _PANGO_MODULE_ENTRY3(prefix,func) prefix##_script_engine_##func +#else +#define PANGO_MODULE_ENTRY(func) script_engine_##func +#endif + +#endif /* PANGO_ENABLE_ENGINE */ + +G_END_DECLS + +#endif /* __PANGO_ENGINE_H__ */ diff --git a/pango/pango-enum-types.c b/pango/pango-enum-types.c new file mode 100644 index 0000000..e725b36 --- /dev/null +++ b/pango/pango-enum-types.c @@ -0,0 +1,560 @@ + +/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ + +#include "config.h" + +#include +/* enumerations from "pango-attributes.h" */ +GType +pango_attr_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_ATTR_INVALID, "PANGO_ATTR_INVALID", "invalid" }, + { PANGO_ATTR_LANGUAGE, "PANGO_ATTR_LANGUAGE", "language" }, + { PANGO_ATTR_FAMILY, "PANGO_ATTR_FAMILY", "family" }, + { PANGO_ATTR_STYLE, "PANGO_ATTR_STYLE", "style" }, + { PANGO_ATTR_WEIGHT, "PANGO_ATTR_WEIGHT", "weight" }, + { PANGO_ATTR_VARIANT, "PANGO_ATTR_VARIANT", "variant" }, + { PANGO_ATTR_STRETCH, "PANGO_ATTR_STRETCH", "stretch" }, + { PANGO_ATTR_SIZE, "PANGO_ATTR_SIZE", "size" }, + { PANGO_ATTR_FONT_DESC, "PANGO_ATTR_FONT_DESC", "font-desc" }, + { PANGO_ATTR_FOREGROUND, "PANGO_ATTR_FOREGROUND", "foreground" }, + { PANGO_ATTR_BACKGROUND, "PANGO_ATTR_BACKGROUND", "background" }, + { PANGO_ATTR_UNDERLINE, "PANGO_ATTR_UNDERLINE", "underline" }, + { PANGO_ATTR_STRIKETHROUGH, "PANGO_ATTR_STRIKETHROUGH", "strikethrough" }, + { PANGO_ATTR_RISE, "PANGO_ATTR_RISE", "rise" }, + { PANGO_ATTR_SHAPE, "PANGO_ATTR_SHAPE", "shape" }, + { PANGO_ATTR_SCALE, "PANGO_ATTR_SCALE", "scale" }, + { PANGO_ATTR_FALLBACK, "PANGO_ATTR_FALLBACK", "fallback" }, + { PANGO_ATTR_LETTER_SPACING, "PANGO_ATTR_LETTER_SPACING", "letter-spacing" }, + { PANGO_ATTR_UNDERLINE_COLOR, "PANGO_ATTR_UNDERLINE_COLOR", "underline-color" }, + { PANGO_ATTR_STRIKETHROUGH_COLOR, "PANGO_ATTR_STRIKETHROUGH_COLOR", "strikethrough-color" }, + { PANGO_ATTR_ABSOLUTE_SIZE, "PANGO_ATTR_ABSOLUTE_SIZE", "absolute-size" }, + { PANGO_ATTR_GRAVITY, "PANGO_ATTR_GRAVITY", "gravity" }, + { PANGO_ATTR_GRAVITY_HINT, "PANGO_ATTR_GRAVITY_HINT", "gravity-hint" }, + { PANGO_ATTR_FONT_FEATURES, "PANGO_ATTR_FONT_FEATURES", "font-features" }, + { PANGO_ATTR_FOREGROUND_ALPHA, "PANGO_ATTR_FOREGROUND_ALPHA", "foreground-alpha" }, + { PANGO_ATTR_BACKGROUND_ALPHA, "PANGO_ATTR_BACKGROUND_ALPHA", "background-alpha" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoAttrType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_underline_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_UNDERLINE_NONE, "PANGO_UNDERLINE_NONE", "none" }, + { PANGO_UNDERLINE_SINGLE, "PANGO_UNDERLINE_SINGLE", "single" }, + { PANGO_UNDERLINE_DOUBLE, "PANGO_UNDERLINE_DOUBLE", "double" }, + { PANGO_UNDERLINE_LOW, "PANGO_UNDERLINE_LOW", "low" }, + { PANGO_UNDERLINE_ERROR, "PANGO_UNDERLINE_ERROR", "error" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoUnderline"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-bidi-type.h" */ +GType +pango_bidi_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_BIDI_TYPE_L, "PANGO_BIDI_TYPE_L", "l" }, + { PANGO_BIDI_TYPE_LRE, "PANGO_BIDI_TYPE_LRE", "lre" }, + { PANGO_BIDI_TYPE_LRO, "PANGO_BIDI_TYPE_LRO", "lro" }, + { PANGO_BIDI_TYPE_R, "PANGO_BIDI_TYPE_R", "r" }, + { PANGO_BIDI_TYPE_AL, "PANGO_BIDI_TYPE_AL", "al" }, + { PANGO_BIDI_TYPE_RLE, "PANGO_BIDI_TYPE_RLE", "rle" }, + { PANGO_BIDI_TYPE_RLO, "PANGO_BIDI_TYPE_RLO", "rlo" }, + { PANGO_BIDI_TYPE_PDF, "PANGO_BIDI_TYPE_PDF", "pdf" }, + { PANGO_BIDI_TYPE_EN, "PANGO_BIDI_TYPE_EN", "en" }, + { PANGO_BIDI_TYPE_ES, "PANGO_BIDI_TYPE_ES", "es" }, + { PANGO_BIDI_TYPE_ET, "PANGO_BIDI_TYPE_ET", "et" }, + { PANGO_BIDI_TYPE_AN, "PANGO_BIDI_TYPE_AN", "an" }, + { PANGO_BIDI_TYPE_CS, "PANGO_BIDI_TYPE_CS", "cs" }, + { PANGO_BIDI_TYPE_NSM, "PANGO_BIDI_TYPE_NSM", "nsm" }, + { PANGO_BIDI_TYPE_BN, "PANGO_BIDI_TYPE_BN", "bn" }, + { PANGO_BIDI_TYPE_B, "PANGO_BIDI_TYPE_B", "b" }, + { PANGO_BIDI_TYPE_S, "PANGO_BIDI_TYPE_S", "s" }, + { PANGO_BIDI_TYPE_WS, "PANGO_BIDI_TYPE_WS", "ws" }, + { PANGO_BIDI_TYPE_ON, "PANGO_BIDI_TYPE_ON", "on" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoBidiType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_direction_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_DIRECTION_LTR, "PANGO_DIRECTION_LTR", "ltr" }, + { PANGO_DIRECTION_RTL, "PANGO_DIRECTION_RTL", "rtl" }, + { PANGO_DIRECTION_TTB_LTR, "PANGO_DIRECTION_TTB_LTR", "ttb-ltr" }, + { PANGO_DIRECTION_TTB_RTL, "PANGO_DIRECTION_TTB_RTL", "ttb-rtl" }, + { PANGO_DIRECTION_WEAK_LTR, "PANGO_DIRECTION_WEAK_LTR", "weak-ltr" }, + { PANGO_DIRECTION_WEAK_RTL, "PANGO_DIRECTION_WEAK_RTL", "weak-rtl" }, + { PANGO_DIRECTION_NEUTRAL, "PANGO_DIRECTION_NEUTRAL", "neutral" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoDirection"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-coverage.h" */ +GType +pango_coverage_level_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_COVERAGE_NONE, "PANGO_COVERAGE_NONE", "none" }, + { PANGO_COVERAGE_FALLBACK, "PANGO_COVERAGE_FALLBACK", "fallback" }, + { PANGO_COVERAGE_APPROXIMATE, "PANGO_COVERAGE_APPROXIMATE", "approximate" }, + { PANGO_COVERAGE_EXACT, "PANGO_COVERAGE_EXACT", "exact" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoCoverageLevel"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-font.h" */ +GType +pango_style_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_STYLE_NORMAL, "PANGO_STYLE_NORMAL", "normal" }, + { PANGO_STYLE_OBLIQUE, "PANGO_STYLE_OBLIQUE", "oblique" }, + { PANGO_STYLE_ITALIC, "PANGO_STYLE_ITALIC", "italic" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoStyle"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_variant_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_VARIANT_NORMAL, "PANGO_VARIANT_NORMAL", "normal" }, + { PANGO_VARIANT_SMALL_CAPS, "PANGO_VARIANT_SMALL_CAPS", "small-caps" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoVariant"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_weight_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_WEIGHT_THIN, "PANGO_WEIGHT_THIN", "thin" }, + { PANGO_WEIGHT_ULTRALIGHT, "PANGO_WEIGHT_ULTRALIGHT", "ultralight" }, + { PANGO_WEIGHT_LIGHT, "PANGO_WEIGHT_LIGHT", "light" }, + { PANGO_WEIGHT_SEMILIGHT, "PANGO_WEIGHT_SEMILIGHT", "semilight" }, + { PANGO_WEIGHT_BOOK, "PANGO_WEIGHT_BOOK", "book" }, + { PANGO_WEIGHT_NORMAL, "PANGO_WEIGHT_NORMAL", "normal" }, + { PANGO_WEIGHT_MEDIUM, "PANGO_WEIGHT_MEDIUM", "medium" }, + { PANGO_WEIGHT_SEMIBOLD, "PANGO_WEIGHT_SEMIBOLD", "semibold" }, + { PANGO_WEIGHT_BOLD, "PANGO_WEIGHT_BOLD", "bold" }, + { PANGO_WEIGHT_ULTRABOLD, "PANGO_WEIGHT_ULTRABOLD", "ultrabold" }, + { PANGO_WEIGHT_HEAVY, "PANGO_WEIGHT_HEAVY", "heavy" }, + { PANGO_WEIGHT_ULTRAHEAVY, "PANGO_WEIGHT_ULTRAHEAVY", "ultraheavy" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoWeight"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_stretch_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_STRETCH_ULTRA_CONDENSED, "PANGO_STRETCH_ULTRA_CONDENSED", "ultra-condensed" }, + { PANGO_STRETCH_EXTRA_CONDENSED, "PANGO_STRETCH_EXTRA_CONDENSED", "extra-condensed" }, + { PANGO_STRETCH_CONDENSED, "PANGO_STRETCH_CONDENSED", "condensed" }, + { PANGO_STRETCH_SEMI_CONDENSED, "PANGO_STRETCH_SEMI_CONDENSED", "semi-condensed" }, + { PANGO_STRETCH_NORMAL, "PANGO_STRETCH_NORMAL", "normal" }, + { PANGO_STRETCH_SEMI_EXPANDED, "PANGO_STRETCH_SEMI_EXPANDED", "semi-expanded" }, + { PANGO_STRETCH_EXPANDED, "PANGO_STRETCH_EXPANDED", "expanded" }, + { PANGO_STRETCH_EXTRA_EXPANDED, "PANGO_STRETCH_EXTRA_EXPANDED", "extra-expanded" }, + { PANGO_STRETCH_ULTRA_EXPANDED, "PANGO_STRETCH_ULTRA_EXPANDED", "ultra-expanded" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoStretch"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_font_mask_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { PANGO_FONT_MASK_FAMILY, "PANGO_FONT_MASK_FAMILY", "family" }, + { PANGO_FONT_MASK_STYLE, "PANGO_FONT_MASK_STYLE", "style" }, + { PANGO_FONT_MASK_VARIANT, "PANGO_FONT_MASK_VARIANT", "variant" }, + { PANGO_FONT_MASK_WEIGHT, "PANGO_FONT_MASK_WEIGHT", "weight" }, + { PANGO_FONT_MASK_STRETCH, "PANGO_FONT_MASK_STRETCH", "stretch" }, + { PANGO_FONT_MASK_SIZE, "PANGO_FONT_MASK_SIZE", "size" }, + { PANGO_FONT_MASK_GRAVITY, "PANGO_FONT_MASK_GRAVITY", "gravity" }, + { PANGO_FONT_MASK_VARIATIONS, "PANGO_FONT_MASK_VARIATIONS", "variations" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("PangoFontMask"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-gravity.h" */ +GType +pango_gravity_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_GRAVITY_SOUTH, "PANGO_GRAVITY_SOUTH", "south" }, + { PANGO_GRAVITY_EAST, "PANGO_GRAVITY_EAST", "east" }, + { PANGO_GRAVITY_NORTH, "PANGO_GRAVITY_NORTH", "north" }, + { PANGO_GRAVITY_WEST, "PANGO_GRAVITY_WEST", "west" }, + { PANGO_GRAVITY_AUTO, "PANGO_GRAVITY_AUTO", "auto" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoGravity"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_gravity_hint_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_GRAVITY_HINT_NATURAL, "PANGO_GRAVITY_HINT_NATURAL", "natural" }, + { PANGO_GRAVITY_HINT_STRONG, "PANGO_GRAVITY_HINT_STRONG", "strong" }, + { PANGO_GRAVITY_HINT_LINE, "PANGO_GRAVITY_HINT_LINE", "line" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoGravityHint"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-layout.h" */ +GType +pango_alignment_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_ALIGN_LEFT, "PANGO_ALIGN_LEFT", "left" }, + { PANGO_ALIGN_CENTER, "PANGO_ALIGN_CENTER", "center" }, + { PANGO_ALIGN_RIGHT, "PANGO_ALIGN_RIGHT", "right" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoAlignment"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_wrap_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_WRAP_WORD, "PANGO_WRAP_WORD", "word" }, + { PANGO_WRAP_CHAR, "PANGO_WRAP_CHAR", "char" }, + { PANGO_WRAP_WORD_CHAR, "PANGO_WRAP_WORD_CHAR", "word-char" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoWrapMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +pango_ellipsize_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_ELLIPSIZE_NONE, "PANGO_ELLIPSIZE_NONE", "none" }, + { PANGO_ELLIPSIZE_START, "PANGO_ELLIPSIZE_START", "start" }, + { PANGO_ELLIPSIZE_MIDDLE, "PANGO_ELLIPSIZE_MIDDLE", "middle" }, + { PANGO_ELLIPSIZE_END, "PANGO_ELLIPSIZE_END", "end" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoEllipsizeMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-renderer.h" */ +GType +pango_render_part_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_RENDER_PART_FOREGROUND, "PANGO_RENDER_PART_FOREGROUND", "foreground" }, + { PANGO_RENDER_PART_BACKGROUND, "PANGO_RENDER_PART_BACKGROUND", "background" }, + { PANGO_RENDER_PART_UNDERLINE, "PANGO_RENDER_PART_UNDERLINE", "underline" }, + { PANGO_RENDER_PART_STRIKETHROUGH, "PANGO_RENDER_PART_STRIKETHROUGH", "strikethrough" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoRenderPart"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-script.h" */ +GType +pango_script_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_SCRIPT_INVALID_CODE, "PANGO_SCRIPT_INVALID_CODE", "invalid-code" }, + { PANGO_SCRIPT_COMMON, "PANGO_SCRIPT_COMMON", "common" }, + { PANGO_SCRIPT_INHERITED, "PANGO_SCRIPT_INHERITED", "inherited" }, + { PANGO_SCRIPT_ARABIC, "PANGO_SCRIPT_ARABIC", "arabic" }, + { PANGO_SCRIPT_ARMENIAN, "PANGO_SCRIPT_ARMENIAN", "armenian" }, + { PANGO_SCRIPT_BENGALI, "PANGO_SCRIPT_BENGALI", "bengali" }, + { PANGO_SCRIPT_BOPOMOFO, "PANGO_SCRIPT_BOPOMOFO", "bopomofo" }, + { PANGO_SCRIPT_CHEROKEE, "PANGO_SCRIPT_CHEROKEE", "cherokee" }, + { PANGO_SCRIPT_COPTIC, "PANGO_SCRIPT_COPTIC", "coptic" }, + { PANGO_SCRIPT_CYRILLIC, "PANGO_SCRIPT_CYRILLIC", "cyrillic" }, + { PANGO_SCRIPT_DESERET, "PANGO_SCRIPT_DESERET", "deseret" }, + { PANGO_SCRIPT_DEVANAGARI, "PANGO_SCRIPT_DEVANAGARI", "devanagari" }, + { PANGO_SCRIPT_ETHIOPIC, "PANGO_SCRIPT_ETHIOPIC", "ethiopic" }, + { PANGO_SCRIPT_GEORGIAN, "PANGO_SCRIPT_GEORGIAN", "georgian" }, + { PANGO_SCRIPT_GOTHIC, "PANGO_SCRIPT_GOTHIC", "gothic" }, + { PANGO_SCRIPT_GREEK, "PANGO_SCRIPT_GREEK", "greek" }, + { PANGO_SCRIPT_GUJARATI, "PANGO_SCRIPT_GUJARATI", "gujarati" }, + { PANGO_SCRIPT_GURMUKHI, "PANGO_SCRIPT_GURMUKHI", "gurmukhi" }, + { PANGO_SCRIPT_HAN, "PANGO_SCRIPT_HAN", "han" }, + { PANGO_SCRIPT_HANGUL, "PANGO_SCRIPT_HANGUL", "hangul" }, + { PANGO_SCRIPT_HEBREW, "PANGO_SCRIPT_HEBREW", "hebrew" }, + { PANGO_SCRIPT_HIRAGANA, "PANGO_SCRIPT_HIRAGANA", "hiragana" }, + { PANGO_SCRIPT_KANNADA, "PANGO_SCRIPT_KANNADA", "kannada" }, + { PANGO_SCRIPT_KATAKANA, "PANGO_SCRIPT_KATAKANA", "katakana" }, + { PANGO_SCRIPT_KHMER, "PANGO_SCRIPT_KHMER", "khmer" }, + { PANGO_SCRIPT_LAO, "PANGO_SCRIPT_LAO", "lao" }, + { PANGO_SCRIPT_LATIN, "PANGO_SCRIPT_LATIN", "latin" }, + { PANGO_SCRIPT_MALAYALAM, "PANGO_SCRIPT_MALAYALAM", "malayalam" }, + { PANGO_SCRIPT_MONGOLIAN, "PANGO_SCRIPT_MONGOLIAN", "mongolian" }, + { PANGO_SCRIPT_MYANMAR, "PANGO_SCRIPT_MYANMAR", "myanmar" }, + { PANGO_SCRIPT_OGHAM, "PANGO_SCRIPT_OGHAM", "ogham" }, + { PANGO_SCRIPT_OLD_ITALIC, "PANGO_SCRIPT_OLD_ITALIC", "old-italic" }, + { PANGO_SCRIPT_ORIYA, "PANGO_SCRIPT_ORIYA", "oriya" }, + { PANGO_SCRIPT_RUNIC, "PANGO_SCRIPT_RUNIC", "runic" }, + { PANGO_SCRIPT_SINHALA, "PANGO_SCRIPT_SINHALA", "sinhala" }, + { PANGO_SCRIPT_SYRIAC, "PANGO_SCRIPT_SYRIAC", "syriac" }, + { PANGO_SCRIPT_TAMIL, "PANGO_SCRIPT_TAMIL", "tamil" }, + { PANGO_SCRIPT_TELUGU, "PANGO_SCRIPT_TELUGU", "telugu" }, + { PANGO_SCRIPT_THAANA, "PANGO_SCRIPT_THAANA", "thaana" }, + { PANGO_SCRIPT_THAI, "PANGO_SCRIPT_THAI", "thai" }, + { PANGO_SCRIPT_TIBETAN, "PANGO_SCRIPT_TIBETAN", "tibetan" }, + { PANGO_SCRIPT_CANADIAN_ABORIGINAL, "PANGO_SCRIPT_CANADIAN_ABORIGINAL", "canadian-aboriginal" }, + { PANGO_SCRIPT_YI, "PANGO_SCRIPT_YI", "yi" }, + { PANGO_SCRIPT_TAGALOG, "PANGO_SCRIPT_TAGALOG", "tagalog" }, + { PANGO_SCRIPT_HANUNOO, "PANGO_SCRIPT_HANUNOO", "hanunoo" }, + { PANGO_SCRIPT_BUHID, "PANGO_SCRIPT_BUHID", "buhid" }, + { PANGO_SCRIPT_TAGBANWA, "PANGO_SCRIPT_TAGBANWA", "tagbanwa" }, + { PANGO_SCRIPT_BRAILLE, "PANGO_SCRIPT_BRAILLE", "braille" }, + { PANGO_SCRIPT_CYPRIOT, "PANGO_SCRIPT_CYPRIOT", "cypriot" }, + { PANGO_SCRIPT_LIMBU, "PANGO_SCRIPT_LIMBU", "limbu" }, + { PANGO_SCRIPT_OSMANYA, "PANGO_SCRIPT_OSMANYA", "osmanya" }, + { PANGO_SCRIPT_SHAVIAN, "PANGO_SCRIPT_SHAVIAN", "shavian" }, + { PANGO_SCRIPT_LINEAR_B, "PANGO_SCRIPT_LINEAR_B", "linear-b" }, + { PANGO_SCRIPT_TAI_LE, "PANGO_SCRIPT_TAI_LE", "tai-le" }, + { PANGO_SCRIPT_UGARITIC, "PANGO_SCRIPT_UGARITIC", "ugaritic" }, + { PANGO_SCRIPT_NEW_TAI_LUE, "PANGO_SCRIPT_NEW_TAI_LUE", "new-tai-lue" }, + { PANGO_SCRIPT_BUGINESE, "PANGO_SCRIPT_BUGINESE", "buginese" }, + { PANGO_SCRIPT_GLAGOLITIC, "PANGO_SCRIPT_GLAGOLITIC", "glagolitic" }, + { PANGO_SCRIPT_TIFINAGH, "PANGO_SCRIPT_TIFINAGH", "tifinagh" }, + { PANGO_SCRIPT_SYLOTI_NAGRI, "PANGO_SCRIPT_SYLOTI_NAGRI", "syloti-nagri" }, + { PANGO_SCRIPT_OLD_PERSIAN, "PANGO_SCRIPT_OLD_PERSIAN", "old-persian" }, + { PANGO_SCRIPT_KHAROSHTHI, "PANGO_SCRIPT_KHAROSHTHI", "kharoshthi" }, + { PANGO_SCRIPT_UNKNOWN, "PANGO_SCRIPT_UNKNOWN", "unknown" }, + { PANGO_SCRIPT_BALINESE, "PANGO_SCRIPT_BALINESE", "balinese" }, + { PANGO_SCRIPT_CUNEIFORM, "PANGO_SCRIPT_CUNEIFORM", "cuneiform" }, + { PANGO_SCRIPT_PHOENICIAN, "PANGO_SCRIPT_PHOENICIAN", "phoenician" }, + { PANGO_SCRIPT_PHAGS_PA, "PANGO_SCRIPT_PHAGS_PA", "phags-pa" }, + { PANGO_SCRIPT_NKO, "PANGO_SCRIPT_NKO", "nko" }, + { PANGO_SCRIPT_KAYAH_LI, "PANGO_SCRIPT_KAYAH_LI", "kayah-li" }, + { PANGO_SCRIPT_LEPCHA, "PANGO_SCRIPT_LEPCHA", "lepcha" }, + { PANGO_SCRIPT_REJANG, "PANGO_SCRIPT_REJANG", "rejang" }, + { PANGO_SCRIPT_SUNDANESE, "PANGO_SCRIPT_SUNDANESE", "sundanese" }, + { PANGO_SCRIPT_SAURASHTRA, "PANGO_SCRIPT_SAURASHTRA", "saurashtra" }, + { PANGO_SCRIPT_CHAM, "PANGO_SCRIPT_CHAM", "cham" }, + { PANGO_SCRIPT_OL_CHIKI, "PANGO_SCRIPT_OL_CHIKI", "ol-chiki" }, + { PANGO_SCRIPT_VAI, "PANGO_SCRIPT_VAI", "vai" }, + { PANGO_SCRIPT_CARIAN, "PANGO_SCRIPT_CARIAN", "carian" }, + { PANGO_SCRIPT_LYCIAN, "PANGO_SCRIPT_LYCIAN", "lycian" }, + { PANGO_SCRIPT_LYDIAN, "PANGO_SCRIPT_LYDIAN", "lydian" }, + { PANGO_SCRIPT_BATAK, "PANGO_SCRIPT_BATAK", "batak" }, + { PANGO_SCRIPT_BRAHMI, "PANGO_SCRIPT_BRAHMI", "brahmi" }, + { PANGO_SCRIPT_MANDAIC, "PANGO_SCRIPT_MANDAIC", "mandaic" }, + { PANGO_SCRIPT_CHAKMA, "PANGO_SCRIPT_CHAKMA", "chakma" }, + { PANGO_SCRIPT_MEROITIC_CURSIVE, "PANGO_SCRIPT_MEROITIC_CURSIVE", "meroitic-cursive" }, + { PANGO_SCRIPT_MEROITIC_HIEROGLYPHS, "PANGO_SCRIPT_MEROITIC_HIEROGLYPHS", "meroitic-hieroglyphs" }, + { PANGO_SCRIPT_MIAO, "PANGO_SCRIPT_MIAO", "miao" }, + { PANGO_SCRIPT_SHARADA, "PANGO_SCRIPT_SHARADA", "sharada" }, + { PANGO_SCRIPT_SORA_SOMPENG, "PANGO_SCRIPT_SORA_SOMPENG", "sora-sompeng" }, + { PANGO_SCRIPT_TAKRI, "PANGO_SCRIPT_TAKRI", "takri" }, + { PANGO_SCRIPT_BASSA_VAH, "PANGO_SCRIPT_BASSA_VAH", "bassa-vah" }, + { PANGO_SCRIPT_CAUCASIAN_ALBANIAN, "PANGO_SCRIPT_CAUCASIAN_ALBANIAN", "caucasian-albanian" }, + { PANGO_SCRIPT_DUPLOYAN, "PANGO_SCRIPT_DUPLOYAN", "duployan" }, + { PANGO_SCRIPT_ELBASAN, "PANGO_SCRIPT_ELBASAN", "elbasan" }, + { PANGO_SCRIPT_GRANTHA, "PANGO_SCRIPT_GRANTHA", "grantha" }, + { PANGO_SCRIPT_KHOJKI, "PANGO_SCRIPT_KHOJKI", "khojki" }, + { PANGO_SCRIPT_KHUDAWADI, "PANGO_SCRIPT_KHUDAWADI", "khudawadi" }, + { PANGO_SCRIPT_LINEAR_A, "PANGO_SCRIPT_LINEAR_A", "linear-a" }, + { PANGO_SCRIPT_MAHAJANI, "PANGO_SCRIPT_MAHAJANI", "mahajani" }, + { PANGO_SCRIPT_MANICHAEAN, "PANGO_SCRIPT_MANICHAEAN", "manichaean" }, + { PANGO_SCRIPT_MENDE_KIKAKUI, "PANGO_SCRIPT_MENDE_KIKAKUI", "mende-kikakui" }, + { PANGO_SCRIPT_MODI, "PANGO_SCRIPT_MODI", "modi" }, + { PANGO_SCRIPT_MRO, "PANGO_SCRIPT_MRO", "mro" }, + { PANGO_SCRIPT_NABATAEAN, "PANGO_SCRIPT_NABATAEAN", "nabataean" }, + { PANGO_SCRIPT_OLD_NORTH_ARABIAN, "PANGO_SCRIPT_OLD_NORTH_ARABIAN", "old-north-arabian" }, + { PANGO_SCRIPT_OLD_PERMIC, "PANGO_SCRIPT_OLD_PERMIC", "old-permic" }, + { PANGO_SCRIPT_PAHAWH_HMONG, "PANGO_SCRIPT_PAHAWH_HMONG", "pahawh-hmong" }, + { PANGO_SCRIPT_PALMYRENE, "PANGO_SCRIPT_PALMYRENE", "palmyrene" }, + { PANGO_SCRIPT_PAU_CIN_HAU, "PANGO_SCRIPT_PAU_CIN_HAU", "pau-cin-hau" }, + { PANGO_SCRIPT_PSALTER_PAHLAVI, "PANGO_SCRIPT_PSALTER_PAHLAVI", "psalter-pahlavi" }, + { PANGO_SCRIPT_SIDDHAM, "PANGO_SCRIPT_SIDDHAM", "siddham" }, + { PANGO_SCRIPT_TIRHUTA, "PANGO_SCRIPT_TIRHUTA", "tirhuta" }, + { PANGO_SCRIPT_WARANG_CITI, "PANGO_SCRIPT_WARANG_CITI", "warang-citi" }, + { PANGO_SCRIPT_AHOM, "PANGO_SCRIPT_AHOM", "ahom" }, + { PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS, "PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS", "anatolian-hieroglyphs" }, + { PANGO_SCRIPT_HATRAN, "PANGO_SCRIPT_HATRAN", "hatran" }, + { PANGO_SCRIPT_MULTANI, "PANGO_SCRIPT_MULTANI", "multani" }, + { PANGO_SCRIPT_OLD_HUNGARIAN, "PANGO_SCRIPT_OLD_HUNGARIAN", "old-hungarian" }, + { PANGO_SCRIPT_SIGNWRITING, "PANGO_SCRIPT_SIGNWRITING", "signwriting" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoScript"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +/* enumerations from "pango-tabs.h" */ +GType +pango_tab_align_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { PANGO_TAB_LEFT, "PANGO_TAB_LEFT", "left" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("PangoTabAlign"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +/* Generated data ends here */ + diff --git a/pango/pango-enum-types.c.template b/pango/pango-enum-types.c.template new file mode 100644 index 0000000..d922c69 --- /dev/null +++ b/pango/pango-enum-types.c.template @@ -0,0 +1,38 @@ +/*** BEGIN file-header ***/ +#include "config.h" + +#include + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +/*** END value-tail ***/ diff --git a/pango/pango-enum-types.h b/pango/pango-enum-types.h new file mode 100644 index 0000000..c4f6226 --- /dev/null +++ b/pango/pango-enum-types.h @@ -0,0 +1,89 @@ + +/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ + +#ifndef __PANGO_ENUM_TYPES_H__ +#define __PANGO_ENUM_TYPES_H__ + +#include + +#include + +G_BEGIN_DECLS + +/* enumerations from "pango-attributes.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_attr_type_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_ATTR_TYPE (pango_attr_type_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_underline_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_UNDERLINE (pango_underline_get_type ()) + +/* enumerations from "pango-bidi-type.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_bidi_type_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_BIDI_TYPE (pango_bidi_type_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_direction_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_DIRECTION (pango_direction_get_type ()) + +/* enumerations from "pango-coverage.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_coverage_level_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_COVERAGE_LEVEL (pango_coverage_level_get_type ()) + +/* enumerations from "pango-font.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_style_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_STYLE (pango_style_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_variant_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_VARIANT (pango_variant_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_weight_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_WEIGHT (pango_weight_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_stretch_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_STRETCH (pango_stretch_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_font_mask_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_FONT_MASK (pango_font_mask_get_type ()) + +/* enumerations from "pango-gravity.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_gravity_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_GRAVITY (pango_gravity_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_gravity_hint_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_GRAVITY_HINT (pango_gravity_hint_get_type ()) + +/* enumerations from "pango-layout.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_alignment_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_ALIGNMENT (pango_alignment_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_wrap_mode_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_ellipsize_mode_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_ELLIPSIZE_MODE (pango_ellipsize_mode_get_type ()) + +/* enumerations from "pango-renderer.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_render_part_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_RENDER_PART (pango_render_part_get_type ()) + +/* enumerations from "pango-script.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_script_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_SCRIPT (pango_script_get_type ()) + +/* enumerations from "pango-tabs.h" */ +PANGO_AVAILABLE_IN_ALL +GType pango_tab_align_get_type (void) G_GNUC_CONST; +#define PANGO_TYPE_TAB_ALIGN (pango_tab_align_get_type ()) +G_END_DECLS + +#endif /* __PANGO_ENUM_TYPES_H__ */ + +/* Generated data ends here */ + diff --git a/pango/pango-enum-types.h.template b/pango/pango-enum-types.h.template new file mode 100644 index 0000000..c26679e --- /dev/null +++ b/pango/pango-enum-types.h.template @@ -0,0 +1,27 @@ +/*** BEGIN file-header ***/ +#ifndef __PANGO_ENUM_TYPES_H__ +#define __PANGO_ENUM_TYPES_H__ + +#include + +#include + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@basename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +PANGO_AVAILABLE_IN_ALL +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __PANGO_ENUM_TYPES_H__ */ +/*** END file-tail ***/ diff --git a/pango/pango-features.h b/pango/pango-features.h new file mode 100644 index 0000000..f8422ea --- /dev/null +++ b/pango/pango-features.h @@ -0,0 +1,12 @@ +/* Generated by configure. Do not edit */ +#ifndef PANGO_FEATURES_H +#define PANGO_FEATURES_H + +#define PANGO_VERSION_MAJOR 1 +#define PANGO_VERSION_MINOR 42 +#define PANGO_VERSION_MICRO 4 + +#define PANGO_VERSION_STRING "1.42.4" + + +#endif diff --git a/pango/pango-features.h.meson b/pango/pango-features.h.meson new file mode 100644 index 0000000..1128bfe --- /dev/null +++ b/pango/pango-features.h.meson @@ -0,0 +1,10 @@ +#ifndef PANGO_FEATURES_H +#define PANGO_FEATURES_H + +#mesondefine PANGO_VERSION_MAJOR +#mesondefine PANGO_VERSION_MINOR +#mesondefine PANGO_VERSION_MICRO + +#define PANGO_VERSION_STRING "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + +#endif /* PANGO_FEATURES_H */ diff --git a/pango/pango-font.h b/pango/pango-font.h new file mode 100644 index 0000000..4af31a9 --- /dev/null +++ b/pango/pango-font.h @@ -0,0 +1,696 @@ +/* Pango + * pango-font.h: Font handling + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FONT_H__ +#define __PANGO_FONT_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +/** + * PangoFontDescription: + * + * The #PangoFontDescription structure represents the description + * of an ideal font. These structures are used both to list + * what fonts are available on the system and also for specifying + * the characteristics of a font to load. + */ +typedef struct _PangoFontDescription PangoFontDescription; +/** + * PangoFontMetrics: + * + * A #PangoFontMetrics structure holds the overall metric information + * for a font (possibly restricted to a script). The fields of this + * structure are private to implementations of a font backend. See + * the documentation of the corresponding getters for documentation + * of their meaning. + */ +typedef struct _PangoFontMetrics PangoFontMetrics; + +/** + * PangoStyle: + * @PANGO_STYLE_NORMAL: the font is upright. + * @PANGO_STYLE_OBLIQUE: the font is slanted, but in a roman style. + * @PANGO_STYLE_ITALIC: the font is slanted in an italic style. + * + * An enumeration specifying the various slant styles possible for a font. + **/ +typedef enum { + PANGO_STYLE_NORMAL, + PANGO_STYLE_OBLIQUE, + PANGO_STYLE_ITALIC +} PangoStyle; + +/** + * PangoVariant: + * @PANGO_VARIANT_NORMAL: A normal font. + * @PANGO_VARIANT_SMALL_CAPS: A font with the lower case characters + * replaced by smaller variants of the capital characters. + * + * An enumeration specifying capitalization variant of the font. + */ +typedef enum { + PANGO_VARIANT_NORMAL, + PANGO_VARIANT_SMALL_CAPS +} PangoVariant; + +/** + * PangoWeight: + * @PANGO_WEIGHT_THIN: the thin weight (= 100; Since: 1.24) + * @PANGO_WEIGHT_ULTRALIGHT: the ultralight weight (= 200) + * @PANGO_WEIGHT_LIGHT: the light weight (= 300) + * @PANGO_WEIGHT_SEMILIGHT: the semilight weight (= 350; Since: 1.36.7) + * @PANGO_WEIGHT_BOOK: the book weight (= 380; Since: 1.24) + * @PANGO_WEIGHT_NORMAL: the default weight (= 400) + * @PANGO_WEIGHT_MEDIUM: the normal weight (= 500; Since: 1.24) + * @PANGO_WEIGHT_SEMIBOLD: the semibold weight (= 600) + * @PANGO_WEIGHT_BOLD: the bold weight (= 700) + * @PANGO_WEIGHT_ULTRABOLD: the ultrabold weight (= 800) + * @PANGO_WEIGHT_HEAVY: the heavy weight (= 900) + * @PANGO_WEIGHT_ULTRAHEAVY: the ultraheavy weight (= 1000; Since: 1.24) + * + * An enumeration specifying the weight (boldness) of a font. This is a numerical + * value ranging from 100 to 1000, but there are some predefined values: + */ +typedef enum { + PANGO_WEIGHT_THIN = 100, + PANGO_WEIGHT_ULTRALIGHT = 200, + PANGO_WEIGHT_LIGHT = 300, + PANGO_WEIGHT_SEMILIGHT = 350, + PANGO_WEIGHT_BOOK = 380, + PANGO_WEIGHT_NORMAL = 400, + PANGO_WEIGHT_MEDIUM = 500, + PANGO_WEIGHT_SEMIBOLD = 600, + PANGO_WEIGHT_BOLD = 700, + PANGO_WEIGHT_ULTRABOLD = 800, + PANGO_WEIGHT_HEAVY = 900, + PANGO_WEIGHT_ULTRAHEAVY = 1000 +} PangoWeight; + +/** + * PangoStretch: + * @PANGO_STRETCH_ULTRA_CONDENSED: ultra condensed width + * @PANGO_STRETCH_EXTRA_CONDENSED: extra condensed width + * @PANGO_STRETCH_CONDENSED: condensed width + * @PANGO_STRETCH_SEMI_CONDENSED: semi condensed width + * @PANGO_STRETCH_NORMAL: the normal width + * @PANGO_STRETCH_SEMI_EXPANDED: semi expanded width + * @PANGO_STRETCH_EXPANDED: expanded width + * @PANGO_STRETCH_EXTRA_EXPANDED: extra expanded width + * @PANGO_STRETCH_ULTRA_EXPANDED: ultra expanded width + * + * An enumeration specifying the width of the font relative to other designs + * within a family. + */ +typedef enum { + PANGO_STRETCH_ULTRA_CONDENSED, + PANGO_STRETCH_EXTRA_CONDENSED, + PANGO_STRETCH_CONDENSED, + PANGO_STRETCH_SEMI_CONDENSED, + PANGO_STRETCH_NORMAL, + PANGO_STRETCH_SEMI_EXPANDED, + PANGO_STRETCH_EXPANDED, + PANGO_STRETCH_EXTRA_EXPANDED, + PANGO_STRETCH_ULTRA_EXPANDED +} PangoStretch; + +/** + * PangoFontMask: + * @PANGO_FONT_MASK_FAMILY: the font family is specified. + * @PANGO_FONT_MASK_STYLE: the font style is specified. + * @PANGO_FONT_MASK_VARIANT: the font variant is specified. + * @PANGO_FONT_MASK_WEIGHT: the font weight is specified. + * @PANGO_FONT_MASK_STRETCH: the font stretch is specified. + * @PANGO_FONT_MASK_SIZE: the font size is specified. + * @PANGO_FONT_MASK_GRAVITY: the font gravity is specified (Since: 1.16.) + * @PANGO_FONT_MASK_VARIATIONS: OpenType font variations are specified (Since: 1.42) + * + * The bits in a #PangoFontMask correspond to fields in a + * #PangoFontDescription that have been set. + */ +typedef enum { + PANGO_FONT_MASK_FAMILY = 1 << 0, + PANGO_FONT_MASK_STYLE = 1 << 1, + PANGO_FONT_MASK_VARIANT = 1 << 2, + PANGO_FONT_MASK_WEIGHT = 1 << 3, + PANGO_FONT_MASK_STRETCH = 1 << 4, + PANGO_FONT_MASK_SIZE = 1 << 5, + PANGO_FONT_MASK_GRAVITY = 1 << 6, + PANGO_FONT_MASK_VARIATIONS = 1 << 7, +} PangoFontMask; + +/* CSS scale factors (1.2 factor between each size) */ +/** + * PANGO_SCALE_XX_SMALL: + * + * The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)). + */ +/** + * PANGO_SCALE_X_SMALL: + * + * The scale factor for two shrinking steps (1 / (1.2 * 1.2)). + */ +/** + * PANGO_SCALE_SMALL: + * + * The scale factor for one shrinking step (1 / 1.2). + */ +/** + * PANGO_SCALE_MEDIUM: + * + * The scale factor for normal size (1.0). + */ +/** + * PANGO_SCALE_LARGE: + * + * The scale factor for one magnification step (1.2). + */ +/** + * PANGO_SCALE_X_LARGE: + * + * The scale factor for two magnification steps (1.2 * 1.2). + */ +/** + * PANGO_SCALE_XX_LARGE: + * + * The scale factor for three magnification steps (1.2 * 1.2 * 1.2). + */ +#define PANGO_SCALE_XX_SMALL ((double)0.5787037037037) +#define PANGO_SCALE_X_SMALL ((double)0.6444444444444) +#define PANGO_SCALE_SMALL ((double)0.8333333333333) +#define PANGO_SCALE_MEDIUM ((double)1.0) +#define PANGO_SCALE_LARGE ((double)1.2) +#define PANGO_SCALE_X_LARGE ((double)1.4399999999999) +#define PANGO_SCALE_XX_LARGE ((double)1.728) + +/* + * PangoFontDescription + */ + +/** + * PANGO_TYPE_FONT_DESCRIPTION: + * + * The #GObject type for #PangoFontDescription. + */ +#define PANGO_TYPE_FONT_DESCRIPTION (pango_font_description_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_font_description_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_description_new (void); +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_description_copy (const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_description_copy_static (const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +guint pango_font_description_hash (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +gboolean pango_font_description_equal (const PangoFontDescription *desc1, + const PangoFontDescription *desc2) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_free (PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +void pango_font_descriptions_free (PangoFontDescription **descs, + int n_descs); + +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_family (PangoFontDescription *desc, + const char *family); +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_family_static (PangoFontDescription *desc, + const char *family); +PANGO_AVAILABLE_IN_ALL +const char *pango_font_description_get_family (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_style (PangoFontDescription *desc, + PangoStyle style); +PANGO_AVAILABLE_IN_ALL +PangoStyle pango_font_description_get_style (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_variant (PangoFontDescription *desc, + PangoVariant variant); +PANGO_AVAILABLE_IN_ALL +PangoVariant pango_font_description_get_variant (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_weight (PangoFontDescription *desc, + PangoWeight weight); +PANGO_AVAILABLE_IN_ALL +PangoWeight pango_font_description_get_weight (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_stretch (PangoFontDescription *desc, + PangoStretch stretch); +PANGO_AVAILABLE_IN_ALL +PangoStretch pango_font_description_get_stretch (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_set_size (PangoFontDescription *desc, + gint size); +PANGO_AVAILABLE_IN_ALL +gint pango_font_description_get_size (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_8 +void pango_font_description_set_absolute_size (PangoFontDescription *desc, + double size); +PANGO_AVAILABLE_IN_1_8 +gboolean pango_font_description_get_size_is_absolute (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_16 +void pango_font_description_set_gravity (PangoFontDescription *desc, + PangoGravity gravity); +PANGO_AVAILABLE_IN_1_16 +PangoGravity pango_font_description_get_gravity (const PangoFontDescription *desc) G_GNUC_PURE; + +PANGO_AVAILABLE_IN_1_42 +void pango_font_description_set_variations_static (PangoFontDescription *desc, + const char *settings); +PANGO_AVAILABLE_IN_1_42 +void pango_font_description_set_variations (PangoFontDescription *desc, + const char *settings); +PANGO_AVAILABLE_IN_1_42 +const char *pango_font_description_get_variations (const PangoFontDescription *desc) G_GNUC_PURE; + +PANGO_AVAILABLE_IN_ALL +PangoFontMask pango_font_description_get_set_fields (const PangoFontDescription *desc) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +void pango_font_description_unset_fields (PangoFontDescription *desc, + PangoFontMask to_unset); + +PANGO_AVAILABLE_IN_ALL +void pango_font_description_merge (PangoFontDescription *desc, + const PangoFontDescription *desc_to_merge, + gboolean replace_existing); +PANGO_AVAILABLE_IN_ALL +void pango_font_description_merge_static (PangoFontDescription *desc, + const PangoFontDescription *desc_to_merge, + gboolean replace_existing); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_font_description_better_match (const PangoFontDescription *desc, + const PangoFontDescription *old_match, + const PangoFontDescription *new_match) G_GNUC_PURE; + +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_description_from_string (const char *str); +PANGO_AVAILABLE_IN_ALL +char * pango_font_description_to_string (const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +char * pango_font_description_to_filename (const PangoFontDescription *desc); + +/* + * PangoFontMetrics + */ + +/** + * PANGO_TYPE_FONT_METRICS: + * + * The #GObject type for #PangoFontMetrics. + */ +#define PANGO_TYPE_FONT_METRICS (pango_font_metrics_get_type ()) +PANGO_AVAILABLE_IN_ALL +GType pango_font_metrics_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoFontMetrics *pango_font_metrics_ref (PangoFontMetrics *metrics); +PANGO_AVAILABLE_IN_ALL +void pango_font_metrics_unref (PangoFontMetrics *metrics); +PANGO_AVAILABLE_IN_ALL +int pango_font_metrics_get_ascent (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +int pango_font_metrics_get_descent (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +int pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_ALL +int pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_6 +int pango_font_metrics_get_underline_position (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_6 +int pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_6 +int pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_6 +int pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) G_GNUC_PURE; + +#ifdef PANGO_ENABLE_BACKEND + +PANGO_AVAILABLE_IN_ALL +PangoFontMetrics *pango_font_metrics_new (void); + +struct _PangoFontMetrics +{ + /* */ + guint ref_count; + + int ascent; + int descent; + int approximate_char_width; + int approximate_digit_width; + int underline_position; + int underline_thickness; + int strikethrough_position; + int strikethrough_thickness; +}; + +#endif /* PANGO_ENABLE_BACKEND */ + +/* + * PangoFontFamily + */ + +/** + * PANGO_TYPE_FONT_FAMILY: + * + * The #GObject type for #PangoFontFamily. + */ +/** + * PANGO_FONT_FAMILY: + * @object: a #GObject. + * + * Casts a #GObject to a #PangoFontFamily. + */ +/** + * PANGO_IS_FONT_FAMILY: + * @object: a #GObject. + * + * Returns: %TRUE if @object is a #PangoFontFamily. + */ +#define PANGO_TYPE_FONT_FAMILY (pango_font_family_get_type ()) +#define PANGO_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily)) +#define PANGO_IS_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY)) + +typedef struct _PangoFontFamily PangoFontFamily; +typedef struct _PangoFontFace PangoFontFace; + +PANGO_AVAILABLE_IN_ALL +GType pango_font_family_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +void pango_font_family_list_faces (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces); +PANGO_AVAILABLE_IN_ALL +const char *pango_font_family_get_name (PangoFontFamily *family) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_4 +gboolean pango_font_family_is_monospace (PangoFontFamily *family) G_GNUC_PURE; + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass)) +#define PANGO_IS_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY)) +#define PANGO_FONT_FAMILY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass)) + +typedef struct _PangoFontFamilyClass PangoFontFamilyClass; + + +/** + * PangoFontFamily: + * + * The #PangoFontFamily structure is used to represent a family of related + * font faces. The faces in a family share a common design, but differ in + * slant, weight, width and other aspects. + */ +struct _PangoFontFamily +{ + GObject parent_instance; +}; + +struct _PangoFontFamilyClass +{ + GObjectClass parent_class; + + /*< public >*/ + + void (*list_faces) (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces); + const char * (*get_name) (PangoFontFamily *family); + gboolean (*is_monospace) (PangoFontFamily *family); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +#endif /* PANGO_ENABLE_BACKEND */ + +/* + * PangoFontFace + */ + +/** + * PANGO_TYPE_FONT_FACE: + * + * The #GObject type for #PangoFontFace. + */ +/** + * PANGO_FONT_FACE: + * @object: a #GObject. + * + * Casts a #GObject to a #PangoFontFace. + */ +/** + * PANGO_IS_FONT_FACE: + * @object: a #GObject. + * + * Returns: %TRUE if @object is a #PangoFontFace. + */ +#define PANGO_TYPE_FONT_FACE (pango_font_face_get_type ()) +#define PANGO_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace)) +#define PANGO_IS_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE)) + +PANGO_AVAILABLE_IN_ALL +GType pango_font_face_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_face_describe (PangoFontFace *face); +PANGO_AVAILABLE_IN_ALL +const char *pango_font_face_get_face_name (PangoFontFace *face) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_4 +void pango_font_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes); +PANGO_AVAILABLE_IN_1_18 +gboolean pango_font_face_is_synthesized (PangoFontFace *face) G_GNUC_PURE; + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_FONT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FACE, PangoFontFaceClass)) +#define PANGO_IS_FONT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FACE)) +#define PANGO_FONT_FACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FACE, PangoFontFaceClass)) + +typedef struct _PangoFontFaceClass PangoFontFaceClass; + +/** + * PangoFontFace: + * + * The #PangoFontFace structure is used to represent a group of fonts with + * the same family, slant, weight, width, but varying sizes. + */ +struct _PangoFontFace +{ + GObject parent_instance; +}; + +struct _PangoFontFaceClass +{ + GObjectClass parent_class; + + /*< public >*/ + + const char * (*get_face_name) (PangoFontFace *face); + PangoFontDescription * (*describe) (PangoFontFace *face); + void (*list_sizes) (PangoFontFace *face, + int **sizes, + int *n_sizes); + gboolean (*is_synthesized) (PangoFontFace *face); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +#endif /* PANGO_ENABLE_BACKEND */ + +/* + * PangoFont + */ + +/** + * PANGO_TYPE_FONT: + * + * The #GObject type for #PangoFont. + */ +/** + * PANGO_FONT: + * @object: a #GObject. + * + * Casts a #GObject to a #PangoFont. + */ +/** + * PANGO_IS_FONT: + * @object: a #GObject. + * + * Returns: %TRUE if @object is a #PangoFont. + */ +#define PANGO_TYPE_FONT (pango_font_get_type ()) +#define PANGO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont)) +#define PANGO_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT)) + +PANGO_AVAILABLE_IN_ALL +GType pango_font_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoFontDescription *pango_font_describe (PangoFont *font); +PANGO_AVAILABLE_IN_1_14 +PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont *font); +PANGO_AVAILABLE_IN_ALL +PangoCoverage * pango_font_get_coverage (PangoFont *font, + PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +PangoEngineShape * pango_font_find_shaper (PangoFont *font, + PangoLanguage *language, + guint32 ch); +PANGO_AVAILABLE_IN_ALL +PangoFontMetrics * pango_font_get_metrics (PangoFont *font, + PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +void pango_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_1_10 +PangoFontMap *pango_font_get_font_map (PangoFont *font); + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT, PangoFontClass)) +#define PANGO_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT)) +#define PANGO_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT, PangoFontClass)) + +typedef struct _PangoFontClass PangoFontClass; + +/** + * PangoFont: + * + * The #PangoFont structure is used to represent + * a font in a rendering-system-independent matter. + * To create an implementation of a #PangoFont, + * the rendering-system specific code should allocate + * a larger structure that contains a nested + * #PangoFont, fill in the klass member of + * the nested #PangoFont with a pointer to + * a appropriate #PangoFontClass, then call + * pango_font_init() on the structure. + * + * The #PangoFont structure contains one member + * which the implementation fills in. + */ +struct _PangoFont +{ + GObject parent_instance; +}; + +struct _PangoFontClass +{ + GObjectClass parent_class; + + /*< public >*/ + + PangoFontDescription *(*describe) (PangoFont *font); + PangoCoverage * (*get_coverage) (PangoFont *font, + PangoLanguage *language); + PangoEngineShape * (*find_shaper) (PangoFont *font, + PangoLanguage *language, + guint32 ch); + void (*get_glyph_extents) (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + PangoFontMetrics * (*get_metrics) (PangoFont *font, + PangoLanguage *language); + PangoFontMap * (*get_font_map) (PangoFont *font); + PangoFontDescription *(*describe_absolute) (PangoFont *font); + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); +}; + +/* used for very rare and miserable situtations that we cannot even + * draw a hexbox + */ +#define PANGO_UNKNOWN_GLYPH_WIDTH 10 +#define PANGO_UNKNOWN_GLYPH_HEIGHT 14 + +#endif /* PANGO_ENABLE_BACKEND */ + +/** + * PANGO_GLYPH_EMPTY: + * + * The %PANGO_GLYPH_EMPTY macro represents a #PangoGlyph value that has a + * special meaning, which is a zero-width empty glyph. This is useful for + * example in shaper modules, to use as the glyph for various zero-width + * Unicode characters (those passing pango_is_zero_width()). + */ +/** + * PANGO_GLYPH_INVALID_INPUT: + * + * The %PANGO_GLYPH_INVALID_INPUT macro represents a #PangoGlyph value that has a + * special meaning of invalid input. #PangoLayout produces one such glyph + * per invalid input UTF-8 byte and such a glyph is rendered as a crossed + * box. + * + * Note that this value is defined such that it has the %PANGO_GLYPH_UNKNOWN_FLAG + * on. + * + * Since: 1.20 + */ +/** + * PANGO_GLYPH_UNKNOWN_FLAG: + * + * The %PANGO_GLYPH_UNKNOWN_FLAG macro is a flag value that can be added to + * a #gunichar value of a valid Unicode character, to produce a #PangoGlyph + * value, representing an unknown-character glyph for the respective #gunichar. + */ +/** + * PANGO_GET_UNKNOWN_GLYPH: + * @wc: a Unicode character + * + * The way this unknown glyphs are rendered is backend specific. For example, + * a box with the hexadecimal Unicode code-point of the character written in it + * is what is done in the most common backends. + * + * Returns: a #PangoGlyph value that means no glyph was found for @wc. + */ +#define PANGO_GLYPH_EMPTY ((PangoGlyph)0x0FFFFFFF) +#define PANGO_GLYPH_INVALID_INPUT ((PangoGlyph)0xFFFFFFFF) +#define PANGO_GLYPH_UNKNOWN_FLAG ((PangoGlyph)0x10000000) +#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG) + + +G_END_DECLS + +#endif /* __PANGO_FONT_H__ */ diff --git a/pango/pango-fontmap.c b/pango/pango-fontmap.c new file mode 100644 index 0000000..ff066be --- /dev/null +++ b/pango/pango-fontmap.c @@ -0,0 +1,340 @@ +/* Pango + * pango-fontmap.c: Font handling + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "pango-fontmap.h" +#include "pango-impl-utils.h" +#include + +static PangoFontset *pango_font_map_real_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); + + +G_DEFINE_ABSTRACT_TYPE (PangoFontMap, pango_font_map, G_TYPE_OBJECT) + +static void +pango_font_map_class_init (PangoFontMapClass *class) +{ + class->load_fontset = pango_font_map_real_load_fontset; +} + +static void +pango_font_map_init (PangoFontMap *fontmap G_GNUC_UNUSED) +{ +} + +/** + * pango_font_map_create_context: + * @fontmap: a #PangoFontMap + * + * Creates a #PangoContext connected to @fontmap. This is equivalent + * to pango_context_new() followed by pango_context_set_font_map(). + * + * If you are using Pango as part of a higher-level system, + * that system may have it's own way of create a #PangoContext. + * For instance, the GTK+ toolkit has, among others, + * gdk_pango_context_get_for_screen(), and + * gtk_widget_get_pango_context(). Use those instead. + * + * Return value: (transfer full): the newly allocated #PangoContext, + * which should be freed with g_object_unref(). + * + * Since: 1.22 + **/ +PangoContext * +pango_font_map_create_context (PangoFontMap *fontmap) +{ + PangoContext *context; + + g_return_val_if_fail (fontmap != NULL, NULL); + + context = pango_context_new (); + pango_context_set_font_map (context, fontmap); + + return context; +} + +/** + * pango_font_map_load_font: + * @fontmap: a #PangoFontMap + * @context: the #PangoContext the font will be used with + * @desc: a #PangoFontDescription describing the font to load + * + * Load the font in the fontmap that is the closest match for @desc. + * + * Returns: (transfer full) (nullable): the newly allocated #PangoFont + * loaded, or %NULL if no font matched. + **/ +PangoFont * +pango_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc) +{ + g_return_val_if_fail (fontmap != NULL, NULL); + + return PANGO_FONT_MAP_GET_CLASS (fontmap)->load_font (fontmap, context, desc); +} + +/** + * pango_font_map_list_families: + * @fontmap: a #PangoFontMap + * @families: (out) (array length=n_families) (transfer container): location to store a pointer to an array of #PangoFontFamily *. + * This array should be freed with g_free(). + * @n_families: (out): location to store the number of elements in @families + * + * List all families for a fontmap. + **/ +void +pango_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families) +{ + g_return_if_fail (fontmap != NULL); + + PANGO_FONT_MAP_GET_CLASS (fontmap)->list_families (fontmap, families, n_families); +} + +/** + * pango_font_map_load_fontset: + * @fontmap: a #PangoFontMap + * @context: the #PangoContext the font will be used with + * @desc: a #PangoFontDescription describing the font to load + * @language: a #PangoLanguage the fonts will be used for + * + * Load a set of fonts in the fontmap that can be used to render + * a font matching @desc. + * + * Returns: (transfer full) (nullable): the newly allocated + * #PangoFontset loaded, or %NULL if no font matched. + **/ +PangoFontset * +pango_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + g_return_val_if_fail (fontmap != NULL, NULL); + + return PANGO_FONT_MAP_GET_CLASS (fontmap)->load_fontset (fontmap, context, desc, language); +} + +static void +pango_font_map_fontset_add_fonts (PangoFontMap *fontmap, + PangoContext *context, + PangoFontsetSimple *fonts, + PangoFontDescription *desc, + const char *family) +{ + PangoFont *font; + + pango_font_description_set_family_static (desc, family); + font = pango_font_map_load_font (fontmap, context, desc); + if (font) + pango_fontset_simple_append (fonts, font); +} + +static PangoFontset * +pango_font_map_real_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + PangoFontDescription *tmp_desc = pango_font_description_copy_static (desc); + const char *family; + char **families; + int i; + PangoFontsetSimple *fonts; + static GHashTable *warned_fonts = NULL; /* MT-safe */ + G_LOCK_DEFINE_STATIC (warned_fonts); + + family = pango_font_description_get_family (desc); + families = g_strsplit (family ? family : "", ",", -1); + + fonts = pango_fontset_simple_new (language); + + for (i = 0; families[i]; i++) + pango_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + families[i]); + + g_strfreev (families); + + /* The font description was completely unloadable, try with + * family == "Sans" + */ + if (pango_fontset_simple_size (fonts) == 0) + { + char *ctmp1, *ctmp2; + + pango_font_description_set_family_static (tmp_desc, + pango_font_description_get_family (desc)); + + ctmp1 = pango_font_description_to_string (desc); + pango_font_description_set_family_static (tmp_desc, "Sans"); + + G_LOCK (warned_fonts); + if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) + { + if (!warned_fonts) + warned_fonts = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_insert (warned_fonts, g_strdup (ctmp1), GINT_TO_POINTER (1)); + + ctmp2 = pango_font_description_to_string (tmp_desc); + g_warning ("couldn't load font \"%s\", falling back to \"%s\", " + "expect ugly output.", ctmp1, ctmp2); + g_free (ctmp2); + } + G_UNLOCK (warned_fonts); + g_free (ctmp1); + + pango_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + "Sans"); + } + + /* We couldn't try with Sans and the specified style. Try Sans Normal + */ + if (pango_fontset_simple_size (fonts) == 0) + { + char *ctmp1, *ctmp2; + + pango_font_description_set_family_static (tmp_desc, "Sans"); + ctmp1 = pango_font_description_to_string (tmp_desc); + pango_font_description_set_style (tmp_desc, PANGO_STYLE_NORMAL); + pango_font_description_set_weight (tmp_desc, PANGO_WEIGHT_NORMAL); + pango_font_description_set_variant (tmp_desc, PANGO_VARIANT_NORMAL); + pango_font_description_set_stretch (tmp_desc, PANGO_STRETCH_NORMAL); + + G_LOCK (warned_fonts); + if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) + { + g_hash_table_insert (warned_fonts, g_strdup (ctmp1), GINT_TO_POINTER (1)); + + ctmp2 = pango_font_description_to_string (tmp_desc); + + g_warning ("couldn't load font \"%s\", falling back to \"%s\", " + "expect ugly output.", ctmp1, ctmp2); + g_free (ctmp2); + } + G_UNLOCK (warned_fonts); + g_free (ctmp1); + + pango_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + "Sans"); + } + + pango_font_description_free (tmp_desc); + + /* Everything failed, we are screwed, there is no way to continue, + * but lets just not crash here. + */ + if (pango_fontset_simple_size (fonts) == 0) + g_warning ("All font fallbacks failed!!!!"); + + return PANGO_FONTSET (fonts); +} + +/** + * pango_font_map_get_shape_engine_type: + * @fontmap: a #PangoFontMap + * + * Returns the render ID for shape engines for this fontmap. + * See the render_type field of + * #PangoEngineInfo. + * + * Return value: the ID string for shape engines for + * this fontmap. Owned by Pango, should not be modified + * or freed. + * + * Since: 1.4 + * Deprecated: 1.38 + **/ +const char * +pango_font_map_get_shape_engine_type (PangoFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_FONT_MAP (fontmap), NULL); + + return PANGO_FONT_MAP_GET_CLASS (fontmap)->shape_engine_type; +} + +/** + * pango_font_map_get_serial: + * @fontmap: a #PangoFontMap + * + * Returns the current serial number of @fontmap. The serial number is + * initialized to an small number larger than zero when a new fontmap + * is created and is increased whenever the fontmap is changed. It may + * wrap, but will never have the value 0. Since it can wrap, never compare + * it with "less than", always use "not equals". + * + * The fontmap can only be changed using backend-specific API, like changing + * fontmap resolution. + * + * This can be used to automatically detect changes to a #PangoFontMap, like + * in #PangoContext. + * + * Return value: The current serial number of @fontmap. + * + * Since: 1.32.4 + **/ +guint +pango_font_map_get_serial (PangoFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_FONT_MAP (fontmap), 0); + + if (PANGO_FONT_MAP_GET_CLASS (fontmap)->get_serial) + return PANGO_FONT_MAP_GET_CLASS (fontmap)->get_serial (fontmap); + else + return 1; +} + +/** + * pango_font_map_changed: + * @fontmap: a #PangoFontMap + * + * Forces a change in the context, which will cause any #PangoContext + * using this fontmap to change. + * + * This function is only useful when implementing a new backend + * for Pango, something applications won't do. Backends should + * call this function if they have attached extra data to the context + * and such data is changed. + * + * Since: 1.34 + **/ +void +pango_font_map_changed (PangoFontMap *fontmap) +{ + g_return_if_fail (PANGO_IS_FONT_MAP (fontmap)); + + if (PANGO_FONT_MAP_GET_CLASS (fontmap)->changed) + PANGO_FONT_MAP_GET_CLASS (fontmap)->changed (fontmap); +} diff --git a/pango/pango-fontmap.h b/pango/pango-fontmap.h new file mode 100644 index 0000000..56128e9 --- /dev/null +++ b/pango/pango-fontmap.h @@ -0,0 +1,175 @@ +/* Pango + * pango-font.h: Font handling + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FONTMAP_H__ +#define __PANGO_FONTMAP_H__ + +#include +#include + +G_BEGIN_DECLS + +/** + * PANGO_TYPE_FONT_MAP: + * + * The #GObject type for #PangoFontMap. + */ +/** + * PANGO_FONT_MAP: + * @object: a #GObject. + * + * Casts a #GObject to a #PangoFontMap. + */ +/** + * PANGO_IS_FONT_MAP: + * @object: a #GObject. + * + * Returns: %TRUE if @object is a #PangoFontMap. + */ +#define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ()) +#define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap)) +#define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP)) + +typedef struct _PangoContext PangoContext; + +PANGO_AVAILABLE_IN_ALL +GType pango_font_map_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_22 +PangoContext * pango_font_map_create_context (PangoFontMap *fontmap); +PANGO_AVAILABLE_IN_ALL +PangoFont * pango_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc); +PANGO_AVAILABLE_IN_ALL +PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +void pango_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families); +PANGO_AVAILABLE_IN_1_32 +guint pango_font_map_get_serial (PangoFontMap *fontmap); +PANGO_AVAILABLE_IN_1_34 +void pango_font_map_changed (PangoFontMap *fontmap); + +#ifdef PANGO_ENABLE_BACKEND + +/** + * PANGO_FONT_MAP_CLASS: + * @klass: a #GObject. + * + * Casts a #GObject to a #PangoFontMapClass. + */ +/** + * PANGO_IS_FONT_MAP_CLASS: + * @klass: a #GObject. + * + * Returns: %TRUE if @klass is a subtype of #PangoFontMapClass. + */ +/** + * PANGO_FONT_MAP_GET_CLASS: + * @obj: a #PangoFontMap. + * + * Returns: class of @obj + */ +#define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass)) +#define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP)) +#define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass)) + +typedef struct _PangoFontMapClass PangoFontMapClass; + +/** + * PangoFontMap: + * + * The #PangoFontMap represents the set of fonts available for a + * particular rendering system. This is a virtual object with + * implementations being specific to particular rendering systems. To + * create an implementation of a #PangoFontMap, the rendering-system + * specific code should allocate a larger structure that contains a nested + * #PangoFontMap, fill in the klass member of the nested #PangoFontMap with a + * pointer to a appropriate #PangoFontMapClass, then call + * pango_font_map_init() on the structure. + * + * The #PangoFontMap structure contains one member which the implementation + * fills in. + */ +struct _PangoFontMap +{ + GObject parent_instance; +}; + +/** + * PangoFontMapClass: + * @parent_class: parent #GObjectClass. + * @load_font: a function to load a font with a given description. See + * pango_font_map_load_font(). + * @list_families: A function to list available font families. See + * pango_font_map_list_families(). + * @load_fontset: a function to load a fontset with a given given description + * suitable for a particular language. See pango_font_map_load_fontset(). + * @shape_engine_type: the type of rendering-system-dependent engines that + * can handle fonts of this fonts loaded with this fontmap. + * @get_serial: a function to get the serial number of the fontmap. + * See pango_font_map_get_serial(). + * @changed: See pango_font_map_changed() + * + * The #PangoFontMapClass structure holds the virtual functions for + * a particular #PangoFontMap implementation. + */ +struct _PangoFontMapClass +{ + GObjectClass parent_class; + + /*< public >*/ + + PangoFont * (*load_font) (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc); + void (*list_families) (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families); + PangoFontset *(*load_fontset) (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); + + const char *shape_engine_type; + + guint (*get_serial) (PangoFontMap *fontmap); + void (*changed) (PangoFontMap *fontmap); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); +}; + +PANGO_DEPRECATED_IN_1_38 +const char *pango_font_map_get_shape_engine_type (PangoFontMap *fontmap); + +#endif /* PANGO_ENABLE_BACKEND */ + +G_END_DECLS + +#endif /* __PANGO_FONTMAP_H__ */ diff --git a/pango/pango-fontset.c b/pango/pango-fontset.c new file mode 100644 index 0000000..7c382b3 --- /dev/null +++ b/pango/pango-fontset.c @@ -0,0 +1,408 @@ +/* Pango + * pango-fontset.c: + * + * Copyright (C) 2001 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +/* + * PangoFontset + */ + +#include "pango-types.h" +#include "pango-font.h" +#include "pango-fontset.h" +#include "pango-impl-utils.h" + +static PangoFontMetrics *pango_fontset_real_get_metrics (PangoFontset *fontset); + + +G_DEFINE_ABSTRACT_TYPE (PangoFontset, pango_fontset, G_TYPE_OBJECT); + +static void +pango_fontset_init (PangoFontset *self) +{ +} + +static void +pango_fontset_class_init (PangoFontsetClass *class) +{ + class->get_metrics = pango_fontset_real_get_metrics; +} + + +/** + * pango_fontset_get_font: + * @fontset: a #PangoFontset + * @wc: a Unicode character + * + * Returns the font in the fontset that contains the best glyph for the + * Unicode character @wc. + * + * Return value: (transfer full): a #PangoFont. The caller must call + * g_object_unref when finished with the font. + **/ +PangoFont * +pango_fontset_get_font (PangoFontset *fontset, + guint wc) +{ + + g_return_val_if_fail (PANGO_IS_FONTSET (fontset), NULL); + + return PANGO_FONTSET_GET_CLASS (fontset)->get_font (fontset, wc); +} + +/** + * pango_fontset_get_metrics: + * @fontset: a #PangoFontset + * + * Get overall metric information for the fonts in the fontset. + * + * Return value: a #PangoFontMetrics object. The caller must call pango_font_metrics_unref() + * when finished using the object. + **/ +PangoFontMetrics * +pango_fontset_get_metrics (PangoFontset *fontset) +{ + g_return_val_if_fail (PANGO_IS_FONTSET (fontset), NULL); + + return PANGO_FONTSET_GET_CLASS (fontset)->get_metrics (fontset); +} + +/** + * pango_fontset_foreach: + * @fontset: a #PangoFontset + * @func: (closure data) (scope call): Callback function + * @data: (closure): data to pass to the callback function + * + * Iterates through all the fonts in a fontset, calling @func for + * each one. If @func returns %TRUE, that stops the iteration. + * + * Since: 1.4 + **/ +void +pango_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data) +{ + g_return_if_fail (PANGO_IS_FONTSET (fontset)); + g_return_if_fail (func != NULL); + + PANGO_FONTSET_GET_CLASS (fontset)->foreach (fontset, func, data); +} + +static gboolean +get_first_metrics_foreach (PangoFontset *fontset, + PangoFont *font, + gpointer data) +{ + PangoFontMetrics *fontset_metrics = data; + PangoLanguage *language = PANGO_FONTSET_GET_CLASS (fontset)->get_language (fontset); + PangoFontMetrics *font_metrics = pango_font_get_metrics (font, language); + guint save_ref_count; + + /* Initialize the fontset metrics to metrics of the first font in the + * fontset; saving the refcount and restoring it is a bit of hack but avoids + * having to update this code for each metrics addition. + */ + save_ref_count = fontset_metrics->ref_count; + *fontset_metrics = *font_metrics; + fontset_metrics->ref_count = save_ref_count; + + pango_font_metrics_unref (font_metrics); + + return TRUE; /* Stops iteration */ +} + +static PangoFontMetrics * +pango_fontset_real_get_metrics (PangoFontset *fontset) +{ + PangoFontMetrics *metrics, *raw_metrics; + const char *sample_str; + const char *p; + int count; + GHashTable *fonts_seen; + PangoFont *font; + PangoLanguage *language; + + language = PANGO_FONTSET_GET_CLASS (fontset)->get_language (fontset); + sample_str = pango_language_get_sample_string (language); + + count = 0; + metrics = pango_font_metrics_new (); + fonts_seen = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + /* Initialize the metrics from the first font in the fontset */ + pango_fontset_foreach (fontset, get_first_metrics_foreach, metrics); + + p = sample_str; + while (*p) + { + gunichar wc = g_utf8_get_char (p); + font = pango_fontset_get_font (fontset, wc); + if (font) + { + if (g_hash_table_lookup (fonts_seen, font) == NULL) + { + raw_metrics = pango_font_get_metrics (font, language); + g_hash_table_insert (fonts_seen, font, font); + + if (count == 0) + { + metrics->ascent = raw_metrics->ascent; + metrics->descent = raw_metrics->descent; + metrics->approximate_char_width = raw_metrics->approximate_char_width; + metrics->approximate_digit_width = raw_metrics->approximate_digit_width; + } + else + { + metrics->ascent = MAX (metrics->ascent, raw_metrics->ascent); + metrics->descent = MAX (metrics->descent, raw_metrics->descent); + metrics->approximate_char_width += raw_metrics->approximate_char_width; + metrics->approximate_digit_width += raw_metrics->approximate_digit_width; + } + count++; + pango_font_metrics_unref (raw_metrics); + } + else + g_object_unref (font); + } + + p = g_utf8_next_char (p); + } + + g_hash_table_destroy (fonts_seen); + + if (count) + { + metrics->approximate_char_width /= count; + metrics->approximate_digit_width /= count; + } + + return metrics; +} + + +/* + * PangoFontsetSimple + */ + +#define PANGO_FONTSET_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET_SIMPLE, PangoFontsetSimpleClass)) +#define PANGO_IS_FONTSET_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET_SIMPLE)) +#define PANGO_FONTSET_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET_SIMPLE, PangoFontsetSimpleClass)) + +static void pango_fontset_simple_finalize (GObject *object); +static PangoFontMetrics *pango_fontset_simple_get_metrics (PangoFontset *fontset); +static PangoLanguage * pango_fontset_simple_get_language (PangoFontset *fontset); +static PangoFont * pango_fontset_simple_get_font (PangoFontset *fontset, + guint wc); +static void pango_fontset_simple_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data); + +struct _PangoFontsetSimple +{ + PangoFontset parent_instance; + + GPtrArray *fonts; + GPtrArray *coverages; + PangoLanguage *language; +}; + +struct _PangoFontsetSimpleClass +{ + PangoFontsetClass parent_class; +}; + +/** + * pango_fontset_simple_new: + * @language: a #PangoLanguage tag + * + * Creates a new #PangoFontsetSimple for the given language. + * + * Return value: the newly allocated #PangoFontsetSimple, which should + * be freed with g_object_unref(). + **/ +PangoFontsetSimple * +pango_fontset_simple_new (PangoLanguage *language) +{ + PangoFontsetSimple *fontset; + + fontset = g_object_new (PANGO_TYPE_FONTSET_SIMPLE, NULL); + fontset->language = language; + + return fontset; +} + + +G_DEFINE_TYPE (PangoFontsetSimple, pango_fontset_simple, PANGO_TYPE_FONTSET); + +static void +pango_fontset_simple_class_init (PangoFontsetSimpleClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontsetClass *fontset_class = PANGO_FONTSET_CLASS (class); + + object_class->finalize = pango_fontset_simple_finalize; + + fontset_class->get_font = pango_fontset_simple_get_font; + fontset_class->get_metrics = pango_fontset_simple_get_metrics; + fontset_class->get_language = pango_fontset_simple_get_language; + fontset_class->foreach = pango_fontset_simple_foreach; +} + +static void +pango_fontset_simple_init (PangoFontsetSimple *fontset) +{ + fontset->fonts = g_ptr_array_new (); + fontset->coverages = g_ptr_array_new (); + fontset->language = NULL; +} + +static void +pango_fontset_simple_finalize (GObject *object) +{ + PangoFontsetSimple *fontset = PANGO_FONTSET_SIMPLE (object); + PangoCoverage *coverage; + unsigned int i; + + for (i = 0; i < fontset->fonts->len; i++) + g_object_unref (g_ptr_array_index(fontset->fonts, i)); + + g_ptr_array_free (fontset->fonts, TRUE); + + for (i = 0; i < fontset->coverages->len; i++) + { + coverage = g_ptr_array_index (fontset->coverages, i); + if (coverage) + pango_coverage_unref (coverage); + } + + g_ptr_array_free (fontset->coverages, TRUE); + + G_OBJECT_CLASS (pango_fontset_simple_parent_class)->finalize (object); +} + +/** + * pango_fontset_simple_append: + * @fontset: a #PangoFontsetSimple. + * @font: a #PangoFont. + * + * Adds a font to the fontset. + **/ +void +pango_fontset_simple_append (PangoFontsetSimple *fontset, + PangoFont *font) +{ + g_ptr_array_add (fontset->fonts, font); + g_ptr_array_add (fontset->coverages, NULL); +} + +/** + * pango_fontset_simple_size: + * @fontset: a #PangoFontsetSimple. + * + * Returns the number of fonts in the fontset. + * + * Return value: the size of @fontset. + **/ +int +pango_fontset_simple_size (PangoFontsetSimple *fontset) +{ + return fontset->fonts->len; +} + +static PangoLanguage * +pango_fontset_simple_get_language (PangoFontset *fontset) +{ + PangoFontsetSimple *simple = PANGO_FONTSET_SIMPLE (fontset); + + return simple->language; +} + +static PangoFontMetrics * +pango_fontset_simple_get_metrics (PangoFontset *fontset) +{ + PangoFontsetSimple *simple = PANGO_FONTSET_SIMPLE (fontset); + + if (simple->fonts->len == 1) + return pango_font_get_metrics (PANGO_FONT (g_ptr_array_index(simple->fonts, 0)), + simple->language); + + return PANGO_FONTSET_CLASS (pango_fontset_simple_parent_class)->get_metrics (fontset); +} + +static PangoFont * +pango_fontset_simple_get_font (PangoFontset *fontset, + guint wc) +{ + PangoFontsetSimple *simple = PANGO_FONTSET_SIMPLE (fontset); + PangoCoverageLevel best_level = PANGO_COVERAGE_NONE; + PangoCoverageLevel level; + PangoFont *font; + PangoCoverage *coverage; + int result = -1; + unsigned int i; + + for (i = 0; i < simple->fonts->len; i++) + { + coverage = g_ptr_array_index (simple->coverages, i); + + if (coverage == NULL) + { + font = g_ptr_array_index (simple->fonts, i); + + coverage = pango_font_get_coverage (font, simple->language); + g_ptr_array_index (simple->coverages, i) = coverage; + } + + level = pango_coverage_get (coverage, wc); + + if (result == -1 || level > best_level) + { + result = i; + best_level = level; + if (level == PANGO_COVERAGE_EXACT) + break; + } + } + + if (G_UNLIKELY (result == -1)) + return NULL; + + font = g_ptr_array_index(simple->fonts, result); + return g_object_ref (font); +} + +static void +pango_fontset_simple_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data) +{ + PangoFontsetSimple *simple = PANGO_FONTSET_SIMPLE (fontset); + unsigned int i; + + for (i = 0; i < simple->fonts->len; i++) + { + if ((*func) (fontset, + g_ptr_array_index (simple->fonts, i), + data)) + return; + } +} diff --git a/pango/pango-fontset.h b/pango/pango-fontset.h new file mode 100644 index 0000000..6ea16d8 --- /dev/null +++ b/pango/pango-fontset.h @@ -0,0 +1,177 @@ +/* Pango + * pango-fontset.h: Font set handling + * + * Copyright (C) 2001 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FONTSET_H__ +#define __PANGO_FONTSET_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +/* + * PangoFontset + */ + +/** + * PANGO_TYPE_FONTSET: + * + * The #GObject type for #PangoFontset. + */ +#define PANGO_TYPE_FONTSET (pango_fontset_get_type ()) +#define PANGO_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET, PangoFontset)) +#define PANGO_IS_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET)) + +PANGO_AVAILABLE_IN_ALL +GType pango_fontset_get_type (void) G_GNUC_CONST; + +typedef struct _PangoFontset PangoFontset; + +/** + * PangoFontsetForeachFunc: + * @fontset: a #PangoFontset + * @font: a font from @fontset + * @user_data: callback data + * + * A callback function used by pango_fontset_foreach() when enumerating + * the fonts in a fontset. + * + * Returns: if %TRUE, stop iteration and return immediately. + * + * Since: 1.4 + **/ +typedef gboolean (*PangoFontsetForeachFunc) (PangoFontset *fontset, + PangoFont *font, + gpointer user_data); + +PANGO_AVAILABLE_IN_ALL +PangoFont * pango_fontset_get_font (PangoFontset *fontset, + guint wc); +PANGO_AVAILABLE_IN_ALL +PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset); +PANGO_AVAILABLE_IN_1_4 +void pango_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data); + +#ifdef PANGO_ENABLE_BACKEND + +typedef struct _PangoFontsetClass PangoFontsetClass; + +#define PANGO_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass)) +#define PANGO_IS_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET)) +#define PANGO_FONTSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass)) + +/** + * PangoFontset: + * + * A #PangoFontset represents a set of #PangoFont to use + * when rendering text. It is the result of resolving a + * #PangoFontDescription against a particular #PangoContext. + * It has operations for finding the component font for + * a particular Unicode character, and for finding a composite + * set of metrics for the entire fontset. + */ +struct _PangoFontset +{ + GObject parent_instance; +}; + +/** + * PangoFontsetClass: + * @parent_class: parent #GObjectClass. + * @get_font: a function to get the font in the fontset that contains the + * best glyph for the given Unicode character; see pango_fontset_get_font(). + * @get_metrics: a function to get overall metric information for the fonts + * in the fontset; see pango_fontset_get_metrics(). + * @get_language: a function to get the language of the fontset. + * @foreach: a function to loop over the fonts in the fontset. See + * pango_fontset_foreach(). + * + * The #PangoFontsetClass structure holds the virtual functions for + * a particular #PangoFontset implementation. + */ +struct _PangoFontsetClass +{ + GObjectClass parent_class; + + /*< public >*/ + + PangoFont * (*get_font) (PangoFontset *fontset, + guint wc); + + PangoFontMetrics *(*get_metrics) (PangoFontset *fontset); + PangoLanguage * (*get_language) (PangoFontset *fontset); + void (*foreach) (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +/* + * PangoFontsetSimple + */ + +/** + * PANGO_TYPE_FONTSET_SIMPLE: + * + * The #GObject type for #PangoFontsetSimple. + */ +/** + * PangoFontsetSimple: + * + * #PangoFontsetSimple is a implementation of the abstract + * #PangoFontset base class in terms of an array of fonts, + * which the creator provides when constructing the + * #PangoFontsetSimple. + */ +#define PANGO_TYPE_FONTSET_SIMPLE (pango_fontset_simple_get_type ()) +#define PANGO_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET_SIMPLE, PangoFontsetSimple)) +#define PANGO_IS_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET_SIMPLE)) + +typedef struct _PangoFontsetSimple PangoFontsetSimple; +typedef struct _PangoFontsetSimpleClass PangoFontsetSimpleClass; + +PANGO_AVAILABLE_IN_ALL +GType pango_fontset_simple_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language); +PANGO_AVAILABLE_IN_ALL +void pango_fontset_simple_append (PangoFontsetSimple *fontset, + PangoFont *font); +PANGO_AVAILABLE_IN_ALL +int pango_fontset_simple_size (PangoFontsetSimple *fontset); + +#endif /* PANGO_ENABLE_BACKEND */ + +G_END_DECLS + +#endif /* __PANGO_FONTSET_H__ */ diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c new file mode 100644 index 0000000..586b23b --- /dev/null +++ b/pango/pango-glyph-item.c @@ -0,0 +1,842 @@ +/* Pango + * pango-glyph-item.c: Pair of PangoItem and a glyph string + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include + +#include "pango-glyph-item.h" +#include "pango-impl-utils.h" + +#define LTR(glyph_item) (((glyph_item)->item->analysis.level % 2) == 0) + +/** + * pango_glyph_item_split: + * @orig: a #PangoItem + * @text: text to which positions in @orig apply + * @split_index: byte index of position to split item, relative to the start of the item + * + * Modifies @orig to cover only the text after @split_index, and + * returns a new item that covers the text before @split_index that + * used to be in @orig. You can think of @split_index as the length of + * the returned item. @split_index may not be 0, and it may not be + * greater than or equal to the length of @orig (that is, there must + * be at least one byte assigned to each item, you can't create a + * zero-length item). + * + * This function is similar in function to pango_item_split() (and uses + * it internally.) + * + * Return value: the newly allocated item representing text before + * @split_index, which should be freed + * with pango_glyph_item_free(). + * + * Since: 1.2 + **/ +PangoGlyphItem * +pango_glyph_item_split (PangoGlyphItem *orig, + const char *text, + int split_index) +{ + PangoGlyphItem *new; + int i; + int num_glyphs; + int num_remaining; + int split_offset; + + g_return_val_if_fail (orig != NULL, NULL); + g_return_val_if_fail (orig->item->length > 0, NULL); + g_return_val_if_fail (split_index > 0, NULL); + g_return_val_if_fail (split_index < orig->item->length, NULL); + + if (LTR (orig)) + { + for (i = 0; i < orig->glyphs->num_glyphs; i++) + { + if (orig->glyphs->log_clusters[i] >= split_index) + break; + } + + if (i == orig->glyphs->num_glyphs) /* No splitting necessary */ + return NULL; + + split_index = orig->glyphs->log_clusters[i]; + num_glyphs = i; + } + else + { + for (i = orig->glyphs->num_glyphs - 1; i >= 0; i--) + { + if (orig->glyphs->log_clusters[i] >= split_index) + break; + } + + if (i < 0) /* No splitting necessary */ + return NULL; + + split_index = orig->glyphs->log_clusters[i]; + num_glyphs = orig->glyphs->num_glyphs - 1 - i; + } + + num_remaining = orig->glyphs->num_glyphs - num_glyphs; + + new = g_slice_new (PangoGlyphItem); + split_offset = g_utf8_pointer_to_offset (text + orig->item->offset, + text + orig->item->offset + split_index); + new->item = pango_item_split (orig->item, split_index, split_offset); + + new->glyphs = pango_glyph_string_new (); + pango_glyph_string_set_size (new->glyphs, num_glyphs); + + if (LTR (orig)) + { + memcpy (new->glyphs->glyphs, orig->glyphs->glyphs, num_glyphs * sizeof (PangoGlyphInfo)); + memcpy (new->glyphs->log_clusters, orig->glyphs->log_clusters, num_glyphs * sizeof (int)); + + memmove (orig->glyphs->glyphs, orig->glyphs->glyphs + num_glyphs, + num_remaining * sizeof (PangoGlyphInfo)); + for (i = num_glyphs; i < orig->glyphs->num_glyphs; i++) + orig->glyphs->log_clusters[i - num_glyphs] = orig->glyphs->log_clusters[i] - split_index; + } + else + { + memcpy (new->glyphs->glyphs, orig->glyphs->glyphs + num_remaining, num_glyphs * sizeof (PangoGlyphInfo)); + memcpy (new->glyphs->log_clusters, orig->glyphs->log_clusters + num_remaining, num_glyphs * sizeof (int)); + + for (i = 0; i < num_remaining; i++) + orig->glyphs->log_clusters[i] = orig->glyphs->log_clusters[i] - split_index; + } + + pango_glyph_string_set_size (orig->glyphs, orig->glyphs->num_glyphs - num_glyphs); + + return new; +} + +/** + * pango_glyph_item_copy: + * @orig: (nullable): a #PangoGlyphItem, may be %NULL + * + * Make a deep copy of an existing #PangoGlyphItem structure. + * + * Return value: (nullable): the newly allocated #PangoGlyphItem, which should + * be freed with pango_glyph_item_free(), or %NULL + * if @orig was %NULL. + * + * Since: 1.20 + **/ +PangoGlyphItem * +pango_glyph_item_copy (PangoGlyphItem *orig) +{ + PangoGlyphItem *result; + + if (orig == NULL) + return NULL; + + result = g_slice_new (PangoGlyphItem); + + result->item = pango_item_copy (orig->item); + result->glyphs = pango_glyph_string_copy (orig->glyphs); + + return result; +} + +/** + * pango_glyph_item_free: + * @glyph_item: (nullable): a #PangoGlyphItem, may be %NULL + * + * Frees a #PangoGlyphItem and resources to which it points. + * + * Since: 1.6 + **/ +void +pango_glyph_item_free (PangoGlyphItem *glyph_item) +{ + if (glyph_item == NULL) + return; + + if (glyph_item->item) + pango_item_free (glyph_item->item); + if (glyph_item->glyphs) + pango_glyph_string_free (glyph_item->glyphs); + + g_slice_free (PangoGlyphItem, glyph_item); +} + +G_DEFINE_BOXED_TYPE (PangoGlyphItem, pango_glyph_item, + pango_glyph_item_copy, + pango_glyph_item_free); + + +/** + * pango_glyph_item_iter_copy: + * @orig: (nullable): a #PangoGlyphItemIter, may be %NULL + * + * Make a shallow copy of an existing #PangoGlyphItemIter structure. + * + * Return value: (nullable): the newly allocated #PangoGlyphItemIter, which should + * be freed with pango_glyph_item_iter_free(), or %NULL + * if @orig was %NULL. + * + * Since: 1.22 + **/ +PangoGlyphItemIter * +pango_glyph_item_iter_copy (PangoGlyphItemIter *orig) +{ + PangoGlyphItemIter *result; + + if (orig == NULL) + return NULL; + + result = g_slice_new (PangoGlyphItemIter); + + *result = *orig; + + return result; +} + +/** + * pango_glyph_item_iter_free: + * @iter: (nullable): a #PangoGlyphItemIter, may be %NULL + * + * Frees a #PangoGlyphItemIter created by pango_glyph_item_iter_copy(). + * + * Since: 1.22 + **/ +void +pango_glyph_item_iter_free (PangoGlyphItemIter *iter) +{ + if (iter == NULL) + return; + + g_slice_free (PangoGlyphItemIter, iter); +} + +G_DEFINE_BOXED_TYPE (PangoGlyphItemIter, pango_glyph_item_iter, + pango_glyph_item_iter_copy, + pango_glyph_item_iter_free) + +/** + * pango_glyph_item_iter_next_cluster: + * @iter: a #PangoGlyphItemIter + * + * Advances the iterator to the next cluster in the glyph item. + * See #PangoGlyphItemIter for details of cluster orders. + * + * Return value: %TRUE if the iterator was advanced, %FALSE if we were already on the + * last cluster. + * + * Since: 1.22 + **/ +gboolean +pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter) +{ + int glyph_index = iter->end_glyph; + PangoGlyphString *glyphs = iter->glyph_item->glyphs; + int cluster; + PangoItem *item = iter->glyph_item->item; + + if (LTR (iter->glyph_item)) + { + if (glyph_index == glyphs->num_glyphs) + return FALSE; + } + else + { + if (glyph_index < 0) + return FALSE; + } + + iter->start_glyph = iter->end_glyph; + iter->start_index = iter->end_index; + iter->start_char = iter->end_char; + + if (LTR (iter->glyph_item)) + { + cluster = glyphs->log_clusters[glyph_index]; + while (TRUE) + { + glyph_index++; + + if (glyph_index == glyphs->num_glyphs) + { + iter->end_index = item->offset + item->length; + iter->end_char = item->num_chars; + break; + } + + if (glyphs->log_clusters[glyph_index] > cluster) + { + iter->end_index = item->offset + glyphs->log_clusters[glyph_index]; + iter->end_char += pango_utf8_strlen (iter->text + iter->start_index, + iter->end_index - iter->start_index); + break; + } + } + } + else /* RTL */ + { + cluster = glyphs->log_clusters[glyph_index]; + while (TRUE) + { + glyph_index--; + + if (glyph_index < 0) + { + iter->end_index = item->offset + item->length; + iter->end_char = item->num_chars; + break; + } + + if (glyphs->log_clusters[glyph_index] > cluster) + { + iter->end_index = item->offset + glyphs->log_clusters[glyph_index]; + iter->end_char += pango_utf8_strlen (iter->text + iter->start_index, + iter->end_index - iter->start_index); + break; + } + } + } + + iter->end_glyph = glyph_index; + + g_assert (iter->start_char < iter->end_char); + g_assert (iter->end_char <= item->num_chars); + + return TRUE; +} + +/** + * pango_glyph_item_iter_prev_cluster: + * @iter: a #PangoGlyphItemIter + * + * Moves the iterator to the preceding cluster in the glyph item. + * See #PangoGlyphItemIter for details of cluster orders. + * + * Return value: %TRUE if the iterator was moved, %FALSE if we were already on the + * first cluster. + * + * Since: 1.22 + **/ +gboolean +pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) +{ + int glyph_index = iter->start_glyph; + PangoGlyphString *glyphs = iter->glyph_item->glyphs; + int cluster; + PangoItem *item = iter->glyph_item->item; + + if (LTR (iter->glyph_item)) + { + if (glyph_index == 0) + return FALSE; + } + else + { + if (glyph_index == glyphs->num_glyphs - 1) + return FALSE; + + } + + iter->end_glyph = iter->start_glyph; + iter->end_index = iter->start_index; + iter->end_char = iter->start_char; + + if (LTR (iter->glyph_item)) + { + cluster = glyphs->log_clusters[glyph_index - 1]; + while (TRUE) + { + if (glyph_index == 0) + { + iter->start_index = item->offset; + iter->start_char = 0; + break; + } + + glyph_index--; + + if (glyphs->log_clusters[glyph_index] < cluster) + { + glyph_index++; + iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; + iter->start_char -= pango_utf8_strlen (iter->text + iter->start_index, + iter->end_index - iter->start_index); + break; + } + } + } + else /* RTL */ + { + cluster = glyphs->log_clusters[glyph_index + 1]; + while (TRUE) + { + if (glyph_index == glyphs->num_glyphs - 1) + { + iter->start_index = item->offset; + iter->start_char = 0; + break; + } + + glyph_index++; + + if (glyphs->log_clusters[glyph_index] < cluster) + { + glyph_index--; + iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; + iter->start_char -= pango_utf8_strlen (iter->text + iter->start_index, + iter->end_index - iter->start_index); + break; + } + } + } + + iter->start_glyph = glyph_index; + + g_assert (iter->start_char < iter->end_char); + g_assert (0 <= iter->start_char); + + return TRUE; +} + +/** + * pango_glyph_item_iter_init_start: + * @iter: a #PangoGlyphItemIter + * @glyph_item: the glyph item to iterate over + * @text: text corresponding to the glyph item + * + * Initializes a #PangoGlyphItemIter structure to point to the + * first cluster in a glyph item. + * See #PangoGlyphItemIter for details of cluster orders. + * + * Return value: %FALSE if there are no clusters in the glyph item + * + * Since: 1.22 + **/ +gboolean +pango_glyph_item_iter_init_start (PangoGlyphItemIter *iter, + PangoGlyphItem *glyph_item, + const char *text) +{ + iter->glyph_item = glyph_item; + iter->text = text; + + if (LTR (glyph_item)) + iter->end_glyph = 0; + else + iter->end_glyph = glyph_item->glyphs->num_glyphs - 1; + + iter->end_index = glyph_item->item->offset; + iter->end_char = 0; + + iter->start_glyph = iter->end_glyph; + iter->start_index = iter->end_index; + iter->start_char = iter->end_char; + + /* Advance onto the first cluster of the glyph item */ + return pango_glyph_item_iter_next_cluster (iter); +} + +/** + * pango_glyph_item_iter_init_end: + * @iter: a #PangoGlyphItemIter + * @glyph_item: the glyph item to iterate over + * @text: text corresponding to the glyph item + * + * Initializes a #PangoGlyphItemIter structure to point to the + * last cluster in a glyph item. + * See #PangoGlyphItemIter for details of cluster orders. + * + * Return value: %FALSE if there are no clusters in the glyph item + * + * Since: 1.22 + **/ +gboolean +pango_glyph_item_iter_init_end (PangoGlyphItemIter *iter, + PangoGlyphItem *glyph_item, + const char *text) +{ + iter->glyph_item = glyph_item; + iter->text = text; + + if (LTR (glyph_item)) + iter->start_glyph = glyph_item->glyphs->num_glyphs; + else + iter->start_glyph = -1; + + iter->start_index = glyph_item->item->offset + glyph_item->item->length; + iter->start_char = glyph_item->item->num_chars; + + iter->end_glyph = iter->start_glyph; + iter->end_index = iter->start_index; + iter->end_char = iter->start_char; + + /* Advance onto the first cluster of the glyph item */ + return pango_glyph_item_iter_prev_cluster (iter); +} + +typedef struct +{ + PangoGlyphItemIter iter; + + GSList *segment_attrs; +} ApplyAttrsState; + +/* Tack @attrs onto the attributes of glyph_item + */ +static void +append_attrs (PangoGlyphItem *glyph_item, + GSList *attrs) +{ + glyph_item->item->analysis.extra_attrs = + g_slist_concat (glyph_item->item->analysis.extra_attrs, attrs); +} + +/* Make a deep copy of a #GSList of PangoAttribute + */ +static GSList * +attr_slist_copy (GSList *attrs) +{ + GSList *tmp_list; + GSList *new_attrs; + + new_attrs = g_slist_copy (attrs); + + for (tmp_list = new_attrs; tmp_list; tmp_list = tmp_list->next) + tmp_list->data = pango_attribute_copy (tmp_list->data); + + return new_attrs; +} + +/* Split the glyph item at the start of the current cluster + */ +static PangoGlyphItem * +split_before_cluster_start (ApplyAttrsState *state) +{ + PangoGlyphItem *split_item; + int split_len = state->iter.start_index - state->iter.glyph_item->item->offset; + + split_item = pango_glyph_item_split (state->iter.glyph_item, state->iter.text, split_len); + append_attrs (split_item, state->segment_attrs); + + /* Adjust iteration to account for the split + */ + if (LTR (state->iter.glyph_item)) + { + state->iter.start_glyph -= split_item->glyphs->num_glyphs; + state->iter.end_glyph -= split_item->glyphs->num_glyphs; + } + + state->iter.start_char -= split_item->item->num_chars; + state->iter.end_char -= split_item->item->num_chars; + + return split_item; +} + +/** + * pango_glyph_item_apply_attrs: + * @glyph_item: a shaped item + * @text: text that @list applies to + * @list: a #PangoAttrList + * + * Splits a shaped item (PangoGlyphItem) into multiple items based + * on an attribute list. The idea is that if you have attributes + * that don't affect shaping, such as color or underline, to avoid + * affecting shaping, you filter them out (pango_attr_list_filter()), + * apply the shaping process and then reapply them to the result using + * this function. + * + * All attributes that start or end inside a cluster are applied + * to that cluster; for instance, if half of a cluster is underlined + * and the other-half strikethrough, then the cluster will end + * up with both underline and strikethrough attributes. In these + * cases, it may happen that item->extra_attrs for some of the + * result items can have multiple attributes of the same type. + * + * This function takes ownership of @glyph_item; it will be reused + * as one of the elements in the list. + * + * Return value: (transfer full) (element-type Pango.GlyphItem): a + * list of glyph items resulting from splitting @glyph_item. Free + * the elements using pango_glyph_item_free(), the list using + * g_slist_free(). + * + * Since: 1.2 + **/ +GSList * +pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, + const char *text, + PangoAttrList *list) +{ + PangoAttrIterator *iter = pango_attr_list_get_iterator (list); + GSList *result = NULL; + ApplyAttrsState state; + gboolean start_new_segment = FALSE; + gboolean have_cluster; + int range_start, range_end; + gboolean is_ellipsis; + + /* This routine works by iterating through the item cluster by + * cluster; we accumulate the attributes that we need to + * add to the next output item, and decide when to split + * off an output item based on two criteria: + * + * A) If start_index < attribute_start < end_index + * (attribute starts within cluster) then we need + * to split between the last cluster and this cluster. + * B) If start_index < attribute_end <= end_index, + * (attribute ends within cluster) then we need to + * split between this cluster and the next one. + */ + + /* Advance the attr iterator to the start of the item + */ + do + { + pango_attr_iterator_range (iter, &range_start, &range_end); + if (range_end > glyph_item->item->offset) + break; + } + while (pango_attr_iterator_next (iter)); + + state.segment_attrs = pango_attr_iterator_get_attrs (iter); + + is_ellipsis = (glyph_item->item->analysis.flags & PANGO_ANALYSIS_FLAG_IS_ELLIPSIS) != 0; + + /* Short circuit the case when we don't actually need to + * split the item + */ + if (is_ellipsis || + (range_start <= glyph_item->item->offset && + range_end >= glyph_item->item->offset + glyph_item->item->length)) + goto out; + + for (have_cluster = pango_glyph_item_iter_init_start (&state.iter, glyph_item, text); + have_cluster; + have_cluster = pango_glyph_item_iter_next_cluster (&state.iter)) + { + gboolean have_next; + + /* [range_start,range_end] is the first range that intersects + * the current cluster. + */ + + /* Split item into two, if this cluster isn't a continuation + * of the last cluster + */ + if (start_new_segment) + { + result = g_slist_prepend (result, + split_before_cluster_start (&state)); + state.segment_attrs = pango_attr_iterator_get_attrs (iter); + } + + start_new_segment = FALSE; + + /* Loop over all ranges that intersect this cluster; exiting + * leaving [range_start,range_end] being the first range that + * intersects the next cluster. + */ + do + { + if (range_end > state.iter.end_index) /* Range intersects next cluster */ + break; + + /* Since ranges end in this cluster, the next cluster goes into a + * separate segment + */ + start_new_segment = TRUE; + + have_next = pango_attr_iterator_next (iter); + pango_attr_iterator_range (iter, &range_start, &range_end); + + if (range_start >= state.iter.end_index) /* New range doesn't intersect this cluster */ + { + /* No gap between ranges, so previous range must of ended + * at cluster boundary. + */ + g_assert (range_start == state.iter.end_index && start_new_segment); + break; + } + + /* If any ranges start *inside* this cluster, then we need + * to split the previous cluster into a separate segment + */ + if (range_start > state.iter.start_index && + state.iter.start_index != glyph_item->item->offset) + { + GSList *new_attrs = attr_slist_copy (state.segment_attrs); + result = g_slist_prepend (result, + split_before_cluster_start (&state)); + state.segment_attrs = new_attrs; + } + + state.segment_attrs = g_slist_concat (state.segment_attrs, + pango_attr_iterator_get_attrs (iter)); + } + while (have_next); + } + + out: + /* What's left in glyph_item is the remaining portion + */ + append_attrs (glyph_item, state.segment_attrs); + result = g_slist_prepend (result, glyph_item); + + if (LTR (glyph_item)) + result = g_slist_reverse (result); + + pango_attr_iterator_destroy (iter); + + return result; +} + +/** + * pango_glyph_item_letter_space: + * @glyph_item: a #PangoGlyphItem + * @text: text that @glyph_item corresponds to + * (glyph_item->item->offset is an offset from the + * start of @text) + * @log_attrs: (array): logical attributes for the item + * (the first logical attribute refers to the position + * before the first character in the item) + * @letter_spacing: amount of letter spacing to add + * in Pango units. May be negative, though too large + * negative values will give ugly results. + * + * Adds spacing between the graphemes of @glyph_item to + * give the effect of typographic letter spacing. + * + * Since: 1.6 + **/ +void +pango_glyph_item_letter_space (PangoGlyphItem *glyph_item, + const char *text, + PangoLogAttr *log_attrs, + int letter_spacing) +{ + PangoGlyphItemIter iter; + PangoGlyphInfo *glyphs = glyph_item->glyphs->glyphs; + gboolean have_cluster; + int space_left, space_right; + + space_left = letter_spacing / 2; + + /* hinting */ + if ((letter_spacing & (PANGO_SCALE - 1)) == 0) + { + space_left = PANGO_UNITS_ROUND (space_left); + } + + space_right = letter_spacing - space_left; + + for (have_cluster = pango_glyph_item_iter_init_start (&iter, glyph_item, text); + have_cluster; + have_cluster = pango_glyph_item_iter_next_cluster (&iter)) + { + if (!log_attrs[iter.start_char].is_cursor_position) + continue; + + if (iter.start_glyph < iter.end_glyph) /* LTR */ + { + if (iter.start_char > 0) + { + glyphs[iter.start_glyph].geometry.width += space_left ; + glyphs[iter.start_glyph].geometry.x_offset += space_left ; + } + if (iter.end_char < glyph_item->item->num_chars) + { + glyphs[iter.end_glyph-1].geometry.width += space_right; + } + } + else /* RTL */ + { + if (iter.start_char > 0) + { + glyphs[iter.start_glyph].geometry.width += space_right; + } + if (iter.end_char < glyph_item->item->num_chars) + { + glyphs[iter.end_glyph+1].geometry.x_offset += space_left ; + glyphs[iter.end_glyph+1].geometry.width += space_left ; + } + } + } +} + +/** + * pango_glyph_item_get_logical_widths: + * @glyph_item: a #PangoGlyphItem + * @text: text that @glyph_item corresponds to + * (glyph_item->item->offset is an offset from the + * start of @text) + * @logical_widths: (array): an array whose length is the number of + * characters in glyph_item (equal to + * glyph_item->item->num_chars) to be filled in with + * the resulting character widths. + * + * Given a #PangoGlyphItem and the corresponding + * text, determine the screen width corresponding to each character. When + * multiple characters compose a single cluster, the width of the entire + * cluster is divided equally among the characters. + * + * See also pango_glyph_string_get_logical_widths(). + * + * Since: 1.26 + **/ +void +pango_glyph_item_get_logical_widths (PangoGlyphItem *glyph_item, + const char *text, + int *logical_widths) +{ + PangoGlyphItemIter iter; + gboolean has_cluster; + int dir; + + dir = glyph_item->item->analysis.level % 2 == 0 ? +1 : -1; + for (has_cluster = pango_glyph_item_iter_init_start (&iter, glyph_item, text); + has_cluster; + has_cluster = pango_glyph_item_iter_next_cluster (&iter)) + { + int glyph_index, char_index, num_chars, cluster_width = 0, char_width; + + for (glyph_index = iter.start_glyph; + glyph_index != iter.end_glyph; + glyph_index += dir) + { + cluster_width += glyph_item->glyphs->glyphs[glyph_index].geometry.width; + } + + num_chars = iter.end_char - iter.start_char; + if (num_chars) /* pedantic */ + { + char_width = cluster_width / num_chars; + + for (char_index = iter.start_char; + char_index < iter.end_char; + char_index++) + { + logical_widths[char_index] = char_width; + } + + /* add any residues to the first char */ + logical_widths[iter.start_char] += cluster_width - (char_width * num_chars); + } + } +} diff --git a/pango/pango-glyph-item.h b/pango/pango-glyph-item.h new file mode 100644 index 0000000..daf2b15 --- /dev/null +++ b/pango/pango-glyph-item.h @@ -0,0 +1,174 @@ +/* Pango + * pango-glyph-item.h: Pair of PangoItem and a glyph string + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_GLYPH_ITEM_H__ +#define __PANGO_GLYPH_ITEM_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * PangoGlyphItem: + * @item: corresponding #PangoItem. + * @glyphs: corresponding #PangoGlyphString. + * + * A #PangoGlyphItem is a pair of a #PangoItem and the glyphs + * resulting from shaping the text corresponding to an item. + * As an example of the usage of #PangoGlyphItem, the results + * of shaping text with #PangoLayout is a list of #PangoLayoutLine, + * each of which contains a list of #PangoGlyphItem. + */ +typedef struct _PangoGlyphItem PangoGlyphItem; + +struct _PangoGlyphItem +{ + PangoItem *item; + PangoGlyphString *glyphs; +}; + +/** + * PANGO_TYPE_GLYPH_ITEM: + * + * The #GObject type for #PangoGlyphItem. + */ +#define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_glyph_item_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_2 +PangoGlyphItem *pango_glyph_item_split (PangoGlyphItem *orig, + const char *text, + int split_index); +PANGO_AVAILABLE_IN_1_20 +PangoGlyphItem *pango_glyph_item_copy (PangoGlyphItem *orig); +PANGO_AVAILABLE_IN_1_6 +void pango_glyph_item_free (PangoGlyphItem *glyph_item); +PANGO_AVAILABLE_IN_1_2 +GSList * pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, + const char *text, + PangoAttrList *list); +PANGO_AVAILABLE_IN_1_6 +void pango_glyph_item_letter_space (PangoGlyphItem *glyph_item, + const char *text, + PangoLogAttr *log_attrs, + int letter_spacing); +PANGO_AVAILABLE_IN_1_26 +void pango_glyph_item_get_logical_widths (PangoGlyphItem *glyph_item, + const char *text, + int *logical_widths); + + +/** + * PangoGlyphItemIter: + * + * A #PangoGlyphItemIter is an iterator over the clusters in a + * #PangoGlyphItem. The forward direction of the + * iterator is the logical direction of text. That is, with increasing + * @start_index and @start_char values. If @glyph_item is right-to-left + * (that is, if @glyph_item->item->analysis.level is odd), + * then @start_glyph decreases as the iterator moves forward. Moreover, + * in right-to-left cases, @start_glyph is greater than @end_glyph. + * + * An iterator should be initialized using either of + * pango_glyph_item_iter_init_start() and + * pango_glyph_item_iter_init_end(), for forward and backward iteration + * respectively, and walked over using any desired mixture of + * pango_glyph_item_iter_next_cluster() and + * pango_glyph_item_iter_prev_cluster(). A common idiom for doing a + * forward iteration over the clusters is: + * + * PangoGlyphItemIter cluster_iter; + * gboolean have_cluster; + * + * for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter, + * glyph_item, text); + * have_cluster; + * have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter)) + * { + * ... + * } + * + * + * Note that @text is the start of the text for layout, which is then + * indexed by @glyph_item->item->offset to get to the + * text of @glyph_item. The @start_index and @end_index values can directly + * index into @text. The @start_glyph, @end_glyph, @start_char, and @end_char + * values however are zero-based for the @glyph_item. For each cluster, the + * item pointed at by the start variables is included in the cluster while + * the one pointed at by end variables is not. + * + * None of the members of a #PangoGlyphItemIter should be modified manually. + * + * Since: 1.22 + */ +typedef struct _PangoGlyphItemIter PangoGlyphItemIter; + +struct _PangoGlyphItemIter +{ + PangoGlyphItem *glyph_item; + const gchar *text; + + int start_glyph; + int start_index; + int start_char; + + int end_glyph; + int end_index; + int end_char; +}; + +/** + * PANGO_TYPE_GLYPH_ITEM_ITER: + * + * The #GObject type for #PangoGlyphItemIter. + * + * Since: 1.22 + */ +#define PANGO_TYPE_GLYPH_ITEM_ITER (pango_glyph_item_iter_get_type ()) + +PANGO_AVAILABLE_IN_1_22 +GType pango_glyph_item_iter_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_22 +PangoGlyphItemIter *pango_glyph_item_iter_copy (PangoGlyphItemIter *orig); +PANGO_AVAILABLE_IN_1_22 +void pango_glyph_item_iter_free (PangoGlyphItemIter *iter); + +PANGO_AVAILABLE_IN_1_22 +gboolean pango_glyph_item_iter_init_start (PangoGlyphItemIter *iter, + PangoGlyphItem *glyph_item, + const char *text); +PANGO_AVAILABLE_IN_1_22 +gboolean pango_glyph_item_iter_init_end (PangoGlyphItemIter *iter, + PangoGlyphItem *glyph_item, + const char *text); +PANGO_AVAILABLE_IN_1_22 +gboolean pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter); +PANGO_AVAILABLE_IN_1_22 +gboolean pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter); + +G_END_DECLS + +#endif /* __PANGO_GLYPH_ITEM_H__ */ diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h new file mode 100644 index 0000000..f24812c --- /dev/null +++ b/pango/pango-glyph.h @@ -0,0 +1,216 @@ +/* Pango + * pango-glyph.h: Glyph storage + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_GLYPH_H__ +#define __PANGO_GLYPH_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _PangoGlyphGeometry PangoGlyphGeometry; +typedef struct _PangoGlyphVisAttr PangoGlyphVisAttr; +typedef struct _PangoGlyphInfo PangoGlyphInfo; +typedef struct _PangoGlyphString PangoGlyphString; + +/* 1024ths of a device unit */ +/** + * PangoGlyphUnit: + * + * The #PangoGlyphUnit type is used to store dimensions within + * Pango. Dimensions are stored in 1/%PANGO_SCALE of a device unit. + * (A device unit might be a pixel for screen display, or + * a point on a printer.) %PANGO_SCALE is currently 1024, and + * may change in the future (unlikely though), but you should not + * depend on its exact value. The PANGO_PIXELS() macro can be used + * to convert from glyph units into device units with correct rounding. + */ +typedef gint32 PangoGlyphUnit; + +/* Positioning information about a glyph + */ +/** + * PangoGlyphGeometry: + * @width: the logical width to use for the the character. + * @x_offset: horizontal offset from nominal character position. + * @y_offset: vertical offset from nominal character position. + * + * The #PangoGlyphGeometry structure contains width and positioning + * information for a single glyph. + */ +struct _PangoGlyphGeometry +{ + PangoGlyphUnit width; + PangoGlyphUnit x_offset; + PangoGlyphUnit y_offset; +}; + +/* Visual attributes of a glyph + */ +/** + * PangoGlyphVisAttr: + * @is_cluster_start: set for the first logical glyph in each cluster. (Clusters + * are stored in visual order, within the cluster, glyphs + * are always ordered in logical order, since visual + * order is meaningless; that is, in Arabic text, accent glyphs + * follow the glyphs for the base character.) + * + * The PangoGlyphVisAttr is used to communicate information between + * the shaping phase and the rendering phase. More attributes may be + * added in the future. + */ +struct _PangoGlyphVisAttr +{ + guint is_cluster_start : 1; +}; + +/* A single glyph + */ +/** + * PangoGlyphInfo: + * @glyph: the glyph itself. + * @geometry: the positional information about the glyph. + * @attr: the visual attributes of the glyph. + * + * The #PangoGlyphInfo structure represents a single glyph together with + * positioning information and visual attributes. + * It contains the following fields. + */ +struct _PangoGlyphInfo +{ + PangoGlyph glyph; + PangoGlyphGeometry geometry; + PangoGlyphVisAttr attr; +}; + +/* A string of glyphs with positional information and visual attributes - + * ready for drawing + */ +/** + * PangoGlyphString: + * @num_glyphs: number of the glyphs in this glyph string. + * @glyphs: (array length=num_glyphs): array of glyph information + * for the glyph string. + * @log_clusters: logical cluster info, indexed by the byte index + * within the text corresponding to the glyph string. + * + * The #PangoGlyphString structure is used to store strings + * of glyphs with geometry and visual attribute information. + * The storage for the glyph information is owned + * by the structure which simplifies memory management. + */ +struct _PangoGlyphString { + gint num_glyphs; + + PangoGlyphInfo *glyphs; + + /* This is a memory inefficient way of representing the information + * here - each value gives the byte index within the text + * corresponding to the glyph string of the start of the cluster to + * which the glyph belongs. + */ + gint *log_clusters; + + /*< private >*/ + gint space; +}; + +/** + * PANGO_TYPE_GLYPH_STRING: + * + * The #GObject type for #PangoGlyphString. + */ +#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ()) + +PANGO_AVAILABLE_IN_ALL +PangoGlyphString *pango_glyph_string_new (void); +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_set_size (PangoGlyphString *string, + gint new_len); +PANGO_AVAILABLE_IN_ALL +GType pango_glyph_string_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoGlyphString *pango_glyph_string_copy (PangoGlyphString *string); +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_free (PangoGlyphString *string); +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_extents (PangoGlyphString *glyphs, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_1_14 +int pango_glyph_string_get_width(PangoGlyphString *glyphs); + +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_extents_range (PangoGlyphString *glyphs, + int start, + int end, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, + const char *text, + int length, + int embedding_level, + int *logical_widths); + +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_index_to_x (PangoGlyphString *glyphs, + char *text, + int length, + PangoAnalysis *analysis, + int index_, + gboolean trailing, + int *x_pos); +PANGO_AVAILABLE_IN_ALL +void pango_glyph_string_x_to_index (PangoGlyphString *glyphs, + char *text, + int length, + PangoAnalysis *analysis, + int x_pos, + int *index_, + int *trailing); + +/* Turn a string of characters into a string of glyphs + */ +PANGO_AVAILABLE_IN_ALL +void pango_shape (const gchar *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs); + +PANGO_AVAILABLE_IN_1_32 +void pango_shape_full (const gchar *item_text, + gint item_length, + const gchar *paragraph_text, + gint paragraph_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs); + +PANGO_AVAILABLE_IN_ALL +GList *pango_reorder_items (GList *logical_items); + +G_END_DECLS + +#endif /* __PANGO_GLYPH_H__ */ diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c new file mode 100644 index 0000000..8565db1 --- /dev/null +++ b/pango/pango-gravity.c @@ -0,0 +1,399 @@ +/* Pango + * pango-gravity.c: Gravity routines + * + * Copyright (C) 2006, 2007 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:vertical + * @short_description:Laying text out in vertical directions + * @title:Vertical Text + * @see_also: pango_context_get_base_gravity(), + * pango_context_set_base_gravity(), + * pango_context_get_gravity(), + * pango_context_get_gravity_hint(), + * pango_context_set_gravity_hint(), + * pango_font_description_set_gravity(), + * pango_font_description_get_gravity(), + * pango_attr_gravity_new(), + * pango_attr_gravity_hint_new() + * + * Since 1.16, Pango is able to correctly lay vertical text out. In fact, it can + * set layouts of mixed vertical and non-vertical text. This section describes + * the types used for setting vertical text parameters. + * + * The way this is implemented is through the concept of + * gravity. Gravity of normal Latin text is south. A + * gravity value of east means that glyphs will be rotated ninety degrees + * counterclockwise. So, to render vertical text one needs to set the gravity + * and rotate the layout using the matrix machinery already in place. This has + * the huge advantage that most algorithms working on a #PangoLayout do not need + * any change as the assumption that lines run in the X direction and stack in + * the Y direction holds even for vertical text layouts. + * + * Applications should only need to set base gravity on #PangoContext in use, and + * let Pango decide the gravity assigned to each run of text. This automatically + * handles text with mixed scripts. A very common use is to set the context base + * gravity to auto using pango_context_set_base_gravity() + * and rotate the layout normally. Pango will make sure that + * Asian languages take the right form, while other scripts are rotated normally. + * + * The correct way to set gravity on a layout is to set it on the context + * associated with it using pango_context_set_base_gravity(). The context + * of a layout can be accessed using pango_layout_get_context(). The currently + * set base gravity of the context can be accessed using + * pango_context_get_base_gravity() and the resolved + * gravity of it using pango_context_get_gravity(). The resolved gravity is + * the same as the base gravity for the most part, except that if the base + * gravity is set to %PANGO_GRAVITY_AUTO, the resolved gravity will depend + * on the current matrix set on context, and is derived using + * pango_gravity_get_for_matrix(). + * + * The next thing an application may want to set on the context is the + * gravity hint. A #PangoGravityHint instructs how + * different scripts should react to the set base gravity. + * + * Font descriptions have a gravity property too, that can be set using + * pango_font_description_set_gravity() and accessed using + * pango_font_description_get_gravity(). However, those are rarely useful + * from application code and are mainly used by #PangoLayout internally. + * + * Last but not least, one can create #PangoAttributes for gravity + * and gravity hint using pango_attr_gravity_new() and + * pango_attr_gravity_hint_new(). + */ +#include "config.h" + +#include "pango-gravity.h" + +#include + +/** + * pango_gravity_to_rotation: + * @gravity: gravity to query + * + * Converts a #PangoGravity value to its natural rotation in radians. + * @gravity should not be %PANGO_GRAVITY_AUTO. + * + * Note that pango_matrix_rotate() takes angle in degrees, not radians. + * So, to call pango_matrix_rotate() with the output of this function + * you should multiply it by (180. / G_PI). + * + * Return value: the rotation value corresponding to @gravity. + * + * Since: 1.16 + */ +double +pango_gravity_to_rotation (PangoGravity gravity) +{ + double rotation; + + g_return_val_if_fail (gravity != PANGO_GRAVITY_AUTO, 0); + + switch (gravity) + { + default: + case PANGO_GRAVITY_AUTO: /* shut gcc up */ + case PANGO_GRAVITY_SOUTH: rotation = 0; break; + case PANGO_GRAVITY_NORTH: rotation = G_PI; break; + case PANGO_GRAVITY_EAST: rotation = -G_PI_2; break; + case PANGO_GRAVITY_WEST: rotation = +G_PI_2; break; + } + + return rotation; +} + +/** + * pango_gravity_get_for_matrix: + * @matrix: (nullable): a #PangoMatrix + * + * Finds the gravity that best matches the rotation component + * in a #PangoMatrix. + * + * Return value: the gravity of @matrix, which will never be + * %PANGO_GRAVITY_AUTO, or %PANGO_GRAVITY_SOUTH if @matrix is %NULL + * + * Since: 1.16 + */ +PangoGravity +pango_gravity_get_for_matrix (const PangoMatrix *matrix) +{ + PangoGravity gravity; + double x; + double y; + + if (!matrix) + return PANGO_GRAVITY_SOUTH; + + x = matrix->xy; + y = matrix->yy; + + if (fabs (x) > fabs (y)) + gravity = x > 0 ? PANGO_GRAVITY_WEST : PANGO_GRAVITY_EAST; + else + gravity = y < 0 ? PANGO_GRAVITY_NORTH : PANGO_GRAVITY_SOUTH; + + return gravity; +} + + + +typedef enum +{ + PANGO_VERTICAL_DIRECTION_NONE, + PANGO_VERTICAL_DIRECTION_TTB, + PANGO_VERTICAL_DIRECTION_BTT +} PangoVerticalDirection; + +typedef struct { + /* PangoDirection */ + guint8 horiz_dir; /* Orientation in horizontal context */ + + /* PangoVerticalDirection */ + guint8 vert_dir; /* Orientation in vertical context */ + + /* PangoGravity */ + guint8 preferred_gravity; /* Preferred context gravity */ + + /* gboolean */ + guint8 wide; /* Whether script is mostly wide. + * Wide characters are upright (ie. + * not rotated) in foreign context */ +} PangoScriptProperties; + +#define NONE PANGO_VERTICAL_DIRECTION_NONE +#define TTB PANGO_VERTICAL_DIRECTION_TTB +#define BTT PANGO_VERTICAL_DIRECTION_BTT + +#define LTR PANGO_DIRECTION_LTR +#define RTL PANGO_DIRECTION_RTL +#define WEAK PANGO_DIRECTION_WEAK_LTR + +#define S PANGO_GRAVITY_SOUTH +#define E PANGO_GRAVITY_EAST +#define W PANGO_GRAVITY_WEST + +const PangoScriptProperties script_properties[] = + { /* ISO 15924 code */ + {LTR, NONE, S, FALSE}, /* Zyyy */ + {LTR, NONE, S, FALSE}, /* Qaai */ + {RTL, NONE, S, FALSE}, /* Arab */ + {LTR, NONE, S, FALSE}, /* Armn */ + {LTR, NONE, S, FALSE}, /* Beng */ + {LTR, TTB, E, TRUE }, /* Bopo */ + {LTR, NONE, S, FALSE}, /* Cher */ + {LTR, NONE, S, FALSE}, /* Qaac */ + {LTR, NONE, S, FALSE}, /* Cyrl (Cyrs) */ + {LTR, NONE, S, FALSE}, /* Dsrt */ + {LTR, NONE, S, FALSE}, /* Deva */ + {LTR, NONE, S, FALSE}, /* Ethi */ + {LTR, NONE, S, FALSE}, /* Geor (Geon, Geoa) */ + {LTR, NONE, S, FALSE}, /* Goth */ + {LTR, NONE, S, FALSE}, /* Grek */ + {LTR, NONE, S, FALSE}, /* Gujr */ + {LTR, NONE, S, FALSE}, /* Guru */ + {LTR, TTB, E, TRUE }, /* Hani */ + {LTR, TTB, E, TRUE }, /* Hang */ + {RTL, NONE, S, FALSE}, /* Hebr */ + {LTR, TTB, E, TRUE }, /* Hira */ + {LTR, NONE, S, FALSE}, /* Knda */ + {LTR, TTB, E, TRUE }, /* Kana */ + {LTR, NONE, S, FALSE}, /* Khmr */ + {LTR, NONE, S, FALSE}, /* Laoo */ + {LTR, NONE, S, FALSE}, /* Latn (Latf, Latg) */ + {LTR, NONE, S, FALSE}, /* Mlym */ + {WEAK,TTB, W, FALSE}, /* Mong */ + {LTR, NONE, S, FALSE}, /* Mymr */ + {LTR, BTT, W, FALSE}, /* Ogam */ + {LTR, NONE, S, FALSE}, /* Ital */ + {LTR, NONE, S, FALSE}, /* Orya */ + {LTR, NONE, S, FALSE}, /* Runr */ + {LTR, NONE, S, FALSE}, /* Sinh */ + {RTL, NONE, S, FALSE}, /* Syrc (Syrj, Syrn, Syre) */ + {LTR, NONE, S, FALSE}, /* Taml */ + {LTR, NONE, S, FALSE}, /* Telu */ + {RTL, NONE, S, FALSE}, /* Thaa */ + {LTR, NONE, S, FALSE}, /* Thai */ + {LTR, NONE, S, FALSE}, /* Tibt */ + {LTR, NONE, S, FALSE}, /* Cans */ + {LTR, TTB, S, TRUE }, /* Yiii */ + {LTR, NONE, S, FALSE}, /* Tglg */ + {LTR, NONE, S, FALSE}, /* Hano */ + {LTR, NONE, S, FALSE}, /* Buhd */ + {LTR, NONE, S, FALSE}, /* Tagb */ + + /* Unicode-4.0 additions */ + {LTR, NONE, S, FALSE}, /* Brai */ + {RTL, NONE, S, FALSE}, /* Cprt */ + {LTR, NONE, S, FALSE}, /* Limb */ + {LTR, NONE, S, FALSE}, /* Osma */ + {LTR, NONE, S, FALSE}, /* Shaw */ + {LTR, NONE, S, FALSE}, /* Linb */ + {LTR, NONE, S, FALSE}, /* Tale */ + {LTR, NONE, S, FALSE}, /* Ugar */ + + /* Unicode-4.1 additions */ + {LTR, NONE, S, FALSE}, /* Talu */ + {LTR, NONE, S, FALSE}, /* Bugi */ + {LTR, NONE, S, FALSE}, /* Glag */ + {LTR, NONE, S, FALSE}, /* Tfng */ + {LTR, NONE, S, FALSE}, /* Sylo */ + {LTR, NONE, S, FALSE}, /* Xpeo */ + {LTR, NONE, S, FALSE}, /* Khar */ + + /* Unicode-5.0 additions */ + {LTR, NONE, S, FALSE}, /* Zzzz */ + {LTR, NONE, S, FALSE}, /* Bali */ + {LTR, NONE, S, FALSE}, /* Xsux */ + {RTL, NONE, S, FALSE}, /* Phnx */ + {LTR, NONE, S, FALSE}, /* Phag */ + {RTL, NONE, S, FALSE} /* Nkoo */ +}; + +#undef NONE +#undef TTB +#undef BTT + +#undef LTR +#undef RTL +#undef WEAK + +#undef S +#undef E +#undef N +#undef W + +static PangoScriptProperties +get_script_properties (PangoScript script) +{ + g_return_val_if_fail (script >= 0, script_properties[0]); + + if ((guint)script >= G_N_ELEMENTS (script_properties)) + return script_properties[0]; + + return script_properties[script]; +} + +/** + * pango_gravity_get_for_script: + * @script: #PangoScript to query + * @base_gravity: base gravity of the paragraph + * @hint: orientation hint + * + * Based on the script, base gravity, and hint, returns actual gravity + * to use in laying out a single #PangoItem. + * + * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the + * preferred gravity of @script. To get the preferred gravity of a script, + * pass %PANGO_GRAVITY_AUTO and %PANGO_GRAVITY_HINT_STRONG in. + * + * Return value: resolved gravity suitable to use for a run of text + * with @script. + * + * Since: 1.16 + */ +PangoGravity +pango_gravity_get_for_script (PangoScript script, + PangoGravity base_gravity, + PangoGravityHint hint) +{ + PangoScriptProperties props = get_script_properties (script); + + if (G_UNLIKELY (base_gravity == PANGO_GRAVITY_AUTO)) + base_gravity = props.preferred_gravity; + + return pango_gravity_get_for_script_and_width (script, props.wide, + base_gravity, hint); +} + +/** + * pango_gravity_get_for_script_and_width: + * @script: #PangoScript to query + * @wide: %TRUE for wide characters as returned by g_unichar_iswide() + * @base_gravity: base gravity of the paragraph + * @hint: orientation hint + * + * Based on the script, East Asian width, base gravity, and hint, + * returns actual gravity to use in laying out a single character + * or #PangoItem. + * + * This function is similar to pango_gravity_get_for_script() except + * that this function makes a distinction between narrow/half-width and + * wide/full-width characters also. Wide/full-width characters always + * stand upright, that is, they always take the base gravity, + * whereas narrow/full-width characters are always rotated in vertical + * context. + * + * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the + * preferred gravity of @script. + * + * Return value: resolved gravity suitable to use for a run of text + * with @script and @wide. + * + * Since: 1.26 + */ +PangoGravity +pango_gravity_get_for_script_and_width (PangoScript script, + gboolean wide, + PangoGravity base_gravity, + PangoGravityHint hint) +{ + PangoScriptProperties props = get_script_properties (script); + gboolean vertical; + + + if (G_UNLIKELY (base_gravity == PANGO_GRAVITY_AUTO)) + base_gravity = props.preferred_gravity; + + vertical = PANGO_GRAVITY_IS_VERTICAL (base_gravity); + + /* Everything is designed such that a system with no vertical support + * renders everything correctly horizontally. So, if not in a vertical + * gravity, base and resolved gravities are always the same. + * + * Wide characters are always upright. + */ + if (G_LIKELY (!vertical || wide)) + return base_gravity; + + /* If here, we have a narrow character in a vertical gravity setting. + * Resolve depending on the hint. + */ + switch (hint) + { + default: + case PANGO_GRAVITY_HINT_NATURAL: + if (props.vert_dir == PANGO_VERTICAL_DIRECTION_NONE) + return PANGO_GRAVITY_SOUTH; + if ((base_gravity == PANGO_GRAVITY_EAST) ^ + (props.vert_dir == PANGO_VERTICAL_DIRECTION_BTT)) + return PANGO_GRAVITY_SOUTH; + else + return PANGO_GRAVITY_NORTH; + + case PANGO_GRAVITY_HINT_STRONG: + return base_gravity; + + case PANGO_GRAVITY_HINT_LINE: + if ((base_gravity == PANGO_GRAVITY_EAST) ^ + (props.horiz_dir == PANGO_DIRECTION_RTL)) + return PANGO_GRAVITY_SOUTH; + else + return PANGO_GRAVITY_NORTH; + } +} diff --git a/pango/pango-gravity.h b/pango/pango-gravity.h new file mode 100644 index 0000000..63c29e5 --- /dev/null +++ b/pango/pango-gravity.h @@ -0,0 +1,132 @@ +/* Pango + * pango-gravity.h: Gravity routines + * + * Copyright (C) 2006, 2007 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_GRAVITY_H__ +#define __PANGO_GRAVITY_H__ + +#include + +G_BEGIN_DECLS + +/** + * PangoGravity: + * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default) + * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees clockwise + * @PANGO_GRAVITY_NORTH: Glyphs are upside-down + * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees counter-clockwise + * @PANGO_GRAVITY_AUTO: Gravity is resolved from the context matrix + * + * The #PangoGravity type represents the orientation of glyphs in a segment + * of text. This is useful when rendering vertical text layouts. In + * those situations, the layout is rotated using a non-identity PangoMatrix, + * and then glyph orientation is controlled using #PangoGravity. + * Not every value in this enumeration makes sense for every usage of + * #PangoGravity; for example, %PANGO_GRAVITY_AUTO only can be passed to + * pango_context_set_base_gravity() and can only be returned by + * pango_context_get_base_gravity(). + * + * See also: #PangoGravityHint + * + * Since: 1.16 + **/ +typedef enum { + PANGO_GRAVITY_SOUTH, + PANGO_GRAVITY_EAST, + PANGO_GRAVITY_NORTH, + PANGO_GRAVITY_WEST, + PANGO_GRAVITY_AUTO +} PangoGravity; + +/** + * PangoGravityHint: + * @PANGO_GRAVITY_HINT_NATURAL: scripts will take their natural gravity based + * on the base gravity and the script. This is the default. + * @PANGO_GRAVITY_HINT_STRONG: always use the base gravity set, regardless of + * the script. + * @PANGO_GRAVITY_HINT_LINE: for scripts not in their natural direction (eg. + * Latin in East gravity), choose per-script gravity such that every script + * respects the line progression. This means, Latin and Arabic will take + * opposite gravities and both flow top-to-bottom for example. + * + * The #PangoGravityHint defines how horizontal scripts should behave in a + * vertical context. That is, English excerpt in a vertical paragraph for + * example. + * + * See #PangoGravity. + * + * Since: 1.16 + **/ +typedef enum { + PANGO_GRAVITY_HINT_NATURAL, + PANGO_GRAVITY_HINT_STRONG, + PANGO_GRAVITY_HINT_LINE +} PangoGravityHint; + +/** + * PANGO_GRAVITY_IS_VERTICAL: + * @gravity: the #PangoGravity to check + * + * Whether a #PangoGravity represents vertical writing directions. + * + * Returns: %TRUE if @gravity is %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST, + * %FALSE otherwise. + * + * Since: 1.16 + **/ +#define PANGO_GRAVITY_IS_VERTICAL(gravity) \ + ((gravity) == PANGO_GRAVITY_EAST || (gravity) == PANGO_GRAVITY_WEST) + +/** + * PANGO_GRAVITY_IS_IMPROPER: + * @gravity: the #PangoGravity to check + * + * Whether a #PangoGravity represents a gravity that results in reversal of text direction. + * + * Returns: %TRUE if @gravity is %PANGO_GRAVITY_WEST or %PANGO_GRAVITY_NORTH, + * %FALSE otherwise. + * + * Since: 1.32 + **/ +#define PANGO_GRAVITY_IS_IMPROPER(gravity) \ + ((gravity) == PANGO_GRAVITY_WEST || (gravity) == PANGO_GRAVITY_NORTH) + +#include +#include + +PANGO_AVAILABLE_IN_1_16 +double pango_gravity_to_rotation (PangoGravity gravity) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_16 +PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_16 +PangoGravity pango_gravity_get_for_script (PangoScript script, + PangoGravity base_gravity, + PangoGravityHint hint) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_26 +PangoGravity pango_gravity_get_for_script_and_width + (PangoScript script, + gboolean wide, + PangoGravity base_gravity, + PangoGravityHint hint) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __PANGO_GRAVITY_H__ */ diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h new file mode 100644 index 0000000..9570da8 --- /dev/null +++ b/pango/pango-impl-utils.h @@ -0,0 +1,134 @@ +/* Pango + * pango-impl-utils.h: Macros for get_type() functions + * Inspired by Jody Goldberg's gsf-impl-utils.h + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_IMPL_UTILS_H__ +#define __PANGO_IMPL_UTILS_H__ + +#include +#include +#include + +G_BEGIN_DECLS + + +/* String interning for static strings */ +#define I_(string) g_intern_static_string (string) + + +/* Some functions for handling PANGO_ATTR_SHAPE */ +void _pango_shape_shape (const char *text, + unsigned int n_chars, + PangoRectangle *shape_ink, + PangoRectangle *shape_logical, + PangoGlyphString *glyphs); + +void _pango_shape_get_extents (gint n_chars, + PangoRectangle *shape_ink, + PangoRectangle *shape_logical, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + + +/* We define these functions static here because we don't want to add public API + * for them (if anything, it belongs to glib, but glib found it trivial enough + * not to add API for). At some point metrics calculations will be + * centralized and this mess can be minimized. Or so I hope. + */ + +static inline G_GNUC_UNUSED int +pango_unichar_width (gunichar c) +{ + return G_UNLIKELY (g_unichar_iszerowidth (c)) ? 0 : + G_UNLIKELY (g_unichar_iswide (c)) ? 2 : 1; +} + +static G_GNUC_UNUSED glong +pango_utf8_strwidth (const gchar *p) +{ + glong len = 0; + g_return_val_if_fail (p != NULL, 0); + + while (*p) + { + len += pango_unichar_width (g_utf8_get_char (p)); + p = g_utf8_next_char (p); + } + + return len; +} + +/* Glib's g_utf8_strlen() is broken and stops at embedded NUL's. + * Wrap it here. */ +static G_GNUC_UNUSED glong +pango_utf8_strlen (const gchar *p, gssize max) +{ + glong len = 0; + const gchar *start = p; + g_return_val_if_fail (p != NULL || max == 0, 0); + + if (max <= 0) + return g_utf8_strlen (p, max); + + p = g_utf8_next_char (p); + while (p - start < max) + { + ++len; + p = g_utf8_next_char (p); + } + + /* only do the last len increment if we got a complete + * char (don't count partial chars) + */ + if (p - start <= max) + ++len; + + return len; +} + + +/* To be made public at some point */ + +static G_GNUC_UNUSED void +pango_glyph_string_reverse_range (PangoGlyphString *glyphs, + int start, int end) +{ + int i, j; + + for (i = start, j = end - 1; i < j; i++, j--) + { + PangoGlyphInfo glyph_info; + gint log_cluster; + + glyph_info = glyphs->glyphs[i]; + glyphs->glyphs[i] = glyphs->glyphs[j]; + glyphs->glyphs[j] = glyph_info; + + log_cluster = glyphs->log_clusters[i]; + glyphs->log_clusters[i] = glyphs->log_clusters[j]; + glyphs->log_clusters[j] = log_cluster; + } +} + + +G_END_DECLS + +#endif /* __PANGO_IMPL_UTILS_H__ */ diff --git a/pango/pango-item.c b/pango/pango-item.c new file mode 100644 index 0000000..8c36887 --- /dev/null +++ b/pango/pango-item.c @@ -0,0 +1,155 @@ +/* Pango + * pango-item.c: Single run handling + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "pango-attributes.h" +#include "pango-item.h" +#include "pango-impl-utils.h" + +/** + * pango_item_new: + * + * Creates a new #PangoItem structure initialized to default values. + * + * Return value: the newly allocated #PangoItem, which should + * be freed with pango_item_free(). + **/ +PangoItem * +pango_item_new (void) +{ + PangoItem *result = g_slice_new0 (PangoItem); + + return result; +} + +/** + * pango_item_copy: + * @item: (nullable): a #PangoItem, may be %NULL + * + * Copy an existing #PangoItem structure. + * + * Return value: (nullable): the newly allocated #PangoItem, which + * should be freed with pango_item_free(), or %NULL if + * @item was %NULL. + **/ +PangoItem * +pango_item_copy (PangoItem *item) +{ + GSList *extra_attrs, *tmp_list; + PangoItem *result; + + if (item == NULL) + return NULL; + + result = g_slice_new (PangoItem); + + result->offset = item->offset; + result->length = item->length; + result->num_chars = item->num_chars; + + result->analysis = item->analysis; + if (result->analysis.font) + g_object_ref (result->analysis.font); + + extra_attrs = NULL; + tmp_list = item->analysis.extra_attrs; + while (tmp_list) + { + extra_attrs = g_slist_prepend (extra_attrs, pango_attribute_copy (tmp_list->data)); + tmp_list = tmp_list->next; + } + + result->analysis.extra_attrs = g_slist_reverse (extra_attrs); + + return result; +} + +/** + * pango_item_free: + * @item: (nullable): a #PangoItem, may be %NULL + * + * Free a #PangoItem and all associated memory. + **/ +void +pango_item_free (PangoItem *item) +{ + if (item == NULL) + return; + + if (item->analysis.extra_attrs) + { + g_slist_foreach (item->analysis.extra_attrs, (GFunc)pango_attribute_destroy, NULL); + g_slist_free (item->analysis.extra_attrs); + } + + if (item->analysis.font) + g_object_unref (item->analysis.font); + + g_slice_free (PangoItem, item); +} + +G_DEFINE_BOXED_TYPE (PangoItem, pango_item, + pango_item_copy, + pango_item_free); + +/** + * pango_item_split: + * @orig: a #PangoItem + * @split_index: byte index of position to split item, relative to the start of the item + * @split_offset: number of chars between start of @orig and @split_index + * + * Modifies @orig to cover only the text after @split_index, and + * returns a new item that covers the text before @split_index that + * used to be in @orig. You can think of @split_index as the length of + * the returned item. @split_index may not be 0, and it may not be + * greater than or equal to the length of @orig (that is, there must + * be at least one byte assigned to each item, you can't create a + * zero-length item). @split_offset is the length of the first item in + * chars, and must be provided because the text used to generate the + * item isn't available, so pango_item_split() can't count the char + * length of the split items itself. + * + * Return value: new item representing text before @split_index, which + * should be freed with pango_item_free(). + **/ +PangoItem* +pango_item_split (PangoItem *orig, + int split_index, + int split_offset) +{ + PangoItem *new_item; + + g_return_val_if_fail (orig != NULL, NULL); + g_return_val_if_fail (split_index > 0, NULL); + g_return_val_if_fail (split_index < orig->length, NULL); + g_return_val_if_fail (split_offset > 0, NULL); + g_return_val_if_fail (split_offset < orig->num_chars, NULL); + + new_item = pango_item_copy (orig); + new_item->length = split_index; + new_item->num_chars = split_offset; + + orig->offset += split_index; + orig->length -= split_index; + orig->num_chars -= split_offset; + + return new_item; +} diff --git a/pango/pango-item.h b/pango/pango-item.h new file mode 100644 index 0000000..cb6a7ed --- /dev/null +++ b/pango/pango-item.h @@ -0,0 +1,118 @@ +/* Pango + * pango-item.h: Structure for storing run information + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_ITEM_H__ +#define __PANGO_ITEM_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _PangoAnalysis PangoAnalysis; +typedef struct _PangoItem PangoItem; + +/** + * PANGO_ANALYSIS_FLAG_CENTERED_BASELINE: + * + * Whether the segment should be shifted to center around the baseline. + * Used in vertical writing directions mostly. + * + * Since: 1.16 + */ +#define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0) + +/** + * PANGO_ANALYSIS_FLAG_IS_ELLIPSIS: + * + * This flag is used to mark runs that hold ellipsized text, + * in an ellipsized layout. + * + * Since: 1.36.7 + */ +#define PANGO_ANALYSIS_FLAG_IS_ELLIPSIS (1 << 1) + +/** + * PangoAnalysis: + * @shape_engine: the engine for doing rendering-system-dependent processing. + * @lang_engine: the engine for doing rendering-system-independent processing. + * @font: the font for this segment. + * @level: the bidirectional level for this segment. + * @gravity: the glyph orientation for this segment (A #PangoGravity). + * @flags: boolean flags for this segment (currently only one) (Since: 1.16). + * @script: the detected script for this segment (A #PangoScript) (Since: 1.18). + * @language: the detected language for this segment. + * @extra_attrs: extra attributes for this segment. + * + * The #PangoAnalysis structure stores information about + * the properties of a segment of text. + */ +struct _PangoAnalysis +{ + PangoEngineShape *shape_engine; + PangoEngineLang *lang_engine; + PangoFont *font; + + guint8 level; + guint8 gravity; /* PangoGravity */ + guint8 flags; + + guint8 script; /* PangoScript */ + PangoLanguage *language; + + GSList *extra_attrs; +}; + +/** + * PangoItem: + * @offset: byte offset of the start of this item in text. + * @length: length of this item in bytes. + * @num_chars: number of Unicode characters in the item. + * @analysis: analysis results for the item. + * + * The #PangoItem structure stores information about a segment of text. + */ +struct _PangoItem +{ + gint offset; + gint length; + gint num_chars; + PangoAnalysis analysis; +}; + +#define PANGO_TYPE_ITEM (pango_item_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_item_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoItem *pango_item_new (void); +PANGO_AVAILABLE_IN_ALL +PangoItem *pango_item_copy (PangoItem *item); +PANGO_AVAILABLE_IN_ALL +void pango_item_free (PangoItem *item); +PANGO_AVAILABLE_IN_ALL +PangoItem *pango_item_split (PangoItem *orig, + int split_index, + int split_offset); + +G_END_DECLS + +#endif /* __PANGO_ITEM_H__ */ diff --git a/pango/pango-language-sample-table.h b/pango/pango-language-sample-table.h new file mode 100644 index 0000000..19614d8 --- /dev/null +++ b/pango/pango-language-sample-table.h @@ -0,0 +1,642 @@ +/* Pango Language Sample Table + * + * Each entry is of the form: + * + * LANGUAGE( + * code |* Name *|, + * SOURCE, + * "Sample text for the language." + * |* Translation of the sample text to English *| + * ) + * + * Where code is the ISO639-1, ISO639-2, or ISO639-3 code for the language, + * the first one that exists. Name is the name of the language in English. + * + * Source is where the sample text comes from. One of: + * + * WP-PANG + * Wikipedia's List of Pangrams in Other Languages + * http://en.wikipedia.org/wiki/List_of_pangrams#Other_languages + * Fetched on 2008-08-19 + * + * WP-SFD + * Wikipedia's Sample Font Displays in Other Languages + * http://en.wikipedia.org/wiki/Sample_Font_Displays_In_Other_Languages + * Fetched on 2008-08-19 + * + * GLASS + * Kermit project's "I Can Eat Glass" list, also available in pango-view/ + * http://www.columbia.edu/kermit/utf8.html#glass + * Fetched on 2008-08-19 + * + * KERMIT + * Kermit project's Quick-Brown-Fox equivalents for other languages + * http://www.columbia.edu/kermit/utf8.html#quickbrownfox + * Fetched on 2008-08-19 + * + * GSPECI + * gnome-specimen's translations + * http://svn.gnome.org/viewvc/gnome-specimen/trunk/po/ + * Fetched on 2008-08-19 + * + * MISC + * Miscellaneous + * + * The sample text may be a pangram, but is not necessarily. It is chosen to + * be demonstrative of normal text in the language, as well as exposing font + * feature requirements unique to the language. It should be suitable for use + * as sample text in a font selection dialog. + * + * Needless to say, the list MUST be sorted on the language code. + */ +/* Sacrificial define to make introspection happy. */ +#ifndef LANGUAGE +#define LANGUAGE(x, y, z) +#endif +LANGUAGE( + af /* Afrikaans */, + GLASS, + "Ek kan glas eet, maar dit doen my nie skade nie." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ar /* Arabic */, + WP-PANG, + "نص حكيم له سر قاطع وذو شأن عظيم مكتوب على ثوب أخضر ومغلف بجلد أزرق." + /* A wise text which has an absolute secret and great importance, written on a green tissue and covered with blue leather. */ + ) +LANGUAGE( + arn /* Mapudungun */, + WP-PANG, + "Gvxam mincetu apocikvyeh: ñizol ce mamvj ka raq kuse bafkeh mew." + /* Tale under the full moon: the chief chemamull and the clay old woman at the lake/sea. */ + ) +LANGUAGE( + bar /* Bavarian */, + GLASS, + "I koh Glos esa, und es duard ma ned wei." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + bg /* Bulgarian */, + WP-SFD, + "Под южно дърво, цъфтящо в синьо, бягаше малко пухкаво зайче." + /* A little fluffy young rabbit ran under a southern tree blooming in blue */ + ) +LANGUAGE( + bi /* Bislama */, + GLASS, + "Mi save kakae glas, hemi no save katem mi." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + bn /* Bengali */, + GLASS, + "আমি কাঁচ খেতে পারি, তাতে আমার কোনো ক্ষতি হয় না।" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + bo /* Tibetan */, + GLASS, + "ཤེལ་སྒོ་ཟ་ནས་ང་ན་གི་མ་རེད།" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + bs /* Bosnian */, + WP-PANG, + "Fin džip, gluh jež i čvrst konjić dođoše bez moljca." + /* A nice jeep, a deaf hedgehog and a tough horse came without a moth. */ + ) +LANGUAGE( + ca /* Catalan */, + WP-PANG, + "Jove xef, porti whisky amb quinze glaçons d'hidrogen, coi!" + /* Young chef, bring whisky with fifteen hydrogen ice cubes, damn! */ + ) +LANGUAGE( + ch /* Chamorro */, + GLASS, + "Siña yo' chumocho krestat, ti ha na'lalamen yo'." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + cs /* Czech */, + WP-SFD, + "Příliš žluťoučký kůň úpěl ďábelské ódy." + /* A too yellow horse moaned devil odes. */ + ) +LANGUAGE( + cy /* Welsh */, + GLASS, + "Dw i'n gallu bwyta gwydr, 'dyw e ddim yn gwneud dolur i mi." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + da /* Danish */, + WP-SFD, + "Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen Walther spillede på xylofon." + /* The quiz contestants ate strawberries with cream while Walther the clown was playing the xylophone. */ + ) +LANGUAGE( + de /* German */, + WP-SFD, + "Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich." + /* Twelve boxing fighters drive Viktor over the great. */ + ) +LANGUAGE( + el /* Greek */, + WP-SFD, + "Θέλει αρετή και τόλμη η ελευθερία. (Ανδρέας Κάλβος)" + /* Liberty requires virtue and mettle. (Andreas Kalvos) */ + ) +LANGUAGE( + en /* English */, + GSPECI, + "The quick brown fox jumps over the lazy dog." + ) +LANGUAGE( + enm /* Middle English */, + GLASS, + "Ich canne glas eten and hit hirtiþ me nouȝt." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + eo /* Esperanto */, + WP-SFD, + "Eĥoŝanĝo ĉiuĵaŭde." + /* Change of echo every Thursday. */ + ) +LANGUAGE( + es /* Spanish */, + WP-PANG, + "Jovencillo emponzoñado de whisky: ¡qué figurota exhibe!" + /* Whisky-intoxicated youngster — what a figure he's showing! */ + ) +LANGUAGE( + et /* Estonian */, + WP-SFD, + "See väike mölder jõuab rongile hüpata." + /* This small miller is able to jump on the train. */ + ) +LANGUAGE( + eu /* Basque */, + GLASS, + "Kristala jan dezaket, ez dit minik ematen." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + fa /* Persian */, + MISC /* Behdad Esfahbod (#548730) */, + "«الا یا اَیُّها السّاقی! اَدِرْ کَأساً وَ ناوِلْها!» که عشق آسان نمود اوّل، ولی افتاد مشکل‌ها!" + ) +LANGUAGE( + fi /* Finnish */, + WP-SFD, + "Viekas kettu punaturkki laiskan koiran takaa kurkki." + /* The cunning red-coated fox peeped from behind the lazy dog. */ + ) +LANGUAGE( + fr /* French */, + MISC /* Vincent Untz (#549520) http://fr.wikipedia.org/wiki/Pangramme */, + "Voix ambiguë d'un cœur qui, au zéphyr, préfère les jattes de kiwis." + /* Ambiguous voice of a heart that, in the wind, prefers bowls of kiwis. */ + ) +LANGUAGE( + fro /* Old French */, + GLASS, + "Je puis mangier del voirre. Ne me nuit." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ga /* Irish */, + WP-PANG, + "Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig." + /* A maiden of large appetite with an intensely white, dense spade went through the hat of my good little porker. */ + ) +LANGUAGE( + gd /* Scottish Gaelic */, + GLASS, + "S urrainn dhomh gloinne ithe; cha ghoirtich i mi." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + gl /* Galician */, + GLASS, + "Eu podo xantar cristais e non cortarme." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + got /* Gothic */, + GLASS, + "𐌼𐌰𐌲 𐌲𐌻𐌴𐍃 𐌹̈𐍄𐌰𐌽, 𐌽𐌹 𐌼𐌹𐍃 𐍅𐌿 𐌽𐌳𐌰𐌽 𐌱𐍂𐌹𐌲𐌲𐌹𐌸." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + gu /* Gujarati */, + GLASS, + "હું કાચ ખાઇ શકુ છુ અને તેનાથી મને દર્દ નથી થતુ." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + gv /* Manx Gaelic */, + GLASS, + "Foddym gee glonney agh cha jean eh gortaghey mee." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + haw /* Hawaiian */, + GLASS, + "Hiki iaʻu ke ʻai i ke aniani; ʻaʻole nō lā au e ʻeha." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + he /* Hebrew */, + WP-SFD, + "דג סקרן שט לו בים זך אך לפתע פגש חבורה נחמדה שצצה כך." + /* A curious fish sailed a clear sea, and suddenly found nice company that just popped up. */ + ) +LANGUAGE( + hi /* Hindi */, + MISC /* G Karunakar (#549532) */, + "नहीं नजर किसी की बुरी नहीं किसी का मुँह काला जो करे सो उपर वाला" + /* its not in the sight or the face, but its all in god's grace. */ + ) +LANGUAGE( + hr /* Croatian */, + GLASS, + "Ja mogu jesti staklo i ne boli me." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + hu /* Hungarian */, + WP-SFD, + "Egy hűtlen vejét fülöncsípő, dühös mexikói úr Wesselényinél mázol Quitóban." + /* An angry Mexican man, who caught his faithless son-in-law, is painting Wesselényi's house in Quito. */ + ) +LANGUAGE( + hy /* Armenian */, + GLASS, + "Կրնամ ապակի ուտել և ինծի անհանգիստ չըներ։" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + is /* Icelandic */, + WP-PANG, + "Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa" + /* If a new axe were here, thieves would feel increasing deterrence and punishment. */ + ) +LANGUAGE( + it /* Italian */, + WP-SFD, + "Ma la volpe, col suo balzo, ha raggiunto il quieto Fido." + /* But the fox, with its jump, reached the calm dog */ + ) +LANGUAGE( + ja /* Japanese */, + KERMIT, + "いろはにほへと ちりぬるを 色は匂へど 散りぬるを" + ) +LANGUAGE( + jam /* Jamaican Creole English */, + KERMIT, + "Chruu, a kwik di kwik brong fox a jomp huova di liezi daag de, yu no siit?" + ) +LANGUAGE( + jbo /* Lojban */, + WP-PANG, + ".o'i mu xagji sofybakni cu zvati le purdi" + /* Watch out, five hungry Soviet-cows are in the garden! */ + ) +LANGUAGE( + jv /* Javanese */, + GLASS, + "Aku isa mangan beling tanpa lara." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ka /* Georgian */, + GLASS, + "მინას ვჭამ და არა მტკივა." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + kn /* Kannada */, + GLASS, + "ನಾನು ಗಾಜನ್ನು ತಿನ್ನಬಲ್ಲೆ ಮತ್ತು ಅದರಿಂದ ನನಗೆ ನೋವಾಗುವುದಿಲ್ಲ." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ko /* Korean */, + WP-SFD, + "다람쥐 헌 쳇바퀴에 타고파" + /* I Wanna ride on the chipmunk's old hamster wheel. */ + ) +LANGUAGE( + kw /* Cornish */, + GLASS, + "Mý a yl dybry gwéder hag éf ny wra ow ankenya." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + la /* Latin */, + WP-PANG, + "Sic surgens, dux, zelotypos quam karus haberis" + ) +LANGUAGE( + lt /* Lithuanian */, + WP-PANG, + "Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą." + /* Incurving fencer sword sparkled and perforated a round watermelon. */ + ) +LANGUAGE( + lv /* Latvian */, + WP-SFD, + "Sarkanās jūrascūciņas peld pa jūru." + /* Red seapigs swim in the sea. */ + ) +LANGUAGE( + map /* Marquesan */, + GLASS, + "E koʻana e kai i te karahi, mea ʻā, ʻaʻe hauhau." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + mk /* Macedonian */, + GLASS, + "Можам да јадам стакло, а не ме штета." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ml /* Malayalam */, + GLASS, + "വേദനയില്ലാതെ കുപ്പിചില്ലു് എനിയ്ക്കു് കഴിയ്ക്കാം." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + mn /* Mongolian */, + GLASS, + "ᠪᠢ ᠰᠢᠯᠢ ᠢᠳᠡᠶᠦ ᠴᠢᠳᠠᠨᠠ ᠂ ᠨᠠᠳᠤᠷ ᠬᠣᠤᠷᠠᠳᠠᠢ ᠪᠢᠰᠢ" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + mr /* Marathi */, + GLASS, + "मी काच खाऊ शकतो, मला ते दुखत नाही." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ms /* Malay */, + GLASS, + "Saya boleh makan kaca dan ia tidak mencederakan saya." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + nap /* Neapolitan */, + GLASS, + "M' pozz magna' o'vetr, e nun m' fa mal." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + nb /* Norwegian Bokmål */, + GSPECI, + "Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi." + ) +LANGUAGE( + nl /* Dutch */, + WP-SFD, + "Pa's wijze lynx bezag vroom het fikse aquaduct." + /* Dad's wise lynx piously regarded the substantial aqueduct. */ + ) +LANGUAGE( + nn /* Norwegian Nynorsk */, + GLASS, + "Eg kan eta glas utan å skada meg." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + no /* Norwegian Bokmål */, + GSPECI, + "Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi." + ) +LANGUAGE( + nv /* Navajo */, + GLASS, + "Tsésǫʼ yishą́ągo bííníshghah dóó doo shił neezgai da." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + oc /* Occitan */, + GLASS, + "Pòdi manjar de veire, me nafrariá pas." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + or /* Oriya */, + GLASS, + "ମୁଁ କାଚ ଖାଇପାରେ ଏବଂ ତାହା ମୋର କ୍ଷତି କରିନଥାଏ।." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + pa /* Punjabi */, + GLASS, + "ਮੈਂ ਗਲਾਸ ਖਾ ਸਕਦਾ ਹਾਂ ਅਤੇ ਇਸ ਨਾਲ ਮੈਨੂੰ ਕੋਈ ਤਕਲੀਫ ਨਹੀਂ." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + pcd /* Picard */, + GLASS, + "Ch'peux mingi du verre, cha m'foé mie n'ma." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + pl /* Polish */, + WP-SFD, + "Pchnąć w tę łódź jeża lub ośm skrzyń fig." + /* Push into this boat a hedgehog or eight boxes of figs. */ + ) +LANGUAGE( + pt /* Portuguese */, + WP-SFD, + "Vejam a bruxa da raposa Salta-Pocinhas e o cão feliz que dorme regalado." + /* Watch the witch of the Jump-Puddles fox and the happy dog that sleeps delighted. */ + ) +LANGUAGE( + pt-br /* Brazilian Portuguese */, + WP-PANG, + "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz." + /* At night, grandpa Kowalsky sees the magnet falling in the complaining penguin's foot and grandma puts sugar in the happy tortoise's date tea.*/ + ) +LANGUAGE( + ro /* Romanian */, + MISC /* Misu Moldovan (#552993) */, + "Fumegând hipnotic sașiul azvârle mreje în bălți." + /* Hypnotically smoking, the cross-eyed man throws fishing nets into ponds. */ + ) +LANGUAGE( + ru /* Russian */, + WP-PANG, + "В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!" + /* Would a citrus live in the bushes of the south? Yes, but only a fake one! */ + ) +LANGUAGE( + sa /* Sanskrit */, + GLASS, + "काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + scn /* Sicilian */, + GLASS, + "Puotsu mangiari u vitru, nun mi fa mali." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + sk /* Slovak */, + KERMIT, + "Starý kôň na hŕbe kníh žuje tíško povädnuté ruže, na stĺpe sa ďateľ učí kvákať novú ódu o živote." + ) +LANGUAGE( + sl /* Slovenian */, + WP-PANG, + "Šerif bo za vajo spet kuhal domače žgance." + /* For an exercise, sheriff will again make home-made mush. */ + ) +LANGUAGE( + sq /* Albanian */, + GLASS, + "Unë mund të ha qelq dhe nuk më gjen gjë." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + sr /* Serbian (Cyrillic) */, + WP-SFD, + "Чешће цeђење мрeжастим џаком побољшава фертилизацију генских хибрида." + /* More frequent filtering through the reticular bag improves fertilization of genetic hybrids. */ + ) +#if 0 +LANGUAGE( + sr-sr@latin /* Serbian (Latin) */, + WP-SFD, + "Češće ceđenje mrežastim džakom poboljšava fertilizaciju genskih hibrida." + /* More frequent filtering through the reticular bag improves fertilization of genetic hybrids. */ + ) +#endif +LANGUAGE( + sv /* Swedish */, + WP-SFD, + "Flygande bäckasiner söka strax hwila på mjuka tuvor." + /* Flying snipes soon look to rest on soft grass beds. */ + ) +LANGUAGE( + swg /* Swabian */, + GLASS, + "I kå Glas frässa, ond des macht mr nix!" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + ta /* Tamil */, + GLASS, + "நான் கண்ணாடி சாப்பிடுவேன், அதனால் எனக்கு ஒரு கேடும் வராது." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + te /* Telugu */, + GLASS, + "నేను గాజు తినగలను అయినా నాకు యేమీ కాదు." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + th /* Thai */, + WP-SFD, + "เป็นมนุษย์สุดประเสริฐเลิศคุณค่า - กว่าบรรดาฝูงสัตว์เดรัจฉาน - จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร - ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า - หัดอภัยเหมือนกีฬาอัชฌาสัย - ปฏิบัติประพฤติกฎกำหนดใจ - พูดจาให้จ๊ะ ๆ จ๋า ๆ น่าฟังเอยฯ" + /* Being a man is worthy - Beyond senseless animal - Begin educate thyself - Begone from killing and trouble - Bear not thy grudge, damn and, curse - Bestow forgiving and sporting - Befit with rules - Benign speech speak thou */ + ) +LANGUAGE( + tl /* Tagalog */, + GLASS, + "Kaya kong kumain nang bubog at hindi ako masaktan." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + tr /* Turkish */, + WP-PANG, + "Pijamalı hasta yağız şoföre çabucak güvendi." + /* The patient in pajamas trusted the swarthy driver quickly. */ + ) +LANGUAGE( + tw /* Twi */, + GLASS, + "Metumi awe tumpan, ɜnyɜ me hwee." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + uk /* Ukrainian */, + WP-PANG, + "Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!" + /* Daughter, do you hear them, eh? Oh, you are funny! Say good-bye without knee-length socks. */ + ) +LANGUAGE( + ur /* Urdu */, + GLASS, + "میں کانچ کھا سکتا ہوں اور مجھے تکلیف نہیں ہوتی ۔" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + vec /* Venetian */, + GLASS, + "Mi posso magnare el vetro, no'l me fa mae." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + vi /* Vietnamese */, + GSPECI, + "Con sói nâu nhảy qua con chó lười." + ) +LANGUAGE( + wa /* Walloon */, + GLASS, + "Dji pou magnî do vêre, çoula m' freut nén må." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + yi /* Yiddish */, + GLASS, + "איך קען עסן גלאָז און עס טוט מיר נישט װײ." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + yo /* Yoruba */, + GLASS, + "Mo lè je̩ dígí, kò ní pa mí lára." + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + zh-cn /* Chinese Simplified */, + GLASS, + "我能吞下玻璃而不伤身体。" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + zh-mo /* Chinese Traditional */, + GLASS, + "我能吞下玻璃而不傷身體。" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + zh-sg /* Chinese Simplified */, + GLASS, + "我能吞下玻璃而不伤身体。" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + zh-tw /* Chinese Traditional */, + GLASS, + "我能吞下玻璃而不傷身體。" + /* I can eat glass and it doesn't hurt me. */ + ) +LANGUAGE( + zlm /* Malay */, + GLASS, + "Saya boleh makan kaca dan ia tidak mencederakan saya." + /* I can eat glass and it doesn't hurt me. */ + ) diff --git a/pango/pango-language.c b/pango/pango-language.c new file mode 100644 index 0000000..725559f --- /dev/null +++ b/pango/pango-language.c @@ -0,0 +1,1009 @@ +/* Pango + * pango-language.c: Language handling routines + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include +#include +#include + +#include "pango-language.h" +#include "pango-impl-utils.h" + +#ifdef HAVE_CORE_TEXT +#include +#endif /* HAVE_CORE_TEXT */ + + +/* We embed a private struct right *before* a where a PangoLanguage * + * points to. + */ + +typedef struct { + gconstpointer lang_info; + gconstpointer script_for_lang; + + int magic; /* Used for verification */ +} PangoLanguagePrivate; + +#define PANGO_LANGUAGE_PRIVATE_MAGIC 0x0BE4DAD0 + +static void +pango_language_private_init (PangoLanguagePrivate *priv) +{ + priv->magic = PANGO_LANGUAGE_PRIVATE_MAGIC; + + priv->lang_info = (gconstpointer) -1; + priv->script_for_lang = (gconstpointer) -1; +} + +static PangoLanguagePrivate * pango_language_get_private (PangoLanguage *language) G_GNUC_CONST; + +static PangoLanguagePrivate * +pango_language_get_private (PangoLanguage *language) +{ + PangoLanguagePrivate *priv; + + if (!language) + return NULL; + + priv = (PangoLanguagePrivate *) ((char *)language - sizeof (PangoLanguagePrivate)); + + if (G_UNLIKELY (priv->magic != PANGO_LANGUAGE_PRIVATE_MAGIC)) + { + g_critical ("Invalid PangoLanguage. Did you pass in a straight string instead of calling pango_language_from_string()?"); + return NULL; + } + + return priv; +} + + + +#define LANGUAGE_SEPARATORS ";:, \t" + +static const char canon_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 0, 0, 0, 0, 0, 0, + '-', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, '-', + 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0 +}; + +static gboolean +lang_equal (gconstpointer v1, + gconstpointer v2) +{ + const guchar *p1 = v1; + const guchar *p2 = v2; + + while (canon_map[*p1] && canon_map[*p1] == canon_map[*p2]) + { + p1++, p2++; + } + + return (canon_map[*p1] == canon_map[*p2]); +} + +static guint +lang_hash (gconstpointer key) +{ + const guchar *p = key; + guint h = 0; + while (canon_map[*p]) + { + h = (h << 5) - h + canon_map[*p]; + p++; + } + + return h; +} + +static PangoLanguage * +pango_language_copy (PangoLanguage *language) +{ + return language; /* language tags are const */ +} + +static void +pango_language_free (PangoLanguage *language G_GNUC_UNUSED) +{ + return; /* nothing */ +} + +/** + * PangoLanguage: + * + * The #PangoLanguage structure is used to + * represent a language. + * + * #PangoLanguage pointers can be efficiently + * copied and compared with each other. + */ +G_DEFINE_BOXED_TYPE (PangoLanguage, pango_language, + pango_language_copy, + pango_language_free); + +/** + * _pango_get_lc_ctype: + * + * Return the Unix-style locale string for the language currently in + * effect. On Unix systems, this is the return value from + * setlocale(LC_CTYPE, NULL), and the user can + * affect this through the environment variables LC_ALL, LC_CTYPE or + * LANG (checked in that order). The locale strings typically is in + * the form lang_COUNTRY, where lang is an ISO-639 language code, and + * COUNTRY is an ISO-3166 country code. For instance, sv_FI for + * Swedish as written in Finland or pt_BR for Portuguese as written in + * Brazil. + * + * On Windows, the C library doesn't use any such environment + * variables, and setting them won't affect the behavior of functions + * like ctime(). The user sets the locale through the Regional Options + * in the Control Panel. The C library (in the setlocale() function) + * does not use country and language codes, but country and language + * names spelled out in English. + * However, this function does check the above environment + * variables, and does return a Unix-style locale string based on + * either said environment variables or the thread's current locale. + * + * Return value: a dynamically allocated string, free with g_free(). + */ +static gchar * +_pango_get_lc_ctype (void) +{ +#ifdef G_OS_WIN32 + /* Somebody might try to set the locale for this process using the + * LANG or LC_ environment variables. The Microsoft C library + * doesn't know anything about them. You set the locale in the + * Control Panel. Setting these env vars won't have any affect on + * locale-dependent C library functions like ctime(). But just for + * kicks, do obey LC_ALL, LC_CTYPE and LANG in Pango. (This also makes + * it easier to test GTK and Pango in various default languages, you + * don't have to clickety-click in the Control Panel, you can simply + * start the program with LC_ALL=something on the command line.) + */ + + gchar *p; + + p = getenv ("LC_ALL"); + if (p != NULL) + return g_strdup (p); + + p = getenv ("LC_CTYPE"); + if (p != NULL) + return g_strdup (p); + + p = getenv ("LANG"); + if (p != NULL) + return g_strdup (p); + + return g_win32_getlocale (); +#elif defined(HAVE_CORE_TEXT) + CFArrayRef languages; + CFStringRef language; + gchar ret[16]; + gchar *p; + + /* Take the same approach as done for Windows above. First we check + * if somebody tried to set the locale through environment variables. + */ + p = getenv ("LC_ALL"); + if (p != NULL) + return g_strdup (p); + + p = getenv ("LC_CTYPE"); + if (p != NULL) + return g_strdup (p); + + p = getenv ("LANG"); + if (p != NULL) + return g_strdup (p); + + /* If the environment variables are not set, determine the locale + * through the platform-native API. + */ + languages = CFLocaleCopyPreferredLanguages (); + language = CFArrayGetValueAtIndex (languages, 0); + + if (!CFStringGetCString (language, ret, 16, kCFStringEncodingUTF8)) + { + CFRelease (languages); + return g_strdup (setlocale (LC_CTYPE, NULL)); + } + + CFRelease (languages); + + return g_strdup (ret); +#else + { + gchar *lc_ctype = setlocale (LC_CTYPE, NULL); + + if (lc_ctype) + return g_strdup (lc_ctype); + else + return g_strdup ("C"); + } +#endif +} + +/** + * pango_language_get_default: + * + * Returns the #PangoLanguage for the current locale of the process. + * Note that this can change over the life of an application. + * + * On Unix systems, this is the return value is derived from + * setlocale(LC_CTYPE, NULL), and the user can + * affect this through the environment variables LC_ALL, LC_CTYPE or + * LANG (checked in that order). The locale string typically is in + * the form lang_COUNTRY, where lang is an ISO-639 language code, and + * COUNTRY is an ISO-3166 country code. For instance, sv_FI for + * Swedish as written in Finland or pt_BR for Portuguese as written in + * Brazil. + * + * On Windows, the C library does not use any such environment + * variables, and setting them won't affect the behavior of functions + * like ctime(). The user sets the locale through the Regional Options + * in the Control Panel. The C library (in the setlocale() function) + * does not use country and language codes, but country and language + * names spelled out in English. + * However, this function does check the above environment + * variables, and does return a Unix-style locale string based on + * either said environment variables or the thread's current locale. + * + * Your application should call setlocale(LC_ALL, ""); + * for the user settings to take effect. Gtk+ does this in its initialization + * functions automatically (by calling gtk_set_locale()). + * See man setlocale for more details. + * + * Return value: (transfer none): the default language as a + * #PangoLanguage, must not be freed. + * + * Since: 1.16 + **/ +PangoLanguage * +pango_language_get_default (void) +{ + static PangoLanguage *result = NULL; /* MT-safe */ + + if (g_once_init_enter (&result)) + { + gchar *lc_ctype; + PangoLanguage *lang; + + lc_ctype = _pango_get_lc_ctype (); + lang = pango_language_from_string (lc_ctype); + g_free (lc_ctype); + + g_once_init_leave (&result, lang); + } + + return result; +} + +/** + * pango_language_from_string: + * @language: (allow-none): a string representing a language tag, or %NULL + * + * Take a RFC-3066 format language tag as a string and convert it to a + * #PangoLanguage pointer that can be efficiently copied (copy the + * pointer) and compared with other language tags (compare the + * pointer.) + * + * This function first canonicalizes the string by converting it to + * lowercase, mapping '_' to '-', and stripping all characters other + * than letters and '-'. + * + * Use pango_language_get_default() if you want to get the #PangoLanguage for + * the current locale of the process. + * + * Return value: (transfer none) (nullable): an opaque pointer to a + * #PangoLanguage structure, or %NULL if @language was + * %NULL. The returned pointer will be valid forever + * after, and should not be freed. + **/ +PangoLanguage * +pango_language_from_string (const char *language) +{ + G_LOCK_DEFINE_STATIC (lang_from_string); + static GHashTable *hash = NULL; /* MT-safe */ + PangoLanguagePrivate *priv; + char *result; + int len; + char *p; + + if (language == NULL) + return NULL; + + G_LOCK (lang_from_string); + + if (G_UNLIKELY (!hash)) + hash = g_hash_table_new (lang_hash, lang_equal); + else + { + result = g_hash_table_lookup (hash, language); + if (result) + goto out; + } + + len = strlen (language); + result = g_malloc0 (sizeof (PangoLanguagePrivate) + len + 1); + g_assert (result); + + priv = (PangoLanguagePrivate *) result; + result += sizeof (*priv); + + pango_language_private_init (priv); + + p = result; + while ((*(p++) = canon_map[*(guchar *)language++])) + ; + + g_hash_table_insert (hash, result, result); + +out: + G_UNLOCK (lang_from_string); + + return (PangoLanguage *)result; +} + +/** + * pango_language_to_string: + * @language: a language tag. + * + * Gets the RFC-3066 format string representing the given language tag. + * + * Returns: a string representing the language tag. This is owned by + * Pango and should not be freed. + */ +const char * +(pango_language_to_string) (PangoLanguage *language) +{ + return pango_language_to_string (language); +} + +/** + * pango_language_matches: + * @language: (nullable): a language tag (see pango_language_from_string()), + * %NULL is allowed and matches nothing but '*' + * @range_list: a list of language ranges, separated by ';', ':', + * ',', or space characters. + * Each element must either be '*', or a RFC 3066 language range + * canonicalized as by pango_language_from_string() + * + * Checks if a language tag matches one of the elements in a list of + * language ranges. A language tag is considered to match a range + * in the list if the range is '*', the range is exactly the tag, + * or the range is a prefix of the tag, and the character after it + * in the tag is '-'. + * + * Return value: %TRUE if a match was found. + **/ +gboolean +pango_language_matches (PangoLanguage *language, + const char *range_list) +{ + const char *lang_str = pango_language_to_string (language); + const char *p = range_list; + gboolean done = FALSE; + + while (!done) + { + const char *end = strpbrk (p, LANGUAGE_SEPARATORS); + if (!end) + { + end = p + strlen (p); + done = TRUE; + } + + if (strncmp (p, "*", 1) == 0 || + (lang_str && strncmp (lang_str, p, end - p) == 0 && + (lang_str[end - p] == '\0' || lang_str[end - p] == '-'))) + return TRUE; + + if (!done) + p = end + 1; + } + + return FALSE; +} + +static int +lang_compare_first_component (gconstpointer pa, + gconstpointer pb) +{ + const char *a = pa, *b = pb; + unsigned int da, db; + const char *p; + + p = strstr (a, "-"); + da = p ? (unsigned int) (p - a) : strlen (a); + + p = strstr (b, "-"); + db = p ? (unsigned int) (p - b) : strlen (b); + + return strncmp (a, b, MAX (da, db)); +} + +/* Finds the best record for @language in an array of records. + * Each record should start with the string representation of the language + * code for the record (embedded, not a pointer), and the records must be + * sorted on language code. + */ +static gconstpointer +find_best_lang_match (PangoLanguage *language, + gconstpointer records, + guint num_records, + guint record_size) +{ + const char *lang_str; + const char *record, *start, *end; + + if (language == NULL) + return NULL; + + lang_str = pango_language_to_string (language); + + record = bsearch (lang_str, + records, num_records, record_size, + lang_compare_first_component); + if (!record) + return NULL; + + start = (const char *) records; + end = start + num_records * record_size; + + /* find the best match among all those that have the same first-component */ + + /* go to the final one matching in the first component */ + while (record < end - record_size && + lang_compare_first_component (lang_str, record + record_size) == 0) + record += record_size; + + /* go back, find which one matches completely */ + while (start <= record && + lang_compare_first_component (lang_str, record) == 0) + { + if (pango_language_matches (language, record)) + return record; + + record -= record_size; + } + + return NULL; +} + +static gconstpointer +find_best_lang_match_cached (PangoLanguage *language, + gconstpointer *cache, + gconstpointer records, + guint num_records, + guint record_size) +{ + gconstpointer result; + + if (G_LIKELY (cache && *cache != (gconstpointer) -1)) + return *cache; + + result = find_best_lang_match (language, + records, + num_records, + record_size); + + if (cache) + *cache = result; + + return result; +} + +#define FIND_BEST_LANG_MATCH_CACHED(language, cache_key, records) \ + find_best_lang_match_cached ((language), \ + pango_language_get_private (language) ? \ + &(pango_language_get_private (language)->cache_key) : NULL, \ + records, \ + G_N_ELEMENTS (records), \ + sizeof (*records)); + +typedef struct { + char lang[6]; + guint16 offset; +} LangInfo; + +/* Pure black magic, based on appendix of dsohowto.pdf */ +#define POOLSTRFIELD(line) POOLSTRFIELD1(line) +#define POOLSTRFIELD1(line) str##line +struct _LangPoolStruct { + char str0[1]; +#define LANGUAGE(id, source, sample) char POOLSTRFIELD(__LINE__)[sizeof(sample)]; +#include "pango-language-sample-table.h" +#undef LANGUAGE +}; + +static const union _LangPool { + struct _LangPoolStruct lang_pool_struct; + const char str[1]; +} lang_pool = { { + "", +#define LANGUAGE(id, source, sample) sample, +#include "pango-language-sample-table.h" +#undef LANGUAGE +} }; +static const LangInfo lang_texts[] = { +#define LANGUAGE(id, source, sample) {G_STRINGIFY(id), G_STRUCT_OFFSET(struct _LangPoolStruct, POOLSTRFIELD(__LINE__))}, +#include "pango-language-sample-table.h" +#undef LANGUAGE + /* One extra entry with no final comma, to make it C89-happy */ + {"~~", 0} +}; + +/** + * pango_language_get_sample_string: + * @language: (nullable): a #PangoLanguage, or %NULL + * + * Get a string that is representative of the characters needed to + * render a particular language. + * + * The sample text may be a pangram, but is not necessarily. It is chosen to + * be demonstrative of normal text in the language, as well as exposing font + * feature requirements unique to the language. It is suitable for use + * as sample text in a font selection dialog. + * + * If @language is %NULL, the default language as found by + * pango_language_get_default() is used. + * + * If Pango does not have a sample string for @language, the classic + * "The quick brown fox..." is returned. This can be detected by + * comparing the returned pointer value to that returned for (non-existent) + * language code "xx". That is, compare to: + * + * pango_language_get_sample_string (pango_language_from_string ("xx")) + * + * + * Return value: the sample string. This value is owned by Pango + * and should not be freed. + **/ +const char * +pango_language_get_sample_string (PangoLanguage *language) +{ + const LangInfo *lang_info; + + if (!language) + language = pango_language_get_default (); + + lang_info = FIND_BEST_LANG_MATCH_CACHED (language, + lang_info, + lang_texts); + + if (lang_info) + return lang_pool.str + lang_info->offset; + + return "The quick brown fox jumps over the lazy dog."; +} + + + + +/* + * From language to script + */ + + +#include "pango-script-lang-table.h" + +/** + * pango_language_get_scripts: + * @language: (allow-none): a #PangoLanguage, or %NULL + * @num_scripts: (out caller-allocates) (allow-none): location to return number of scripts, + * or %NULL + * + * Determines the scripts used to to write @language. + * If nothing is known about the language tag @language, + * or if @language is %NULL, then %NULL is returned. + * The list of scripts returned starts with the script that the + * language uses most and continues to the one it uses least. + * + * The value @num_script points at will be set to the number + * of scripts in the returned array (or zero if %NULL is returned). + * + * Most languages use only one script for writing, but there are + * some that use two (Latin and Cyrillic for example), and a few + * use three (Japanese for example). Applications should not make + * any assumptions on the maximum number of scripts returned + * though, except that it is positive if the return value is not + * %NULL, and it is a small number. + * + * The pango_language_includes_script() function uses this function + * internally. + * + * Return value: (array length=num_scripts) (nullable): An array of + * #PangoScript values, with the number of entries in the array stored + * in @num_scripts, or %NULL if Pango does not have any information + * about this particular language tag (also the case if @language is + * %NULL). The returned array is owned by Pango and should not be + * modified or freed. + + * Since: 1.22 + **/ +const PangoScript * +pango_language_get_scripts (PangoLanguage *language, + int *num_scripts) +{ + const PangoScriptForLang *script_for_lang; + unsigned int j; + + script_for_lang = FIND_BEST_LANG_MATCH_CACHED (language, + script_for_lang, + pango_script_for_lang); + + if (!script_for_lang) + { + if (num_scripts) + *num_scripts = 0; + + return NULL; + } + + if (num_scripts) + { + for (j = 0; j < G_N_ELEMENTS (script_for_lang->scripts); j++) + if (script_for_lang->scripts[j] == 0) + break; + + g_assert (j > 0); + + *num_scripts = j; + } + + return script_for_lang->scripts; +} + +/** + * pango_language_includes_script: + * @language: (nullable): a #PangoLanguage, or %NULL + * @script: a #PangoScript + * + * Determines if @script is one of the scripts used to + * write @language. The returned value is conservative; + * if nothing is known about the language tag @language, + * %TRUE will be returned, since, as far as Pango knows, + * @script might be used to write @language. + * + * This routine is used in Pango's itemization process when + * determining if a supplied language tag is relevant to + * a particular section of text. It probably is not useful for + * applications in most circumstances. + * + * This function uses pango_language_get_scripts() internally. + * + * Return value: %TRUE if @script is one of the scripts used + * to write @language or if nothing is known about @language + * (including the case that @language is %NULL), + * %FALSE otherwise. + + * Since: 1.4 + **/ +gboolean +pango_language_includes_script (PangoLanguage *language, + PangoScript script) +{ + const PangoScript *scripts; + int num_scripts, j; + +/* copied from the one in pango-script.c */ +#define REAL_SCRIPT(script) \ + ((script) > PANGO_SCRIPT_INHERITED && (script) != PANGO_SCRIPT_UNKNOWN) + + if (!REAL_SCRIPT (script)) + return TRUE; + +#undef REAL_SCRIPT + + scripts = pango_language_get_scripts (language, &num_scripts); + if (!scripts) + return TRUE; + + for (j = 0; j < num_scripts; j++) + if (scripts[j] == script) + return TRUE; + + return FALSE; +} + + + + +/* + * From script to language + */ + + +static PangoLanguage ** +parse_default_languages (void) +{ + char *p, *p_copy; + gboolean done = FALSE; + GArray *langs; + + p = getenv ("PANGO_LANGUAGE"); + + if (p == NULL) + p = getenv ("LANGUAGE"); + + if (p == NULL) + return NULL; + + p_copy = p = g_strdup (p); + + langs = g_array_new (TRUE, FALSE, sizeof (PangoLanguage *)); + + while (!done) + { + char *end = strpbrk (p, LANGUAGE_SEPARATORS); + if (!end) + { + end = p + strlen (p); + done = TRUE; + } + else + *end = '\0'; + + /* skip empty languages, and skip the language 'C' */ + if (p != end && !(p + 1 == end && *p == 'C')) + { + PangoLanguage *l = pango_language_from_string (p); + + g_array_append_val (langs, l); + } + + if (!done) + p = end + 1; + } + + g_free (p_copy); + + return (PangoLanguage **) g_array_free (langs, FALSE); +} + +static PangoLanguage * +_pango_script_get_default_language (PangoScript script) +{ + G_LOCK_DEFINE_STATIC (languages); + static gboolean initialized = FALSE; /* MT-safe */ + static PangoLanguage * const * languages = NULL; /* MT-safe */ + static GHashTable *hash = NULL; /* MT-safe */ + PangoLanguage *result, * const * p; + + G_LOCK (languages); + + if (G_UNLIKELY (!initialized)) + { + languages = parse_default_languages (); + + if (languages) + hash = g_hash_table_new (NULL, NULL); + + initialized = TRUE; + } + + if (!languages) + { + result = NULL; + goto out; + } + + if (g_hash_table_lookup_extended (hash, GINT_TO_POINTER (script), NULL, (gpointer *) (gpointer) &result)) + goto out; + + for (p = languages; *p; p++) + if (pango_language_includes_script (*p, script)) + break; + result = *p; + + g_hash_table_insert (hash, GINT_TO_POINTER (script), result); + +out: + G_UNLOCK (languages); + + return result; +} + +/** + * pango_script_get_sample_language: + * @script: a #PangoScript + * + * Given a script, finds a language tag that is reasonably + * representative of that script. This will usually be the + * most widely spoken or used language written in that script: + * for instance, the sample language for %PANGO_SCRIPT_CYRILLIC + * is ru (Russian), the sample language + * for %PANGO_SCRIPT_ARABIC is ar. + * + * For some + * scripts, no sample language will be returned because there + * is no language that is sufficiently representative. The best + * example of this is %PANGO_SCRIPT_HAN, where various different + * variants of written Chinese, Japanese, and Korean all use + * significantly different sets of Han characters and forms + * of shared characters. No sample language can be provided + * for many historical scripts as well. + * + * As of 1.18, this function checks the environment variables + * PANGO_LANGUAGE and LANGUAGE (checked in that order) first. + * If one of them is set, it is parsed as a list of language tags + * separated by colons or other separators. This function + * will return the first language in the parsed list that Pango + * believes may use @script for writing. This last predicate + * is tested using pango_language_includes_script(). This can + * be used to control Pango's font selection for non-primary + * languages. For example, a PANGO_LANGUAGE enviroment variable + * set to "en:fa" makes Pango choose fonts suitable for Persian (fa) + * instead of Arabic (ar) when a segment of Arabic text is found + * in an otherwise non-Arabic text. The same trick can be used to + * choose a default language for %PANGO_SCRIPT_HAN when setting + * context language is not feasible. + * + * Return value: (nullable): a #PangoLanguage that is representative + * of the script, or %NULL if no such language exists. + * + * Since: 1.4 + **/ +PangoLanguage * +pango_script_get_sample_language (PangoScript script) +{ + /* Note that in the following, we want + * pango_language_includes_script() for the sample language + * to include the script, so alternate orthographies + * (Shavian for English, Osmanya for Somali, etc), typically + * have no sample language + */ + static const char sample_languages[][4] = { + "", /* PANGO_SCRIPT_COMMON */ + "", /* PANGO_SCRIPT_INHERITED */ + "ar", /* PANGO_SCRIPT_ARABIC */ + "hy", /* PANGO_SCRIPT_ARMENIAN */ + "bn", /* PANGO_SCRIPT_BENGALI */ + /* Used primarily in Taiwan, but not part of the standard + * zh-tw orthography */ + "", /* PANGO_SCRIPT_BOPOMOFO */ + "chr", /* PANGO_SCRIPT_CHEROKEE */ + "cop", /* PANGO_SCRIPT_COPTIC */ + "ru", /* PANGO_SCRIPT_CYRILLIC */ + /* Deseret was used to write English */ + "", /* PANGO_SCRIPT_DESERET */ + "hi", /* PANGO_SCRIPT_DEVANAGARI */ + "am", /* PANGO_SCRIPT_ETHIOPIC */ + "ka", /* PANGO_SCRIPT_GEORGIAN */ + "", /* PANGO_SCRIPT_GOTHIC */ + "el", /* PANGO_SCRIPT_GREEK */ + "gu", /* PANGO_SCRIPT_GUJARATI */ + "pa", /* PANGO_SCRIPT_GURMUKHI */ + "", /* PANGO_SCRIPT_HAN */ + "ko", /* PANGO_SCRIPT_HANGUL */ + "he", /* PANGO_SCRIPT_HEBREW */ + "ja", /* PANGO_SCRIPT_HIRAGANA */ + "kn", /* PANGO_SCRIPT_KANNADA */ + "ja", /* PANGO_SCRIPT_KATAKANA */ + "km", /* PANGO_SCRIPT_KHMER */ + "lo", /* PANGO_SCRIPT_LAO */ + "en", /* PANGO_SCRIPT_LATIN */ + "ml", /* PANGO_SCRIPT_MALAYALAM */ + "mn", /* PANGO_SCRIPT_MONGOLIAN */ + "my", /* PANGO_SCRIPT_MYANMAR */ + /* Ogham was used to write old Irish */ + "", /* PANGO_SCRIPT_OGHAM */ + "", /* PANGO_SCRIPT_OLD_ITALIC */ + "or", /* PANGO_SCRIPT_ORIYA */ + "", /* PANGO_SCRIPT_RUNIC */ + "si", /* PANGO_SCRIPT_SINHALA */ + "syr", /* PANGO_SCRIPT_SYRIAC */ + "ta", /* PANGO_SCRIPT_TAMIL */ + "te", /* PANGO_SCRIPT_TELUGU */ + "dv", /* PANGO_SCRIPT_THAANA */ + "th", /* PANGO_SCRIPT_THAI */ + "bo", /* PANGO_SCRIPT_TIBETAN */ + "iu", /* PANGO_SCRIPT_CANADIAN_ABORIGINAL */ + "", /* PANGO_SCRIPT_YI */ + "tl", /* PANGO_SCRIPT_TAGALOG */ + /* Phillipino languages/scripts */ + "hnn", /* PANGO_SCRIPT_HANUNOO */ + "bku", /* PANGO_SCRIPT_BUHID */ + "tbw", /* PANGO_SCRIPT_TAGBANWA */ + + "", /* PANGO_SCRIPT_BRAILLE */ + "", /* PANGO_SCRIPT_CYPRIOT */ + "", /* PANGO_SCRIPT_LIMBU */ + /* Used for Somali (so) in the past */ + "", /* PANGO_SCRIPT_OSMANYA */ + /* The Shavian alphabet was designed for English */ + "", /* PANGO_SCRIPT_SHAVIAN */ + "", /* PANGO_SCRIPT_LINEAR_B */ + "", /* PANGO_SCRIPT_TAI_LE */ + "uga", /* PANGO_SCRIPT_UGARITIC */ + + "", /* PANGO_SCRIPT_NEW_TAI_LUE */ + "bug", /* PANGO_SCRIPT_BUGINESE */ + /* The original script for Old Church Slavonic (chu), later + * written with Cyrillic */ + "", /* PANGO_SCRIPT_GLAGOLITIC */ + /* Used for for Berber (ber), but Arabic script is more common */ + "", /* PANGO_SCRIPT_TIFINAGH */ + "syl", /* PANGO_SCRIPT_SYLOTI_NAGRI */ + "peo", /* PANGO_SCRIPT_OLD_PERSIAN */ + "", /* PANGO_SCRIPT_KHAROSHTHI */ + + "", /* PANGO_SCRIPT_UNKNOWN */ + "", /* PANGO_SCRIPT_BALINESE */ + "", /* PANGO_SCRIPT_CUNEIFORM */ + "", /* PANGO_SCRIPT_PHOENICIAN */ + "", /* PANGO_SCRIPT_PHAGS_PA */ + "nqo", /* PANGO_SCRIPT_NKO */ + + /* Unicode-5.1 additions */ + "", /* PANGO_SCRIPT_KAYAH_LI */ + "", /* PANGO_SCRIPT_LEPCHA */ + "", /* PANGO_SCRIPT_REJANG */ + "", /* PANGO_SCRIPT_SUNDANESE */ + "", /* PANGO_SCRIPT_SAURASHTRA */ + "", /* PANGO_SCRIPT_CHAM */ + "", /* PANGO_SCRIPT_OL_CHIKI */ + "", /* PANGO_SCRIPT_VAI */ + "", /* PANGO_SCRIPT_CARIAN */ + "", /* PANGO_SCRIPT_LYCIAN */ + "", /* PANGO_SCRIPT_LYDIAN */ + + /* Unicode-6.0 additions */ + "", /* PANGO_SCRIPT_BATAK */ + "", /* PANGO_SCRIPT_BRAHMI */ + "", /* PANGO_SCRIPT_MANDAIC */ + + /* Unicode-6.1 additions */ + "", /* PANGO_SCRIPT_CHAKMA */ + "", /* PANGO_SCRIPT_MEROITIC_CURSIVE */ + "", /* PANGO_SCRIPT_MEROITIC_HIEROGLYPHS */ + "", /* PANGO_SCRIPT_MIAO */ + "", /* PANGO_SCRIPT_SHARADA */ + "", /* PANGO_SCRIPT_SORA_SOMPENG */ + "", /* PANGO_SCRIPT_TAKRI */ + }; + const char *sample_language; + PangoLanguage *result; + + g_return_val_if_fail (script >= 0, NULL); + + if ((guint)script >= G_N_ELEMENTS (sample_languages)) + return NULL; + + result = _pango_script_get_default_language (script); + if (result) + return result; + + sample_language = sample_languages[script]; + + if (!sample_language[0]) + return NULL; + else + return pango_language_from_string (sample_language); +} diff --git a/pango/pango-language.h b/pango/pango-language.h new file mode 100644 index 0000000..2ab07bc --- /dev/null +++ b/pango/pango-language.h @@ -0,0 +1,71 @@ +/* Pango + * pango-language.h: Language handling routines + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_LANGUAGE_H__ +#define __PANGO_LANGUAGE_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +typedef struct _PangoLanguage PangoLanguage; + +/** + * PANGO_TYPE_LANGUAGE: + * + * The #GObject type for #PangoLanguage. + */ +#define PANGO_TYPE_LANGUAGE (pango_language_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_language_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoLanguage *pango_language_from_string (const char *language); + +PANGO_AVAILABLE_IN_ALL +const char *pango_language_to_string (PangoLanguage *language) G_GNUC_CONST; +/* For back compat. Will have to keep indefinitely. */ +#define pango_language_to_string(language) ((const char *)language) + +PANGO_AVAILABLE_IN_ALL +const char *pango_language_get_sample_string (PangoLanguage *language) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_16 +PangoLanguage *pango_language_get_default (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +gboolean pango_language_matches (PangoLanguage *language, + const char *range_list) G_GNUC_PURE; + +#include + +PANGO_AVAILABLE_IN_1_4 +gboolean pango_language_includes_script (PangoLanguage *language, + PangoScript script) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_22 +const PangoScript *pango_language_get_scripts (PangoLanguage *language, + int *num_scripts); + +G_END_DECLS + +#endif /* __PANGO_LANGUAGE_H__ */ diff --git a/pango/pango-layout-private.h b/pango/pango-layout-private.h new file mode 100644 index 0000000..4b5327e --- /dev/null +++ b/pango/pango-layout-private.h @@ -0,0 +1,155 @@ +/* Pango + * pango-layout-private.h: Internal structures of PangoLayout + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_LAYOUT_PRIVATE_H__ +#define __PANGO_LAYOUT_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + +struct _PangoLayout +{ + GObject parent_instance; + + /* If you add fields to PangoLayout be sure to update _copy() + * unless you add a value between copy_begin and copy_end. + */ + + /* Referenced items */ + PangoContext *context; + PangoAttrList *attrs; + PangoFontDescription *font_desc; + PangoTabArray *tabs; + + /* Dupped */ + gchar *text; + + /* Value fields. These will be memcpy'd in _copy() */ + int copy_begin; + + guint serial; + guint context_serial; + + int length; /* length of text in bytes */ + int n_chars; /* number of characters in layout */ + int width; /* wrap/ellipsize width, in device units, or -1 if not set */ + int height; /* ellipsize width, in device units if positive, number of lines if negative */ + int indent; /* amount by which first line should be shorter */ + int spacing; /* spacing between lines */ + + guint justify : 1; + guint alignment : 2; + guint single_paragraph : 1; + guint auto_dir : 1; + guint wrap : 2; /* PangoWrapMode */ + guint is_wrapped : 1; /* Whether the layout has any wrapped lines */ + guint ellipsize : 2; /* PangoEllipsizeMode */ + guint is_ellipsized : 1; /* Whether the layout has any ellipsized lines */ + int unknown_glyphs_count; /* number of unknown glyphs */ + + /* some caching */ + guint logical_rect_cached : 1; + guint ink_rect_cached : 1; + PangoRectangle logical_rect; + PangoRectangle ink_rect; + int tab_width; /* Cached width of a tab. -1 == not yet calculated */ + + int copy_end; + + /* Not copied during _copy() */ + + PangoLogAttr *log_attrs; /* Logical attributes for layout's text */ + GSList *lines; + guint line_count; /* Number of lines in @lines. 0 if lines is %NULL */ +}; + +typedef struct _Extents Extents; +struct _Extents +{ + /* Vertical position of the line's baseline in layout coords */ + int baseline; + + /* Line extents in layout coords */ + PangoRectangle ink_rect; + PangoRectangle logical_rect; +}; + +struct _PangoLayoutIter +{ + PangoLayout *layout; + GSList *line_list_link; + PangoLayoutLine *line; + + /* If run is NULL, it means we're on a "virtual run" + * at the end of the line with 0 width + */ + GSList *run_list_link; + PangoLayoutRun *run; /* FIXME nuke this, just keep the link */ + int index; + + /* list of Extents for each line in layout coordinates */ + Extents *line_extents; + int line_index; + + /* X position of the current run */ + int run_x; + + /* Width of the current run */ + int run_width; + + /* this run is left-to-right */ + gboolean ltr; + + /* X position of the left side of the current cluster */ + int cluster_x; + + /* The width of the current cluster */ + int cluster_width; + + /* glyph offset to the current cluster start */ + int cluster_start; + + /* first glyph in the next cluster */ + int next_cluster_glyph; + + /* number of Unicode chars in current cluster */ + int cluster_num_chars; + + /* visual position of current character within the cluster */ + int character_position; + + /* the real width of layout */ + int layout_width; +}; + +gboolean _pango_layout_line_ellipsize (PangoLayoutLine *line, + PangoAttrList *attrs, + int goal_width); + +void _pango_layout_get_iter (PangoLayout *layout, + PangoLayoutIter *iter); + +void _pango_layout_iter_destroy (PangoLayoutIter *iter); + +G_END_DECLS + +#endif /* __PANGO_LAYOUT_PRIVATE_H__ */ diff --git a/pango/pango-layout.c b/pango/pango-layout.c new file mode 100644 index 0000000..7129a9d --- /dev/null +++ b/pango/pango-layout.c @@ -0,0 +1,6471 @@ +/* Pango + * pango-layout.c: High-level layout driver + * + * Copyright (C) 2000, 2001, 2006 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:layout + * @short_description:High-level layout driver objects + * @title:Layout Objects + * + * While complete access to the layout capabilities of Pango is provided + * using the detailed interfaces for itemization and shaping, using + * that functionality directly involves writing a fairly large amount + * of code. The objects and functions in this section provide a + * high-level driver for formatting entire paragraphs of text + * at once. + */ + +/** + * PangoLayout: + * + * The #PangoLayout structure represents an entire paragraph + * of text. It is initialized with a #PangoContext, UTF-8 string + * and set of attributes for that string. Once that is done, the + * set of formatted lines can be extracted from the object, + * the layout can be rendered, and conversion between logical + * character positions within the layout's text, and the physical + * position of the resulting glyphs can be made. + * + * There are also a number of parameters to adjust the formatting + * of a #PangoLayout, which are illustrated in . + * It is possible, as well, to ignore the 2-D setup, and simply + * treat the results of a #PangoLayout as a list of lines. + * + *
+ * Adjustable parameters for a PangoLayout + * + *
+ * + * The #PangoLayout structure is opaque, and has no user-visible + * fields. + */ + +/** + * PangoLayoutIter: + * + * A #PangoLayoutIter structure can be used to + * iterate over the visual extents of a #PangoLayout. + * + * The #PangoLayoutIter structure is opaque, and + * has no user-visible fields. + */ + +#include "config.h" +#include "pango-glyph.h" /* For pango_shape() */ +#include "pango-break.h" +#include "pango-item.h" +#include "pango-engine.h" +#include "pango-impl-utils.h" +#include "pango-glyph-item.h" +#include + +#include "pango-layout-private.h" + + +typedef struct _ItemProperties ItemProperties; +typedef struct _ParaBreakState ParaBreakState; + +struct _ItemProperties +{ + PangoUnderline uline; + gboolean strikethrough; + gint rise; + gint letter_spacing; + gboolean shape_set; + PangoRectangle *shape_ink_rect; + PangoRectangle *shape_logical_rect; +}; + +typedef struct _PangoLayoutLinePrivate PangoLayoutLinePrivate; + +struct _PangoLayoutLinePrivate +{ + PangoLayoutLine line; + guint ref_count; + + /* Extents cache status: + * + * LEAKED means that the user has access to this line structure or a + * run included in this line, and so can change the glyphs/glyph-widths. + * If this is true, extents caching will be disabled. + */ + enum { + NOT_CACHED, + CACHED, + LEAKED + } cache_status; + PangoRectangle ink_rect; + PangoRectangle logical_rect; +}; + +struct _PangoLayoutClass +{ + GObjectClass parent_class; + + +}; + +#define LINE_IS_VALID(line) ((line) && (line)->layout != NULL) + +#ifdef G_DISABLE_CHECKS +#define ITER_IS_INVALID(iter) FALSE +#else +#define ITER_IS_INVALID(iter) G_UNLIKELY (check_invalid ((iter), G_STRLOC)) +static gboolean +check_invalid (PangoLayoutIter *iter, + const char *loc) +{ + if (iter->line->layout == NULL) + { + g_warning ("%s: PangoLayout changed since PangoLayoutIter was created, iterator invalid", loc); + return TRUE; + } + else + { + return FALSE; + } +} +#endif + +static void check_context_changed (PangoLayout *layout); +static void layout_changed (PangoLayout *layout); + +static void pango_layout_clear_lines (PangoLayout *layout); +static void pango_layout_check_lines (PangoLayout *layout); + +static PangoAttrList *pango_layout_get_effective_attributes (PangoLayout *layout); + +static PangoLayoutLine * pango_layout_line_new (PangoLayout *layout); +static void pango_layout_line_postprocess (PangoLayoutLine *line, + ParaBreakState *state, + gboolean wrapped); + +static int *pango_layout_line_get_log2vis_map (PangoLayoutLine *line, + gboolean strong); +static int *pango_layout_line_get_vis2log_map (PangoLayoutLine *line, + gboolean strong); +static void pango_layout_line_leaked (PangoLayoutLine *line); + +/* doesn't leak line */ +static PangoLayoutLine* _pango_layout_iter_get_line (PangoLayoutIter *iter); + +static void pango_layout_get_item_properties (PangoItem *item, + ItemProperties *properties); + +static void pango_layout_get_empty_extents_at_index (PangoLayout *layout, + int index, + PangoRectangle *logical_rect); + +static void pango_layout_finalize (GObject *object); + +G_DEFINE_TYPE (PangoLayout, pango_layout, G_TYPE_OBJECT) + +static void +pango_layout_init (PangoLayout *layout) +{ + layout->serial = 1; + layout->attrs = NULL; + layout->font_desc = NULL; + layout->text = NULL; + layout->length = 0; + layout->width = -1; + layout->height = -1; + layout->indent = 0; + layout->spacing = 0; + + layout->alignment = PANGO_ALIGN_LEFT; + layout->justify = FALSE; + layout->auto_dir = TRUE; + + layout->log_attrs = NULL; + layout->lines = NULL; + layout->line_count = 0; + + layout->tab_width = -1; + layout->unknown_glyphs_count = -1; + + layout->wrap = PANGO_WRAP_WORD; + layout->is_wrapped = FALSE; + layout->ellipsize = PANGO_ELLIPSIZE_NONE; + layout->is_ellipsized = FALSE; +} + +static void +pango_layout_class_init (PangoLayoutClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = pango_layout_finalize; +} + +static void +pango_layout_finalize (GObject *object) +{ + PangoLayout *layout; + + layout = PANGO_LAYOUT (object); + + pango_layout_clear_lines (layout); + + if (layout->context) + g_object_unref (layout->context); + + if (layout->attrs) + pango_attr_list_unref (layout->attrs); + + g_free (layout->text); + + if (layout->font_desc) + pango_font_description_free (layout->font_desc); + + if (layout->tabs) + pango_tab_array_free (layout->tabs); + + G_OBJECT_CLASS (pango_layout_parent_class)->finalize (object); +} + + +/** + * pango_layout_new: + * @context: a #PangoContext + * + * Create a new #PangoLayout object with attributes initialized to + * default values for a particular #PangoContext. + * + * Return value: the newly allocated #PangoLayout, with a reference + * count of one, which should be freed with + * g_object_unref(). + **/ +PangoLayout * +pango_layout_new (PangoContext *context) +{ + PangoLayout *layout; + + g_return_val_if_fail (context != NULL, NULL); + + layout = g_object_new (PANGO_TYPE_LAYOUT, NULL); + + layout->context = context; + layout->context_serial = pango_context_get_serial (context); + g_object_ref (context); + + return layout; +} + +/** + * pango_layout_copy: + * @src: a #PangoLayout + * + * Does a deep copy-by-value of the @src layout. The attribute list, + * tab array, and text from the original layout are all copied by + * value. + * + * Return value: (transfer full): the newly allocated #PangoLayout, + * with a reference count of one, which should be freed + * with g_object_unref(). + **/ +PangoLayout* +pango_layout_copy (PangoLayout *src) +{ + PangoLayout *layout; + + g_return_val_if_fail (PANGO_IS_LAYOUT (src), NULL); + + /* Copy referenced members */ + + layout = pango_layout_new (src->context); + if (src->attrs) + layout->attrs = pango_attr_list_copy (src->attrs); + if (src->font_desc) + layout->font_desc = pango_font_description_copy (src->font_desc); + if (src->tabs) + layout->tabs = pango_tab_array_copy (src->tabs); + + /* Dupped */ + layout->text = g_strdup (src->text); + + /* Value fields */ + memcpy (&layout->copy_begin, &src->copy_begin, + G_STRUCT_OFFSET (PangoLayout, copy_end) - G_STRUCT_OFFSET (PangoLayout, copy_begin)); + + return layout; +} + +/** + * pango_layout_get_context: + * @layout: a #PangoLayout + * + * Retrieves the #PangoContext used for this layout. + * + * Return value: (transfer none): the #PangoContext for the layout. + * This does not have an additional refcount added, so if you want to + * keep a copy of this around, you must reference it yourself. + **/ +PangoContext * +pango_layout_get_context (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, NULL); + + return layout->context; +} + +/** + * pango_layout_set_width: + * @layout: a #PangoLayout. + * @width: the desired width in Pango units, or -1 to indicate that no + * wrapping or ellipsization should be performed. + * + * Sets the width to which the lines of the #PangoLayout should wrap or + * ellipsized. The default value is -1: no width set. + **/ +void +pango_layout_set_width (PangoLayout *layout, + int width) +{ + g_return_if_fail (layout != NULL); + + if (width < 0) + width = -1; + + if (width != layout->width) + { + layout->width = width; + layout_changed (layout); + } +} + +/** + * pango_layout_get_width: + * @layout: a #PangoLayout + * + * Gets the width to which the lines of the #PangoLayout should wrap. + * + * Return value: the width in Pango units, or -1 if no width set. + **/ +int +pango_layout_get_width (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, 0); + return layout->width; +} + +/** + * pango_layout_set_height: + * @layout: a #PangoLayout. + * @height: the desired height of the layout in Pango units if positive, + * or desired number of lines if negative. + * + * Sets the height to which the #PangoLayout should be ellipsized at. There + * are two different behaviors, based on whether @height is positive or + * negative. + * + * If @height is positive, it will be the maximum height of the layout. Only + * lines would be shown that would fit, and if there is any text omitted, + * an ellipsis added. At least one line is included in each paragraph regardless + * of how small the height value is. A value of zero will render exactly one + * line for the entire layout. + * + * If @height is negative, it will be the (negative of) maximum number of lines per + * paragraph. That is, the total number of lines shown may well be more than + * this value if the layout contains multiple paragraphs of text. + * The default value of -1 means that first line of each paragraph is ellipsized. + * This behvaior may be changed in the future to act per layout instead of per + * paragraph. File a bug against pango at http://bugzilla.gnome.org/ if your + * code relies on this behavior. + * + * Height setting only has effect if a positive width is set on + * @layout and ellipsization mode of @layout is not %PANGO_ELLIPSIZE_NONE. + * The behavior is undefined if a height other than -1 is set and + * ellipsization mode is set to %PANGO_ELLIPSIZE_NONE, and may change in the + * future. + * + * Since: 1.20 + **/ +void +pango_layout_set_height (PangoLayout *layout, + int height) +{ + g_return_if_fail (layout != NULL); + + if (height != layout->height) + { + layout->height = height; + + /* Do not invalidate if the number of lines requested is + * larger than the total number of lines in layout. + * Bug 549003 + */ + if (layout->ellipsize != PANGO_ELLIPSIZE_NONE && + !(layout->lines && layout->is_ellipsized == FALSE && + height < 0 && layout->line_count <= (guint) -height)) + layout_changed (layout); + } +} + +/** + * pango_layout_get_height: + * @layout: a #PangoLayout + * + * Gets the height of layout used for ellipsization. See + * pango_layout_set_height() for details. + * + * Return value: the height, in Pango units if positive, or + * number of lines if negative. + * + * Since: 1.20 + **/ +int +pango_layout_get_height (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, 0); + return layout->height; +} + +/** + * pango_layout_set_wrap: + * @layout: a #PangoLayout + * @wrap: the wrap mode + * + * Sets the wrap mode; the wrap mode only has effect if a width + * is set on the layout with pango_layout_set_width(). + * To turn off wrapping, set the width to -1. + **/ +void +pango_layout_set_wrap (PangoLayout *layout, + PangoWrapMode wrap) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + if (layout->wrap != wrap) + { + layout->wrap = wrap; + + if (layout->width != -1) + layout_changed (layout); + } +} + +/** + * pango_layout_get_wrap: + * @layout: a #PangoLayout + * + * Gets the wrap mode for the layout. + * + * Use pango_layout_is_wrapped() to query whether any paragraphs + * were actually wrapped. + * + * Return value: active wrap mode. + **/ +PangoWrapMode +pango_layout_get_wrap (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), 0); + + return layout->wrap; +} + +/** + * pango_layout_is_wrapped: + * @layout: a #PangoLayout + * + * Queries whether the layout had to wrap any paragraphs. + * + * This returns %TRUE if a positive width is set on @layout, + * ellipsization mode of @layout is set to %PANGO_ELLIPSIZE_NONE, + * and there are paragraphs exceeding the layout width that have + * to be wrapped. + * + * Return value: %TRUE if any paragraphs had to be wrapped, %FALSE + * otherwise. + * + * Since: 1.16 + */ +gboolean +pango_layout_is_wrapped (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, FALSE); + + pango_layout_check_lines (layout); + + return layout->is_wrapped; +} + +/** + * pango_layout_set_indent: + * @layout: a #PangoLayout. + * @indent: the amount by which to indent. + * + * Sets the width in Pango units to indent each paragraph. A negative value + * of @indent will produce a hanging indentation. That is, the first line will + * have the full width, and subsequent lines will be indented by the + * absolute value of @indent. + * + * The indent setting is ignored if layout alignment is set to + * %PANGO_ALIGN_CENTER. + **/ +void +pango_layout_set_indent (PangoLayout *layout, + int indent) +{ + g_return_if_fail (layout != NULL); + + if (indent != layout->indent) + { + layout->indent = indent; + layout_changed (layout); + } +} + +/** + * pango_layout_get_indent: + * @layout: a #PangoLayout + * + * Gets the paragraph indent width in Pango units. A negative value + * indicates a hanging indentation. + * + * Return value: the indent in Pango units. + **/ +int +pango_layout_get_indent (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, 0); + return layout->indent; +} + +/** + * pango_layout_set_spacing: + * @layout: a #PangoLayout. + * @spacing: the amount of spacing + * + * Sets the amount of spacing in Pango unit between the lines of the + * layout. + **/ +void +pango_layout_set_spacing (PangoLayout *layout, + int spacing) +{ + g_return_if_fail (layout != NULL); + + if (spacing != layout->spacing) + { + layout->spacing = spacing; + layout_changed (layout); + } +} + +/** + * pango_layout_get_spacing: + * @layout: a #PangoLayout + * + * Gets the amount of spacing between the lines of the layout. + * + * Return value: the spacing in Pango units. + **/ +int +pango_layout_get_spacing (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, 0); + return layout->spacing; +} + +/** + * pango_layout_set_attributes: + * @layout: a #PangoLayout + * @attrs: (allow-none) (transfer none): a #PangoAttrList, can be %NULL + * + * Sets the text attributes for a layout object. + * References @attrs, so the caller can unref its reference. + **/ +void +pango_layout_set_attributes (PangoLayout *layout, + PangoAttrList *attrs) +{ + PangoAttrList *old_attrs; + g_return_if_fail (layout != NULL); + + old_attrs = layout->attrs; + + /* We always clear lines such that this function can be called + * whenever attrs changes. + */ + + layout->attrs = attrs; + if (layout->attrs) + pango_attr_list_ref (layout->attrs); + + layout_changed (layout); + + if (old_attrs) + pango_attr_list_unref (old_attrs); + layout->tab_width = -1; +} + +/** + * pango_layout_get_attributes: + * @layout: a #PangoLayout + * + * Gets the attribute list for the layout, if any. + * + * Return value: (transfer none): a #PangoAttrList. + **/ +PangoAttrList* +pango_layout_get_attributes (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + return layout->attrs; +} + +/** + * pango_layout_set_font_description: + * @layout: a #PangoLayout + * @desc: (allow-none): the new #PangoFontDescription, or %NULL to unset the + * current font description + * + * Sets the default font description for the layout. If no font + * description is set on the layout, the font description from + * the layout's context is used. + **/ +void +pango_layout_set_font_description (PangoLayout *layout, + const PangoFontDescription *desc) +{ + g_return_if_fail (layout != NULL); + + if (desc != layout->font_desc && + (!desc || !layout->font_desc || !pango_font_description_equal(desc, layout->font_desc))) + { + if (layout->font_desc) + pango_font_description_free (layout->font_desc); + + layout->font_desc = desc ? pango_font_description_copy (desc) : NULL; + + layout_changed (layout); + layout->tab_width = -1; + } +} + +/** + * pango_layout_get_font_description: + * @layout: a #PangoLayout + * + * Gets the font description for the layout, if any. + * + * Return value: (nullable): a pointer to the layout's font + * description, or %NULL if the font description from the layout's + * context is inherited. This value is owned by the layout and must + * not be modified or freed. + * + * Since: 1.8 + **/ +const PangoFontDescription * +pango_layout_get_font_description (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + return layout->font_desc; +} + +/** + * pango_layout_set_justify: + * @layout: a #PangoLayout + * @justify: whether the lines in the layout should be justified. + * + * Sets whether each complete line should be stretched to + * fill the entire width of the layout. This stretching is typically + * done by adding whitespace, but for some scripts (such as Arabic), + * the justification may be done in more complex ways, like extending + * the characters. + * + * Note that this setting is not implemented and so is ignored in Pango + * older than 1.18. + **/ +void +pango_layout_set_justify (PangoLayout *layout, + gboolean justify) +{ + g_return_if_fail (layout != NULL); + + if (justify != layout->justify) + { + layout->justify = justify; + + if (layout->is_ellipsized || layout->is_wrapped) + layout_changed (layout); + } +} + +/** + * pango_layout_get_justify: + * @layout: a #PangoLayout + * + * Gets whether each complete line should be stretched to fill the entire + * width of the layout. + * + * Return value: the justify. + **/ +gboolean +pango_layout_get_justify (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, FALSE); + return layout->justify; +} + +/** + * pango_layout_set_auto_dir: + * @layout: a #PangoLayout + * @auto_dir: if %TRUE, compute the bidirectional base direction + * from the layout's contents. + * + * Sets whether to calculate the bidirectional base direction + * for the layout according to the contents of the layout; + * when this flag is on (the default), then paragraphs in + @layout that begin with strong right-to-left characters + * (Arabic and Hebrew principally), will have right-to-left + * layout, paragraphs with letters from other scripts will + * have left-to-right layout. Paragraphs with only neutral + * characters get their direction from the surrounding paragraphs. + * + * When %FALSE, the choice between left-to-right and + * right-to-left layout is done according to the base direction + * of the layout's #PangoContext. (See pango_context_set_base_dir()). + * + * When the auto-computed direction of a paragraph differs from the + * base direction of the context, the interpretation of + * %PANGO_ALIGN_LEFT and %PANGO_ALIGN_RIGHT are swapped. + * + * Since: 1.4 + **/ +void +pango_layout_set_auto_dir (PangoLayout *layout, + gboolean auto_dir) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + auto_dir = auto_dir != FALSE; + + if (auto_dir != layout->auto_dir) + { + layout->auto_dir = auto_dir; + layout_changed (layout); + } +} + +/** + * pango_layout_get_auto_dir: + * @layout: a #PangoLayout + * + * Gets whether to calculate the bidirectional base direction + * for the layout according to the contents of the layout. + * See pango_layout_set_auto_dir(). + * + * Return value: %TRUE if the bidirectional base direction + * is computed from the layout's contents, %FALSE otherwise. + * + * Since: 1.4 + **/ +gboolean +pango_layout_get_auto_dir (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), FALSE); + + return layout->auto_dir; +} + +/** + * pango_layout_set_alignment: + * @layout: a #PangoLayout + * @alignment: the alignment + * + * Sets the alignment for the layout: how partial lines are + * positioned within the horizontal space available. + **/ +void +pango_layout_set_alignment (PangoLayout *layout, + PangoAlignment alignment) +{ + g_return_if_fail (layout != NULL); + + if (alignment != layout->alignment) + { + layout->alignment = alignment; + layout_changed (layout); + } +} + +/** + * pango_layout_get_alignment: + * @layout: a #PangoLayout + * + * Gets the alignment for the layout: how partial lines are + * positioned within the horizontal space available. + * + * Return value: the alignment. + **/ +PangoAlignment +pango_layout_get_alignment (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, PANGO_ALIGN_LEFT); + return layout->alignment; +} + + +/** + * pango_layout_set_tabs: + * @layout: a #PangoLayout + * @tabs: (allow-none): a #PangoTabArray, or %NULL + * + * Sets the tabs to use for @layout, overriding the default tabs + * (by default, tabs are every 8 spaces). If @tabs is %NULL, the default + * tabs are reinstated. @tabs is copied into the layout; you must + * free your copy of @tabs yourself. + **/ +void +pango_layout_set_tabs (PangoLayout *layout, + PangoTabArray *tabs) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + + if (tabs != layout->tabs) + { + if (layout->tabs) + pango_tab_array_free (layout->tabs); + + layout->tabs = tabs ? pango_tab_array_copy (tabs) : NULL; + + layout_changed (layout); + } +} + +/** + * pango_layout_get_tabs: + * @layout: a #PangoLayout + * + * Gets the current #PangoTabArray used by this layout. If no + * #PangoTabArray has been set, then the default tabs are in use + * and %NULL is returned. Default tabs are every 8 spaces. + * The return value should be freed with pango_tab_array_free(). + * + * Return value: (nullable): a copy of the tabs for this layout, or + * %NULL. + **/ +PangoTabArray* +pango_layout_get_tabs (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + if (layout->tabs) + return pango_tab_array_copy (layout->tabs); + else + return NULL; +} + +/** + * pango_layout_set_single_paragraph_mode: + * @layout: a #PangoLayout + * @setting: new setting + * + * If @setting is %TRUE, do not treat newlines and similar characters + * as paragraph separators; instead, keep all text in a single paragraph, + * and display a glyph for paragraph separator characters. Used when + * you want to allow editing of newlines on a single text line. + **/ +void +pango_layout_set_single_paragraph_mode (PangoLayout *layout, + gboolean setting) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + setting = setting != FALSE; + + if (layout->single_paragraph != setting) + { + layout->single_paragraph = setting; + layout_changed (layout); + } +} + +/** + * pango_layout_get_single_paragraph_mode: + * @layout: a #PangoLayout + * + * Obtains the value set by pango_layout_set_single_paragraph_mode(). + * + * Return value: %TRUE if the layout does not break paragraphs at + * paragraph separator characters, %FALSE otherwise. + **/ +gboolean +pango_layout_get_single_paragraph_mode (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), FALSE); + + return layout->single_paragraph; +} + +/** + * pango_layout_set_ellipsize: + * @layout: a #PangoLayout + * @ellipsize: the new ellipsization mode for @layout + * + * Sets the type of ellipsization being performed for @layout. + * Depending on the ellipsization mode @ellipsize text is + * removed from the start, middle, or end of text so they + * fit within the width and height of layout set with + * pango_layout_set_width() and pango_layout_set_height(). + * + * If the layout contains characters such as newlines that + * force it to be layed out in multiple paragraphs, then whether + * each paragraph is ellipsized separately or the entire layout + * is ellipsized as a whole depends on the set height of the layout. + * See pango_layout_set_height() for details. + * + * Since: 1.6 + **/ +void +pango_layout_set_ellipsize (PangoLayout *layout, + PangoEllipsizeMode ellipsize) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + if (ellipsize != layout->ellipsize) + { + layout->ellipsize = ellipsize; + + if (layout->is_ellipsized || layout->is_wrapped) + layout_changed (layout); + } +} + +/** + * pango_layout_get_ellipsize: + * @layout: a #PangoLayout + * + * Gets the type of ellipsization being performed for @layout. + * See pango_layout_set_ellipsize() + * + * Return value: the current ellipsization mode for @layout. + * + * Use pango_layout_is_ellipsized() to query whether any paragraphs + * were actually ellipsized. + * + * Since: 1.6 + **/ +PangoEllipsizeMode +pango_layout_get_ellipsize (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), PANGO_ELLIPSIZE_NONE); + + return layout->ellipsize; +} + +/** + * pango_layout_is_ellipsized: + * @layout: a #PangoLayout + * + * Queries whether the layout had to ellipsize any paragraphs. + * + * This returns %TRUE if the ellipsization mode for @layout + * is not %PANGO_ELLIPSIZE_NONE, a positive width is set on @layout, + * and there are paragraphs exceeding that width that have to be + * ellipsized. + * + * Return value: %TRUE if any paragraphs had to be ellipsized, %FALSE + * otherwise. + * + * Since: 1.16 + */ +gboolean +pango_layout_is_ellipsized (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, FALSE); + + pango_layout_check_lines (layout); + + return layout->is_ellipsized; +} + +/** + * pango_layout_set_text: + * @layout: a #PangoLayout + * @text: a valid UTF-8 string + * @length: maximum length of @text, in bytes. -1 indicates that + * the string is nul-terminated and the length should be + * calculated. The text will also be truncated on + * encountering a nul-termination even when @length is + * positive. + * + * Sets the text of the layout. + * + * Note that if you have used + * pango_layout_set_markup() or pango_layout_set_markup_with_accel() on + * @layout before, you may want to call pango_layout_set_attributes() to clear + * the attributes set on the layout from the markup as this function does not + * clear attributes. + **/ +void +pango_layout_set_text (PangoLayout *layout, + const char *text, + int length) +{ + char *old_text, *start, *end; + + g_return_if_fail (layout != NULL); + g_return_if_fail (length == 0 || text != NULL); + + old_text = layout->text; + + if (length < 0) + layout->text = g_strdup (text); + else if (length > 0) + /* This is not exactly what we want. We don't need the padding... + */ + layout->text = g_strndup (text, length); + else + layout->text = g_malloc0 (1); + + layout->length = strlen (layout->text); + + /* validate it, and replace invalid bytes with '?' + */ + start = layout->text; + for (;;) { + gboolean valid; + + valid = g_utf8_validate (start, -1, (const char **)&end); + + if (!*end) + break; + + /* Replace invalid bytes with -1. The -1 will be converted to + * ((gunichar) -1) by glib, and that in turn yields a glyph value of + * ((PangoGlyph) -1) by PANGO_GET_UNKNOWN_GLYPH(-1), + * and that's PANGO_GLYPH_INVALID_INPUT. + */ + if (!valid) + *end++ = -1; + + start = end; + } + + if (start != layout->text) + /* TODO: Write out the beginning excerpt of text? */ + g_warning ("Invalid UTF-8 string passed to pango_layout_set_text()"); + + layout->n_chars = pango_utf8_strlen (layout->text, -1); + + layout_changed (layout); + + g_free (old_text); +} + +/** + * pango_layout_get_text: + * @layout: a #PangoLayout + * + * Gets the text in the layout. The returned text should not + * be freed or modified. + * + * Return value: the text in the @layout. + **/ +const char* +pango_layout_get_text (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + /* We don't ever want to return NULL as the text. + */ + if (G_UNLIKELY (!layout->text)) + return ""; + + return layout->text; +} + +/** + * pango_layout_get_character_count: + * @layout: a #PangoLayout + * + * Returns the number of Unicode characters in the + * the text of @layout. + * + * Return value: the number of Unicode characters + * in the text of @layout + * + * Since: 1.30 + */ +gint +pango_layout_get_character_count (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), 0); + + return layout->n_chars; +} + +/** + * pango_layout_set_markup: + * @layout: a #PangoLayout + * @markup: marked-up text + * @length: length of marked-up text in bytes, or -1 if @markup is + * null-terminated + * + * Same as pango_layout_set_markup_with_accel(), but + * the markup text isn't scanned for accelerators. + * + **/ +void +pango_layout_set_markup (PangoLayout *layout, + const char *markup, + int length) +{ + pango_layout_set_markup_with_accel (layout, markup, length, 0, NULL); +} + +/** + * pango_layout_set_markup_with_accel: + * @layout: a #PangoLayout + * @markup: marked-up text + * (see markup format) + * @length: length of marked-up text in bytes, or -1 if @markup is + * null-terminated + * @accel_marker: marker for accelerators in the text + * @accel_char: (out caller-allocates) (allow-none): return location + * for first located accelerator, or %NULL + * + * Sets the layout text and attribute list from marked-up text (see + * markup format). Replaces + * the current text and attribute list. + * + * If @accel_marker is nonzero, the given character will mark the + * character following it as an accelerator. For example, @accel_marker + * might be an ampersand or underscore. All characters marked + * as an accelerator will receive a %PANGO_UNDERLINE_LOW attribute, + * and the first character so marked will be returned in @accel_char. + * Two @accel_marker characters following each other produce a single + * literal @accel_marker character. + **/ +void +pango_layout_set_markup_with_accel (PangoLayout *layout, + const char *markup, + int length, + gunichar accel_marker, + gunichar *accel_char) +{ + PangoAttrList *list = NULL; + char *text = NULL; + GError *error; + + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + g_return_if_fail (markup != NULL); + + error = NULL; + if (!pango_parse_markup (markup, length, + accel_marker, + &list, &text, + accel_char, + &error)) + { + g_warning ("pango_layout_set_markup_with_accel: %s", error->message); + g_error_free (error); + return; + } + + pango_layout_set_text (layout, text, -1); + pango_layout_set_attributes (layout, list); + pango_attr_list_unref (list); + g_free (text); +} + +/** + * pango_layout_get_unknown_glyphs_count: + * @layout: a #PangoLayout + * + * Counts the number unknown glyphs in @layout. That is, zero if + * glyphs for all characters in the layout text were found, or more + * than zero otherwise. + * + * This function can be used to determine if there are any fonts + * available to render all characters in a certain string, or when + * used in combination with %PANGO_ATTR_FALLBACK, to check if a + * certain font supports all the characters in the string. + * + * Return value: The number of unknown glyphs in @layout. + * + * Since: 1.16 + */ +int +pango_layout_get_unknown_glyphs_count (PangoLayout *layout) +{ + PangoLayoutLine *line; + PangoLayoutRun *run; + GSList *lines_list; + GSList *runs_list; + int i, count = 0; + + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), 0); + + pango_layout_check_lines (layout); + + if (layout->unknown_glyphs_count >= 0) + return layout->unknown_glyphs_count; + + lines_list = layout->lines; + while (lines_list) + { + line = lines_list->data; + runs_list = line->runs; + + while (runs_list) + { + run = runs_list->data; + + for (i = 0; i < run->glyphs->num_glyphs; i++) + { + if (run->glyphs->glyphs[i].glyph & PANGO_GLYPH_UNKNOWN_FLAG) + count++; + } + + runs_list = runs_list->next; + } + lines_list = lines_list->next; + } + + layout->unknown_glyphs_count = count; + return count; +} + +static void +check_context_changed (PangoLayout *layout) +{ + guint old_serial = layout->context_serial; + + layout->context_serial = pango_context_get_serial (layout->context); + + if (old_serial != layout->context_serial) + pango_layout_context_changed (layout); +} + +static void +layout_changed (PangoLayout *layout) +{ + layout->serial++; + if (layout->serial == 0) + layout->serial++; + pango_layout_clear_lines (layout); +} + +/** + * pango_layout_context_changed: + * @layout: a #PangoLayout + * + * Forces recomputation of any state in the #PangoLayout that + * might depend on the layout's context. This function should + * be called if you make changes to the context subsequent + * to creating the layout. + **/ +void +pango_layout_context_changed (PangoLayout *layout) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + layout_changed (layout); + layout->tab_width = -1; +} + +/** + * pango_layout_get_serial: + * @layout: a #PangoLayout + * + * Returns the current serial number of @layout. The serial number is + * initialized to an small number larger than zero when a new layout + * is created and is increased whenever the layout is changed using any + * of the setter functions, or the #PangoContext it uses has changed. + * The serial may wrap, but will never have the value 0. Since it + * can wrap, never compare it with "less than", always use "not equals". + * + * This can be used to automatically detect changes to a #PangoLayout, and + * is useful for example to decide whether a layout needs redrawing. + * To force the serial to be increased, use pango_layout_context_changed(). + * + * Return value: The current serial number of @layout. + * + * Since: 1.32.4 + **/ +guint +pango_layout_get_serial (PangoLayout *layout) +{ + check_context_changed (layout); + return layout->serial; +} + +/** + * pango_layout_get_log_attrs: + * @layout: a #PangoLayout + * @attrs: (out)(array length=n_attrs)(transfer container): + * location to store a pointer to an array of logical attributes + * This value must be freed with g_free(). + * @n_attrs: (out): location to store the number of the attributes in the + * array. (The stored value will be one more than the total number + * of characters in the layout, since there need to be attributes + * corresponding to both the position before the first character + * and the position after the last character.) + * + * Retrieves an array of logical attributes for each character in + * the @layout. + **/ +void +pango_layout_get_log_attrs (PangoLayout *layout, + PangoLogAttr **attrs, + gint *n_attrs) +{ + g_return_if_fail (layout != NULL); + + pango_layout_check_lines (layout); + + if (attrs) + { + *attrs = g_new (PangoLogAttr, layout->n_chars + 1); + memcpy (*attrs, layout->log_attrs, sizeof(PangoLogAttr) * (layout->n_chars + 1)); + } + + if (n_attrs) + *n_attrs = layout->n_chars + 1; +} + +/** + * pango_layout_get_log_attrs_readonly: + * @layout: a #PangoLayout + * @n_attrs: (out): location to store the number of the attributes in + * the array + * + * Retrieves an array of logical attributes for each character in + * the @layout. + * + * This is a faster alternative to pango_layout_get_log_attrs(). + * The returned array is part of @layout and must not be modified. + * Modifying the layout will invalidate the returned array. + * + * The number of attributes returned in @n_attrs will be one more + * than the total number of characters in the layout, since there + * need to be attributes corresponding to both the position before + * the first character and the position after the last character. + * + * Returns: (array length=n_attrs): an array of logical attributes + * + * Since: 1.30 + */ +const PangoLogAttr * +pango_layout_get_log_attrs_readonly (PangoLayout *layout, + gint *n_attrs) +{ + if (n_attrs) + *n_attrs = 0; + g_return_val_if_fail (layout != NULL, NULL); + + pango_layout_check_lines (layout); + + if (n_attrs) + *n_attrs = layout->n_chars + 1; + + return layout->log_attrs; +} + + +/** + * pango_layout_get_line_count: + * @layout: #PangoLayout + * + * Retrieves the count of lines for the @layout. + * + * Return value: the line count. + **/ +int +pango_layout_get_line_count (PangoLayout *layout) +{ + g_return_val_if_fail (layout != NULL, 0); + + pango_layout_check_lines (layout); + return layout->line_count; +} + +/** + * pango_layout_get_lines: + * @layout: a #PangoLayout + * + * Returns the lines of the @layout as a list. + * + * Use the faster pango_layout_get_lines_readonly() if you do not plan + * to modify the contents of the lines (glyphs, glyph widths, etc.). + * + * Return value: (element-type Pango.LayoutLine) (transfer none): a #GSList containing + * the lines in the layout. This points to internal data of the #PangoLayout + * and must be used with care. It will become invalid on any change to the layout's + * text or properties. + **/ +GSList * +pango_layout_get_lines (PangoLayout *layout) +{ + pango_layout_check_lines (layout); + + if (layout->lines) + { + GSList *tmp_list = layout->lines; + while (tmp_list) + { + PangoLayoutLine *line = tmp_list->data; + tmp_list = tmp_list->next; + + pango_layout_line_leaked (line); + } + } + + return layout->lines; +} + +/** + * pango_layout_get_lines_readonly: + * @layout: a #PangoLayout + * + * Returns the lines of the @layout as a list. + * + * This is a faster alternative to pango_layout_get_lines(), + * but the user is not expected + * to modify the contents of the lines (glyphs, glyph widths, etc.). + * + * Return value: (element-type Pango.LayoutLine) (transfer none): a #GSList containing + * the lines in the layout. This points to internal data of the #PangoLayout and + * must be used with care. It will become invalid on any change to the layout's + * text or properties. No changes should be made to the lines. + * + * Since: 1.16 + **/ +GSList * +pango_layout_get_lines_readonly (PangoLayout *layout) +{ + pango_layout_check_lines (layout); + + return layout->lines; +} + +/** + * pango_layout_get_line: + * @layout: a #PangoLayout + * @line: the index of a line, which must be between 0 and + * pango_layout_get_line_count(layout) - 1, inclusive. + * + * Retrieves a particular line from a #PangoLayout. + * + * Use the faster pango_layout_get_line_readonly() if you do not plan + * to modify the contents of the line (glyphs, glyph widths, etc.). + * + * Return value: (transfer none) (nullable): the requested + * #PangoLayoutLine, or %NULL if the index is out of + * range. This layout line can be ref'ed and retained, + * but will become invalid if changes are made to the + * #PangoLayout. + **/ +PangoLayoutLine * +pango_layout_get_line (PangoLayout *layout, + int line) +{ + GSList *list_item; + g_return_val_if_fail (layout != NULL, NULL); + + if (line < 0) + return NULL; + + pango_layout_check_lines (layout); + + list_item = g_slist_nth (layout->lines, line); + + if (list_item) + { + PangoLayoutLine *line = list_item->data; + + pango_layout_line_leaked (line); + return line; + } + + return NULL; +} + +/** + * pango_layout_get_line_readonly: + * @layout: a #PangoLayout + * @line: the index of a line, which must be between 0 and + * pango_layout_get_line_count(layout) - 1, inclusive. + * + * Retrieves a particular line from a #PangoLayout. + * + * This is a faster alternative to pango_layout_get_line(), + * but the user is not expected + * to modify the contents of the line (glyphs, glyph widths, etc.). + * + * Return value: (transfer none) (nullable): the requested + * #PangoLayoutLine, or %NULL if the index is out of + * range. This layout line can be ref'ed and retained, + * but will become invalid if changes are made to the + * #PangoLayout. No changes should be made to the line. + * + * Since: 1.16 + **/ +PangoLayoutLine * +pango_layout_get_line_readonly (PangoLayout *layout, + int line) +{ + GSList *list_item; + g_return_val_if_fail (layout != NULL, NULL); + + if (line < 0) + return NULL; + + pango_layout_check_lines (layout); + + list_item = g_slist_nth (layout->lines, line); + + if (list_item) + { + PangoLayoutLine *line = list_item->data; + return line; + } + + return NULL; +} + +/** + * pango_layout_line_index_to_x: + * @line: a #PangoLayoutLine + * @index_: byte offset of a grapheme within the layout + * @trailing: an integer indicating the edge of the grapheme to retrieve + * the position of. If > 0, the trailing edge of the grapheme, + * if 0, the leading of the grapheme. + * @x_pos: (out): location to store the x_offset (in Pango unit) + * + * Converts an index within a line to a X position. + * + **/ +void +pango_layout_line_index_to_x (PangoLayoutLine *line, + int index, + int trailing, + int *x_pos) +{ + PangoLayout *layout = line->layout; + GSList *run_list = line->runs; + int width = 0; + + while (run_list) + { + PangoLayoutRun *run = run_list->data; + ItemProperties properties; + + pango_layout_get_item_properties (run->item, &properties); + + if (run->item->offset <= index && run->item->offset + run->item->length > index) + { + int offset = g_utf8_pointer_to_offset (layout->text, layout->text + index); + if (trailing) + { + while (index < line->start_index + line->length && + offset + 1 < layout->n_chars && + !layout->log_attrs[offset + 1].is_cursor_position) + { + offset++; + index = g_utf8_next_char (layout->text + index) - layout->text; + } + } + else + { + while (index > line->start_index && + !layout->log_attrs[offset].is_cursor_position) + { + offset--; + index = g_utf8_prev_char (layout->text + index) - layout->text; + } + + } + + pango_glyph_string_index_to_x (run->glyphs, + layout->text + run->item->offset, + run->item->length, + &run->item->analysis, + index - run->item->offset, trailing, x_pos); + if (x_pos) + *x_pos += width; + + return; + } + + width += pango_glyph_string_get_width (run->glyphs); + + run_list = run_list->next; + } + + if (x_pos) + *x_pos = width; +} + +static PangoLayoutLine * +pango_layout_index_to_line (PangoLayout *layout, + int index, + int *line_nr, + PangoLayoutLine **line_before, + PangoLayoutLine **line_after) +{ + GSList *tmp_list; + GSList *line_list; + PangoLayoutLine *line = NULL; + PangoLayoutLine *prev_line = NULL; + int i = -1; + + line_list = tmp_list = layout->lines; + while (tmp_list) + { + PangoLayoutLine *tmp_line = tmp_list->data; + + if (tmp_line->start_index > index) + break; /* index was in paragraph delimiters */ + + prev_line = line; + line = tmp_line; + line_list = tmp_list; + i++; + + if (line->start_index + line->length > index) + break; + + tmp_list = tmp_list->next; + } + + if (line_nr) + *line_nr = i; + + if (line_before) + *line_before = prev_line; + + if (line_after) + *line_after = (line_list && line_list->next) ? line_list->next->data : NULL; + + return line; +} + +static PangoLayoutLine * +pango_layout_index_to_line_and_extents (PangoLayout *layout, + int index, + PangoRectangle *line_rect) +{ + PangoLayoutIter iter; + PangoLayoutLine *line = NULL; + + _pango_layout_get_iter (layout, &iter); + + if (!ITER_IS_INVALID (&iter)) + while (TRUE) + { + PangoLayoutLine *tmp_line = _pango_layout_iter_get_line (&iter); + + if (tmp_line->start_index > index) + break; /* index was in paragraph delimiters */ + + line = tmp_line; + + pango_layout_iter_get_line_extents (&iter, NULL, line_rect); + + if (line->start_index + line->length > index) + break; + + if (!pango_layout_iter_next_line (&iter)) + break; /* Use end of last line */ + } + + _pango_layout_iter_destroy (&iter); + + return line; +} + +/** + * pango_layout_index_to_line_x: + * @layout: a #PangoLayout + * @index_: the byte index of a grapheme within the layout. + * @trailing: an integer indicating the edge of the grapheme to retrieve the + * position of. If > 0, the trailing edge of the grapheme, if 0, + * the leading of the grapheme. + * @line: (out) (allow-none): location to store resulting line index. (which will + * between 0 and pango_layout_get_line_count(layout) - 1), or %NULL + * @x_pos: (out) (allow-none): location to store resulting position within line + * (%PANGO_SCALE units per device unit), or %NULL + * + * Converts from byte @index_ within the @layout to line and X position. + * (X position is measured from the left edge of the line) + */ +void +pango_layout_index_to_line_x (PangoLayout *layout, + int index, + gboolean trailing, + int *line, + int *x_pos) +{ + int line_num; + PangoLayoutLine *layout_line = NULL; + + g_return_if_fail (layout != NULL); + g_return_if_fail (index >= 0); + g_return_if_fail (index <= layout->length); + + pango_layout_check_lines (layout); + + layout_line = pango_layout_index_to_line (layout, index, + &line_num, NULL, NULL); + + if (layout_line) + { + /* use end of line if index was in the paragraph delimiters */ + if (index > layout_line->start_index + layout_line->length) + index = layout_line->start_index + layout_line->length; + + if (line) + *line = line_num; + + pango_layout_line_index_to_x (layout_line, index, trailing, x_pos); + } + else + { + if (line) + *line = -1; + if (x_pos) + *x_pos = -1; + } +} + +/** + * pango_layout_move_cursor_visually: + * @layout: a #PangoLayout. + * @strong: whether the moving cursor is the strong cursor or the + * weak cursor. The strong cursor is the cursor corresponding + * to text insertion in the base direction for the layout. + * @old_index: the byte index of the grapheme for the old index + * @old_trailing: if 0, the cursor was at the leading edge of the + * grapheme indicated by @old_index, if > 0, the cursor + * was at the trailing edge. + * @direction: direction to move cursor. A negative + * value indicates motion to the left. + * @new_index: (out): location to store the new cursor byte index. A value of -1 + * indicates that the cursor has been moved off the beginning + * of the layout. A value of %G_MAXINT indicates that + * the cursor has been moved off the end of the layout. + * @new_trailing: (out): number of characters to move forward from the + * location returned for @new_index to get the position + * where the cursor should be displayed. This allows + * distinguishing the position at the beginning of one + * line from the position at the end of the preceding + * line. @new_index is always on the line where the + * cursor should be displayed. + * + * Computes a new cursor position from an old position and + * a count of positions to move visually. If @direction is positive, + * then the new strong cursor position will be one position + * to the right of the old cursor position. If @direction is negative, + * then the new strong cursor position will be one position + * to the left of the old cursor position. + * + * In the presence of bidirectional text, the correspondence + * between logical and visual order will depend on the direction + * of the current run, and there may be jumps when the cursor + * is moved off of the end of a run. + * + * Motion here is in cursor positions, not in characters, so a + * single call to pango_layout_move_cursor_visually() may move the + * cursor over multiple characters when multiple characters combine + * to form a single grapheme. + **/ +void +pango_layout_move_cursor_visually (PangoLayout *layout, + gboolean strong, + int old_index, + int old_trailing, + int direction, + int *new_index, + int *new_trailing) +{ + PangoLayoutLine *line = NULL; + PangoLayoutLine *prev_line; + PangoLayoutLine *next_line; + + int *log2vis_map; + int *vis2log_map; + int n_vis; + int vis_pos, vis_pos_old, log_pos; + int start_offset; + gboolean off_start = FALSE; + gboolean off_end = FALSE; + + g_return_if_fail (layout != NULL); + g_return_if_fail (old_index >= 0 && old_index <= layout->length); + g_return_if_fail (old_index < layout->length || old_trailing == 0); + g_return_if_fail (new_index != NULL); + g_return_if_fail (new_trailing != NULL); + + direction = (direction >= 0 ? 1 : -1); + + pango_layout_check_lines (layout); + + /* Find the line the old cursor is on */ + line = pango_layout_index_to_line (layout, old_index, + NULL, &prev_line, &next_line); + + start_offset = g_utf8_pointer_to_offset (layout->text, layout->text + line->start_index); + + while (old_trailing--) + old_index = g_utf8_next_char (layout->text + old_index) - layout->text; + + log2vis_map = pango_layout_line_get_log2vis_map (line, strong); + n_vis = pango_utf8_strlen (layout->text + line->start_index, line->length); + + /* Clamp old_index to fit on the line */ + if (old_index > (line->start_index + line->length)) + old_index = line->start_index + line->length; + + vis_pos = log2vis_map[old_index - line->start_index]; + + g_free (log2vis_map); + + /* Handling movement between lines */ + if (vis_pos == 0 && direction < 0) + { + if (line->resolved_dir == PANGO_DIRECTION_LTR) + off_start = TRUE; + else + off_end = TRUE; + } + else if (vis_pos == n_vis && direction > 0) + { + if (line->resolved_dir == PANGO_DIRECTION_LTR) + off_end = TRUE; + else + off_start = TRUE; + } + + if (off_start || off_end) + { + /* If we move over a paragraph boundary, count that as + * an extra position in the motion + */ + gboolean paragraph_boundary; + + if (off_start) + { + if (!prev_line) + { + *new_index = -1; + *new_trailing = 0; + return; + } + line = prev_line; + paragraph_boundary = (line->start_index + line->length != old_index); + } + else + { + if (!next_line) + { + *new_index = G_MAXINT; + *new_trailing = 0; + return; + } + line = next_line; + paragraph_boundary = (line->start_index != old_index); + } + + n_vis = pango_utf8_strlen (layout->text + line->start_index, line->length); + start_offset = g_utf8_pointer_to_offset (layout->text, layout->text + line->start_index); + + if (vis_pos == 0 && direction < 0) + { + vis_pos = n_vis; + if (paragraph_boundary) + vis_pos++; + } + else /* (vis_pos == n_vis && direction > 0) */ + { + vis_pos = 0; + if (paragraph_boundary) + vis_pos--; + } + } + + vis2log_map = pango_layout_line_get_vis2log_map (line, strong); + + vis_pos_old = vis_pos + direction; + log_pos = g_utf8_pointer_to_offset (layout->text + line->start_index, + layout->text + line->start_index + vis2log_map[vis_pos_old]); + do + { + vis_pos += direction; + log_pos += g_utf8_pointer_to_offset (layout->text + line->start_index + vis2log_map[vis_pos_old], + layout->text + line->start_index + vis2log_map[vis_pos]); + vis_pos_old = vis_pos; + } + while (vis_pos > 0 && vis_pos < n_vis && + !layout->log_attrs[start_offset + log_pos].is_cursor_position); + + *new_index = line->start_index + vis2log_map[vis_pos]; + g_free (vis2log_map); + + *new_trailing = 0; + + if (*new_index == line->start_index + line->length && line->length > 0) + { + do + { + log_pos--; + *new_index = g_utf8_prev_char (layout->text + *new_index) - layout->text; + (*new_trailing)++; + } + while (log_pos > 0 && !layout->log_attrs[start_offset + log_pos].is_cursor_position); + } +} + +/** + * pango_layout_xy_to_index: + * @layout: a #PangoLayout + * @x: the X offset (in Pango units) + * from the left edge of the layout. + * @y: the Y offset (in Pango units) + * from the top edge of the layout + * @index_: (out): location to store calculated byte index + * @trailing: (out): location to store a integer indicating where + * in the grapheme the user clicked. It will either + * be zero, or the number of characters in the + * grapheme. 0 represents the leading edge of the grapheme. + * + * Converts from X and Y position within a layout to the byte + * index to the character at that logical position. If the + * Y position is not inside the layout, the closest position is chosen + * (the position will be clamped inside the layout). If the + * X position is not within the layout, then the start or the + * end of the line is chosen as described for pango_layout_line_x_to_index(). + * If either the X or Y positions were not inside the layout, then the + * function returns %FALSE; on an exact hit, it returns %TRUE. + * + * Return value: %TRUE if the coordinates were inside text, %FALSE otherwise. + **/ +gboolean +pango_layout_xy_to_index (PangoLayout *layout, + int x, + int y, + int *index, + gint *trailing) +{ + PangoLayoutIter iter; + PangoLayoutLine *prev_line = NULL; + PangoLayoutLine *found = NULL; + int found_line_x = 0; + int prev_last = 0; + int prev_line_x = 0; + gboolean retval = FALSE; + gboolean outside = FALSE; + + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), FALSE); + + _pango_layout_get_iter (layout, &iter); + + do + { + PangoRectangle line_logical; + int first_y, last_y; + + pango_layout_iter_get_line_extents (&iter, NULL, &line_logical); + pango_layout_iter_get_line_yrange (&iter, &first_y, &last_y); + + if (y < first_y) + { + if (prev_line && y < (prev_last + (first_y - prev_last) / 2)) + { + found = prev_line; + found_line_x = prev_line_x; + } + else + { + if (prev_line == NULL) + outside = TRUE; /* off the top */ + + found = _pango_layout_iter_get_line (&iter); + found_line_x = x - line_logical.x; + } + } + else if (y >= first_y && + y < last_y) + { + found = _pango_layout_iter_get_line (&iter); + found_line_x = x - line_logical.x; + } + + prev_line = _pango_layout_iter_get_line (&iter); + prev_last = last_y; + prev_line_x = x - line_logical.x; + + if (found != NULL) + break; + } + while (pango_layout_iter_next_line (&iter)); + + _pango_layout_iter_destroy (&iter); + + if (found == NULL) + { + /* Off the bottom of the layout */ + outside = TRUE; + + found = prev_line; + found_line_x = prev_line_x; + } + + retval = pango_layout_line_x_to_index (found, + found_line_x, + index, trailing); + + if (outside) + retval = FALSE; + + return retval; +} + +/** + * pango_layout_index_to_pos: + * @layout: a #PangoLayout + * @index_: byte index within @layout + * @pos: (out): rectangle in which to store the position of the grapheme + * + * Converts from an index within a #PangoLayout to the onscreen position + * corresponding to the grapheme at that index, which is represented + * as rectangle. Note that pos->x is always the leading + * edge of the grapheme and pos->x + pos->width the trailing + * edge of the grapheme. If the directionality of the grapheme is right-to-left, + * then pos->width will be negative. + **/ +void +pango_layout_index_to_pos (PangoLayout *layout, + int index, + PangoRectangle *pos) +{ + PangoRectangle logical_rect; + PangoLayoutIter iter; + PangoLayoutLine *layout_line = NULL; + int x_pos; + + g_return_if_fail (layout != NULL); + g_return_if_fail (index >= 0); + g_return_if_fail (pos != NULL); + + _pango_layout_get_iter (layout, &iter); + + if (!ITER_IS_INVALID (&iter)) + { + while (TRUE) + { + PangoLayoutLine *tmp_line = _pango_layout_iter_get_line (&iter); + + if (tmp_line->start_index > index) + { + /* index is in the paragraph delim&iters, move to + * end of previous line + * + * This shouldn’t occur in the first loop &iteration as the first + * line’s start_index should always be 0. + */ + g_assert (layout_line != NULL); + index = layout_line->start_index + layout_line->length; + break; + } + + layout_line = tmp_line; + + pango_layout_iter_get_line_extents (&iter, NULL, &logical_rect); + + if (layout_line->start_index + layout_line->length > index) + break; + + if (!pango_layout_iter_next_line (&iter)) + { + index = layout_line->start_index + layout_line->length; + break; + } + } + + pos->y = logical_rect.y; + pos->height = logical_rect.height; + + pango_layout_line_index_to_x (layout_line, index, 0, &x_pos); + pos->x = logical_rect.x + x_pos; + + if (index < layout_line->start_index + layout_line->length) + { + pango_layout_line_index_to_x (layout_line, index, 1, &x_pos); + pos->width = (logical_rect.x + x_pos) - pos->x; + } + else + pos->width = 0; + } + + _pango_layout_iter_destroy (&iter); +} + +static void +pango_layout_line_get_range (PangoLayoutLine *line, + char **start, + char **end) +{ + char *p; + + p = line->layout->text + line->start_index; + + if (start) + *start = p; + if (end) + *end = p + line->length; +} + +static int * +pango_layout_line_get_vis2log_map (PangoLayoutLine *line, + gboolean strong) +{ + PangoLayout *layout = line->layout; + PangoDirection prev_dir; + PangoDirection cursor_dir; + GSList *tmp_list; + gchar *start, *end; + int *result; + int pos; + int n_chars; + + pango_layout_line_get_range (line, &start, &end); + n_chars = pango_utf8_strlen (start, end - start); + + result = g_new (int, n_chars + 1); + + if (strong) + cursor_dir = line->resolved_dir; + else + cursor_dir = (line->resolved_dir == PANGO_DIRECTION_LTR) ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR; + + /* Handle the first visual position + */ + if (line->resolved_dir == cursor_dir) + result[0] = line->resolved_dir == PANGO_DIRECTION_LTR ? 0 : end - start; + + prev_dir = line->resolved_dir; + pos = 0; + tmp_list = line->runs; + while (tmp_list) + { + PangoLayoutRun *run = tmp_list->data; + int run_n_chars = run->item->num_chars; + PangoDirection run_dir = (run->item->analysis.level % 2) ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR; + char *p = layout->text + run->item->offset; + int i; + + /* pos is the visual position at the start of the run */ + /* p is the logical byte index at the start of the run */ + + if (run_dir == PANGO_DIRECTION_LTR) + { + if ((cursor_dir == PANGO_DIRECTION_LTR) || + (prev_dir == run_dir)) + result[pos] = p - start; + + p = g_utf8_next_char (p); + + for (i = 1; i < run_n_chars; i++) + { + result[pos + i] = p - start; + p = g_utf8_next_char (p); + } + + if (cursor_dir == PANGO_DIRECTION_LTR) + result[pos + run_n_chars] = p - start; + } + else + { + if (cursor_dir == PANGO_DIRECTION_RTL) + result[pos + run_n_chars] = p - start; + + p = g_utf8_next_char (p); + + for (i = 1; i < run_n_chars; i++) + { + result[pos + run_n_chars - i] = p - start; + p = g_utf8_next_char (p); + } + + if ((cursor_dir == PANGO_DIRECTION_RTL) || + (prev_dir == run_dir)) + result[pos] = p - start; + } + + pos += run_n_chars; + prev_dir = run_dir; + tmp_list = tmp_list->next; + } + + /* And the last visual position + */ + if ((cursor_dir == line->resolved_dir) || (prev_dir == line->resolved_dir)) + result[pos] = line->resolved_dir == PANGO_DIRECTION_LTR ? end - start : 0; + + return result; +} + +static int * +pango_layout_line_get_log2vis_map (PangoLayoutLine *line, + gboolean strong) +{ + gchar *start, *end; + int *reverse_map; + int *result; + int i; + int n_chars; + + pango_layout_line_get_range (line, &start, &end); + n_chars = pango_utf8_strlen (start, end - start); + result = g_new0 (int, end - start + 1); + + reverse_map = pango_layout_line_get_vis2log_map (line, strong); + + for (i=0; i <= n_chars; i++) + result[reverse_map[i]] = i; + + g_free (reverse_map); + + return result; +} + +static PangoDirection +pango_layout_line_get_char_direction (PangoLayoutLine *layout_line, + int index) +{ + GSList *run_list; + + run_list = layout_line->runs; + while (run_list) + { + PangoLayoutRun *run = run_list->data; + + if (run->item->offset <= index && run->item->offset + run->item->length > index) + return run->item->analysis.level % 2 ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR; + + run_list = run_list->next; + } + + g_assert_not_reached (); + + return PANGO_DIRECTION_LTR; +} + +/** + * pango_layout_get_cursor_pos: + * @layout: a #PangoLayout + * @index_: the byte index of the cursor + * @strong_pos: (out) (allow-none): location to store the strong cursor position + * (may be %NULL) + * @weak_pos: (out) (allow-none): location to store the weak cursor position (may be %NULL) + * + * Given an index within a layout, determines the positions that of the + * strong and weak cursors if the insertion point is at that + * index. The position of each cursor is stored as a zero-width + * rectangle. The strong cursor location is the location where + * characters of the directionality equal to the base direction of the + * layout are inserted. The weak cursor location is the location + * where characters of the directionality opposite to the base + * direction of the layout are inserted. + **/ +void +pango_layout_get_cursor_pos (PangoLayout *layout, + int index, + PangoRectangle *strong_pos, + PangoRectangle *weak_pos) +{ + PangoDirection dir1; + PangoRectangle line_rect; + PangoLayoutLine *layout_line = NULL; /* Quiet GCC */ + int x1_trailing; + int x2; + + g_return_if_fail (layout != NULL); + g_return_if_fail (index >= 0 && index <= layout->length); + + layout_line = pango_layout_index_to_line_and_extents (layout, index, + &line_rect); + + g_assert (index >= layout_line->start_index); + + /* Examine the trailing edge of the character before the cursor */ + if (index == layout_line->start_index) + { + dir1 = layout_line->resolved_dir; + if (layout_line->resolved_dir == PANGO_DIRECTION_LTR) + x1_trailing = 0; + else + x1_trailing = line_rect.width; + } + else if (index >= layout_line->start_index + layout_line->length) + { + dir1 = layout_line->resolved_dir; + if (layout_line->resolved_dir == PANGO_DIRECTION_LTR) + x1_trailing = line_rect.width; + else + x1_trailing = 0; + } + else + { + gint prev_index = g_utf8_prev_char (layout->text + index) - layout->text; + dir1 = pango_layout_line_get_char_direction (layout_line, prev_index); + pango_layout_line_index_to_x (layout_line, prev_index, TRUE, &x1_trailing); + } + + /* Examine the leading edge of the character after the cursor */ + if (index >= layout_line->start_index + layout_line->length) + { + if (layout_line->resolved_dir == PANGO_DIRECTION_LTR) + x2 = line_rect.width; + else + x2 = 0; + } + else + { + pango_layout_line_index_to_x (layout_line, index, FALSE, &x2); + } + + if (strong_pos) + { + strong_pos->x = line_rect.x; + + if (dir1 == layout_line->resolved_dir) + strong_pos->x += x1_trailing; + else + strong_pos->x += x2; + + strong_pos->y = line_rect.y; + strong_pos->width = 0; + strong_pos->height = line_rect.height; + } + + if (weak_pos) + { + weak_pos->x = line_rect.x; + + if (dir1 == layout_line->resolved_dir) + weak_pos->x += x2; + else + weak_pos->x += x1_trailing; + + weak_pos->y = line_rect.y; + weak_pos->width = 0; + weak_pos->height = line_rect.height; + } +} + +static inline int +direction_simple (PangoDirection d) +{ + switch (d) + { + case PANGO_DIRECTION_LTR : + case PANGO_DIRECTION_WEAK_LTR : + case PANGO_DIRECTION_TTB_RTL : + return 1; + case PANGO_DIRECTION_RTL : + case PANGO_DIRECTION_WEAK_RTL : + case PANGO_DIRECTION_TTB_LTR : + return -1; + case PANGO_DIRECTION_NEUTRAL : + return 0; + /* no default, compiler should complain if a new values is added */ + } + /* not reached */ + return 0; +} + +static PangoAlignment +get_alignment (PangoLayout *layout, + PangoLayoutLine *line) +{ + PangoAlignment alignment = layout->alignment; + + if (alignment != PANGO_ALIGN_CENTER && line->layout->auto_dir && + direction_simple (line->resolved_dir) == + -direction_simple (pango_context_get_base_dir (layout->context))) + { + if (alignment == PANGO_ALIGN_LEFT) + alignment = PANGO_ALIGN_RIGHT; + else if (alignment == PANGO_ALIGN_RIGHT) + alignment = PANGO_ALIGN_LEFT; + } + + return alignment; +} + +static void +get_x_offset (PangoLayout *layout, + PangoLayoutLine *line, + int layout_width, + int line_width, + int *x_offset) +{ + PangoAlignment alignment = get_alignment (layout, line); + + /* Alignment */ + if (layout_width == 0) + *x_offset = 0; + else if (alignment == PANGO_ALIGN_RIGHT) + *x_offset = layout_width - line_width; + else if (alignment == PANGO_ALIGN_CENTER) { + *x_offset = (layout_width - line_width) / 2; + /* hinting */ + if (((layout_width | line_width) & (PANGO_SCALE - 1)) == 0) + { + *x_offset = PANGO_UNITS_ROUND (*x_offset); + } + } else + *x_offset = 0; + + /* Indentation */ + + + /* For center, we ignore indentation; I think I've seen word + * processors that still do the indentation here as if it were + * indented left/right, though we can't sensibly do that without + * knowing whether left/right is the "normal" thing for this text + */ + + if (alignment == PANGO_ALIGN_CENTER) + return; + + if (line->is_paragraph_start) + { + if (layout->indent > 0) + { + if (alignment == PANGO_ALIGN_LEFT) + *x_offset += layout->indent; + else + *x_offset -= layout->indent; + } + } + else + { + if (layout->indent < 0) + { + if (alignment == PANGO_ALIGN_LEFT) + *x_offset -= layout->indent; + else + *x_offset += layout->indent; + } + } +} + +static void +get_line_extents_layout_coords (PangoLayout *layout, + PangoLayoutLine *line, + int layout_width, + int y_offset, + int *baseline, + PangoRectangle *line_ink_layout, + PangoRectangle *line_logical_layout) +{ + int x_offset; + /* Line extents in line coords (origin at line baseline) */ + PangoRectangle line_ink; + PangoRectangle line_logical; + + pango_layout_line_get_extents (line, line_ink_layout ? &line_ink : NULL, + &line_logical); + + get_x_offset (layout, line, layout_width, line_logical.width, &x_offset); + + /* Convert the line's extents into layout coordinates */ + if (line_ink_layout) + { + *line_ink_layout = line_ink; + line_ink_layout->x = line_ink.x + x_offset; + line_ink_layout->y = y_offset - line_logical.y + line_ink.y; + } + + if (line_logical_layout) + { + *line_logical_layout = line_logical; + line_logical_layout->x = line_logical.x + x_offset; + line_logical_layout->y = y_offset; + } + + if (baseline) + *baseline = y_offset - line_logical.y; +} + +/* if non-NULL line_extents returns a list of line extents + * in layout coordinates + */ +static void +pango_layout_get_extents_internal (PangoLayout *layout, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect, + Extents **line_extents) +{ + GSList *line_list; + int y_offset = 0; + int width; + gboolean need_width = FALSE; + int line_index = 0; + + g_return_if_fail (layout != NULL); + + pango_layout_check_lines (layout); + + if (ink_rect && layout->ink_rect_cached) + { + *ink_rect = layout->ink_rect; + ink_rect = NULL; + } + if (logical_rect && layout->logical_rect_cached) + { + *logical_rect = layout->logical_rect; + logical_rect = NULL; + } + if (!ink_rect && !logical_rect && !line_extents) + return; + + /* When we are not wrapping, we need the overall width of the layout to + * figure out the x_offsets of each line. However, we only need the + * x_offsets if we are computing the ink_rect or individual line extents. + */ + width = layout->width; + + if (layout->auto_dir) + { + /* If one of the lines of the layout is not left aligned, then we need + * the width of the layout to calculate line x-offsets; this requires + * looping through the lines for layout->auto_dir. + */ + line_list = layout->lines; + while (line_list && !need_width) + { + PangoLayoutLine *line = line_list->data; + + if (get_alignment (layout, line) != PANGO_ALIGN_LEFT) + need_width = TRUE; + + line_list = line_list->next; + } + } + else if (layout->alignment != PANGO_ALIGN_LEFT) + need_width = TRUE; + + if (width == -1 && need_width && (ink_rect || line_extents)) + { + PangoRectangle overall_logical; + + pango_layout_get_extents_internal (layout, NULL, &overall_logical, NULL); + width = overall_logical.width; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = 0; + logical_rect->width = 0; + logical_rect->height = 0; + } + + + if (line_extents && layout->line_count > 0) + { + *line_extents = g_malloc (sizeof (Extents) * layout->line_count); + } + + line_list = layout->lines; + while (line_list) + { + PangoLayoutLine *line = line_list->data; + /* Line extents in layout coords (origin at 0,0 of the layout) */ + PangoRectangle line_ink_layout; + PangoRectangle line_logical_layout; + + int new_pos; + + /* This block gets the line extents in layout coords */ + { + int baseline; + + get_line_extents_layout_coords (layout, line, + width, y_offset, + &baseline, + ink_rect ? &line_ink_layout : NULL, + &line_logical_layout); + + if (line_extents && layout->line_count > 0) + { + Extents *ext = &(*line_extents)[line_index]; + ext->baseline = baseline; + ext->ink_rect = line_ink_layout; + ext->logical_rect = line_logical_layout; + } + } + + if (ink_rect) + { + /* Compute the union of the current ink_rect with + * line_ink_layout + */ + + if (line_list == layout->lines) + { + *ink_rect = line_ink_layout; + } + else + { + new_pos = MIN (ink_rect->x, line_ink_layout.x); + ink_rect->width = + MAX (ink_rect->x + ink_rect->width, + line_ink_layout.x + line_ink_layout.width) - new_pos; + ink_rect->x = new_pos; + + new_pos = MIN (ink_rect->y, line_ink_layout.y); + ink_rect->height = + MAX (ink_rect->y + ink_rect->height, + line_ink_layout.y + line_ink_layout.height) - new_pos; + ink_rect->y = new_pos; + } + } + + if (logical_rect) + { + if (layout->width == -1) + { + /* When no width is set on layout, we can just compute the max of the + * line lengths to get the horizontal extents ... logical_rect.x = 0. + */ + logical_rect->width = MAX (logical_rect->width, line_logical_layout.width); + } + else + { + /* When a width is set, we have to compute the union of the horizontal + * extents of all the lines. + */ + if (line_list == layout->lines) + { + logical_rect->x = line_logical_layout.x; + logical_rect->width = line_logical_layout.width; + } + else + { + new_pos = MIN (logical_rect->x, line_logical_layout.x); + logical_rect->width = + MAX (logical_rect->x + logical_rect->width, + line_logical_layout.x + line_logical_layout.width) - new_pos; + logical_rect->x = new_pos; + + } + } + + logical_rect->height += line_logical_layout.height; + + /* No space after the last line, of course. */ + if (line_list->next != NULL) + logical_rect->height += layout->spacing; + } + + y_offset += line_logical_layout.height + layout->spacing; + line_list = line_list->next; + line_index ++; + } + + if (ink_rect) + { + layout->ink_rect = *ink_rect; + layout->ink_rect_cached = TRUE; + } + if (logical_rect) + { + layout->logical_rect = *logical_rect; + layout->logical_rect_cached = TRUE; + } +} + +/** + * pango_layout_get_extents: + * @layout: a #PangoLayout + * @ink_rect: (out) (allow-none): rectangle used to store the extents of the + * layout as drawn or %NULL to indicate that the result is + * not needed. + * @logical_rect: (out) (allow-none):rectangle used to store the logical + * extents of the layout or %NULL to indicate that the + * result is not needed. + * + * Computes the logical and ink extents of @layout. Logical extents + * are usually what you want for positioning things. Note that both extents + * may have non-zero x and y. You may want to use those to offset where you + * render the layout. Not doing that is a very typical bug that shows up as + * right-to-left layouts not being correctly positioned in a layout with + * a set width. + * + * The extents are given in layout coordinates and in Pango units; layout + * coordinates begin at the top left corner of the layout. + */ +void +pango_layout_get_extents (PangoLayout *layout, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + g_return_if_fail (layout != NULL); + + pango_layout_get_extents_internal (layout, ink_rect, logical_rect, NULL); +} + +/** + * pango_layout_get_pixel_extents: + * @layout: a #PangoLayout + * @ink_rect: (out) (allow-none): rectangle used to store the extents of the + * layout as drawn or %NULL to indicate that the result is + * not needed. + * @logical_rect: (out) (allow-none): rectangle used to store the logical + * extents of the layout or %NULL to indicate that the + * result is not needed. + * + * Computes the logical and ink extents of @layout in device units. + * This function just calls pango_layout_get_extents() followed by + * two pango_extents_to_pixels() calls, rounding @ink_rect and @logical_rect + * such that the rounded rectangles fully contain the unrounded one (that is, + * passes them as first argument to pango_extents_to_pixels()). + **/ +void +pango_layout_get_pixel_extents (PangoLayout *layout, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + pango_layout_get_extents (layout, ink_rect, logical_rect); + pango_extents_to_pixels (ink_rect, NULL); + pango_extents_to_pixels (logical_rect, NULL); +} + +/** + * pango_layout_get_size: + * @layout: a #PangoLayout + * @width: (out) (allow-none): location to store the logical width, or %NULL + * @height: (out) (allow-none): location to store the logical height, or %NULL + * + * Determines the logical width and height of a #PangoLayout + * in Pango units (device units scaled by %PANGO_SCALE). This + * is simply a convenience function around pango_layout_get_extents(). + **/ +void +pango_layout_get_size (PangoLayout *layout, + int *width, + int *height) +{ + PangoRectangle logical_rect; + + pango_layout_get_extents (layout, NULL, &logical_rect); + + if (width) + *width = logical_rect.width; + if (height) + *height = logical_rect.height; +} + +/** + * pango_layout_get_pixel_size: + * @layout: a #PangoLayout + * @width: (out) (allow-none): location to store the logical width, or %NULL + * @height: (out) (allow-none): location to store the logical height, or %NULL + * + * Determines the logical width and height of a #PangoLayout + * in device units. (pango_layout_get_size() returns the width + * and height scaled by %PANGO_SCALE.) This + * is simply a convenience function around + * pango_layout_get_pixel_extents(). + **/ +void +pango_layout_get_pixel_size (PangoLayout *layout, + int *width, + int *height) +{ + PangoRectangle logical_rect; + + pango_layout_get_pixel_extents (layout, NULL, &logical_rect); + + if (width) + *width = logical_rect.width; + if (height) + *height = logical_rect.height; +} + +/** + * pango_layout_get_baseline: + * @layout: a #PangoLayout + * + * Gets the Y position of baseline of the first line in @layout. + * + * Return value: baseline of first line, from top of @layout. + * + * Since: 1.22 + **/ +int +pango_layout_get_baseline (PangoLayout *layout) +{ + int baseline; + Extents *extents = NULL; + + /* XXX this is kinda inefficient */ + pango_layout_get_extents_internal (layout, NULL, NULL, &extents); + baseline = extents ? extents[0].baseline : 0; + + g_free (extents); + + return baseline; +} + +static void +pango_layout_clear_lines (PangoLayout *layout) +{ + if (layout->lines) + { + GSList *tmp_list = layout->lines; + while (tmp_list) + { + PangoLayoutLine *line = tmp_list->data; + tmp_list = tmp_list->next; + + line->layout = NULL; + pango_layout_line_unref (line); + } + + g_slist_free (layout->lines); + layout->lines = NULL; + layout->line_count = 0; + + /* This could be handled separately, since we don't need to + * recompute log_attrs on a width change, but this is easiest + */ + g_free (layout->log_attrs); + layout->log_attrs = NULL; + } + + layout->unknown_glyphs_count = -1; + layout->logical_rect_cached = FALSE; + layout->ink_rect_cached = FALSE; + layout->is_ellipsized = FALSE; + layout->is_wrapped = FALSE; +} + +static void +pango_layout_line_leaked (PangoLayoutLine *line) +{ + PangoLayoutLinePrivate *private = (PangoLayoutLinePrivate *)line; + + private->cache_status = LEAKED; + + if (line->layout) + { + line->layout->logical_rect_cached = FALSE; + line->layout->ink_rect_cached = FALSE; + } +} + + +/***************** + * Line Breaking * + *****************/ + +static void shape_tab (PangoLayoutLine *line, + PangoGlyphString *glyphs); + +static void +free_run (PangoLayoutRun *run, gpointer data) +{ + gboolean free_item = data != NULL; + if (free_item) + pango_item_free (run->item); + + pango_glyph_string_free (run->glyphs); + g_slice_free (PangoLayoutRun, run); +} + +static PangoItem * +uninsert_run (PangoLayoutLine *line) +{ + PangoLayoutRun *run; + PangoItem *item; + + GSList *tmp_node = line->runs; + + run = tmp_node->data; + item = run->item; + + line->runs = tmp_node->next; + line->length -= item->length; + + g_slist_free_1 (tmp_node); + free_run (run, (gpointer)FALSE); + + return item; +} + +static void +ensure_tab_width (PangoLayout *layout) +{ + if (layout->tab_width == -1) + { + /* Find out how wide 8 spaces are in the context's default + * font. Utter performance killer. :-( + */ + PangoGlyphString *glyphs = pango_glyph_string_new (); + PangoItem *item; + GList *items; + PangoAttribute *attr; + PangoAttrList *layout_attrs; + PangoAttrList *tmp_attrs; + PangoAttrIterator *iter; + PangoFontDescription *font_desc = pango_font_description_copy_static (pango_context_get_font_description (layout->context)); + PangoLanguage *language; + + layout_attrs = pango_layout_get_effective_attributes (layout); + iter = pango_attr_list_get_iterator (layout_attrs); + pango_attr_iterator_get_font (iter, font_desc, &language, NULL); + + tmp_attrs = pango_attr_list_new (); + + attr = pango_attr_font_desc_new (font_desc); + pango_font_description_free (font_desc); + pango_attr_list_insert_before (tmp_attrs, attr); + + if (language) + { + attr = pango_attr_language_new (language); + pango_attr_list_insert_before (tmp_attrs, attr); + } + + items = pango_itemize (layout->context, " ", 0, 1, tmp_attrs, NULL); + + pango_attr_iterator_destroy (iter); + if (layout_attrs != layout->attrs) + { + pango_attr_list_unref (layout_attrs); + layout_attrs = NULL; + } + pango_attr_list_unref (tmp_attrs); + + item = items->data; + pango_shape (" ", 8, &item->analysis, glyphs); + + pango_item_free (item); + g_list_free (items); + + layout->tab_width = pango_glyph_string_get_width (glyphs); + + pango_glyph_string_free (glyphs); + + /* We need to make sure the tab_width is > 0 so finding tab positions + * terminates. This check should be necessary only under extreme + * problems with the font. + */ + if (layout->tab_width <= 0) + layout->tab_width = 50 * PANGO_SCALE; /* pretty much arbitrary */ + } +} + +/* For now we only need the tab position, we assume + * all tabs are left-aligned. + */ +static int +get_tab_pos (PangoLayout *layout, int index, gboolean *is_default) +{ + gint n_tabs; + gboolean in_pixels; + + if (layout->tabs) + { + n_tabs = pango_tab_array_get_size (layout->tabs); + in_pixels = pango_tab_array_get_positions_in_pixels (layout->tabs); + if (is_default) + *is_default = FALSE; + } + else + { + n_tabs = 0; + in_pixels = FALSE; + if (is_default) + *is_default = TRUE; + } + + if (index < n_tabs) + { + gint pos = 0; + + pango_tab_array_get_tab (layout->tabs, index, NULL, &pos); + + if (in_pixels) + return pos * PANGO_SCALE; + else + return pos; + } + + if (n_tabs > 0) + { + /* Extrapolate tab position, repeating the last tab gap to + * infinity. + */ + int last_pos = 0; + int next_to_last_pos = 0; + int tab_width; + + pango_tab_array_get_tab (layout->tabs, n_tabs - 1, NULL, &last_pos); + + if (n_tabs > 1) + pango_tab_array_get_tab (layout->tabs, n_tabs - 2, NULL, &next_to_last_pos); + else + next_to_last_pos = 0; + + if (in_pixels) + { + next_to_last_pos *= PANGO_SCALE; + last_pos *= PANGO_SCALE; + } + + if (last_pos > next_to_last_pos) + { + tab_width = last_pos - next_to_last_pos; + } + else + { + tab_width = layout->tab_width; + } + + return last_pos + tab_width * (index - n_tabs + 1); + } + else + { + /* No tab array set, so use default tab width + */ + return layout->tab_width * index; + } +} + +static int +line_width (PangoLayoutLine *line) +{ + GSList *l; + int i; + int width = 0; + + /* Compute the width of the line currently - inefficient, but easier + * than keeping the current width of the line up to date everywhere + */ + for (l = line->runs; l; l = l->next) + { + PangoLayoutRun *run = l->data; + + for (i=0; i < run->glyphs->num_glyphs; i++) + width += run->glyphs->glyphs[i].geometry.width; + } + + return width; +} + +static void +shape_tab (PangoLayoutLine *line, + PangoGlyphString *glyphs) +{ + int i, space_width; + + int current_width = line_width (line); + + pango_glyph_string_set_size (glyphs, 1); + + glyphs->glyphs[0].glyph = PANGO_GLYPH_EMPTY; + glyphs->glyphs[0].geometry.x_offset = 0; + glyphs->glyphs[0].geometry.y_offset = 0; + glyphs->glyphs[0].attr.is_cluster_start = 1; + + glyphs->log_clusters[0] = 0; + + ensure_tab_width (line->layout); + space_width = line->layout->tab_width / 8; + + for (i=0;;i++) + { + gboolean is_default; + int tab_pos = get_tab_pos (line->layout, i, &is_default); + /* Make sure there is at least a space-width of space between + * tab-aligned text and the text before it. However, only do + * this if no tab array is set on the layout, ie. using default + * tab positions. If use has set tab positions, respect it to + * the pixel. + */ + if (tab_pos >= current_width + (is_default ? space_width : 1)) + { + glyphs->glyphs[0].geometry.width = tab_pos - current_width; + break; + } + } +} + +static inline gboolean +can_break_at (PangoLayout *layout, + gint offset, + gboolean always_wrap_char) +{ + PangoWrapMode wrap; + /* We probably should have a mode where we treat all white-space as + * of fungible width - appropriate for typography but not for + * editing. + */ + wrap = layout->wrap; + + if (wrap == PANGO_WRAP_WORD_CHAR) + wrap = always_wrap_char ? PANGO_WRAP_CHAR : PANGO_WRAP_WORD; + + if (offset == layout->n_chars) + return TRUE; + else if (wrap == PANGO_WRAP_WORD) + return layout->log_attrs[offset].is_line_break; + else if (wrap == PANGO_WRAP_CHAR) + return layout->log_attrs[offset].is_char_break; + else + { + g_warning (G_STRLOC": broken PangoLayout"); + return TRUE; + } +} + +static inline gboolean +can_break_in (PangoLayout *layout, + int start_offset, + int num_chars, + gboolean allow_break_at_start) +{ + int i; + + for (i = allow_break_at_start ? 0 : 1; i < num_chars; i++) + if (can_break_at (layout, start_offset + i, FALSE)) + return TRUE; + + return FALSE; +} + +static inline void +distribute_letter_spacing (int letter_spacing, + int *space_left, + int *space_right) +{ + *space_left = letter_spacing / 2; + /* hinting */ + if ((letter_spacing & (PANGO_SCALE - 1)) == 0) + { + *space_left = PANGO_UNITS_ROUND (*space_left); + } + *space_right = letter_spacing - *space_left; +} + +typedef enum +{ + BREAK_NONE_FIT, + BREAK_SOME_FIT, + BREAK_ALL_FIT, + BREAK_EMPTY_FIT, + BREAK_LINE_SEPARATOR +} BreakResult; + +struct _ParaBreakState +{ + /* maintained per layout */ + int line_height; /* Estimate of height of current line; < 0 is no estimate */ + int remaining_height; /* Remaining height of the layout; only defined if layout->height >= 0 */ + + /* maintained per paragraph */ + PangoAttrList *attrs; /* Attributes being used for itemization */ + GList *items; /* This paragraph turned into items */ + PangoDirection base_dir; /* Current resolved base direction */ + gboolean line_of_par; /* Line of the paragraph, starting at 1 for first line */ + + PangoGlyphString *glyphs; /* Glyphs for the first item in state->items */ + int start_offset; /* Character offset of first item in state->items in layout->text */ + ItemProperties properties; /* Properties for the first item in state->items */ + int *log_widths; /* Logical widths for first item in state->items.. */ + int log_widths_offset; /* Offset into log_widths to the point corresponding + * to the remaining portion of the first item */ + + int line_start_index; /* Start index (byte offset) of line in layout->text */ + int line_start_offset; /* Character offset of line in layout->text */ + + /* maintained per line */ + int line_width; /* Goal width of line currently processing; < 0 is infinite */ + int remaining_width; /* Amount of space remaining on line; < 0 is infinite */ +}; + +static gboolean +should_ellipsize_current_line (PangoLayout *layout, + ParaBreakState *state); + +static PangoGlyphString * +shape_run (PangoLayoutLine *line, + ParaBreakState *state, + PangoItem *item) +{ + PangoLayout *layout = line->layout; + PangoGlyphString *glyphs = pango_glyph_string_new (); + + if (layout->text[item->offset] == '\t') + shape_tab (line, glyphs); + else + { + if (state->properties.shape_set) + _pango_shape_shape (layout->text + item->offset, item->num_chars, + state->properties.shape_ink_rect, state->properties.shape_logical_rect, + glyphs); + else + pango_shape_full (layout->text + item->offset, item->length, + layout->text, layout->length, + &item->analysis, glyphs); + + if (state->properties.letter_spacing) + { + PangoGlyphItem glyph_item; + int space_left, space_right; + + glyph_item.item = item; + glyph_item.glyphs = glyphs; + + pango_glyph_item_letter_space (&glyph_item, + layout->text, + layout->log_attrs + state->start_offset, + state->properties.letter_spacing); + + distribute_letter_spacing (state->properties.letter_spacing, &space_left, &space_right); + + glyphs->glyphs[0].geometry.width += space_left; + glyphs->glyphs[0].geometry.x_offset += space_left; + glyphs->glyphs[glyphs->num_glyphs - 1].geometry.width += space_right; + } + } + + return glyphs; +} + +static void +insert_run (PangoLayoutLine *line, + ParaBreakState *state, + PangoItem *run_item, + gboolean last_run) +{ + PangoLayoutRun *run = g_slice_new (PangoLayoutRun); + + run->item = run_item; + + if (last_run && state->log_widths_offset == 0) + run->glyphs = state->glyphs; + else + run->glyphs = shape_run (line, state, run_item); + + if (last_run) + { + if (state->log_widths_offset > 0) + pango_glyph_string_free (state->glyphs); + state->glyphs = NULL; + g_free (state->log_widths); + state->log_widths = NULL; + } + + line->runs = g_slist_prepend (line->runs, run); + line->length += run_item->length; +} + +#if 0 +# define DEBUG debug +void +debug (const char *where, PangoLayoutLine *line, ParaBreakState *state) +{ + int line_width = pango_layout_line_get_width (line); + + g_debug ("rem %d + line %d = %d %s", + state->remaining_width, + line_width, + state->remaining_width + line_width, + where); +} +#else +# define DEBUG(where, line, state) do { } while (0) +#endif + +/* Tries to insert as much as possible of the item at the head of + * state->items onto @line. Five results are possible: + * + * %BREAK_NONE_FIT: Couldn't fit anything. + * %BREAK_SOME_FIT: The item was broken in the middle. + * %BREAK_ALL_FIT: Everything fit. + * %BREAK_EMPTY_FIT: Nothing fit, but that was ok, as we can break at the first char. + * %BREAK_LINE_SEPARATOR: Item begins with a line separator. + * + * If @force_fit is %TRUE, then %BREAK_NONE_FIT will never + * be returned, a run will be added even if inserting the minimum amount + * will cause the line to overflow. This is used at the start of a line + * and until we've found at least some place to break. + * + * If @no_break_at_end is %TRUE, then %BREAK_ALL_FIT will never be + * returned even everything fits; the run will be broken earlier, + * or %BREAK_NONE_FIT returned. This is used when the end of the + * run is not a break position. + */ +static BreakResult +process_item (PangoLayout *layout, + PangoLayoutLine *line, + ParaBreakState *state, + gboolean force_fit, + gboolean no_break_at_end) +{ + PangoItem *item = state->items->data; + gboolean shape_set = FALSE; + int width; + int length; + int i; + gboolean processing_new_item = FALSE; + + /* Only one character has type G_UNICODE_LINE_SEPARATOR in Unicode 5.0; + * update this if that changes. */ +#define LINE_SEPARATOR 0x2028 + + if (!state->glyphs) + { + pango_layout_get_item_properties (item, &state->properties); + state->glyphs = shape_run (line, state, item); + + state->log_widths = NULL; + state->log_widths_offset = 0; + + processing_new_item = TRUE; + } + + if (!layout->single_paragraph && + g_utf8_get_char (layout->text + item->offset) == LINE_SEPARATOR && + !should_ellipsize_current_line (layout, state)) + { + insert_run (line, state, item, TRUE); + state->log_widths_offset += item->num_chars; + return BREAK_LINE_SEPARATOR; + } + + if (state->remaining_width < 0 && !no_break_at_end) /* Wrapping off */ + { + insert_run (line, state, item, TRUE); + + return BREAK_ALL_FIT; + } + + width = 0; + if (processing_new_item) + { + width = pango_glyph_string_get_width (state->glyphs); + } + else + { + for (i = 0; i < item->num_chars; i++) + width += state->log_widths[state->log_widths_offset + i]; + } + + if ((width <= state->remaining_width || (item->num_chars == 1 && !line->runs)) && + !no_break_at_end) + { + state->remaining_width -= width; + state->remaining_width = MAX (state->remaining_width, 0); + insert_run (line, state, item, TRUE); + + return BREAK_ALL_FIT; + } + else + { + int num_chars = item->num_chars; + int break_num_chars = num_chars; + int break_width = width; + int orig_width = width; + gboolean retrying_with_char_breaks = FALSE; + + if (processing_new_item) + { + PangoGlyphItem glyph_item = {item, state->glyphs}; + state->log_widths = g_new (int, item->num_chars); + pango_glyph_item_get_logical_widths (&glyph_item, layout->text, state->log_widths); + } + + retry_break: + + /* See how much of the item we can stuff in the line. */ + width = 0; + for (num_chars = 0; num_chars < item->num_chars; num_chars++) + { + if (width > state->remaining_width && break_num_chars < item->num_chars) + break; + + /* If there are no previous runs we have to take care to grab at least one char. */ + if (can_break_at (layout, state->start_offset + num_chars, retrying_with_char_breaks) && + (num_chars > 0 || line->runs)) + { + break_num_chars = num_chars; + break_width = width; + } + + width += state->log_widths[state->log_widths_offset + num_chars]; + } + + /* If there's a space at the end of the line, include that also. + * The logic here should match zero_line_final_space(). + * XXX Currently it doesn't quite match the logic there. We don't check + * the cluster here. But should be fine in practice. */ + if (break_num_chars > 0 && break_num_chars < item->num_chars && + layout->log_attrs[state->start_offset + break_num_chars - 1].is_white) + { + break_width -= state->log_widths[state->log_widths_offset + break_num_chars - 1]; + } + + if (layout->wrap == PANGO_WRAP_WORD_CHAR && force_fit && break_width > state->remaining_width && !retrying_with_char_breaks) + { + retrying_with_char_breaks = TRUE; + num_chars = item->num_chars; + width = orig_width; + break_num_chars = num_chars; + break_width = width; + goto retry_break; + } + + if (force_fit || break_width <= state->remaining_width) /* Successfully broke the item */ + { + if (state->remaining_width >= 0) + { + state->remaining_width -= break_width; + state->remaining_width = MAX (state->remaining_width, 0); + } + + if (break_num_chars == item->num_chars) + { + insert_run (line, state, item, TRUE); + + return BREAK_ALL_FIT; + } + else if (break_num_chars == 0) + { + return BREAK_EMPTY_FIT; + } + else + { + PangoItem *new_item; + + length = g_utf8_offset_to_pointer (layout->text + item->offset, break_num_chars) - (layout->text + item->offset); + + new_item = pango_item_split (item, length, break_num_chars); + + /* Add the width back, to the line, reshape, subtract the new width */ + state->remaining_width += break_width; + insert_run (line, state, new_item, FALSE); + break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs); + state->remaining_width -= break_width; + + state->log_widths_offset += break_num_chars; + + /* Shaped items should never be broken */ + g_assert (!shape_set); + + return BREAK_SOME_FIT; + } + } + else + { + pango_glyph_string_free (state->glyphs); + state->glyphs = NULL; + g_free (state->log_widths); + state->log_widths = NULL; + + return BREAK_NONE_FIT; + } + } +} + +/* The resolved direction for the line is always one + * of LTR/RTL; not a week or neutral directions + */ +static void +line_set_resolved_dir (PangoLayoutLine *line, + PangoDirection direction) +{ + switch (direction) + { + default: + case PANGO_DIRECTION_LTR: + case PANGO_DIRECTION_TTB_RTL: + case PANGO_DIRECTION_WEAK_LTR: + case PANGO_DIRECTION_NEUTRAL: + line->resolved_dir = PANGO_DIRECTION_LTR; + break; + case PANGO_DIRECTION_RTL: + case PANGO_DIRECTION_WEAK_RTL: + case PANGO_DIRECTION_TTB_LTR: + line->resolved_dir = PANGO_DIRECTION_RTL; + break; + } + + /* The direction vs. gravity dance: + * - If gravity is SOUTH, leave direction untouched. + * - If gravity is NORTH, switch direction. + * - If gravity is EAST, set to LTR, as + * it's a clockwise-rotated layout, so the rotated + * top is unrotated left. + * - If gravity is WEST, set to RTL, as + * it's a counter-clockwise-rotated layout, so the rotated + * top is unrotated right. + * + * A similar dance is performed in pango-context.c: + * itemize_state_add_character(). Keep in synch. + */ + switch (pango_context_get_gravity (line->layout->context)) + { + default: + case PANGO_GRAVITY_AUTO: + case PANGO_GRAVITY_SOUTH: + break; + case PANGO_GRAVITY_NORTH: + line->resolved_dir = PANGO_DIRECTION_LTR + + PANGO_DIRECTION_RTL + - line->resolved_dir; + break; + case PANGO_GRAVITY_EAST: + /* This is in fact why deprecated TTB_RTL is LTR */ + line->resolved_dir = PANGO_DIRECTION_LTR; + break; + case PANGO_GRAVITY_WEST: + /* This is in fact why deprecated TTB_LTR is RTL */ + line->resolved_dir = PANGO_DIRECTION_RTL; + break; + } +} + +static gboolean +should_ellipsize_current_line (PangoLayout *layout, + ParaBreakState *state) +{ + if (G_LIKELY (layout->ellipsize == PANGO_ELLIPSIZE_NONE || layout->width < 0)) + return FALSE; + + + if (layout->height >= 0) + { + /* state->remaining_height is height of layout left */ + + /* if we can't stuff two more lines at the current guess of line height, + * the line we are going to produce is going to be the last line */ + return state->line_height * 2 > state->remaining_height; + } + else + { + /* -layout->height is number of lines per paragraph to show */ + return state->line_of_par == - layout->height; + } +} + +static void +add_line (PangoLayoutLine *line, + ParaBreakState *state) +{ + PangoLayout *layout = line->layout; + + /* we prepend, then reverse the list later */ + layout->lines = g_slist_prepend (layout->lines, line); + layout->line_count++; + + if (layout->height >= 0) + { + PangoRectangle logical_rect; + pango_layout_line_get_extents (line, NULL, &logical_rect); + state->remaining_height -= logical_rect.height; + state->remaining_height -= layout->spacing; + state->line_height = logical_rect.height; + } +} + +static void +process_line (PangoLayout *layout, + ParaBreakState *state) +{ + PangoLayoutLine *line; + + gboolean have_break = FALSE; /* If we've seen a possible break yet */ + int break_remaining_width = 0; /* Remaining width before adding run with break */ + int break_start_offset = 0; /* Start offset before adding run with break */ + GSList *break_link = NULL; /* Link holding run before break */ + gboolean wrapped = FALSE; /* If we had to wrap the line */ + + line = pango_layout_line_new (layout); + line->start_index = state->line_start_index; + line->is_paragraph_start = state->line_of_par == 1; + line_set_resolved_dir (line, state->base_dir); + + state->line_width = layout->width; + if (state->line_width >= 0 && layout->alignment != PANGO_ALIGN_CENTER) + { + if (line->is_paragraph_start && layout->indent >= 0) + state->line_width -= layout->indent; + else if (!line->is_paragraph_start && layout->indent < 0) + state->line_width += layout->indent; + + if (state->line_width < 0) + state->line_width = 0; + } + + if (G_UNLIKELY (should_ellipsize_current_line (layout, state))) + state->remaining_width = -1; + else + state->remaining_width = state->line_width; + DEBUG ("starting to fill line", line, state); + + while (state->items) + { + PangoItem *item = state->items->data; + BreakResult result; + int old_num_chars; + int old_remaining_width; + gboolean first_item_in_line; + + old_num_chars = item->num_chars; + old_remaining_width = state->remaining_width; + first_item_in_line = line->runs != NULL; + + result = process_item (layout, line, state, !have_break, FALSE); + + switch (result) + { + case BREAK_ALL_FIT: + if (can_break_in (layout, state->start_offset, old_num_chars, first_item_in_line)) + { + have_break = TRUE; + break_remaining_width = old_remaining_width; + break_start_offset = state->start_offset; + break_link = line->runs->next; + } + + state->items = g_list_delete_link (state->items, state->items); + state->start_offset += old_num_chars; + + break; + + case BREAK_EMPTY_FIT: + wrapped = TRUE; + goto done; + + case BREAK_SOME_FIT: + state->start_offset += old_num_chars - item->num_chars; + wrapped = TRUE; + goto done; + + case BREAK_NONE_FIT: + /* Back up over unused runs to run where there is a break */ + while (line->runs && line->runs != break_link) + state->items = g_list_prepend (state->items, uninsert_run (line)); + + state->start_offset = break_start_offset; + state->remaining_width = break_remaining_width; + + /* Reshape run to break */ + item = state->items->data; + + old_num_chars = item->num_chars; + result = process_item (layout, line, state, TRUE, TRUE); + g_assert (result == BREAK_SOME_FIT || result == BREAK_EMPTY_FIT); + + state->start_offset += old_num_chars - item->num_chars; + + wrapped = TRUE; + goto done; + + case BREAK_LINE_SEPARATOR: + state->items = g_list_delete_link (state->items, state->items); + state->start_offset += old_num_chars; + /* A line-separate is just a forced break. Set wrapped, so we do + * justification */ + wrapped = TRUE; + goto done; + } + } + + done: + pango_layout_line_postprocess (line, state, wrapped); + add_line (line, state); + state->line_of_par++; + state->line_start_index += line->length; + state->line_start_offset = state->start_offset; +} + +static void +get_items_log_attrs (const char *text, + GList *items, + PangoLogAttr *log_attrs, + int para_delimiter_len) +{ + int offset = 0; + int index = 0; + + while (items) + { + PangoItem tmp_item = *(PangoItem *)items->data; + + /* Accumulate all the consecutive items that match in language + * characteristics, ignoring font, style tags, etc. + */ + while (items->next) + { + PangoItem *next_item = items->next->data; + + /* FIXME: Handle language tags */ + if (next_item->analysis.lang_engine != tmp_item.analysis.lang_engine) + break; + else + { + tmp_item.length += next_item->length; + tmp_item.num_chars += next_item->num_chars; + } + + items = items->next; + } + + /* Break the paragraph delimiters with the last item */ + if (items->next == NULL) + { + tmp_item.num_chars += pango_utf8_strlen (text + index + tmp_item.length, para_delimiter_len); + tmp_item.length += para_delimiter_len; + } + + /* XXX This is wrong. we should call pango_default_break on the entire + * layout text and then tailor_break on each lang_engine change, like + * pango_get_log_attrs does. + */ + pango_break (text + index, tmp_item.length, &tmp_item.analysis, + log_attrs + offset, tmp_item.num_chars + 1); + + offset += tmp_item.num_chars; + index += tmp_item.length; + + items = items->next; + } +} + +static PangoAttrList * +pango_layout_get_effective_attributes (PangoLayout *layout) +{ + PangoAttrList *attrs; + + if (layout->attrs) + attrs = pango_attr_list_copy (layout->attrs); + else + attrs = pango_attr_list_new (); + + if (layout->font_desc) + { + PangoAttribute *attr = pango_attr_font_desc_new (layout->font_desc); + pango_attr_list_insert_before (attrs, attr); + } + + return attrs; +} + +static gboolean +no_shape_filter_func (PangoAttribute *attribute, + gpointer data G_GNUC_UNUSED) +{ + static const PangoAttrType no_shape_types[] = { + PANGO_ATTR_FOREGROUND, + PANGO_ATTR_BACKGROUND, + PANGO_ATTR_UNDERLINE, + PANGO_ATTR_STRIKETHROUGH, + PANGO_ATTR_RISE + /* Ideally we want font-features here, because we don't + * want it to break shaping runs. But if we put it here, + * it won't show up in the shaper anymore :(. To be + * fixed later. */ + /* PANGO_ATTR_FONT_FEATURES */ + }; + + int i; + + for (i = 0; i < (int)G_N_ELEMENTS (no_shape_types); i++) + if (attribute->klass->type == no_shape_types[i]) + return TRUE; + + return FALSE; +} + +static PangoAttrList * +filter_no_shape_attributes (PangoAttrList *attrs) +{ + return pango_attr_list_filter (attrs, + no_shape_filter_func, + NULL); +} + +static void +apply_no_shape_attributes (PangoLayout *layout, + PangoAttrList *no_shape_attrs) +{ + GSList *line_list; + + for (line_list = layout->lines; line_list; line_list = line_list->next) + { + PangoLayoutLine *line = line_list->data; + GSList *old_runs = g_slist_reverse (line->runs); + GSList *run_list; + + line->runs = NULL; + for (run_list = old_runs; run_list; run_list = run_list->next) + { + PangoGlyphItem *glyph_item = run_list->data; + GSList *new_runs; + + new_runs = pango_glyph_item_apply_attrs (glyph_item, + layout->text, + no_shape_attrs); + + line->runs = g_slist_concat (new_runs, line->runs); + } + + g_slist_free (old_runs); + } +} + +static void +pango_layout_check_lines (PangoLayout *layout) +{ + const char *start; + gboolean done = FALSE; + int start_offset; + PangoAttrList *attrs; + PangoAttrList *no_shape_attrs; + PangoAttrIterator *iter; + PangoDirection prev_base_dir = PANGO_DIRECTION_NEUTRAL, base_dir = PANGO_DIRECTION_NEUTRAL; + ParaBreakState state; + + check_context_changed (layout); + + if (G_LIKELY (layout->lines)) + return; + + g_assert (!layout->log_attrs); + + /* For simplicity, we make sure at this point that layout->text + * is non-NULL even if it is zero length + */ + if (G_UNLIKELY (!layout->text)) + pango_layout_set_text (layout, NULL, 0); + + attrs = pango_layout_get_effective_attributes (layout); + no_shape_attrs = filter_no_shape_attributes (attrs); + iter = pango_attr_list_get_iterator (attrs); + + layout->log_attrs = g_new (PangoLogAttr, layout->n_chars + 1); + + start_offset = 0; + start = layout->text; + + /* Find the first strong direction of the text */ + if (layout->auto_dir) + { + prev_base_dir = pango_find_base_dir (layout->text, layout->length); + if (prev_base_dir == PANGO_DIRECTION_NEUTRAL) + prev_base_dir = pango_context_get_base_dir (layout->context); + } + else + base_dir = pango_context_get_base_dir (layout->context); + + /* these are only used if layout->height >= 0 */ + state.remaining_height = layout->height; + state.line_height = -1; + if (layout->height >= 0) + { + PangoRectangle logical; + pango_layout_get_empty_extents_at_index (layout, 0, &logical); + state.line_height = logical.height; + } + + do + { + int delim_len; + const char *end; + int delimiter_index, next_para_index; + + if (layout->single_paragraph) + { + delimiter_index = layout->length; + next_para_index = layout->length; + } + else + { + pango_find_paragraph_boundary (start, + (layout->text + layout->length) - start, + &delimiter_index, + &next_para_index); + } + + g_assert (next_para_index >= delimiter_index); + + if (layout->auto_dir) + { + base_dir = pango_find_base_dir (start, delimiter_index); + + /* Propagate the base direction for neutral paragraphs */ + if (base_dir == PANGO_DIRECTION_NEUTRAL) + base_dir = prev_base_dir; + else + prev_base_dir = base_dir; + } + + end = start + delimiter_index; + + delim_len = next_para_index - delimiter_index; + + if (end == (layout->text + layout->length)) + done = TRUE; + + g_assert (end <= (layout->text + layout->length)); + g_assert (start <= (layout->text + layout->length)); + g_assert (delim_len < 4); /* PS is 3 bytes */ + g_assert (delim_len >= 0); + + state.attrs = attrs; + state.items = pango_itemize_with_base_dir (layout->context, + base_dir, + layout->text, + start - layout->text, + end - start, + attrs, + iter); + + get_items_log_attrs (start, state.items, + layout->log_attrs + start_offset, + delim_len); + + state.base_dir = base_dir; + state.line_of_par = 1; + state.start_offset = start_offset; + state.line_start_offset = start_offset; + state.line_start_index = start - layout->text; + + state.glyphs = NULL; + state.log_widths = NULL; + + /* for deterministic bug hunting's sake set everything! */ + state.line_width = -1; + state.remaining_width = -1; + state.log_widths_offset = 0; + + if (state.items) + { + while (state.items) + process_line (layout, &state); + } + else + { + PangoLayoutLine *empty_line; + + empty_line = pango_layout_line_new (layout); + empty_line->start_index = state.line_start_index; + empty_line->is_paragraph_start = TRUE; + line_set_resolved_dir (empty_line, base_dir); + + add_line (empty_line, &state); + } + + if (layout->height >= 0 && state.remaining_height < state.line_height) + done = TRUE; + + if (!done) + start_offset += pango_utf8_strlen (start, (end - start) + delim_len); + + start = end + delim_len; + } + while (!done); + + pango_attr_iterator_destroy (iter); + pango_attr_list_unref (attrs); + + if (no_shape_attrs) + { + apply_no_shape_attributes (layout, no_shape_attrs); + pango_attr_list_unref (no_shape_attrs); + } + + layout->lines = g_slist_reverse (layout->lines); +} + +/** + * pango_layout_line_ref: + * @line: (nullable): a #PangoLayoutLine, may be %NULL + * + * Increase the reference count of a #PangoLayoutLine by one. + * + * Return value: the line passed in. + * + * Since: 1.10 + **/ +PangoLayoutLine * +pango_layout_line_ref (PangoLayoutLine *line) +{ + PangoLayoutLinePrivate *private = (PangoLayoutLinePrivate *)line; + + if (line == NULL) + return NULL; + + g_atomic_int_inc ((int *) &private->ref_count); + + return line; +} + +/** + * pango_layout_line_unref: + * @line: a #PangoLayoutLine + * + * Decrease the reference count of a #PangoLayoutLine by one. + * If the result is zero, the line and all associated memory + * will be freed. + **/ +void +pango_layout_line_unref (PangoLayoutLine *line) +{ + PangoLayoutLinePrivate *private = (PangoLayoutLinePrivate *)line; + + if (line == NULL) + return; + + g_return_if_fail (private->ref_count > 0); + + if (g_atomic_int_dec_and_test ((int *) &private->ref_count)) + { + g_slist_foreach (line->runs, (GFunc)free_run, GINT_TO_POINTER (1)); + g_slist_free (line->runs); + g_slice_free (PangoLayoutLinePrivate, private); + } +} + +G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, + pango_layout_line_ref, + pango_layout_line_unref); + +/** + * pango_layout_line_x_to_index: + * @line: a #PangoLayoutLine + * @x_pos: the X offset (in Pango units) + * from the left edge of the line. + * @index_: (out): location to store calculated byte index for + * the grapheme in which the user clicked. + * @trailing: (out): location to store an integer indicating where + * in the grapheme the user clicked. It will either + * be zero, or the number of characters in the + * grapheme. 0 represents the leading edge of the grapheme. + * + * Converts from x offset to the byte index of the corresponding + * character within the text of the layout. If @x_pos is outside the line, + * @index_ and @trailing will point to the very first or very last position + * in the line. This determination is based on the resolved direction + * of the paragraph; for example, if the resolved direction is + * right-to-left, then an X position to the right of the line (after it) + * results in 0 being stored in @index_ and @trailing. An X position to the + * left of the line results in @index_ pointing to the (logical) last + * grapheme in the line and @trailing being set to the number of characters + * in that grapheme. The reverse is true for a left-to-right line. + * + * Return value: %FALSE if @x_pos was outside the line, %TRUE if inside + **/ +gboolean +pango_layout_line_x_to_index (PangoLayoutLine *line, + int x_pos, + int *index, + int *trailing) +{ + GSList *tmp_list; + gint start_pos = 0; + gint first_index = 0; /* line->start_index */ + gint first_offset; + gint last_index; /* start of last grapheme in line */ + gint last_offset; + gint end_index; /* end iterator for line */ + gint end_offset; /* end iterator for line */ + PangoLayout *layout; + gint last_trailing; + gboolean suppress_last_trailing; + + g_return_val_if_fail (LINE_IS_VALID (line), FALSE); + + layout = line->layout; + + /* Find the last index in the line + */ + first_index = line->start_index; + + if (line->length == 0) + { + if (index) + *index = first_index; + if (trailing) + *trailing = 0; + + return FALSE; + } + + g_assert (line->length > 0); + + first_offset = g_utf8_pointer_to_offset (layout->text, layout->text + line->start_index); + + end_index = first_index + line->length; + end_offset = first_offset + g_utf8_pointer_to_offset (layout->text + first_index, layout->text + end_index); + + last_index = end_index; + last_offset = end_offset; + last_trailing = 0; + do + { + last_index = g_utf8_prev_char (layout->text + last_index) - layout->text; + last_offset--; + last_trailing++; + } + while (last_offset > first_offset && !layout->log_attrs[last_offset].is_cursor_position); + + /* This is a HACK. If a program only keeps track of cursor (etc) + * indices and not the trailing flag, then the trailing index of the + * last character on a wrapped line is identical to the leading + * index of the next line. So, we fake it and set the trailing flag + * to zero. + * + * That is, if the text is "now is the time", and is broken between + * 'now' and 'is' + * + * Then when the cursor is actually at: + * + * n|o|w| |i|s| + * ^ + * we lie and say it is at: + * + * n|o|w| |i|s| + * ^ + * + * So the cursor won't appear on the next line before 'the'. + * + * Actually, any program keeping cursor + * positions with wrapped lines should distinguish leading and + * trailing cursors. + */ + tmp_list = layout->lines; + while (tmp_list->data != line) + tmp_list = tmp_list->next; + + if (tmp_list->next && + line->start_index + line->length == ((PangoLayoutLine *)tmp_list->next->data)->start_index) + suppress_last_trailing = TRUE; + else + suppress_last_trailing = FALSE; + + if (x_pos < 0) + { + /* pick the leftmost char */ + if (index) + *index = (line->resolved_dir == PANGO_DIRECTION_LTR) ? first_index : last_index; + /* and its leftmost edge */ + if (trailing) + *trailing = (line->resolved_dir == PANGO_DIRECTION_LTR || suppress_last_trailing) ? 0 : last_trailing; + + return FALSE; + } + + tmp_list = line->runs; + while (tmp_list) + { + PangoLayoutRun *run = tmp_list->data; + int logical_width; + + logical_width = pango_glyph_string_get_width (run->glyphs); + + if (x_pos >= start_pos && x_pos < start_pos + logical_width) + { + int offset; + gboolean char_trailing; + int grapheme_start_index; + int grapheme_start_offset; + int grapheme_end_offset; + int pos; + int char_index; + + pango_glyph_string_x_to_index (run->glyphs, + layout->text + run->item->offset, run->item->length, + &run->item->analysis, + x_pos - start_pos, + &pos, &char_trailing); + + char_index = run->item->offset + pos; + + /* Convert from characters to graphemes */ + + offset = g_utf8_pointer_to_offset (layout->text, layout->text + char_index); + + grapheme_start_offset = offset; + grapheme_start_index = char_index; + while (grapheme_start_offset > first_offset && + !layout->log_attrs[grapheme_start_offset].is_cursor_position) + { + grapheme_start_index = g_utf8_prev_char (layout->text + grapheme_start_index) - layout->text; + grapheme_start_offset--; + } + + grapheme_end_offset = offset; + do + { + grapheme_end_offset++; + } + while (grapheme_end_offset < end_offset && + !layout->log_attrs[grapheme_end_offset].is_cursor_position); + + if (index) + *index = grapheme_start_index; + + if (trailing) + { + if ((grapheme_end_offset == end_offset && suppress_last_trailing) || + offset + char_trailing <= (grapheme_start_offset + grapheme_end_offset) / 2) + *trailing = 0; + else + *trailing = grapheme_end_offset - grapheme_start_offset; + } + + return TRUE; + } + + start_pos += logical_width; + tmp_list = tmp_list->next; + } + + /* pick the rightmost char */ + if (index) + *index = (line->resolved_dir == PANGO_DIRECTION_LTR) ? last_index : first_index; + + /* and its rightmost edge */ + if (trailing) + *trailing = (line->resolved_dir == PANGO_DIRECTION_LTR && !suppress_last_trailing) ? last_trailing : 0; + + return FALSE; +} + +static int +pango_layout_line_get_width (PangoLayoutLine *line) +{ + int width = 0; + GSList *tmp_list = line->runs; + + while (tmp_list) + { + PangoLayoutRun *run = tmp_list->data; + + width += pango_glyph_string_get_width (run->glyphs); + + tmp_list = tmp_list->next; + } + + return width; +} + +/** + * pango_layout_line_get_x_ranges: + * @line: a #PangoLayoutLine + * @start_index: Start byte index of the logical range. If this value + * is less than the start index for the line, then + * the first range will extend all the way to the leading + * edge of the layout. Otherwise it will start at the + * leading edge of the first character. + * @end_index: Ending byte index of the logical range. If this value + * is greater than the end index for the line, then + * the last range will extend all the way to the trailing + * edge of the layout. Otherwise, it will end at the + * trailing edge of the last character. + * @ranges: (out) (array length=n_ranges) (transfer full): + * location to store a pointer to an array of ranges. + * The array will be of length 2*n_ranges, + * with each range starting at (*ranges)[2*n] + * and of width (*ranges)[2*n + 1] - (*ranges)[2*n]. + * This array must be freed with g_free(). The coordinates are relative + * to the layout and are in Pango units. + * @n_ranges: The number of ranges stored in @ranges. + * + * Gets a list of visual ranges corresponding to a given logical range. + * This list is not necessarily minimal - there may be consecutive + * ranges which are adjacent. The ranges will be sorted from left to + * right. The ranges are with respect to the left edge of the entire + * layout, not with respect to the line. + **/ +void +pango_layout_line_get_x_ranges (PangoLayoutLine *line, + int start_index, + int end_index, + int **ranges, + int *n_ranges) +{ + gint line_start_index = 0; + GSList *tmp_list; + int range_count = 0; + int accumulated_width = 0; + int x_offset; + int width, line_width; + PangoAlignment alignment; + + g_return_if_fail (line != NULL); + g_return_if_fail (line->layout != NULL); + g_return_if_fail (start_index <= end_index); + + alignment = get_alignment (line->layout, line); + + width = line->layout->width; + if (width == -1 && alignment != PANGO_ALIGN_LEFT) + { + PangoRectangle logical_rect; + pango_layout_get_extents (line->layout, NULL, &logical_rect); + width = logical_rect.width; + } + + /* FIXME: The computations here could be optimized, by moving the + * computations of the x_offset after we go through and figure + * out where each range is. + */ + + { + PangoRectangle logical_rect; + pango_layout_line_get_extents (line, NULL, &logical_rect); + line_width = logical_rect.width; + } + + get_x_offset (line->layout, line, width, line_width, &x_offset); + + line_start_index = line->start_index; + + /* Allocate the maximum possible size */ + if (ranges) + *ranges = g_new (int, 2 * (2 + g_slist_length (line->runs))); + + if (x_offset > 0 && + ((line->resolved_dir == PANGO_DIRECTION_LTR && start_index < line_start_index) || + (line->resolved_dir == PANGO_DIRECTION_RTL && end_index > line_start_index + line->length))) + { + if (ranges) + { + (*ranges)[2*range_count] = 0; + (*ranges)[2*range_count + 1] = x_offset; + } + + range_count ++; + } + + tmp_list = line->runs; + while (tmp_list) + { + PangoLayoutRun *run = (PangoLayoutRun *)tmp_list->data; + + if ((start_index < run->item->offset + run->item->length && + end_index > run->item->offset)) + { + if (ranges) + { + int run_start_index = MAX (start_index, run->item->offset); + int run_end_index = MIN (end_index, run->item->offset + run->item->length); + int run_start_x, run_end_x; + + g_assert (run_end_index > 0); + + /* Back the end_index off one since we want to find the trailing edge of the preceding character */ + + run_end_index = g_utf8_prev_char (line->layout->text + run_end_index) - line->layout->text; + + pango_glyph_string_index_to_x (run->glyphs, + line->layout->text + run->item->offset, + run->item->length, + &run->item->analysis, + run_start_index - run->item->offset, FALSE, + &run_start_x); + pango_glyph_string_index_to_x (run->glyphs, + line->layout->text + run->item->offset, + run->item->length, + &run->item->analysis, + run_end_index - run->item->offset, TRUE, + &run_end_x); + + (*ranges)[2*range_count] = x_offset + accumulated_width + MIN (run_start_x, run_end_x); + (*ranges)[2*range_count + 1] = x_offset + accumulated_width + MAX (run_start_x, run_end_x); + } + + range_count++; + } + + if (tmp_list->next) + accumulated_width += pango_glyph_string_get_width (run->glyphs); + + tmp_list = tmp_list->next; + } + + if (x_offset + line_width < line->layout->width && + ((line->resolved_dir == PANGO_DIRECTION_LTR && end_index > line_start_index + line->length) || + (line->resolved_dir == PANGO_DIRECTION_RTL && start_index < line_start_index))) + { + if (ranges) + { + (*ranges)[2*range_count] = x_offset + line_width; + (*ranges)[2*range_count + 1] = line->layout->width; + } + + range_count ++; + } + + if (n_ranges) + *n_ranges = range_count; +} + +static void +pango_layout_get_empty_extents_at_index (PangoLayout *layout, + int index, + PangoRectangle *logical_rect) +{ + if (logical_rect) + { + PangoFont *font; + PangoFontDescription *font_desc = NULL; + gboolean free_font_desc = FALSE; + + font_desc = pango_context_get_font_description (layout->context); + + if (layout->font_desc) + { + font_desc = pango_font_description_copy_static (font_desc); + pango_font_description_merge (font_desc, layout->font_desc, TRUE); + free_font_desc = TRUE; + } + + /* Find the font description for this line + */ + if (layout->attrs) + { + PangoAttrIterator *iter = pango_attr_list_get_iterator (layout->attrs); + int start, end; + + do + { + pango_attr_iterator_range (iter, &start, &end); + + if (start <= index && index < end) + { + if (!free_font_desc) + { + font_desc = pango_font_description_copy_static (font_desc); + free_font_desc = TRUE; + } + + pango_attr_iterator_get_font (iter, + font_desc, + NULL, + NULL); + + break; + } + + } + while (pango_attr_iterator_next (iter)); + + pango_attr_iterator_destroy (iter); + } + + font = pango_context_load_font (layout->context, font_desc); + if (font) + { + PangoFontMetrics *metrics; + + metrics = pango_font_get_metrics (font, + pango_context_get_language (layout->context)); + + if (metrics) + { + logical_rect->y = - pango_font_metrics_get_ascent (metrics); + logical_rect->height = - logical_rect->y + pango_font_metrics_get_descent (metrics); + + pango_font_metrics_unref (metrics); + } + else + { + logical_rect->y = 0; + logical_rect->height = 0; + } + g_object_unref (font); + } + else + { + logical_rect->y = 0; + logical_rect->height = 0; + } + + if (free_font_desc) + pango_font_description_free (font_desc); + + logical_rect->x = 0; + logical_rect->width = 0; + } +} + +static void +pango_layout_line_get_empty_extents (PangoLayoutLine *line, + PangoRectangle *logical_rect) +{ + pango_layout_get_empty_extents_at_index (line->layout, line->start_index, logical_rect); +} + +static void +pango_layout_run_get_extents (PangoLayoutRun *run, + PangoRectangle *run_ink, + PangoRectangle *run_logical) +{ + PangoRectangle logical; + ItemProperties properties; + + if (G_UNLIKELY (!run_ink && !run_logical)) + return; + + pango_layout_get_item_properties (run->item, &properties); + + if (!run_logical && (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)) + run_logical = &logical; + + if (!run_logical && (properties.uline != PANGO_UNDERLINE_NONE || properties.strikethrough)) + run_logical = &logical; + + if (properties.shape_set) + _pango_shape_get_extents (run->item->num_chars, + properties.shape_ink_rect, + properties.shape_logical_rect, + run_ink, run_logical); + else + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, + run_ink, run_logical); + + if (run_ink && (properties.uline != PANGO_UNDERLINE_NONE || properties.strikethrough)) + { + PangoFontMetrics *metrics = pango_font_get_metrics (run->item->analysis.font, + run->item->analysis.language); + int underline_thickness = pango_font_metrics_get_underline_thickness (metrics); + int underline_position = pango_font_metrics_get_underline_position (metrics); + int strikethrough_thickness = pango_font_metrics_get_strikethrough_thickness (metrics); + int strikethrough_position = pango_font_metrics_get_strikethrough_position (metrics); + + int new_pos; + + /* the underline/strikethrough takes x,width of logical_rect. reflect + * that into ink_rect. + */ + new_pos = MIN (run_ink->x, run_logical->x); + run_ink->width = MAX (run_ink->x + run_ink->width, run_logical->x + run_logical->width) - new_pos; + run_ink->x = new_pos; + + /* We should better handle the case of height==0 in the following cases. + * If run_ink->height == 0, we should adjust run_ink->y appropriately. + */ + + if (properties.strikethrough) + { + if (run_ink->height == 0) + { + run_ink->height = strikethrough_thickness; + run_ink->y = -strikethrough_position; + } + } + + switch (properties.uline) + { + case PANGO_UNDERLINE_ERROR: + run_ink->height = MAX (run_ink->height, + 3 * underline_thickness - underline_position - run_ink->y); + break; + case PANGO_UNDERLINE_SINGLE: + run_ink->height = MAX (run_ink->height, + underline_thickness - underline_position - run_ink->y); + break; + case PANGO_UNDERLINE_DOUBLE: + run_ink->height = MAX (run_ink->height, + 3 * underline_thickness - underline_position - run_ink->y); + break; + case PANGO_UNDERLINE_LOW: + run_ink->height += 2 * underline_thickness; + break; + case PANGO_UNDERLINE_NONE: + break; + default: + g_critical ("unknown underline mode"); + break; + } + + pango_font_metrics_unref (metrics); + } + + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) + { + gboolean is_hinted = (run_logical->y & run_logical->height & (PANGO_SCALE - 1)) == 0; + int adjustment = run_logical->y + run_logical->height / 2; + + if (is_hinted) + adjustment = PANGO_UNITS_ROUND (adjustment); + + properties.rise += adjustment; + } + + if (properties.rise != 0) + { + if (run_ink) + run_ink->y -= properties.rise; + + if (run_logical) + run_logical->y -= properties.rise; + } +} + +/** + * pango_layout_line_get_extents: + * @line: a #PangoLayoutLine + * @ink_rect: (out) (allow-none): rectangle used to store the extents of + * the glyph string as drawn, or %NULL + * @logical_rect: (out) (allow-none):rectangle used to store the logical + * extents of the glyph string, or %NULL + * + * Computes the logical and ink extents of a layout line. See + * pango_font_get_glyph_extents() for details about the interpretation + * of the rectangles. + */ +void +pango_layout_line_get_extents (PangoLayoutLine *line, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoLayoutLinePrivate *private = (PangoLayoutLinePrivate *)line; + GSList *tmp_list; + int x_pos = 0; + gboolean caching = FALSE; + + g_return_if_fail (LINE_IS_VALID (line)); + + if (G_UNLIKELY (!ink_rect && !logical_rect)) + return; + + switch (private->cache_status) + { + case CACHED: + { + if (ink_rect) + *ink_rect = private->ink_rect; + if (logical_rect) + *logical_rect = private->logical_rect; + return; + } + case NOT_CACHED: + { + caching = TRUE; + if (!ink_rect) + ink_rect = &private->ink_rect; + if (!logical_rect) + logical_rect = &private->logical_rect; + break; + } + case LEAKED: + { + break; + } + } + + if (ink_rect) + { + ink_rect->x = 0; + ink_rect->y = 0; + ink_rect->width = 0; + ink_rect->height = 0; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = 0; + logical_rect->width = 0; + logical_rect->height = 0; + } + + tmp_list = line->runs; + while (tmp_list) + { + PangoLayoutRun *run = tmp_list->data; + int new_pos; + PangoRectangle run_ink; + PangoRectangle run_logical; + + pango_layout_run_get_extents (run, + ink_rect ? &run_ink : NULL, + &run_logical); + + if (ink_rect) + { + if (ink_rect->width == 0 || ink_rect->height == 0) + { + *ink_rect = run_ink; + ink_rect->x += x_pos; + } + else if (run_ink.width != 0 && run_ink.height != 0) + { + new_pos = MIN (ink_rect->x, x_pos + run_ink.x); + ink_rect->width = MAX (ink_rect->x + ink_rect->width, + x_pos + run_ink.x + run_ink.width) - new_pos; + ink_rect->x = new_pos; + + new_pos = MIN (ink_rect->y, run_ink.y); + ink_rect->height = MAX (ink_rect->y + ink_rect->height, + run_ink.y + run_ink.height) - new_pos; + ink_rect->y = new_pos; + } + } + + if (logical_rect) + { + new_pos = MIN (logical_rect->x, x_pos + run_logical.x); + logical_rect->width = MAX (logical_rect->x + logical_rect->width, + x_pos + run_logical.x + run_logical.width) - new_pos; + logical_rect->x = new_pos; + + new_pos = MIN (logical_rect->y, run_logical.y); + logical_rect->height = MAX (logical_rect->y + logical_rect->height, + run_logical.y + run_logical.height) - new_pos; + logical_rect->y = new_pos; + } + + x_pos += run_logical.width; + tmp_list = tmp_list->next; + } + + if (logical_rect && !line->runs) + pango_layout_line_get_empty_extents (line, logical_rect); + + if (caching) + { + if (&private->ink_rect != ink_rect) + private->ink_rect = *ink_rect; + if (&private->logical_rect != logical_rect) + private->logical_rect = *logical_rect; + private->cache_status = CACHED; + } +} + +static PangoLayoutLine * +pango_layout_line_new (PangoLayout *layout) +{ + PangoLayoutLinePrivate *private = g_slice_new (PangoLayoutLinePrivate); + + private->ref_count = 1; + private->line.layout = layout; + private->line.runs = NULL; + private->line.length = 0; + private->cache_status = NOT_CACHED; + + /* Note that we leave start_index, resolved_dir, and is_paragraph_start + * uninitialized */ + + return (PangoLayoutLine *) private; +} + +/** + * pango_layout_line_get_pixel_extents: + * @layout_line: a #PangoLayoutLine + * @ink_rect: (out) (allow-none): rectangle used to store the extents of + * the glyph string as drawn, or %NULL + * @logical_rect: (out) (allow-none): rectangle used to store the logical + * extents of the glyph string, or %NULL + * + * Computes the logical and ink extents of @layout_line in device units. + * This function just calls pango_layout_line_get_extents() followed by + * two pango_extents_to_pixels() calls, rounding @ink_rect and @logical_rect + * such that the rounded rectangles fully contain the unrounded one (that is, + * passes them as first argument to pango_extents_to_pixels()). + **/ +void +pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + g_return_if_fail (LINE_IS_VALID (layout_line)); + + pango_layout_line_get_extents (layout_line, ink_rect, logical_rect); + pango_extents_to_pixels (ink_rect, NULL); + pango_extents_to_pixels (logical_rect, NULL); +} + +/* + * NB: This implement the exact same algorithm as + * reorder-items.c:pango_reorder_items(). + */ + +static GSList * +reorder_runs_recurse (GSList *items, int n_items) +{ + GSList *tmp_list, *level_start_node; + int i, level_start_i; + int min_level = G_MAXINT; + GSList *result = NULL; + + if (n_items == 0) + return NULL; + + tmp_list = items; + for (i=0; idata; + + min_level = MIN (min_level, run->item->analysis.level); + + tmp_list = tmp_list->next; + } + + level_start_i = 0; + level_start_node = items; + tmp_list = items; + for (i=0; idata; + + if (run->item->analysis.level == min_level) + { + if (min_level % 2) + { + if (i > level_start_i) + result = g_slist_concat (reorder_runs_recurse (level_start_node, i - level_start_i), result); + result = g_slist_prepend (result, run); + } + else + { + if (i > level_start_i) + result = g_slist_concat (result, reorder_runs_recurse (level_start_node, i - level_start_i)); + result = g_slist_append (result, run); + } + + level_start_i = i + 1; + level_start_node = tmp_list->next; + } + + tmp_list = tmp_list->next; + } + + if (min_level % 2) + { + if (i > level_start_i) + result = g_slist_concat (reorder_runs_recurse (level_start_node, i - level_start_i), result); + } + else + { + if (i > level_start_i) + result = g_slist_concat (result, reorder_runs_recurse (level_start_node, i - level_start_i)); + } + + return result; +} + +static void +pango_layout_line_reorder (PangoLayoutLine *line) +{ + GSList *logical_runs = line->runs; + GSList *tmp_list; + gboolean all_even, all_odd; + guint8 level_or = 0, level_and = 1; + int length = 0; + + /* Check if all items are in the same direction, in that case, the + * line does not need modification and we can avoid the expensive + * reorder runs recurse procedure. + */ + for (tmp_list = logical_runs; tmp_list != NULL; tmp_list = tmp_list->next) + { + PangoLayoutRun *run = tmp_list->data; + + level_or |= run->item->analysis.level; + level_and &= run->item->analysis.level; + + length++; + } + + /* If none of the levels had the LSB set, all numbers were even. */ + all_even = (level_or & 0x1) == 0; + + /* If all of the levels had the LSB set, all numbers were odd. */ + all_odd = (level_and & 0x1) == 1; + + if (!all_even && !all_odd) + { + line->runs = reorder_runs_recurse (logical_runs, length); + g_slist_free (logical_runs); + } + else if (all_odd) + line->runs = g_slist_reverse (logical_runs); +} + +static int +get_item_letter_spacing (PangoItem *item) +{ + ItemProperties properties; + + pango_layout_get_item_properties (item, &properties); + + return properties.letter_spacing; +} + +static void +pad_glyphstring_right (PangoGlyphString *glyphs, + ParaBreakState *state, + int adjustment) +{ + int glyph = glyphs->num_glyphs - 1; + + while (glyph >= 0 && glyphs->glyphs[glyph].geometry.width == 0) + glyph--; + + if (glyph < 0) + return; + + state->remaining_width -= adjustment; + glyphs->glyphs[glyph].geometry.width += adjustment; + if (glyphs->glyphs[glyph].geometry.width < 0) + { + state->remaining_width += glyphs->glyphs[glyph].geometry.width; + glyphs->glyphs[glyph].geometry.width = 0; + } +} + +static void +pad_glyphstring_left (PangoGlyphString *glyphs, + ParaBreakState *state, + int adjustment) +{ + int glyph = 0; + + while (glyph < glyphs->num_glyphs && glyphs->glyphs[glyph].geometry.width == 0) + glyph++; + + if (glyph == glyphs->num_glyphs) + return; + + state->remaining_width -= adjustment; + glyphs->glyphs[glyph].geometry.width += adjustment; + glyphs->glyphs[glyph].geometry.x_offset += adjustment; +} + +static gboolean +is_tab_run (PangoLayout *layout, + PangoLayoutRun *run) +{ + return (layout->text[run->item->offset] == '\t'); +} + +static void +zero_line_final_space (PangoLayoutLine *line, + ParaBreakState *state, + PangoLayoutRun *run) +{ + PangoLayout *layout = line->layout; + PangoItem *item = run->item; + PangoGlyphString *glyphs = run->glyphs; + int glyph = item->analysis.level % 2 ? 0 : glyphs->num_glyphs - 1; + + /* if the final char of line forms a cluster, and it's + * a whitespace char, zero its glyph's width as it's been wrapped + */ + + if (glyphs->num_glyphs < 1 || state->start_offset == 0 || + !layout->log_attrs[state->start_offset - 1].is_white) + return; + + if (glyphs->num_glyphs >= 2 && + glyphs->log_clusters[glyph] == glyphs->log_clusters[glyph + (item->analysis.level % 2 ? 1 : -1)]) + return; + + state->remaining_width += glyphs->glyphs[glyph].geometry.width; + glyphs->glyphs[glyph].geometry.width = 0; +} + +/* When doing shaping, we add the letter spacing value for a + * run after every grapheme in the run. This produces ugly + * asymmetrical results, so what this routine is redistributes + * that space to the beginning and the end of the run. + * + * We also trim the letter spacing from runs adjacent to + * tabs and from the outside runs of the lines so that things + * line up properly. The line breaking and tab positioning + * were computed without this trimming so they are no longer + * exactly correct, but this won't be very noticeable in most + * cases. + */ +static void +adjust_line_letter_spacing (PangoLayoutLine *line, + ParaBreakState *state) +{ + PangoLayout *layout = line->layout; + gboolean reversed; + PangoLayoutRun *last_run; + int tab_adjustment; + GSList *l; + + /* If we have tab stops and the resolved direction of the + * line is RTL, then we need to walk through the line + * in reverse direction to figure out the corrections for + * tab stops. + */ + reversed = FALSE; + if (line->resolved_dir == PANGO_DIRECTION_RTL) + { + for (l = line->runs; l; l = l->next) + if (is_tab_run (layout, l->data)) + { + line->runs = g_slist_reverse (line->runs); + reversed = TRUE; + break; + } + } + + /* Walk over the runs in the line, redistributing letter + * spacing from the end of the run to the start of the + * run and trimming letter spacing from the ends of the + * runs adjacent to the ends of the line or tab stops. + * + * We accumulate a correction factor from this trimming + * which we add onto the next tab stop space to keep the + * things properly aligned. + */ + + last_run = NULL; + tab_adjustment = 0; + for (l = line->runs; l; l = l->next) + { + PangoLayoutRun *run = l->data; + PangoLayoutRun *next_run = l->next ? l->next->data : NULL; + + if (is_tab_run (layout, run)) + { + pad_glyphstring_right (run->glyphs, state, tab_adjustment); + tab_adjustment = 0; + } + else + { + PangoLayoutRun *visual_next_run = reversed ? last_run : next_run; + PangoLayoutRun *visual_last_run = reversed ? next_run : last_run; + int run_spacing = get_item_letter_spacing (run->item); + int space_left, space_right; + + distribute_letter_spacing (run_spacing, &space_left, &space_right); + + if (run->glyphs->glyphs[0].geometry.width == 0) + { + /* we've zeroed this space glyph at the end of line, now remove + * the letter spacing added to its adjacent glyph */ + pad_glyphstring_left (run->glyphs, state, - space_left); + } + else if (!visual_last_run || is_tab_run (layout, visual_last_run)) + { + pad_glyphstring_left (run->glyphs, state, - space_left); + tab_adjustment += space_left; + } + + if (run->glyphs->glyphs[run->glyphs->num_glyphs - 1].geometry.width == 0) + { + /* we've zeroed this space glyph at the end of line, now remove + * the letter spacing added to its adjacent glyph */ + pad_glyphstring_right (run->glyphs, state, - space_right); + } + else if (!visual_next_run || is_tab_run (layout, visual_next_run)) + { + pad_glyphstring_right (run->glyphs, state, - space_right); + tab_adjustment += space_right; + } + } + + last_run = run; + } + + if (reversed) + line->runs = g_slist_reverse (line->runs); +} + +static void +justify_clusters (PangoLayoutLine *line, + ParaBreakState *state) +{ + const gchar *text = line->layout->text; + const PangoLogAttr *log_attrs = line->layout->log_attrs; + + int total_remaining_width, total_gaps = 0; + int added_so_far, gaps_so_far; + gboolean is_hinted; + GSList *run_iter; + enum { + MEASURE, + ADJUST + } mode; + + total_remaining_width = state->remaining_width; + if (total_remaining_width <= 0) + return; + + /* hint to full pixel if total remaining width was so */ + is_hinted = (total_remaining_width & (PANGO_SCALE - 1)) == 0; + + for (mode = MEASURE; mode <= ADJUST; mode++) + { + gboolean leftedge = TRUE; + PangoGlyphString *rightmost_glyphs = NULL; + int rightmost_space = 0; + int residual = 0; + + added_so_far = 0; + gaps_so_far = 0; + + for (run_iter = line->runs; run_iter; run_iter = run_iter->next) + { + PangoLayoutRun *run = run_iter->data; + PangoGlyphString *glyphs = run->glyphs; + PangoGlyphItemIter cluster_iter; + gboolean have_cluster; + int dir; + int offset; + + dir = run->item->analysis.level % 2 == 0 ? +1 : -1; + + /* We need character offset of the start of the run. We don't have this. + * Compute by counting from the beginning of the line. The naming is + * confusing. Note that: + * + * run->item->offset is byte offset of start of run in layout->text. + * state->line_start_index is byte offset of start of line in layout->text. + * state->line_start_offset is character offset of start of line in layout->text. + */ + g_assert (run->item->offset >= state->line_start_index); + offset = state->line_start_offset + + pango_utf8_strlen (text + state->line_start_index, + run->item->offset - state->line_start_index); + + for (have_cluster = dir > 0 ? + pango_glyph_item_iter_init_start (&cluster_iter, run, text) : + pango_glyph_item_iter_init_end (&cluster_iter, run, text); + have_cluster; + have_cluster = dir > 0 ? + pango_glyph_item_iter_next_cluster (&cluster_iter) : + pango_glyph_item_iter_prev_cluster (&cluster_iter)) + { + int i; + int width = 0; + + /* don't expand in the middle of graphemes */ + if (!log_attrs[offset + cluster_iter.start_char].is_cursor_position) + continue; + + for (i = cluster_iter.start_glyph; i != cluster_iter.end_glyph; i += dir) + width += glyphs->glyphs[i].geometry.width; + + /* also don't expand zero-width clusters. */ + if (width == 0) + continue; + + gaps_so_far++; + + if (mode == ADJUST) + { + int leftmost, rightmost; + int adjustment, space_left, space_right; + + adjustment = total_remaining_width / total_gaps + residual; + if (is_hinted) + { + int old_adjustment = adjustment; + adjustment = PANGO_UNITS_ROUND (adjustment); + residual = old_adjustment - adjustment; + } + /* distribute to before/after */ + distribute_letter_spacing (adjustment, &space_left, &space_right); + + if (cluster_iter.start_glyph < cluster_iter.end_glyph) + { + /* LTR */ + leftmost = cluster_iter.start_glyph; + rightmost = cluster_iter.end_glyph - 1; + } + else + { + /* RTL */ + leftmost = cluster_iter.end_glyph + 1; + rightmost = cluster_iter.start_glyph; + } + /* Don't add to left-side of left-most glyph of left-most non-zero run. */ + if (leftedge) + leftedge = FALSE; + else + { + glyphs->glyphs[leftmost].geometry.width += space_left ; + glyphs->glyphs[leftmost].geometry.x_offset += space_left ; + added_so_far += space_left; + } + /* Don't add to right-side of right-most glyph of right-most non-zero run. */ + { + /* Save so we can undo later. */ + rightmost_glyphs = glyphs; + rightmost_space = space_right; + + glyphs->glyphs[rightmost].geometry.width += space_right; + added_so_far += space_right; + } + } + } + } + + if (mode == MEASURE) + { + total_gaps = gaps_so_far - 1; + + if (total_gaps == 0) + { + /* a single cluster, can't really justify it */ + return; + } + } + else /* mode == ADJUST */ + { + if (rightmost_glyphs) + { + rightmost_glyphs->glyphs[rightmost_glyphs->num_glyphs - 1].geometry.width -= rightmost_space; + added_so_far -= rightmost_space; + } + } + } + + state->remaining_width -= added_so_far; +} + +static void +justify_words (PangoLayoutLine *line, + ParaBreakState *state) +{ + const gchar *text = line->layout->text; + const PangoLogAttr *log_attrs = line->layout->log_attrs; + + int total_remaining_width, total_space_width = 0; + int added_so_far, spaces_so_far; + gboolean is_hinted; + GSList *run_iter; + enum { + MEASURE, + ADJUST + } mode; + + total_remaining_width = state->remaining_width; + if (total_remaining_width <= 0) + return; + + /* hint to full pixel if total remaining width was so */ + is_hinted = (total_remaining_width & (PANGO_SCALE - 1)) == 0; + + for (mode = MEASURE; mode <= ADJUST; mode++) + { + added_so_far = 0; + spaces_so_far = 0; + + for (run_iter = line->runs; run_iter; run_iter = run_iter->next) + { + PangoLayoutRun *run = run_iter->data; + PangoGlyphString *glyphs = run->glyphs; + PangoGlyphItemIter cluster_iter; + gboolean have_cluster; + int offset; + + /* We need character offset of the start of the run. We don't have this. + * Compute by counting from the beginning of the line. The naming is + * confusing. Note that: + * + * run->item->offset is byte offset of start of run in layout->text. + * state->line_start_index is byte offset of start of line in layout->text. + * state->line_start_offset is character offset of start of line in layout->text. + */ + g_assert (run->item->offset >= state->line_start_index); + offset = state->line_start_offset + + pango_utf8_strlen (text + state->line_start_index, + run->item->offset - state->line_start_index); + + for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter, run, text); + have_cluster; + have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter)) + { + int i; + int dir; + + if (!log_attrs[offset + cluster_iter.start_char].is_expandable_space) + continue; + + dir = (cluster_iter.start_glyph < cluster_iter.end_glyph) ? 1 : -1; + for (i = cluster_iter.start_glyph; i != cluster_iter.end_glyph; i += dir) + { + int glyph_width = glyphs->glyphs[i].geometry.width; + + if (glyph_width == 0) + continue; + + spaces_so_far += glyph_width; + + if (mode == ADJUST) + { + int adjustment; + + adjustment = ((guint64) spaces_so_far * total_remaining_width) / total_space_width - added_so_far; + if (is_hinted) + adjustment = PANGO_UNITS_ROUND (adjustment); + + glyphs->glyphs[i].geometry.width += adjustment; + added_so_far += adjustment; + } + } + } + } + + if (mode == MEASURE) + { + total_space_width = spaces_so_far; + + if (total_space_width == 0) + { + justify_clusters (line, state); + return; + } + } + } + + state->remaining_width -= added_so_far; +} + +static void +pango_layout_line_postprocess (PangoLayoutLine *line, + ParaBreakState *state, + gboolean wrapped) +{ + gboolean ellipsized = FALSE; + + DEBUG ("postprocessing", line, state); + + /* Truncate the logical-final whitespace in the line if we broke the line at it + */ + if (wrapped) + /* The runs are in reverse order at this point, since we prepended them to the list. + * So, the first run is the last logical run. */ + zero_line_final_space (line, state, line->runs->data); + + /* Reverse the runs + */ + line->runs = g_slist_reverse (line->runs); + + /* Ellipsize the line if necessary + */ + if (G_UNLIKELY (state->line_width >= 0 && + should_ellipsize_current_line (line->layout, state))) + { + ellipsized = _pango_layout_line_ellipsize (line, state->attrs, state->line_width); + } + + DEBUG ("after removing final space", line, state); + + /* Now convert logical to visual order + */ + pango_layout_line_reorder (line); + + DEBUG ("after reordering", line, state); + + /* Fixup letter spacing between runs + */ + adjust_line_letter_spacing (line, state); + + DEBUG ("after letter spacing", line, state); + + /* Distribute extra space between words if justifying and line was wrapped + */ + if (line->layout->justify && (wrapped || ellipsized)) + { + /* if we ellipsized, we don't have remaining_width set */ + if (state->remaining_width < 0) + state->remaining_width = state->line_width - pango_layout_line_get_width (line); + + justify_words (line, state); + } + + DEBUG ("after justification", line, state); + + line->layout->is_wrapped |= wrapped; + line->layout->is_ellipsized |= ellipsized; +} + +static void +pango_layout_get_item_properties (PangoItem *item, + ItemProperties *properties) +{ + GSList *tmp_list = item->analysis.extra_attrs; + + properties->uline = PANGO_UNDERLINE_NONE; + properties->strikethrough = FALSE; + properties->letter_spacing = 0; + properties->rise = 0; + properties->shape_set = FALSE; + properties->shape_ink_rect = NULL; + properties->shape_logical_rect = NULL; + + while (tmp_list) + { + PangoAttribute *attr = tmp_list->data; + + switch ((int) attr->klass->type) + { + case PANGO_ATTR_UNDERLINE: + properties->uline = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_STRIKETHROUGH: + properties->strikethrough = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_RISE: + properties->rise = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_LETTER_SPACING: + properties->letter_spacing = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_SHAPE: + properties->shape_set = TRUE; + properties->shape_logical_rect = &((PangoAttrShape *)attr)->logical_rect; + properties->shape_ink_rect = &((PangoAttrShape *)attr)->ink_rect; + break; + + default: + break; + } + tmp_list = tmp_list->next; + } +} + +static int +next_cluster_start (PangoGlyphString *gs, + int cluster_start) +{ + int i; + + i = cluster_start + 1; + while (i < gs->num_glyphs) + { + if (gs->glyphs[i].attr.is_cluster_start) + return i; + + i++; + } + + return gs->num_glyphs; +} + +static int +cluster_width (PangoGlyphString *gs, + int cluster_start) +{ + int i; + int width; + + width = gs->glyphs[cluster_start].geometry.width; + i = cluster_start + 1; + while (i < gs->num_glyphs) + { + if (gs->glyphs[i].attr.is_cluster_start) + break; + + width += gs->glyphs[i].geometry.width; + i++; + } + + return width; +} + +static inline void +offset_y (PangoLayoutIter *iter, + int *y) +{ + *y += iter->line_extents[iter->line_index].baseline; +} + +/* Sets up the iter for the start of a new cluster. cluster_start_index + * is the byte index of the cluster start relative to the run. + */ +static void +update_cluster (PangoLayoutIter *iter, + int cluster_start_index) +{ + char *cluster_text; + PangoGlyphString *gs; + int cluster_length; + + iter->character_position = 0; + + gs = iter->run->glyphs; + iter->cluster_width = cluster_width (gs, iter->cluster_start); + iter->next_cluster_glyph = next_cluster_start (gs, iter->cluster_start); + + if (iter->ltr) + { + /* For LTR text, finding the length of the cluster is easy + * since logical and visual runs are in the same direction. + */ + if (iter->next_cluster_glyph < gs->num_glyphs) + cluster_length = gs->log_clusters[iter->next_cluster_glyph] - cluster_start_index; + else + cluster_length = iter->run->item->length - cluster_start_index; + } + else + { + /* For RTL text, we have to scan backwards to find the previous + * visual cluster which is the next logical cluster. + */ + int i = iter->cluster_start; + while (i > 0 && gs->log_clusters[i - 1] == cluster_start_index) + i--; + + if (i == 0) + cluster_length = iter->run->item->length - cluster_start_index; + else + cluster_length = gs->log_clusters[i - 1] - cluster_start_index; + } + + cluster_text = iter->layout->text + iter->run->item->offset + cluster_start_index; + iter->cluster_num_chars = pango_utf8_strlen (cluster_text, cluster_length); + + if (iter->ltr) + iter->index = cluster_text - iter->layout->text; + else + iter->index = g_utf8_prev_char (cluster_text + cluster_length) - iter->layout->text; +} + +static void +update_run (PangoLayoutIter *iter, + int run_start_index) +{ + const Extents *line_ext = &iter->line_extents[iter->line_index]; + + /* Note that in iter_new() the iter->run_width + * is garbage but we don't use it since we're on the first run of + * a line. + */ + if (iter->run_list_link == iter->line->runs) + iter->run_x = line_ext->logical_rect.x; + else + iter->run_x += iter->run_width; + + if (iter->run) + { + iter->run_width = pango_glyph_string_get_width (iter->run->glyphs); + } + else + { + /* The empty run at the end of a line */ + iter->run_width = 0; + } + + if (iter->run) + iter->ltr = (iter->run->item->analysis.level % 2) == 0; + else + iter->ltr = TRUE; + + iter->cluster_start = 0; + iter->cluster_x = iter->run_x; + + if (iter->run) + { + update_cluster (iter, iter->run->glyphs->log_clusters[0]); + } + else + { + iter->cluster_width = 0; + iter->character_position = 0; + iter->cluster_num_chars = 0; + iter->index = run_start_index; + } +} + +/** + * pango_layout_iter_copy: + * @iter: (nullable): a #PangoLayoutIter, may be %NULL + * + * Copies a #PangoLayoutIter. + * + * Return value: (nullable): the newly allocated #PangoLayoutIter, + * which should be freed with pango_layout_iter_free(), + * or %NULL if @iter was %NULL. + * + * Since: 1.20 + **/ +PangoLayoutIter * +pango_layout_iter_copy (PangoLayoutIter *iter) +{ + PangoLayoutIter *new; + + if (iter == NULL) + return NULL; + + new = g_slice_new (PangoLayoutIter); + + new->layout = g_object_ref (iter->layout); + new->line_list_link = iter->line_list_link; + new->line = iter->line; + pango_layout_line_ref (new->line); + + new->run_list_link = iter->run_list_link; + new->run = iter->run; + new->index = iter->index; + + new->line_extents = NULL; + if (iter->line_extents != NULL) + { + new->line_extents = g_memdup (iter->line_extents, + iter->layout->line_count * sizeof (Extents)); + + } + new->line_index = iter->line_index; + + new->run_x = iter->run_x; + new->run_width = iter->run_width; + new->ltr = iter->ltr; + + new->cluster_x = iter->cluster_x; + new->cluster_width = iter->cluster_width; + + new->cluster_start = iter->cluster_start; + new->next_cluster_glyph = iter->next_cluster_glyph; + + new->cluster_num_chars = iter->cluster_num_chars; + new->character_position = iter->character_position; + + new->layout_width = iter->layout_width; + + return new; +} + +G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, + pango_layout_iter_copy, + pango_layout_iter_free); + +/** + * pango_layout_get_iter: + * @layout: a #PangoLayout + * + * Returns an iterator to iterate over the visual extents of the layout. + * + * Return value: the new #PangoLayoutIter that should be freed using + * pango_layout_iter_free(). + **/ +PangoLayoutIter* +pango_layout_get_iter (PangoLayout *layout) +{ + PangoLayoutIter *iter; + + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + iter = g_slice_new (PangoLayoutIter); + + _pango_layout_get_iter (layout, iter); + + return iter; +} + +void +_pango_layout_get_iter (PangoLayout *layout, + PangoLayoutIter*iter) +{ + int run_start_index; + PangoRectangle logical_rect; + + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + iter->layout = g_object_ref (layout); + + pango_layout_check_lines (layout); + + iter->line_list_link = layout->lines; + iter->line = iter->line_list_link->data; + pango_layout_line_ref (iter->line); + + run_start_index = iter->line->start_index; + iter->run_list_link = iter->line->runs; + + if (iter->run_list_link) + { + iter->run = iter->run_list_link->data; + run_start_index = iter->run->item->offset; + } + else + iter->run = NULL; + + iter->line_extents = NULL; + pango_layout_get_extents_internal (layout, + NULL, + &logical_rect, + &iter->line_extents); + iter->layout_width = layout->width == -1 ? logical_rect.width : layout->width; + iter->line_index = 0; + + update_run (iter, run_start_index); +} + +void +_pango_layout_iter_destroy (PangoLayoutIter *iter) +{ + if (iter == NULL) + return; + + g_free (iter->line_extents); + pango_layout_line_unref (iter->line); + g_object_unref (iter->layout); +} + +/** + * pango_layout_iter_free: + * @iter: (nullable): a #PangoLayoutIter, may be %NULL + * + * Frees an iterator that's no longer in use. + **/ +void +pango_layout_iter_free (PangoLayoutIter *iter) +{ + if (iter == NULL) + return; + + _pango_layout_iter_destroy (iter); + g_slice_free (PangoLayoutIter, iter); +} + +/** + * pango_layout_iter_get_index: + * @iter: a #PangoLayoutIter + * + * Gets the current byte index. Note that iterating forward by char + * moves in visual order, not logical order, so indexes may not be + * sequential. Also, the index may be equal to the length of the text + * in the layout, if on the %NULL run (see pango_layout_iter_get_run()). + * + * Return value: current byte index. + **/ +int +pango_layout_iter_get_index (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return 0; + + return iter->index; +} + +/** + * pango_layout_iter_get_run: + * @iter: a #PangoLayoutIter + * + * Gets the current run. When iterating by run, at the end of each + * line, there's a position with a %NULL run, so this function can return + * %NULL. The %NULL run at the end of each line ensures that all lines have + * at least one run, even lines consisting of only a newline. + * + * Use the faster pango_layout_iter_get_run_readonly() if you do not plan + * to modify the contents of the run (glyphs, glyph widths, etc.). + * + * Return value: (transfer none) (nullable): the current run. + **/ +PangoLayoutRun* +pango_layout_iter_get_run (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return NULL; + + pango_layout_line_leaked (iter->line); + + return iter->run; +} + +/** + * pango_layout_iter_get_run_readonly: + * @iter: a #PangoLayoutIter + * + * Gets the current run. When iterating by run, at the end of each + * line, there's a position with a %NULL run, so this function can return + * %NULL. The %NULL run at the end of each line ensures that all lines have + * at least one run, even lines consisting of only a newline. + * + * This is a faster alternative to pango_layout_iter_get_run(), + * but the user is not expected + * to modify the contents of the run (glyphs, glyph widths, etc.). + * + * Return value: (transfer none) (nullable): the current run, that + * should not be modified. + * + * Since: 1.16 + **/ +PangoLayoutRun* +pango_layout_iter_get_run_readonly (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return NULL; + + pango_layout_line_leaked (iter->line); + + return iter->run; +} + +/* an inline-able version for local use */ +static PangoLayoutLine* +_pango_layout_iter_get_line (PangoLayoutIter *iter) +{ + return iter->line; +} + +/** + * pango_layout_iter_get_line: + * @iter: a #PangoLayoutIter + * + * Gets the current line. + * + * Use the faster pango_layout_iter_get_line_readonly() if you do not plan + * to modify the contents of the line (glyphs, glyph widths, etc.). + * + * Return value: the current line. + **/ +PangoLayoutLine* +pango_layout_iter_get_line (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return NULL; + + pango_layout_line_leaked (iter->line); + + return iter->line; +} + +/** + * pango_layout_iter_get_line_readonly: + * @iter: a #PangoLayoutIter + * + * Gets the current line for read-only access. + * + * This is a faster alternative to pango_layout_iter_get_line(), + * but the user is not expected + * to modify the contents of the line (glyphs, glyph widths, etc.). + * + * Return value: (transfer none): the current line, that should not be + * modified. + * + * Since: 1.16 + **/ +PangoLayoutLine* +pango_layout_iter_get_line_readonly (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return NULL; + + return iter->line; +} + +/** + * pango_layout_iter_at_last_line: + * @iter: a #PangoLayoutIter + * + * Determines whether @iter is on the last line of the layout. + * + * Return value: %TRUE if @iter is on the last line. + **/ +gboolean +pango_layout_iter_at_last_line (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return FALSE; + + return iter->line_index == iter->layout->line_count - 1; +} + +/** + * pango_layout_iter_get_layout: + * @iter: a #PangoLayoutIter + * + * Gets the layout associated with a #PangoLayoutIter. + * + * Return value: (transfer none): the layout associated with @iter. + * + * Since: 1.20 + **/ +PangoLayout* +pango_layout_iter_get_layout (PangoLayoutIter *iter) +{ + /* check is redundant as it simply checks that iter->layout is not NULL */ + if (ITER_IS_INVALID (iter)) + return NULL; + + return iter->layout; +} + + +static gboolean +line_is_terminated (PangoLayoutIter *iter) +{ + /* There is a real terminator at the end of each paragraph other + * than the last. + */ + if (iter->line_list_link->next) + { + PangoLayoutLine *next_line = iter->line_list_link->next->data; + if (next_line->is_paragraph_start) + return TRUE; + } + + return FALSE; +} + +/* Moves to the next non-empty line. If @include_terminators + * is set, a line with just an explicit paragraph separator + * is considered non-empty. + */ +static gboolean +next_nonempty_line (PangoLayoutIter *iter, + gboolean include_terminators) +{ + gboolean result; + + while (TRUE) + { + result = pango_layout_iter_next_line (iter); + if (!result) + break; + + if (iter->line->runs) + break; + + if (include_terminators && line_is_terminated (iter)) + break; + } + + return result; +} + +/* Moves to the next non-empty run. If @include_terminators + * is set, the trailing run at the end of a line with an explicit + * paragraph separator is considered non-empty. + */ +static gboolean +next_nonempty_run (PangoLayoutIter *iter, + gboolean include_terminators) +{ + gboolean result; + + while (TRUE) + { + result = pango_layout_iter_next_run (iter); + if (!result) + break; + + if (iter->run) + break; + + if (include_terminators && line_is_terminated (iter)) + break; + } + + return result; +} + +/* Like pango_layout_next_cluster(), but if @include_terminators + * is set, includes the fake runs/clusters for empty lines. + * (But not positions introduced by line wrapping). + */ +static gboolean +next_cluster_internal (PangoLayoutIter *iter, + gboolean include_terminators) +{ + PangoGlyphString *gs; + int next_start; + + if (ITER_IS_INVALID (iter)) + return FALSE; + + if (iter->run == NULL) + return next_nonempty_line (iter, include_terminators); + + gs = iter->run->glyphs; + + next_start = iter->next_cluster_glyph; + if (next_start == gs->num_glyphs) + { + return next_nonempty_run (iter, include_terminators); + } + else + { + iter->cluster_start = next_start; + iter->cluster_x += iter->cluster_width; + update_cluster(iter, gs->log_clusters[iter->cluster_start]); + + return TRUE; + } +} + +/** + * pango_layout_iter_next_char: + * @iter: a #PangoLayoutIter + * + * Moves @iter forward to the next character in visual order. If @iter was already at + * the end of the layout, returns %FALSE. + * + * Return value: whether motion was possible. + **/ +gboolean +pango_layout_iter_next_char (PangoLayoutIter *iter) +{ + const char *text; + + if (ITER_IS_INVALID (iter)) + return FALSE; + + if (iter->run == NULL) + { + /* We need to fake an iterator position in the middle of a \r\n line terminator */ + if (line_is_terminated (iter) && + strncmp (iter->layout->text + iter->line->start_index + iter->line->length, "\r\n", 2) == 0 && + iter->character_position == 0) + { + iter->character_position++; + return TRUE; + } + + return next_nonempty_line (iter, TRUE); + } + + iter->character_position++; + if (iter->character_position >= iter->cluster_num_chars) + return next_cluster_internal (iter, TRUE); + + text = iter->layout->text; + if (iter->ltr) + iter->index = g_utf8_next_char (text + iter->index) - text; + else + iter->index = g_utf8_prev_char (text + iter->index) - text; + + return TRUE; +} + +/** + * pango_layout_iter_next_cluster: + * @iter: a #PangoLayoutIter + * + * Moves @iter forward to the next cluster in visual order. If @iter + * was already at the end of the layout, returns %FALSE. + * + * Return value: whether motion was possible. + **/ +gboolean +pango_layout_iter_next_cluster (PangoLayoutIter *iter) +{ + return next_cluster_internal (iter, FALSE); +} + +/** + * pango_layout_iter_next_run: + * @iter: a #PangoLayoutIter + * + * Moves @iter forward to the next run in visual order. If @iter was + * already at the end of the layout, returns %FALSE. + * + * Return value: whether motion was possible. + **/ +gboolean +pango_layout_iter_next_run (PangoLayoutIter *iter) +{ + int next_run_start; /* byte index */ + GSList *next_link; + + if (ITER_IS_INVALID (iter)) + return FALSE; + + if (iter->run == NULL) + return pango_layout_iter_next_line (iter); + + next_link = iter->run_list_link->next; + + if (next_link == NULL) + { + /* Moving on to the zero-width "virtual run" at the end of each + * line + */ + next_run_start = iter->run->item->offset + iter->run->item->length; + iter->run = NULL; + iter->run_list_link = NULL; + } + else + { + iter->run_list_link = next_link; + iter->run = iter->run_list_link->data; + next_run_start = iter->run->item->offset; + } + + update_run (iter, next_run_start); + + return TRUE; +} + +/** + * pango_layout_iter_next_line: + * @iter: a #PangoLayoutIter + * + * Moves @iter forward to the start of the next line. If @iter is + * already on the last line, returns %FALSE. + * + * Return value: whether motion was possible. + **/ +gboolean +pango_layout_iter_next_line (PangoLayoutIter *iter) +{ + GSList *next_link; + + if (ITER_IS_INVALID (iter)) + return FALSE; + + next_link = iter->line_list_link->next; + + if (next_link == NULL) + return FALSE; + + iter->line_list_link = next_link; + + pango_layout_line_unref (iter->line); + + iter->line = iter->line_list_link->data; + + pango_layout_line_ref (iter->line); + + iter->run_list_link = iter->line->runs; + + if (iter->run_list_link) + iter->run = iter->run_list_link->data; + else + iter->run = NULL; + + iter->line_index ++; + + update_run (iter, iter->line->start_index); + + return TRUE; +} + +/** + * pango_layout_iter_get_char_extents: + * @iter: a #PangoLayoutIter + * @logical_rect: (out caller-allocates): rectangle to fill with + * logical extents + * + * Gets the extents of the current character, in layout coordinates + * (origin is the top left of the entire layout). Only logical extents + * can sensibly be obtained for characters; ink extents make sense only + * down to the level of clusters. + * + **/ +void +pango_layout_iter_get_char_extents (PangoLayoutIter *iter, + PangoRectangle *logical_rect) +{ + PangoRectangle cluster_rect; + int x0, x1; + + if (ITER_IS_INVALID (iter)) + return; + + if (logical_rect == NULL) + return; + + pango_layout_iter_get_cluster_extents (iter, NULL, &cluster_rect); + + if (iter->run == NULL) + { + /* When on the NULL run, cluster, char, and run all have the + * same extents + */ + *logical_rect = cluster_rect; + return; + } + + if (iter->cluster_num_chars) + { + x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars; + x1 = ((iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars; + } + else + { + x0 = x1 = 0; + } + + logical_rect->width = x1 - x0; + logical_rect->height = cluster_rect.height; + logical_rect->y = cluster_rect.y; + logical_rect->x = cluster_rect.x + x0; +} + +/** + * pango_layout_iter_get_cluster_extents: + * @iter: a #PangoLayoutIter + * @ink_rect: (out) (allow-none): rectangle to fill with ink extents, or %NULL + * @logical_rect: (out) (allow-none): rectangle to fill with logical extents, or %NULL + * + * Gets the extents of the current cluster, in layout coordinates + * (origin is the top left of the entire layout). + * + **/ +void +pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + if (ITER_IS_INVALID (iter)) + return; + + if (iter->run == NULL) + { + /* When on the NULL run, cluster, char, and run all have the + * same extents + */ + pango_layout_iter_get_run_extents (iter, ink_rect, logical_rect); + return; + } + + pango_glyph_string_extents_range (iter->run->glyphs, + iter->cluster_start, + iter->next_cluster_glyph, + iter->run->item->analysis.font, + ink_rect, + logical_rect); + + if (ink_rect) + { + ink_rect->x += iter->cluster_x; + offset_y (iter, &ink_rect->y); + } + + if (logical_rect) + { + g_assert (logical_rect->width == iter->cluster_width); + logical_rect->x += iter->cluster_x; + offset_y (iter, &logical_rect->y); + } +} + +/** + * pango_layout_iter_get_run_extents: + * @iter: a #PangoLayoutIter + * @ink_rect: (out) (allow-none): rectangle to fill with ink extents, or %NULL + * @logical_rect: (out) (allow-none): rectangle to fill with logical extents, or %NULL + * + * Gets the extents of the current run in layout coordinates + * (origin is the top left of the entire layout). + * + **/ +void +pango_layout_iter_get_run_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + if (G_UNLIKELY (!ink_rect && !logical_rect)) + return; + + if (ITER_IS_INVALID (iter)) + return; + + if (iter->run) + { + pango_layout_run_get_extents (iter->run, ink_rect, logical_rect); + + if (ink_rect) + { + offset_y (iter, &ink_rect->y); + ink_rect->x += iter->run_x; + } + + if (logical_rect) + { + offset_y (iter, &logical_rect->y); + logical_rect->x += iter->run_x; + } + } + else + { + /* The empty run at the end of a line */ + + pango_layout_iter_get_line_extents (iter, ink_rect, logical_rect); + + if (ink_rect) + { + ink_rect->x = iter->run_x; + ink_rect->width = 0; + } + + if (logical_rect) + { + logical_rect->x = iter->run_x; + logical_rect->width = 0; + } + } +} + +/** + * pango_layout_iter_get_line_extents: + * @iter: a #PangoLayoutIter + * @ink_rect: (out) (allow-none): rectangle to fill with ink extents, or %NULL + * @logical_rect: (out) (allow-none): rectangle to fill with logical extents, or %NULL + * + * Obtains the extents of the current line. @ink_rect or @logical_rect + * can be %NULL if you aren't interested in them. Extents are in layout + * coordinates (origin is the top-left corner of the entire + * #PangoLayout). Thus the extents returned by this function will be + * the same width/height but not at the same x/y as the extents + * returned from pango_layout_line_get_extents(). + * + **/ +void +pango_layout_iter_get_line_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + const Extents *ext; + + if (ITER_IS_INVALID (iter)) + return; + + ext = &iter->line_extents[iter->line_index]; + + if (ink_rect) + { + get_line_extents_layout_coords (iter->layout, iter->line, + iter->layout_width, + ext->logical_rect.y, + NULL, + ink_rect, + NULL); + } + + if (logical_rect) + *logical_rect = ext->logical_rect; +} + +/** + * pango_layout_iter_get_line_yrange: + * @iter: a #PangoLayoutIter + * @y0_: (out) (allow-none): start of line, or %NULL + * @y1_: (out) (allow-none): end of line, or %NULL + * + * Divides the vertical space in the #PangoLayout being iterated over + * between the lines in the layout, and returns the space belonging to + * the current line. A line's range includes the line's logical + * extents, plus half of the spacing above and below the line, if + * pango_layout_set_spacing() has been called to set layout spacing. + * The Y positions are in layout coordinates (origin at top left of the + * entire layout). + * + **/ +void +pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, + int *y0, + int *y1) +{ + const Extents *ext; + int half_spacing; + + if (ITER_IS_INVALID (iter)) + return; + + ext = &iter->line_extents[iter->line_index]; + + half_spacing = iter->layout->spacing / 2; + + /* Note that if layout->spacing is odd, the remainder spacing goes + * above the line (this is pretty arbitrary of course) + */ + + if (y0) + { + /* No spacing above the first line */ + + if (iter->line_index == 0) + *y0 = ext->logical_rect.y; + else + *y0 = ext->logical_rect.y - (iter->layout->spacing - half_spacing); + } + + if (y1) + { + /* No spacing below the last line */ + if (iter->line_index == iter->layout->line_count - 1) + *y1 = ext->logical_rect.y + ext->logical_rect.height; + else + *y1 = ext->logical_rect.y + ext->logical_rect.height + half_spacing; + } +} + +/** + * pango_layout_iter_get_baseline: + * @iter: a #PangoLayoutIter + * + * Gets the Y position of the current line's baseline, in layout + * coordinates (origin at top left of the entire layout). + * + * Return value: baseline of current line. + **/ +int +pango_layout_iter_get_baseline (PangoLayoutIter *iter) +{ + if (ITER_IS_INVALID (iter)) + return 0; + + return iter->line_extents[iter->line_index].baseline; +} + +/** + * pango_layout_iter_get_layout_extents: + * @iter: a #PangoLayoutIter + * @ink_rect: (out) (allow-none): rectangle to fill with ink extents, + * or %NULL + * @logical_rect: (out) (allow-none): rectangle to fill with logical + * extents, or %NULL + * + * Obtains the extents of the #PangoLayout being iterated + * over. @ink_rect or @logical_rect can be %NULL if you + * aren't interested in them. + * + **/ +void +pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + if (ITER_IS_INVALID (iter)) + return; + + pango_layout_get_extents (iter->layout, ink_rect, logical_rect); +} diff --git a/pango/pango-layout.h b/pango/pango-layout.h new file mode 100644 index 0000000..b095a30 --- /dev/null +++ b/pango/pango-layout.h @@ -0,0 +1,430 @@ +/* Pango + * pango-layout.h: High-level layout driver + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_LAYOUT_H__ +#define __PANGO_LAYOUT_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +typedef struct _PangoLayout PangoLayout; +typedef struct _PangoLayoutClass PangoLayoutClass; +typedef struct _PangoLayoutLine PangoLayoutLine; + +/** + * PangoLayoutRun: + * + * The #PangoLayoutRun structure represents a single run within + * a #PangoLayoutLine; it is simply an alternate name for + * #PangoGlyphItem. + * See the #PangoGlyphItem docs for details on the fields. + */ +typedef PangoGlyphItem PangoLayoutRun; + +/** + * PangoAlignment: + * @PANGO_ALIGN_LEFT: Put all available space on the right + * @PANGO_ALIGN_CENTER: Center the line within the available space + * @PANGO_ALIGN_RIGHT: Put all available space on the left + * + * A #PangoAlignment describes how to align the lines of a #PangoLayout within the + * available space. If the #PangoLayout is set to justify + * using pango_layout_set_justify(), this only has effect for partial lines. + */ +typedef enum { + PANGO_ALIGN_LEFT, + PANGO_ALIGN_CENTER, + PANGO_ALIGN_RIGHT +} PangoAlignment; + +/** + * PangoWrapMode: + * @PANGO_WRAP_WORD: wrap lines at word boundaries. + * @PANGO_WRAP_CHAR: wrap lines at character boundaries. + * @PANGO_WRAP_WORD_CHAR: wrap lines at word boundaries, but fall back to character boundaries if there is not + * enough space for a full word. + * + * A #PangoWrapMode describes how to wrap the lines of a #PangoLayout to the desired width. + */ +typedef enum { + PANGO_WRAP_WORD, + PANGO_WRAP_CHAR, + PANGO_WRAP_WORD_CHAR +} PangoWrapMode; + +/** + * PangoEllipsizeMode: + * @PANGO_ELLIPSIZE_NONE: No ellipsization + * @PANGO_ELLIPSIZE_START: Omit characters at the start of the text + * @PANGO_ELLIPSIZE_MIDDLE: Omit characters in the middle of the text + * @PANGO_ELLIPSIZE_END: Omit characters at the end of the text + * + * The #PangoEllipsizeMode type describes what sort of (if any) + * ellipsization should be applied to a line of text. In + * the ellipsization process characters are removed from the + * text in order to make it fit to a given width and replaced + * with an ellipsis. + */ +typedef enum { + PANGO_ELLIPSIZE_NONE, + PANGO_ELLIPSIZE_START, + PANGO_ELLIPSIZE_MIDDLE, + PANGO_ELLIPSIZE_END +} PangoEllipsizeMode; + +/** + * PangoLayoutLine: + * @layout: (allow-none): the layout this line belongs to, might be %NULL + * @start_index: start of line as byte index into layout->text + * @length: length of line in bytes + * @runs: (allow-none) (element-type Pango.LayoutRun): list of runs in the + * line, from left to right + * @is_paragraph_start: #TRUE if this is the first line of the paragraph + * @resolved_dir: #Resolved PangoDirection of line + * + * The #PangoLayoutLine structure represents one of the lines resulting + * from laying out a paragraph via #PangoLayout. #PangoLayoutLine + * structures are obtained by calling pango_layout_get_line() and + * are only valid until the text, attributes, or settings of the + * parent #PangoLayout are modified. + * + * Routines for rendering PangoLayout objects are provided in + * code specific to each rendering system. + */ +struct _PangoLayoutLine +{ + PangoLayout *layout; + gint start_index; /* start of line as byte index into layout->text */ + gint length; /* length of line in bytes */ + GSList *runs; + guint is_paragraph_start : 1; /* TRUE if this is the first line of the paragraph */ + guint resolved_dir : 3; /* Resolved PangoDirection of line */ +}; + +#define PANGO_TYPE_LAYOUT (pango_layout_get_type ()) +#define PANGO_LAYOUT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_LAYOUT, PangoLayout)) +#define PANGO_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_LAYOUT, PangoLayoutClass)) +#define PANGO_IS_LAYOUT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_LAYOUT)) +#define PANGO_IS_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_LAYOUT)) +#define PANGO_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_LAYOUT, PangoLayoutClass)) + +/* The PangoLayout and PangoLayoutClass structs are private; if you + * need to create a subclass of these, file a bug. + */ + +PANGO_AVAILABLE_IN_ALL +GType pango_layout_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoLayout *pango_layout_new (PangoContext *context); +PANGO_AVAILABLE_IN_ALL +PangoLayout *pango_layout_copy (PangoLayout *src); + +PANGO_AVAILABLE_IN_ALL +PangoContext *pango_layout_get_context (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_attributes (PangoLayout *layout, + PangoAttrList *attrs); +PANGO_AVAILABLE_IN_ALL +PangoAttrList *pango_layout_get_attributes (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_text (PangoLayout *layout, + const char *text, + int length); +PANGO_AVAILABLE_IN_ALL +const char *pango_layout_get_text (PangoLayout *layout); + +PANGO_AVAILABLE_IN_1_30 +gint pango_layout_get_character_count (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_markup (PangoLayout *layout, + const char *markup, + int length); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_markup_with_accel (PangoLayout *layout, + const char *markup, + int length, + gunichar accel_marker, + gunichar *accel_char); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_font_description (PangoLayout *layout, + const PangoFontDescription *desc); + +PANGO_AVAILABLE_IN_1_8 +const PangoFontDescription *pango_layout_get_font_description (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_width (PangoLayout *layout, + int width); +PANGO_AVAILABLE_IN_ALL +int pango_layout_get_width (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_20 +void pango_layout_set_height (PangoLayout *layout, + int height); +PANGO_AVAILABLE_IN_1_20 +int pango_layout_get_height (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_wrap (PangoLayout *layout, + PangoWrapMode wrap); +PANGO_AVAILABLE_IN_ALL +PangoWrapMode pango_layout_get_wrap (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_16 +gboolean pango_layout_is_wrapped (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_indent (PangoLayout *layout, + int indent); +PANGO_AVAILABLE_IN_ALL +int pango_layout_get_indent (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_spacing (PangoLayout *layout, + int spacing); +PANGO_AVAILABLE_IN_ALL +int pango_layout_get_spacing (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_justify (PangoLayout *layout, + gboolean justify); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_get_justify (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_4 +void pango_layout_set_auto_dir (PangoLayout *layout, + gboolean auto_dir); +PANGO_AVAILABLE_IN_1_4 +gboolean pango_layout_get_auto_dir (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_alignment (PangoLayout *layout, + PangoAlignment alignment); +PANGO_AVAILABLE_IN_ALL +PangoAlignment pango_layout_get_alignment (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_tabs (PangoLayout *layout, + PangoTabArray *tabs); + +PANGO_AVAILABLE_IN_ALL +PangoTabArray* pango_layout_get_tabs (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_set_single_paragraph_mode (PangoLayout *layout, + gboolean setting); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout); + +PANGO_AVAILABLE_IN_1_6 +void pango_layout_set_ellipsize (PangoLayout *layout, + PangoEllipsizeMode ellipsize); +PANGO_AVAILABLE_IN_1_6 +PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_16 +gboolean pango_layout_is_ellipsized (PangoLayout *layout); + +PANGO_AVAILABLE_IN_1_16 +int pango_layout_get_unknown_glyphs_count (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_context_changed (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_32 +guint pango_layout_get_serial (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_log_attrs (PangoLayout *layout, + PangoLogAttr **attrs, + gint *n_attrs); + +PANGO_AVAILABLE_IN_1_30 +const PangoLogAttr *pango_layout_get_log_attrs_readonly (PangoLayout *layout, + gint *n_attrs); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_index_to_pos (PangoLayout *layout, + int index_, + PangoRectangle *pos); +PANGO_AVAILABLE_IN_ALL +void pango_layout_index_to_line_x (PangoLayout *layout, + int index_, + gboolean trailing, + int *line, + int *x_pos); +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_cursor_pos (PangoLayout *layout, + int index_, + PangoRectangle *strong_pos, + PangoRectangle *weak_pos); +PANGO_AVAILABLE_IN_ALL +void pango_layout_move_cursor_visually (PangoLayout *layout, + gboolean strong, + int old_index, + int old_trailing, + int direction, + int *new_index, + int *new_trailing); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_xy_to_index (PangoLayout *layout, + int x, + int y, + int *index_, + int *trailing); +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_extents (PangoLayout *layout, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_pixel_extents (PangoLayout *layout, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_size (PangoLayout *layout, + int *width, + int *height); +PANGO_AVAILABLE_IN_ALL +void pango_layout_get_pixel_size (PangoLayout *layout, + int *width, + int *height); +PANGO_AVAILABLE_IN_1_22 +int pango_layout_get_baseline (PangoLayout *layout); + +PANGO_AVAILABLE_IN_ALL +int pango_layout_get_line_count (PangoLayout *layout); +PANGO_AVAILABLE_IN_ALL +PangoLayoutLine *pango_layout_get_line (PangoLayout *layout, + int line); +PANGO_AVAILABLE_IN_1_16 +PangoLayoutLine *pango_layout_get_line_readonly (PangoLayout *layout, + int line); +PANGO_AVAILABLE_IN_ALL +GSList * pango_layout_get_lines (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_16 +GSList * pango_layout_get_lines_readonly (PangoLayout *layout); + + +#define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_layout_line_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_10 +PangoLayoutLine *pango_layout_line_ref (PangoLayoutLine *line); +PANGO_AVAILABLE_IN_ALL +void pango_layout_line_unref (PangoLayoutLine *line); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, + int x_pos, + int *index_, + int *trailing); +PANGO_AVAILABLE_IN_ALL +void pango_layout_line_index_to_x (PangoLayoutLine *line, + int index_, + gboolean trailing, + int *x_pos); +PANGO_AVAILABLE_IN_ALL +void pango_layout_line_get_x_ranges (PangoLayoutLine *line, + int start_index, + int end_index, + int **ranges, + int *n_ranges); +PANGO_AVAILABLE_IN_ALL +void pango_layout_line_get_extents (PangoLayoutLine *line, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +typedef struct _PangoLayoutIter PangoLayoutIter; + +#define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type ()) + +PANGO_AVAILABLE_IN_ALL +GType pango_layout_iter_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoLayoutIter *pango_layout_get_iter (PangoLayout *layout); +PANGO_AVAILABLE_IN_1_20 +PangoLayoutIter *pango_layout_iter_copy (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_free (PangoLayoutIter *iter); + +PANGO_AVAILABLE_IN_ALL +int pango_layout_iter_get_index (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +PangoLayoutRun *pango_layout_iter_get_run (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_1_16 +PangoLayoutRun *pango_layout_iter_get_run_readonly (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +PangoLayoutLine *pango_layout_iter_get_line (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_1_16 +PangoLayoutLine *pango_layout_iter_get_line_readonly (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_1_20 +PangoLayout *pango_layout_iter_get_layout (PangoLayoutIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_iter_next_char (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_iter_next_run (PangoLayoutIter *iter); +PANGO_AVAILABLE_IN_ALL +gboolean pango_layout_iter_next_line (PangoLayoutIter *iter); + +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +/* All the yranges meet, unlike the logical_rect's (i.e. the yranges + * assign between-line spacing to the nearest line) + */ +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, + int *y0_, + int *y1_); +PANGO_AVAILABLE_IN_ALL +void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +PANGO_AVAILABLE_IN_ALL +int pango_layout_iter_get_baseline (PangoLayoutIter *iter); + +G_END_DECLS + +#endif /* __PANGO_LAYOUT_H__ */ + diff --git a/pango/pango-markup.c b/pango/pango-markup.c new file mode 100644 index 0000000..22bf4fe --- /dev/null +++ b/pango/pango-markup.c @@ -0,0 +1,1673 @@ +/* Pango + * pango-markup.c: Parse markup into attributed text + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include + +#include "pango-attributes.h" +#include "pango-font.h" +#include "pango-enum-types.h" +#include "pango-impl-utils.h" +#include "pango-utils-internal.h" + +/* FIXME */ +#define _(x) x + +/* CSS size levels */ +typedef enum +{ + XXSmall = -3, + XSmall = -2, + Small = -1, + Medium = 0, + Large = 1, + XLarge = 2, + XXLarge = 3 +} SizeLevel; + +typedef struct _MarkupData MarkupData; + +struct _MarkupData +{ + PangoAttrList *attr_list; + GString *text; + GSList *tag_stack; + gsize index; + GSList *to_apply; + gunichar accel_marker; + gunichar accel_char; +}; + +typedef struct _OpenTag OpenTag; + +struct _OpenTag +{ + GSList *attrs; + gsize start_index; + /* Current total scale level; reset whenever + * an absolute size is set. + * Each "larger" ups it 1, each "smaller" decrements it 1 + */ + gint scale_level; + /* Our impact on scale_level, so we know whether we + * need to create an attribute ourselves on close + */ + gint scale_level_delta; + /* Base scale factor currently in effect + * or size that this tag + * forces, or parent's scale factor or size. + */ + double base_scale_factor; + int base_font_size; + guint has_base_font_size : 1; +}; + +typedef gboolean (*TagParseFunc) (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); + +static gboolean b_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean big_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean span_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean i_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean markup_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean s_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean sub_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean sup_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean small_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean tt_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); +static gboolean u_parse_func (MarkupData *md, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); + +static double +scale_factor (int scale_level, double base) +{ + double factor = base; + int i; + + /* 1.2 is the CSS scale factor between sizes */ + + if (scale_level > 0) + { + i = 0; + while (i < scale_level) + { + factor *= 1.2; + + ++i; + } + } + else if (scale_level < 0) + { + i = scale_level; + while (i < 0) + { + factor /= 1.2; + + ++i; + } + } + + return factor; +} + +static void +open_tag_free (OpenTag *ot) +{ + g_slist_foreach (ot->attrs, (GFunc) pango_attribute_destroy, NULL); + g_slist_free (ot->attrs); + g_slice_free (OpenTag, ot); +} + +static void +open_tag_set_absolute_font_size (OpenTag *ot, + int font_size) +{ + ot->base_font_size = font_size; + ot->has_base_font_size = TRUE; + ot->scale_level = 0; + ot->scale_level_delta = 0; +} + +static void +open_tag_set_absolute_font_scale (OpenTag *ot, + double scale) +{ + ot->base_scale_factor = scale; + ot->has_base_font_size = FALSE; + ot->scale_level = 0; + ot->scale_level_delta = 0; +} + +static OpenTag* +markup_data_open_tag (MarkupData *md) +{ + OpenTag *ot; + OpenTag *parent = NULL; + + if (md->attr_list == NULL) + return NULL; + + if (md->tag_stack) + parent = md->tag_stack->data; + + ot = g_slice_new (OpenTag); + ot->attrs = NULL; + ot->start_index = md->index; + ot->scale_level_delta = 0; + + if (parent == NULL) + { + ot->base_scale_factor = 1.0; + ot->base_font_size = 0; + ot->has_base_font_size = FALSE; + ot->scale_level = 0; + } + else + { + ot->base_scale_factor = parent->base_scale_factor; + ot->base_font_size = parent->base_font_size; + ot->has_base_font_size = parent->has_base_font_size; + ot->scale_level = parent->scale_level; + } + + md->tag_stack = g_slist_prepend (md->tag_stack, ot); + + return ot; +} + +static void +markup_data_close_tag (MarkupData *md) +{ + OpenTag *ot; + GSList *tmp_list; + + if (md->attr_list == NULL) + return; + + /* pop the stack */ + ot = md->tag_stack->data; + md->tag_stack = g_slist_delete_link (md->tag_stack, + md->tag_stack); + + /* Adjust end indexes, and push each attr onto the front of the + * to_apply list. This means that outermost tags are on the front of + * that list; if we apply the list in order, then the innermost + * tags will "win" which is correct. + */ + tmp_list = ot->attrs; + while (tmp_list != NULL) + { + PangoAttribute *a = tmp_list->data; + + a->start_index = ot->start_index; + a->end_index = md->index; + + md->to_apply = g_slist_prepend (md->to_apply, a); + + tmp_list = g_slist_next (tmp_list); + } + + if (ot->scale_level_delta != 0) + { + /* We affected relative font size; create an appropriate + * attribute and reverse our effects on the current level + */ + PangoAttribute *a; + + if (ot->has_base_font_size) + { + /* Create a font using the absolute point size + * as the base size to be scaled from + */ + a = pango_attr_size_new (scale_factor (ot->scale_level, + 1.0) * + ot->base_font_size); + } + else + { + /* Create a font using the current scale factor + * as the base size to be scaled from + */ + a = pango_attr_scale_new (scale_factor (ot->scale_level, + ot->base_scale_factor)); + } + + a->start_index = ot->start_index; + a->end_index = md->index; + + md->to_apply = g_slist_prepend (md->to_apply, a); + } + + g_slist_free (ot->attrs); + g_slice_free (OpenTag, ot); +} + +static void +start_element_handler (GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error) +{ + TagParseFunc parse_func = NULL; + OpenTag *ot; + + switch (*element_name) + { + case 'b': + if (strcmp ("b", element_name) == 0) + parse_func = b_parse_func; + else if (strcmp ("big", element_name) == 0) + parse_func = big_parse_func; + break; + + case 'i': + if (strcmp ("i", element_name) == 0) + parse_func = i_parse_func; + break; + + case 'm': + if (strcmp ("markup", element_name) == 0) + parse_func = markup_parse_func; + break; + + case 's': + if (strcmp ("span", element_name) == 0) + parse_func = span_parse_func; + else if (strcmp ("s", element_name) == 0) + parse_func = s_parse_func; + else if (strcmp ("sub", element_name) == 0) + parse_func = sub_parse_func; + else if (strcmp ("sup", element_name) == 0) + parse_func = sup_parse_func; + else if (strcmp ("small", element_name) == 0) + parse_func = small_parse_func; + break; + + case 't': + if (strcmp ("tt", element_name) == 0) + parse_func = tt_parse_func; + break; + + case 'u': + if (strcmp ("u", element_name) == 0) + parse_func = u_parse_func; + break; + } + + if (parse_func == NULL) + { + gint line_number, char_number; + + g_markup_parse_context_get_position (context, + &line_number, &char_number); + + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ELEMENT, + _("Unknown tag '%s' on line %d char %d"), + element_name, + line_number, char_number); + + return; + } + + ot = markup_data_open_tag (user_data); + + /* note ot may be NULL if the user didn't want the attribute list */ + + if (!(*parse_func) (user_data, ot, + attribute_names, attribute_values, + context, error)) + { + /* there's nothing to do; we return an error, and end up + * freeing ot off the tag stack later. + */ + } +} + +static void +end_element_handler (GMarkupParseContext *context G_GNUC_UNUSED, + const gchar *element_name G_GNUC_UNUSED, + gpointer user_data, + GError **error G_GNUC_UNUSED) +{ + markup_data_close_tag (user_data); +} + +static void +text_handler (GMarkupParseContext *context G_GNUC_UNUSED, + const gchar *text, + gsize text_len, + gpointer user_data, + GError **error G_GNUC_UNUSED) +{ + MarkupData *md = user_data; + + if (md->accel_marker == 0) + { + /* Just append all the text */ + + md->index += text_len; + + g_string_append_len (md->text, text, text_len); + } + else + { + /* Parse the accelerator */ + const gchar *p; + const gchar *end; + const gchar *range_start; + const gchar *range_end; + gssize uline_index = -1; + gsize uline_len = 0; /* Quiet GCC */ + + range_end = NULL; + range_start = text; + p = text; + end = text + text_len; + + while (p != end) + { + gunichar c; + + c = g_utf8_get_char (p); + + if (range_end) + { + if (c == md->accel_marker) + { + /* escaped accel marker; move range_end + * past the accel marker that came before, + * append the whole thing + */ + range_end = g_utf8_next_char (range_end); + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + + /* set next range_start, skipping accel marker */ + range_start = g_utf8_next_char (p); + } + else + { + /* Don't append the accel marker (leave range_end + * alone); set the accel char to c; record location for + * underline attribute + */ + if (md->accel_char == 0) + md->accel_char = c; + + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + + /* The underline should go underneath the char + * we're setting as the next range_start + */ + uline_index = md->index; + uline_len = g_utf8_next_char (p) - p; + + /* set next range_start to include this char */ + range_start = p; + } + + /* reset range_end */ + range_end = NULL; + } + else if (c == md->accel_marker) + { + range_end = p; + } + + p = g_utf8_next_char (p); + } + + if (range_end) + { + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + } + else + { + g_string_append_len (md->text, + range_start, + end - range_start); + md->index += end - range_start; + } + + if (md->attr_list != NULL && uline_index >= 0) + { + /* Add the underline indicating the accelerator */ + PangoAttribute *attr; + + attr = pango_attr_underline_new (PANGO_UNDERLINE_LOW); + + attr->start_index = uline_index; + attr->end_index = uline_index + uline_len; + + pango_attr_list_change (md->attr_list, attr); + } + } +} + +static gboolean +xml_isspace (char c) +{ + return c == ' ' || c == '\t' || c == '\n' || c == '\r'; +} + +static const GMarkupParser pango_markup_parser = { + start_element_handler, + end_element_handler, + text_handler, + NULL, + NULL +}; + +static void +destroy_markup_data (MarkupData *md) +{ + g_slist_free_full (md->tag_stack, (GDestroyNotify) open_tag_free); + g_slist_free_full (md->to_apply, (GDestroyNotify) pango_attribute_destroy); + if (md->text) + g_string_free (md->text, TRUE); + + if (md->attr_list) + pango_attr_list_unref (md->attr_list); + + g_slice_free (MarkupData, md); +} + +static GMarkupParseContext * +pango_markup_parser_new_internal (char accel_marker, + GError **error, + gboolean want_attr_list) +{ + MarkupData *md; + GMarkupParseContext *context; + + md = g_slice_new (MarkupData); + + /* Don't bother creating these if they weren't requested; + * might be useful e.g. if you just want to validate + * some markup. + */ + if (want_attr_list) + md->attr_list = pango_attr_list_new (); + else + md->attr_list = NULL; + + md->text = g_string_new (NULL); + + md->accel_marker = accel_marker; + md->accel_char = 0; + + md->index = 0; + md->tag_stack = NULL; + md->to_apply = NULL; + + context = g_markup_parse_context_new (&pango_markup_parser, + 0, md, + (GDestroyNotify)destroy_markup_data); + + if (!g_markup_parse_context_parse (context, + "", + -1, + error)) + goto error; + + return context; + + error: + g_markup_parse_context_free (context); + return NULL; +} + +/** + * pango_parse_markup: + * @markup_text: markup to parse (see markup format) + * @length: length of @markup_text, or -1 if nul-terminated + * @accel_marker: character that precedes an accelerator, or 0 for none + * @attr_list: (out) (allow-none): address of return location for a #PangoAttrList, or %NULL + * @text: (out) (allow-none): address of return location for text with tags stripped, or %NULL + * @accel_char: (out) (allow-none): address of return location for accelerator char, or %NULL + * @error: address of return location for errors, or %NULL + * + * Parses marked-up text (see + * markup format) to create + * a plain-text string and an attribute list. + * + * If @accel_marker is nonzero, the given character will mark the + * character following it as an accelerator. For example, @accel_marker + * might be an ampersand or underscore. All characters marked + * as an accelerator will receive a %PANGO_UNDERLINE_LOW attribute, + * and the first character so marked will be returned in @accel_char. + * Two @accel_marker characters following each other produce a single + * literal @accel_marker character. + * + * To parse a stream of pango markup incrementally, use pango_markup_parser_new(). + * + * If any error happens, none of the output arguments are touched except + * for @error. + * + * Return value: %FALSE if @error is set, otherwise %TRUE + **/ +gboolean +pango_parse_markup (const char *markup_text, + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error) +{ + GMarkupParseContext *context = NULL; + gboolean ret = FALSE; + const char *p; + const char *end; + + g_return_val_if_fail (markup_text != NULL, FALSE); + + if (length < 0) + length = strlen (markup_text); + + p = markup_text; + end = markup_text + length; + while (p != end && xml_isspace (*p)) + ++p; + + context = pango_markup_parser_new_internal (accel_marker, + error, + (attr_list != NULL)); + if (context == NULL) + goto out; + + if (!g_markup_parse_context_parse (context, + markup_text, + length, + error)) + goto out; + + if (!pango_markup_parser_finish (context, + attr_list, + text, + accel_char, + error)) + goto out; + + ret = TRUE; + + out: + if (context != NULL) + g_markup_parse_context_free (context); + return ret; +} + +/** + * pango_markup_parser_new: + * @accel_marker: character that precedes an accelerator, or 0 for none + * + * Parses marked-up text (see + * markup format) to create + * a plain-text string and an attribute list. + * + * If @accel_marker is nonzero, the given character will mark the + * character following it as an accelerator. For example, @accel_marker + * might be an ampersand or underscore. All characters marked + * as an accelerator will receive a %PANGO_UNDERLINE_LOW attribute, + * and the first character so marked will be returned in @accel_char, + * when calling finish(). Two @accel_marker characters following each + * other produce a single literal @accel_marker character. + * + * To feed markup to the parser, use g_markup_parse_context_parse() + * on the returned #GMarkupParseContext. When done with feeding markup + * to the parser, use pango_markup_parser_finish() to get the data out + * of it, and then use g_markup_parse_context_free() to free it. + * + * This function is designed for applications that read pango markup + * from streams. To simply parse a string containing pango markup, + * the simpler pango_parse_markup() API is recommended instead. + * + * Return value: (transfer none): a #GMarkupParseContext that should be + * destroyed with g_markup_parse_context_free(). + * + * Since: 1.31.0 + **/ +GMarkupParseContext * +pango_markup_parser_new (gunichar accel_marker) +{ + GError *error = NULL; + GMarkupParseContext *context; + context = pango_markup_parser_new_internal (accel_marker, &error, TRUE); + + if (context == NULL) + g_critical ("Had error when making markup parser: %s\n", error->message); + + return context; +} + +/** + * pango_markup_parser_finish: + * @context: A valid parse context that was returned from pango_markup_parser_new() + * @attr_list: (out) (allow-none): address of return location for a #PangoAttrList, or %NULL + * @text: (out) (allow-none): address of return location for text with tags stripped, or %NULL + * @accel_char: (out) (allow-none): address of return location for accelerator char, or %NULL + * @error: address of return location for errors, or %NULL + * + * After feeding a pango markup parser some data with g_markup_parse_context_parse(), + * use this function to get the list of pango attributes and text out of the + * markup. This function will not free @context, use g_markup_parse_context_free() + * to do so. + * + * Return value: %FALSE if @error is set, otherwise %TRUE + * + * Since: 1.31.0 + */ +gboolean +pango_markup_parser_finish (GMarkupParseContext *context, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error) +{ + gboolean ret = FALSE; + MarkupData *md = g_markup_parse_context_get_user_data (context); + GSList *tmp_list; + + if (!g_markup_parse_context_parse (context, + "", + -1, + error)) + goto out; + + if (!g_markup_parse_context_end_parse (context, error)) + goto out; + + if (md->attr_list) + { + /* The apply list has the most-recently-closed tags first; + * we want to apply the least-recently-closed tag last. + */ + tmp_list = md->to_apply; + while (tmp_list != NULL) + { + PangoAttribute *attr = tmp_list->data; + + /* Innermost tags before outermost */ + pango_attr_list_insert (md->attr_list, attr); + + tmp_list = g_slist_next (tmp_list); + } + g_slist_free (md->to_apply); + md->to_apply = NULL; + } + + if (attr_list) + { + *attr_list = md->attr_list; + md->attr_list = NULL; + } + + if (text) + { + *text = g_string_free (md->text, FALSE); + md->text = NULL; + } + + if (accel_char) + *accel_char = md->accel_char; + + g_assert (md->tag_stack == NULL); + ret = TRUE; + + out: + return ret; +} + +static void +set_bad_attribute (GError **error, + GMarkupParseContext *context, + const char *element_name, + const char *attribute_name) +{ + gint line_number, char_number; + + g_markup_parse_context_get_position (context, + &line_number, &char_number); + + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, + _("Tag '%s' does not support attribute '%s' on line %d char %d"), + element_name, + attribute_name, + line_number, char_number); +} + +static void +add_attribute (OpenTag *ot, + PangoAttribute *attr) +{ + if (ot == NULL) + pango_attribute_destroy (attr); + else + ot->attrs = g_slist_prepend (ot->attrs, attr); +} + +#define CHECK_NO_ATTRS(elem) G_STMT_START { \ + if (*names != NULL) { \ + set_bad_attribute (error, context, (elem), *names); \ + return FALSE; \ + } }G_STMT_END + +static gboolean +b_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("b"); + add_attribute (tag, pango_attr_weight_new (PANGO_WEIGHT_BOLD)); + return TRUE; +} + +static gboolean +big_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("big"); + + /* Grow text one level */ + if (tag) + { + tag->scale_level_delta += 1; + tag->scale_level += 1; + } + + return TRUE; +} + +static gboolean +parse_absolute_size (OpenTag *tag, + const char *size) +{ + SizeLevel level = Medium; + double factor; + + if (strcmp (size, "xx-small") == 0) + level = XXSmall; + else if (strcmp (size, "x-small") == 0) + level = XSmall; + else if (strcmp (size, "small") == 0) + level = Small; + else if (strcmp (size, "medium") == 0) + level = Medium; + else if (strcmp (size, "large") == 0) + level = Large; + else if (strcmp (size, "x-large") == 0) + level = XLarge; + else if (strcmp (size, "xx-large") == 0) + level = XXLarge; + else + return FALSE; + + /* This is "absolute" in that it's relative to the base font, + * but not to sizes created by any other tags + */ + factor = scale_factor (level, 1.0); + add_attribute (tag, pango_attr_scale_new (factor)); + if (tag) + open_tag_set_absolute_font_scale (tag, factor); + + return TRUE; +} + +/* a string compare func that ignores '-' vs '_' differences */ +static gint +attr_strcmp (gconstpointer pa, + gconstpointer pb) +{ + const char *a = pa; + const char *b = pb; + + int ca; + int cb; + + while (*a && *b) + { + ca = *a++; + cb = *b++; + + if (ca == cb) + continue; + + ca = ca == '_' ? '-' : ca; + cb = cb == '_' ? '-' : cb; + + if (ca != cb) + return cb - ca; + } + + ca = *a; + cb = *b; + + return cb - ca; +} + +static gboolean +span_parse_int (const char *attr_name, + const char *attr_val, + int *val, + int line_number, + GError **error) +{ + const char *end = attr_val; + + if (!_pango_scan_int (&end, val) || *end != '\0') + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of '%s' attribute on tag " + "on line %d could not be parsed; " + "should be an integer, not '%s'"), + attr_name, line_number, attr_val); + return FALSE; + } + + return TRUE; +} + +static gboolean +span_parse_boolean (const char *attr_name, + const char *attr_val, + gboolean *val, + int line_number, + GError **error) +{ + if (strcmp (attr_val, "true") == 0 || + strcmp (attr_val, "yes") == 0 || + strcmp (attr_val, "t") == 0 || + strcmp (attr_val, "y") == 0) + *val = TRUE; + else if (strcmp (attr_val, "false") == 0 || + strcmp (attr_val, "no") == 0 || + strcmp (attr_val, "f") == 0 || + strcmp (attr_val, "n") == 0) + *val = FALSE; + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of '%s' attribute on tag " + "line %d should have one of " + "'true/yes/t/y' or 'false/no/f/n': '%s' is not valid"), + attr_name, line_number, attr_val); + return FALSE; + } + + return TRUE; +} + +static gboolean +span_parse_color (const char *attr_name, + const char *attr_val, + PangoColor *color, + guint16 *alpha, + int line_number, + GError **error) +{ + if (!_pango_color_parse_with_alpha (color, alpha, attr_val)) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of '%s' attribute on tag " + "on line %d could not be parsed; " + "should be a color specification, not '%s'"), + attr_name, line_number, attr_val); + return FALSE; + } + + return TRUE; +} + +static gboolean +span_parse_alpha (const char *attr_name, + const char *attr_val, + guint16 *val, + int line_number, + GError **error) +{ + const char *end = attr_val; + int int_val; + + if (_pango_scan_int (&end, &int_val)) + { + if (*end == '\0' && int_val > 0 && int_val <= 0xffff) + { + *val = (guint16)int_val; + return TRUE; + } + else if (*end == '%' && int_val > 0 && int_val <= 100) + { + *val = (guint16)(int_val * 0xffff / 100); + return TRUE; + } + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of '%s' attribute on tag " + "on line %d could not be parsed; " + "should be between 0 and 65536 or a " + "percentage, not '%s'"), + attr_name, line_number, attr_val); + return FALSE; + } + } + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of '%s' attribute on tag " + "on line %d could not be parsed; " + "should be an integer, not '%s'"), + attr_name, line_number, attr_val); + return FALSE; + } + + return TRUE; +} + +static gboolean +span_parse_enum (const char *attr_name, + const char *attr_val, + GType type, + int *val, + int line_number, + GError **error) +{ + char *possible_values = NULL; + + if (!_pango_parse_enum (type, attr_val, val, FALSE, &possible_values)) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the '%s' " + "attribute on tag, line %d; valid " + "values are %s"), + attr_val, attr_name, line_number, possible_values); + g_free (possible_values); + return FALSE; + } + + return TRUE; +} + +static gboolean +span_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) +{ + int line_number, char_number; + int i; + + const char *family = NULL; + const char *size = NULL; + const char *style = NULL; + const char *weight = NULL; + const char *variant = NULL; + const char *stretch = NULL; + const char *desc = NULL; + const char *foreground = NULL; + const char *background = NULL; + const char *underline = NULL; + const char *underline_color = NULL; + const char *strikethrough = NULL; + const char *strikethrough_color = NULL; + const char *rise = NULL; + const char *letter_spacing = NULL; + const char *lang = NULL; + const char *fallback = NULL; + const char *gravity = NULL; + const char *gravity_hint = NULL; + const char *font_features = NULL; + const char *alpha = NULL; + const char *background_alpha = NULL; + + g_markup_parse_context_get_position (context, + &line_number, &char_number); + +#define CHECK_DUPLICATE(var) G_STMT_START{ \ + if ((var) != NULL) { \ + g_set_error (error, G_MARKUP_ERROR, \ + G_MARKUP_ERROR_INVALID_CONTENT, \ + _("Attribute '%s' occurs twice on tag " \ + "on line %d char %d, may only occur once"), \ + names[i], line_number, char_number); \ + return FALSE; \ + }}G_STMT_END +#define CHECK_ATTRIBUTE2(var, name) \ + if (attr_strcmp (names[i], (name)) == 0) { \ + CHECK_DUPLICATE (var); \ + (var) = values[i]; \ + found = TRUE; \ + break; \ + } +#define CHECK_ATTRIBUTE(var) CHECK_ATTRIBUTE2 (var, G_STRINGIFY (var)) + + i = 0; + while (names[i]) + { + gboolean found = FALSE; + + switch (names[i][0]) { + case 'a': + CHECK_ATTRIBUTE (alpha); + break; + case 'b': + CHECK_ATTRIBUTE (background); + CHECK_ATTRIBUTE2(background, "bgcolor"); + CHECK_ATTRIBUTE (background_alpha); + CHECK_ATTRIBUTE2(background_alpha, "bgalpha"); + break; + case 'c': + CHECK_ATTRIBUTE2(foreground, "color"); + break; + case 'f': + CHECK_ATTRIBUTE (fallback); + CHECK_ATTRIBUTE2(desc, "font"); + CHECK_ATTRIBUTE2(desc, "font_desc"); + CHECK_ATTRIBUTE2(family, "face"); + + CHECK_ATTRIBUTE2(family, "font_family"); + CHECK_ATTRIBUTE2(size, "font_size"); + CHECK_ATTRIBUTE2(stretch, "font_stretch"); + CHECK_ATTRIBUTE2(style, "font_style"); + CHECK_ATTRIBUTE2(variant, "font_variant"); + CHECK_ATTRIBUTE2(weight, "font_weight"); + + CHECK_ATTRIBUTE (foreground); + CHECK_ATTRIBUTE2(foreground, "fgcolor"); + CHECK_ATTRIBUTE2(alpha, "fgalpha"); + + CHECK_ATTRIBUTE (font_features); + break; + case 's': + CHECK_ATTRIBUTE (size); + CHECK_ATTRIBUTE (stretch); + CHECK_ATTRIBUTE (strikethrough); + CHECK_ATTRIBUTE (strikethrough_color); + CHECK_ATTRIBUTE (style); + break; + case 'g': + CHECK_ATTRIBUTE (gravity); + CHECK_ATTRIBUTE (gravity_hint); + break; + case 'l': + CHECK_ATTRIBUTE (lang); + CHECK_ATTRIBUTE (letter_spacing); + break; + case 'u': + CHECK_ATTRIBUTE (underline); + CHECK_ATTRIBUTE (underline_color); + break; + default: + CHECK_ATTRIBUTE (rise); + CHECK_ATTRIBUTE (variant); + CHECK_ATTRIBUTE (weight); + break; + } + + if (!found) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, + _("Attribute '%s' is not allowed on the tag " + "on line %d char %d"), + names[i], line_number, char_number); + return FALSE; + } + + ++i; + } + + /* Parse desc first, then modify it with other font-related attributes. */ + if (G_UNLIKELY (desc)) + { + PangoFontDescription *parsed; + + parsed = pango_font_description_from_string (desc); + if (parsed) + { + add_attribute (tag, pango_attr_font_desc_new (parsed)); + if (tag) + open_tag_set_absolute_font_size (tag, pango_font_description_get_size (parsed)); + pango_font_description_free (parsed); + } + } + + if (G_UNLIKELY (family)) + { + add_attribute (tag, pango_attr_family_new (family)); + } + + if (G_UNLIKELY (size)) + { + if (g_ascii_isdigit (*size)) + { + const char *end; + gint n; + + if ((end = size, !_pango_scan_int (&end, &n)) || *end != '\0' || n < 0) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of 'size' attribute on tag on line %d " + "could not be parsed; should be an integer no more than %d," + " or a string such as 'small', not '%s'"), + line_number, INT_MAX, size); + goto error; + } + + add_attribute (tag, pango_attr_size_new (n)); + if (tag) + open_tag_set_absolute_font_size (tag, n); + } + else if (strcmp (size, "smaller") == 0) + { + if (tag) + { + tag->scale_level_delta -= 1; + tag->scale_level -= 1; + } + } + else if (strcmp (size, "larger") == 0) + { + if (tag) + { + tag->scale_level_delta += 1; + tag->scale_level += 1; + } + } + else if (parse_absolute_size (tag, size)) + ; /* nothing */ + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of 'size' attribute on tag on line %d " + "could not be parsed; should be an integer, or a " + "string such as 'small', not '%s'"), + line_number, size); + goto error; + } + } + + if (G_UNLIKELY (style)) + { + PangoStyle pango_style; + + if (pango_parse_style (style, &pango_style, FALSE)) + add_attribute (tag, pango_attr_style_new (pango_style)); + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'style' attribute " + "on tag, line %d; valid values are " + "'normal', 'oblique', 'italic'"), + style, line_number); + goto error; + } + } + + if (G_UNLIKELY (weight)) + { + PangoWeight pango_weight; + + if (pango_parse_weight (weight, &pango_weight, FALSE)) + add_attribute (tag, + pango_attr_weight_new (pango_weight)); + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'weight' " + "attribute on tag, line %d; valid " + "values are for example 'light', 'ultrabold' or a number"), + weight, line_number); + goto error; + } + } + + if (G_UNLIKELY (variant)) + { + PangoVariant pango_variant; + + if (pango_parse_variant (variant, &pango_variant, FALSE)) + add_attribute (tag, pango_attr_variant_new (pango_variant)); + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'variant' " + "attribute on tag, line %d; valid values are " + "'normal', 'smallcaps'"), + variant, line_number); + goto error; + } + } + + if (G_UNLIKELY (stretch)) + { + PangoStretch pango_stretch; + + if (pango_parse_stretch (stretch, &pango_stretch, FALSE)) + add_attribute (tag, pango_attr_stretch_new (pango_stretch)); + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'stretch' " + "attribute on tag, line %d; valid " + "values are for example 'condensed', " + "'ultraexpanded', 'normal'"), + stretch, line_number); + goto error; + } + } + + if (G_UNLIKELY (foreground)) + { + PangoColor color; + guint16 alpha; + + if (!span_parse_color ("foreground", foreground, &color, &alpha, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_foreground_new (color.red, color.green, color.blue)); + if (alpha != 0) + add_attribute (tag, pango_attr_foreground_alpha_new (alpha)); + } + + if (G_UNLIKELY (background)) + { + PangoColor color; + guint16 alpha; + + if (!span_parse_color ("background", background, &color, &alpha, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_background_new (color.red, color.green, color.blue)); + if (alpha != 0) + add_attribute (tag, pango_attr_background_alpha_new (alpha)); + } + + if (G_UNLIKELY (alpha)) + { + guint16 val; + + if (!span_parse_alpha ("alpha", alpha, &val, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_foreground_alpha_new (val)); + } + + if (G_UNLIKELY (background_alpha)) + { + guint16 val; + + if (!span_parse_alpha ("background_alpha", background_alpha, &val, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_background_alpha_new (val)); + } + + if (G_UNLIKELY (underline)) + { + PangoUnderline ul = PANGO_UNDERLINE_NONE; + + if (!span_parse_enum ("underline", underline, PANGO_TYPE_UNDERLINE, (int*)(void*)&ul, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_underline_new (ul)); + } + + if (G_UNLIKELY (underline_color)) + { + PangoColor color; + + if (!span_parse_color ("underline_color", underline_color, &color, NULL, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_underline_color_new (color.red, color.green, color.blue)); + } + + if (G_UNLIKELY (gravity)) + { + PangoGravity gr = PANGO_GRAVITY_SOUTH; + + if (!span_parse_enum ("gravity", gravity, PANGO_TYPE_GRAVITY, (int*)(void*)&gr, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_gravity_new (gr)); + } + + if (G_UNLIKELY (gravity_hint)) + { + PangoGravityHint hint = PANGO_GRAVITY_HINT_NATURAL; + + if (!span_parse_enum ("gravity_hint", gravity_hint, PANGO_TYPE_GRAVITY_HINT, (int*)(void*)&hint, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_gravity_hint_new (hint)); + } + + if (G_UNLIKELY (strikethrough)) + { + gboolean b = FALSE; + + if (!span_parse_boolean ("strikethrough", strikethrough, &b, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_strikethrough_new (b)); + } + + if (G_UNLIKELY (strikethrough_color)) + { + PangoColor color; + + if (!span_parse_color ("strikethrough_color", strikethrough_color, &color, NULL, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_strikethrough_color_new (color.red, color.green, color.blue)); + } + + if (G_UNLIKELY (fallback)) + { + gboolean b = FALSE; + + if (!span_parse_boolean ("fallback", fallback, &b, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_fallback_new (b)); + } + + if (G_UNLIKELY (rise)) + { + gint n = 0; + + if (!span_parse_int ("rise", rise, &n, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_rise_new (n)); + } + + if (G_UNLIKELY (letter_spacing)) + { + gint n = 0; + + if (!span_parse_int ("letter_spacing", letter_spacing, &n, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_letter_spacing_new (n)); + } + + if (G_UNLIKELY (lang)) + { + add_attribute (tag, + pango_attr_language_new (pango_language_from_string (lang))); + } + + if (G_UNLIKELY (font_features)) + { + add_attribute (tag, pango_attr_font_features_new (font_features)); + } + + return TRUE; + + error: + + return FALSE; +} + +static gboolean +i_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("i"); + add_attribute (tag, pango_attr_style_new (PANGO_STYLE_ITALIC)); + + return TRUE; +} + +static gboolean +markup_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag G_GNUC_UNUSED, + const gchar **names G_GNUC_UNUSED, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context G_GNUC_UNUSED, + GError **error G_GNUC_UNUSED) +{ + /* We don't do anything with this tag at the moment. */ + + return TRUE; +} + +static gboolean +s_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("s"); + add_attribute (tag, pango_attr_strikethrough_new (TRUE)); + + return TRUE; +} + +#define SUPERSUB_RISE 5000 + +static gboolean +sub_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("sub"); + + /* Shrink font, and set a negative rise */ + if (tag) + { + tag->scale_level_delta -= 1; + tag->scale_level -= 1; + } + + add_attribute (tag, pango_attr_rise_new (-SUPERSUB_RISE)); + + return TRUE; +} + +static gboolean +sup_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("sup"); + + /* Shrink font, and set a positive rise */ + if (tag) + { + tag->scale_level_delta -= 1; + tag->scale_level -= 1; + } + + add_attribute (tag, pango_attr_rise_new (SUPERSUB_RISE)); + + return TRUE; +} + +static gboolean +small_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("small"); + + /* Shrink text one level */ + if (tag) + { + tag->scale_level_delta -= 1; + tag->scale_level -= 1; + } + + return TRUE; +} + +static gboolean +tt_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("tt"); + + add_attribute (tag, pango_attr_family_new ("Monospace")); + + return TRUE; +} + +static gboolean +u_parse_func (MarkupData *md G_GNUC_UNUSED, + OpenTag *tag, + const gchar **names, + const gchar **values G_GNUC_UNUSED, + GMarkupParseContext *context, + GError **error) +{ + CHECK_NO_ATTRS("u"); + add_attribute (tag, pango_attr_underline_new (PANGO_UNDERLINE_SINGLE)); + + return TRUE; +} diff --git a/pango/pango-matrix.c b/pango/pango-matrix.c new file mode 100644 index 0000000..50f8be1 --- /dev/null +++ b/pango/pango-matrix.c @@ -0,0 +1,480 @@ +/* Pango + * pango-matrix.c: Matrix manipulation routines + * + * Copyright (C) 2000, 2006 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include + +#include "pango-matrix.h" +#include "pango-impl-utils.h" + +G_DEFINE_BOXED_TYPE (PangoMatrix, pango_matrix, + pango_matrix_copy, + pango_matrix_free); + +/** + * pango_matrix_copy: + * @matrix: (nullable): a #PangoMatrix, may be %NULL + * + * Copies a #PangoMatrix. + * + * Return value: (nullable): the newly allocated #PangoMatrix, which + * should be freed with pango_matrix_free(), or %NULL if + * @matrix was %NULL. + * + * Since: 1.6 + **/ +PangoMatrix * +pango_matrix_copy (const PangoMatrix *matrix) +{ + PangoMatrix *new_matrix; + + if (matrix == NULL) + return NULL; + + new_matrix = g_slice_new (PangoMatrix); + + *new_matrix = *matrix; + + return new_matrix; +} + +/** + * pango_matrix_free: + * @matrix: (nullable): a #PangoMatrix, may be %NULL + * + * Free a #PangoMatrix created with pango_matrix_copy(). + * + * Since: 1.6 + **/ +void +pango_matrix_free (PangoMatrix *matrix) +{ + if (matrix == NULL) + return; + + g_slice_free (PangoMatrix, matrix); +} + +/** + * pango_matrix_translate: + * @matrix: a #PangoMatrix + * @tx: amount to translate in the X direction + * @ty: amount to translate in the Y direction + * + * Changes the transformation represented by @matrix to be the + * transformation given by first translating by (@tx, @ty) + * then applying the original transformation. + * + * Since: 1.6 + **/ +void +pango_matrix_translate (PangoMatrix *matrix, + double tx, + double ty) +{ + g_return_if_fail (matrix != NULL); + + matrix->x0 = matrix->xx * tx + matrix->xy * ty + matrix->x0; + matrix->y0 = matrix->yx * tx + matrix->yy * ty + matrix->y0; +} + +/** + * pango_matrix_scale: + * @matrix: a #PangoMatrix + * @scale_x: amount to scale by in X direction + * @scale_y: amount to scale by in Y direction + * + * Changes the transformation represented by @matrix to be the + * transformation given by first scaling by @sx in the X direction + * and @sy in the Y direction then applying the original + * transformation. + * + * Since: 1.6 + **/ +void +pango_matrix_scale (PangoMatrix *matrix, + double scale_x, + double scale_y) +{ + g_return_if_fail (matrix != NULL); + + matrix->xx *= scale_x; + matrix->xy *= scale_y; + matrix->yx *= scale_x; + matrix->yy *= scale_y; +} + +/** + * pango_matrix_rotate: + * @matrix: a #PangoMatrix + * @degrees: degrees to rotate counter-clockwise + * + * Changes the transformation represented by @matrix to be the + * transformation given by first rotating by @degrees degrees + * counter-clockwise then applying the original transformation. + * + * Since: 1.6 + **/ +void +pango_matrix_rotate (PangoMatrix *matrix, + double degrees) +{ + PangoMatrix tmp; + gdouble r, s, c; + + g_return_if_fail (matrix != NULL); + + r = degrees * (G_PI / 180.); + s = sin (r); + c = cos (r); + + tmp.xx = c; + tmp.xy = s; + tmp.yx = -s; + tmp.yy = c; + tmp.x0 = 0; + tmp.y0 = 0; + + pango_matrix_concat (matrix, &tmp); +} + +/** + * pango_matrix_concat: + * @matrix: a #PangoMatrix + * @new_matrix: a #PangoMatrix + * + * Changes the transformation represented by @matrix to be the + * transformation given by first applying transformation + * given by @new_matrix then applying the original transformation. + * + * Since: 1.6 + **/ +void +pango_matrix_concat (PangoMatrix *matrix, + const PangoMatrix *new_matrix) +{ + PangoMatrix tmp; + + g_return_if_fail (matrix != NULL); + + tmp = *matrix; + + matrix->xx = tmp.xx * new_matrix->xx + tmp.xy * new_matrix->yx; + matrix->xy = tmp.xx * new_matrix->xy + tmp.xy * new_matrix->yy; + matrix->yx = tmp.yx * new_matrix->xx + tmp.yy * new_matrix->yx; + matrix->yy = tmp.yx * new_matrix->xy + tmp.yy * new_matrix->yy; + matrix->x0 = tmp.xx * new_matrix->x0 + tmp.xy * new_matrix->y0 + tmp.x0; + matrix->y0 = tmp.yx * new_matrix->x0 + tmp.yy * new_matrix->y0 + tmp.y0; +} + +/** + * pango_matrix_get_font_scale_factor: + * @matrix: (allow-none): a #PangoMatrix, may be %NULL + * + * Returns the scale factor of a matrix on the height of the font. + * That is, the scale factor in the direction perpendicular to the + * vector that the X coordinate is mapped to. If the scale in the X + * coordinate is needed as well, use pango_matrix_get_font_scale_factors(). + * + * Return value: the scale factor of @matrix on the height of the font, + * or 1.0 if @matrix is %NULL. + * + * Since: 1.12 + **/ +double +pango_matrix_get_font_scale_factor (const PangoMatrix *matrix) +{ + double yscale; + pango_matrix_get_font_scale_factors (matrix, NULL, &yscale); + return yscale; +} + +/** + * pango_matrix_get_font_scale_factors: + * @matrix: (nullable): a #PangoMatrix, or %NULL + * @xscale: (out) (allow-none): output scale factor in the x direction, or %NULL + * @yscale: (out) (allow-none): output scale factor perpendicular to the x direction, or %NULL + * + * Calculates the scale factor of a matrix on the width and height of the font. + * That is, @xscale is the scale factor in the direction of the X coordinate, + * and @yscale is the scale factor in the direction perpendicular to the + * vector that the X coordinate is mapped to. + * + * Note that output numbers will always be non-negative. + * + * Since: 1.38 + **/ +void +pango_matrix_get_font_scale_factors (const PangoMatrix *matrix, + double *xscale, double *yscale) +{ +/* + * Based on cairo-matrix.c:_cairo_matrix_compute_scale_factors() + * + * Copyright 2005, Keith Packard + */ + double major = 1., minor = 1.; + + if (matrix) + { + double x = matrix->xx; + double y = matrix->yx; + major = sqrt (x*x + y*y); + + if (major) + { + double det = matrix->xx * matrix->yy - matrix->yx * matrix->xy; + + /* + * ignore mirroring + */ + if (det < 0) + det = - det; + + minor = det / major; + } + else + minor = 0.; + } + + if (xscale) + *xscale = major; + if (yscale) + *yscale = minor; +} + +/** + * pango_matrix_transform_distance: + * @matrix: (nullable): a #PangoMatrix, or %NULL + * @dx: (inout): in/out X component of a distance vector + * @dy: (inout): in/out Y component of a distance vector + * + * Transforms the distance vector (@dx,@dy) by @matrix. This is + * similar to pango_matrix_transform_point() except that the translation + * components of the transformation are ignored. The calculation of + * the returned vector is as follows: + * + * + * dx2 = dx1 * xx + dy1 * xy; + * dy2 = dx1 * yx + dy1 * yy; + * + * + * Affine transformations are position invariant, so the same vector + * always transforms to the same vector. If (@x1,@y1) transforms + * to (@x2,@y2) then (@x1+@dx1,@y1+@dy1) will transform to + * (@x1+@dx2,@y1+@dy2) for all values of @x1 and @x2. + * + * Since: 1.16 + **/ +void +pango_matrix_transform_distance (const PangoMatrix *matrix, + double *dx, + double *dy) +{ + if (matrix) + { + double new_x, new_y; + + new_x = (matrix->xx * *dx + matrix->xy * *dy); + new_y = (matrix->yx * *dx + matrix->yy * *dy); + + *dx = new_x; + *dy = new_y; + } +} + +/** + * pango_matrix_transform_point: + * @matrix: (nullable): a #PangoMatrix, or %NULL + * @x: (inout): in/out X position + * @y: (inout): in/out Y position + * + * Transforms the point (@x, @y) by @matrix. + * + * Since: 1.16 + **/ +void +pango_matrix_transform_point (const PangoMatrix *matrix, + double *x, + double *y) +{ + if (matrix) + { + pango_matrix_transform_distance (matrix, x, y); + + *x += matrix->x0; + *y += matrix->y0; + } +} + +/** + * pango_matrix_transform_rectangle: + * @matrix: (nullable): a #PangoMatrix, or %NULL + * @rect: (inout) (allow-none): in/out bounding box in Pango units, or %NULL + * + * First transforms @rect using @matrix, then calculates the bounding box + * of the transformed rectangle. The rectangle should be in Pango units. + * + * This function is useful for example when you want to draw a rotated + * @PangoLayout to an image buffer, and want to know how large the image + * should be and how much you should shift the layout when rendering. + * + * If you have a rectangle in device units (pixels), use + * pango_matrix_transform_pixel_rectangle(). + * + * If you have the rectangle in Pango units and want to convert to + * transformed pixel bounding box, it is more accurate to transform it first + * (using this function) and pass the result to pango_extents_to_pixels(), + * first argument, for an inclusive rounded rectangle. + * However, there are valid reasons that you may want to convert + * to pixels first and then transform, for example when the transformed + * coordinates may overflow in Pango units (large matrix translation for + * example). + * + * Since: 1.16 + **/ +void +pango_matrix_transform_rectangle (const PangoMatrix *matrix, + PangoRectangle *rect) +{ + int i; + double quad_x[4], quad_y[4]; + double dx1, dy1; + double dx2, dy2; + double min_x, max_x; + double min_y, max_y; + + if (!rect || !matrix) + return; + + quad_x[0] = pango_units_to_double (rect->x); + quad_y[0] = pango_units_to_double (rect->y); + pango_matrix_transform_point (matrix, &quad_x[0], &quad_y[0]); + + dx1 = pango_units_to_double (rect->width); + dy1 = 0; + pango_matrix_transform_distance (matrix, &dx1, &dy1); + quad_x[1] = quad_x[0] + dx1; + quad_y[1] = quad_y[0] + dy1; + + dx2 = 0; + dy2 = pango_units_to_double (rect->height); + pango_matrix_transform_distance (matrix, &dx2, &dy2); + quad_x[2] = quad_x[0] + dx2; + quad_y[2] = quad_y[0] + dy2; + + quad_x[3] = quad_x[0] + dx1 + dx2; + quad_y[3] = quad_y[0] + dy1 + dy2; + + min_x = max_x = quad_x[0]; + min_y = max_y = quad_y[0]; + + for (i=1; i < 4; i++) { + if (quad_x[i] < min_x) + min_x = quad_x[i]; + else if (quad_x[i] > max_x) + max_x = quad_x[i]; + + if (quad_y[i] < min_y) + min_y = quad_y[i]; + else if (quad_y[i] > max_y) + max_y = quad_y[i]; + } + + rect->x = pango_units_from_double (min_x); + rect->y = pango_units_from_double (min_y); + rect->width = pango_units_from_double (max_x) - rect->x; + rect->height = pango_units_from_double (max_y) - rect->y; +} + +/** + * pango_matrix_transform_pixel_rectangle: + * @matrix: (nullable): a #PangoMatrix, or %NULL + * @rect: (inout) (allow-none): in/out bounding box in device units, or %NULL + * + * First transforms the @rect using @matrix, then calculates the bounding box + * of the transformed rectangle. The rectangle should be in device units + * (pixels). + * + * This function is useful for example when you want to draw a rotated + * @PangoLayout to an image buffer, and want to know how large the image + * should be and how much you should shift the layout when rendering. + * + * For better accuracy, you should use pango_matrix_transform_rectangle() on + * original rectangle in Pango units and convert to pixels afterward + * using pango_extents_to_pixels()'s first argument. + * + * Since: 1.16 + **/ +void +pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix, + PangoRectangle *rect) +{ + int i; + double quad_x[4], quad_y[4]; + double dx1, dy1; + double dx2, dy2; + double min_x, max_x; + double min_y, max_y; + + if (!rect || !matrix) + return; + + quad_x[0] = rect->x; + quad_y[0] = rect->y; + pango_matrix_transform_point (matrix, &quad_x[0], &quad_y[0]); + + dx1 = rect->width; + dy1 = 0; + pango_matrix_transform_distance (matrix, &dx1, &dy1); + quad_x[1] = quad_x[0] + dx1; + quad_y[1] = quad_y[0] + dy1; + + dx2 = 0; + dy2 = rect->height; + pango_matrix_transform_distance (matrix, &dx2, &dy2); + quad_x[2] = quad_x[0] + dx2; + quad_y[2] = quad_y[0] + dy2; + + quad_x[3] = quad_x[0] + dx1 + dx2; + quad_y[3] = quad_y[0] + dy1 + dy2; + + min_x = max_x = quad_x[0]; + min_y = max_y = quad_y[0]; + + for (i=1; i < 4; i++) { + if (quad_x[i] < min_x) + min_x = quad_x[i]; + else if (quad_x[i] > max_x) + max_x = quad_x[i]; + + if (quad_y[i] < min_y) + min_y = quad_y[i]; + else if (quad_y[i] > max_y) + max_y = quad_y[i]; + } + + rect->x = floor (min_x); + rect->y = floor (min_y); + rect->width = ceil (max_x - rect->x); + rect->height = ceil (max_y - rect->y); +} diff --git a/pango/pango-matrix.h b/pango/pango-matrix.h new file mode 100644 index 0000000..9ec3704 --- /dev/null +++ b/pango/pango-matrix.h @@ -0,0 +1,132 @@ +/* Pango + * pango-matrix.h: Matrix manipulation routines + * + * Copyright (C) 2002, 2006 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_MATRIX_H__ +#define __PANGO_MATRIX_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _PangoMatrix PangoMatrix; + +/** + * PangoMatrix: + * @xx: 1st component of the transformation matrix + * @xy: 2nd component of the transformation matrix + * @yx: 3rd component of the transformation matrix + * @yy: 4th component of the transformation matrix + * @x0: x translation + * @y0: y translation + * + * A structure specifying a transformation between user-space + * coordinates and device coordinates. The transformation + * is given by + * + * + * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; + * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; + * + * + * Since: 1.6 + **/ +struct _PangoMatrix +{ + double xx; + double xy; + double yx; + double yy; + double x0; + double y0; +}; + +/** + * PANGO_TYPE_MATRIX: + * + * The GObject type for #PangoMatrix + **/ +#define PANGO_TYPE_MATRIX (pango_matrix_get_type ()) + +/** + * PANGO_MATRIX_INIT: + * + * Constant that can be used to initialize a PangoMatrix to + * the identity transform. + * + * + * PangoMatrix matrix = PANGO_MATRIX_INIT; + * pango_matrix_rotate (&matrix, 45.); + * + * + * Since: 1.6 + **/ +#define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. } + +/* for PangoRectangle */ +#include + +PANGO_AVAILABLE_IN_1_6 +GType pango_matrix_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_6 +PangoMatrix *pango_matrix_copy (const PangoMatrix *matrix); +PANGO_AVAILABLE_IN_1_6 +void pango_matrix_free (PangoMatrix *matrix); + +PANGO_AVAILABLE_IN_1_6 +void pango_matrix_translate (PangoMatrix *matrix, + double tx, + double ty); +PANGO_AVAILABLE_IN_1_6 +void pango_matrix_scale (PangoMatrix *matrix, + double scale_x, + double scale_y); +PANGO_AVAILABLE_IN_1_6 +void pango_matrix_rotate (PangoMatrix *matrix, + double degrees); +PANGO_AVAILABLE_IN_1_6 +void pango_matrix_concat (PangoMatrix *matrix, + const PangoMatrix *new_matrix); +PANGO_AVAILABLE_IN_1_16 +void pango_matrix_transform_point (const PangoMatrix *matrix, + double *x, + double *y); +PANGO_AVAILABLE_IN_1_16 +void pango_matrix_transform_distance (const PangoMatrix *matrix, + double *dx, + double *dy); +PANGO_AVAILABLE_IN_1_16 +void pango_matrix_transform_rectangle (const PangoMatrix *matrix, + PangoRectangle *rect); +PANGO_AVAILABLE_IN_1_16 +void pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix, + PangoRectangle *rect); +PANGO_AVAILABLE_IN_1_12 +double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix) G_GNUC_PURE; +PANGO_AVAILABLE_IN_1_38 +void pango_matrix_get_font_scale_factors (const PangoMatrix *matrix, + double *xscale, double *yscale); + + +G_END_DECLS + +#endif /* __PANGO_MATRIX_H__ */ diff --git a/pango/pango-modules.h b/pango/pango-modules.h new file mode 100644 index 0000000..82230b6 --- /dev/null +++ b/pango/pango-modules.h @@ -0,0 +1,77 @@ +/* Pango + * pango-modules.h: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_MODULES_H__ +#define __PANGO_MODULES_H__ + +#include + +G_BEGIN_DECLS + +#ifdef PANGO_ENABLE_BACKEND + +typedef struct _PangoMap PangoMap; +typedef struct _PangoMapEntry PangoMapEntry; + +typedef struct _PangoIncludedModule PangoIncludedModule; + +/** + * PangoIncludedModule: + * @list: a function that lists the engines defined in this module. + * @init: a function to initialize the module. + * @exit: a function to finalize the module. + * @create: a function to create an engine, given the engine name. + * + * The #PangoIncludedModule structure for a statically linked module + * contains the functions that would otherwise be loaded from a dynamically + * loaded module. + * + * Deprecated: 1.38 + */ +struct _PangoIncludedModule +{ + void (*list) (PangoEngineInfo **engines, + int *n_engines); + void (*init) (GTypeModule *module); + void (*exit) (void); + PangoEngine *(*create) (const char *id); +}; + +PANGO_DEPRECATED_IN_1_38 +PangoMap * pango_find_map (PangoLanguage *language, + guint engine_type_id, + guint render_type_id); +PANGO_DEPRECATED_IN_1_38 +PangoEngine * pango_map_get_engine (PangoMap *map, + PangoScript script); +PANGO_DEPRECATED_IN_1_38 +void pango_map_get_engines (PangoMap *map, + PangoScript script, + GSList **exact_engines, + GSList **fallback_engines); +PANGO_DEPRECATED_IN_1_38 +void pango_module_register (PangoIncludedModule *module); + +#endif /* PANGO_ENABLE_BACKEND */ + +G_END_DECLS + +#endif /* __PANGO_MODULES_H__ */ diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c new file mode 100644 index 0000000..334df74 --- /dev/null +++ b/pango/pango-ot-buffer.c @@ -0,0 +1,208 @@ +/* Pango + * pango-ot-buffer.c: Buffer of glyphs for shaping/positioning + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-ot-private.h" + +/** + * pango_ot_buffer_new + * @font: a #PangoFcFont + * + * Creates a new #PangoOTBuffer for the given OpenType font. + * + * Return value: the newly allocated #PangoOTBuffer, which should + * be freed with pango_ot_buffer_destroy(). + * + * Since: 1.4 + **/ +PangoOTBuffer * +pango_ot_buffer_new (PangoFcFont *font) +{ + PangoOTBuffer *buffer = g_slice_new (PangoOTBuffer); + + buffer->buffer = hb_buffer_create (); + + return buffer; +} + +/** + * pango_ot_buffer_destroy + * @buffer: a #PangoOTBuffer + * + * Destroys a #PangoOTBuffer and free all associated memory. + * + * Since: 1.4 + **/ +void +pango_ot_buffer_destroy (PangoOTBuffer *buffer) +{ + hb_buffer_destroy (buffer->buffer); + g_slice_free (PangoOTBuffer, buffer); +} + +/** + * pango_ot_buffer_clear + * @buffer: a #PangoOTBuffer + * + * Empties a #PangoOTBuffer, make it ready to add glyphs to. + * + * Since: 1.4 + **/ +void +pango_ot_buffer_clear (PangoOTBuffer *buffer) +{ + hb_buffer_reset (buffer->buffer); +} + +/** + * pango_ot_buffer_add_glyph + * @buffer: a #PangoOTBuffer + * @glyph: the glyph index to add, like a #PangoGlyph + * @properties: the glyph properties + * @cluster: the cluster that this glyph belongs to + * + * Appends a glyph to a #PangoOTBuffer, with @properties identifying which + * features should be applied on this glyph. See pango_ot_ruleset_add_feature(). + * + * Since: 1.4 + **/ +void +pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, + guint glyph, + guint properties, + guint cluster) +{ + hb_buffer_add (buffer->buffer, glyph, cluster); +} + +/** + * pango_ot_buffer_set_rtl + * @buffer: a #PangoOTBuffer + * @rtl: %TRUE for right-to-left text + * + * Sets whether glyphs will be rendered right-to-left. This setting + * is needed for proper horizontal positioning of right-to-left scripts. + * + * Since: 1.4 + **/ +void +pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, + gboolean rtl) +{ + hb_buffer_set_direction (buffer->buffer, rtl ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); +} + +/** + * pango_ot_buffer_set_zero_width_marks + * @buffer: a #PangoOTBuffer + * @zero_width_marks: %TRUE if characters with a mark class should + * be forced to zero width. + * + * Sets whether characters with a mark class should be forced to zero width. + * This setting is needed for proper positioning of Arabic accents, + * but will produce incorrect results with standard OpenType Indic + * fonts. + * + * Since: 1.6 + **/ +void +pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, + gboolean zero_width_marks) +{ +} + +/** + * pango_ot_buffer_get_glyphs + * @buffer: a #PangoOTBuffer + * @glyphs: (array length=n_glyphs) (out) (optional): location to + * store the array of glyphs, or %NULL + * @n_glyphs: (out) (optional): location to store the number of + * glyphs, or %NULL + * + * Gets the glyph array contained in a #PangoOTBuffer. The glyphs are + * owned by the buffer and should not be freed, and are only valid as long + * as buffer is not modified. + * + * Since: 1.4 + **/ +void +pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, + PangoOTGlyph **glyphs, + int *n_glyphs) +{ + if (glyphs) + *glyphs = (PangoOTGlyph *) hb_buffer_get_glyph_infos (buffer->buffer, NULL); + + if (n_glyphs) + *n_glyphs = hb_buffer_get_length (buffer->buffer); +} + +/** + * pango_ot_buffer_output + * @buffer: a #PangoOTBuffer + * @glyphs: a #PangoGlyphString + * + * Exports the glyphs in a #PangoOTBuffer into a #PangoGlyphString. This is + * typically used after the OpenType layout processing is over, to convert the + * resulting glyphs into a generic Pango glyph string. + * + * Since: 1.4 + **/ +void +pango_ot_buffer_output (const PangoOTBuffer *buffer, + PangoGlyphString *glyphs) +{ + unsigned int i; + int last_cluster; + + unsigned int num_glyphs; + hb_buffer_t *hb_buffer = buffer->buffer; + hb_glyph_info_t *hb_glyph; + hb_glyph_position_t *hb_position; + + if (HB_DIRECTION_IS_BACKWARD (hb_buffer_get_direction (buffer->buffer))) + hb_buffer_reverse (buffer->buffer); + + /* Copy glyphs into output glyph string */ + num_glyphs = hb_buffer_get_length (hb_buffer); + hb_glyph = hb_buffer_get_glyph_infos (hb_buffer, NULL); + hb_position = hb_buffer_get_glyph_positions (hb_buffer, NULL); + pango_glyph_string_set_size (glyphs, num_glyphs); + last_cluster = -1; + for (i = 0; i < num_glyphs; i++) + { + glyphs->glyphs[i].glyph = hb_glyph->codepoint; + glyphs->log_clusters[i] = hb_glyph->cluster; + glyphs->glyphs[i].attr.is_cluster_start = glyphs->log_clusters[i] != last_cluster; + last_cluster = glyphs->log_clusters[i]; + + glyphs->glyphs[i].geometry.width = hb_position->x_advance; + glyphs->glyphs[i].geometry.x_offset = hb_position->x_offset; + glyphs->glyphs[i].geometry.y_offset = hb_position->y_offset; + + hb_glyph++; + hb_position++; + } + + if (HB_DIRECTION_IS_BACKWARD (hb_buffer_get_direction (buffer->buffer))) + hb_buffer_reverse (buffer->buffer); +} diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c new file mode 100644 index 0000000..28f5dbc --- /dev/null +++ b/pango/pango-ot-info.c @@ -0,0 +1,330 @@ +/* Pango + * pango-ot-info.c: Store tables for OpenType + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:opentype + * @short_description:Obtaining information from OpenType tables + * @title:OpenType Font Handling + * @stability:Unstable + * + * Functions and macros in this section are used to implement the OpenType Layout + * features and algorithms. These are mostly useful when writing Fontconfig-based + * shaping engines + */ +#include "config.h" + +#include "pango-ot-private.h" + +static void pango_ot_info_finalize (GObject *object); + +G_DEFINE_TYPE (PangoOTInfo, pango_ot_info, G_TYPE_OBJECT); + +static void +pango_ot_info_init (PangoOTInfo *self) +{ +} + +static void +pango_ot_info_class_init (PangoOTInfoClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = pango_ot_info_finalize; +} + +static void +pango_ot_info_finalize (GObject *object) +{ + PangoOTInfo *info = PANGO_OT_INFO (object); + + if (info->hb_face) + hb_face_destroy (info->hb_face); + + G_OBJECT_CLASS (pango_ot_info_parent_class)->finalize (object); +} + +static void +pango_ot_info_finalizer (void *object) +{ + FT_Face face = object; + PangoOTInfo *info = face->generic.data; + + info->face = NULL; + g_object_unref (info); +} + + +/** + * pango_ot_info_get: + * @face: a FT_Face. + * + * Returns the #PangoOTInfo structure for the given FreeType font face. + * + * Return value: the #PangoOTInfo for @face. This object will have + * the same lifetime as @face. + * + * Since: 1.2 + **/ +PangoOTInfo * +pango_ot_info_get (FT_Face face) +{ + PangoOTInfo *info; + + if (G_UNLIKELY (!face)) + return NULL; + + if (G_LIKELY (face->generic.data && face->generic.finalizer == pango_ot_info_finalizer)) + return face->generic.data; + else + { + if (face->generic.finalizer) + face->generic.finalizer (face); + + info = face->generic.data = g_object_new (PANGO_TYPE_OT_INFO, NULL); + face->generic.finalizer = pango_ot_info_finalizer; + + info->face = face; + info->hb_face = hb_ft_face_create (face, NULL); + } + + return info; +} + +static hb_tag_t +get_hb_table_type (PangoOTTableType table_type) +{ + switch (table_type) { + case PANGO_OT_TABLE_GSUB: return HB_OT_TAG_GSUB; + case PANGO_OT_TABLE_GPOS: return HB_OT_TAG_GPOS; + default: return HB_TAG_NONE; + } +} + +/** + * pango_ot_info_find_script: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * @script_tag: the tag of the script to find. + * @script_index: (out) (optional): location to store the index of the + * script, or %NULL. + * + * Finds the index of a script. If not found, tries to find the 'DFLT' + * and then 'dflt' scripts and return the index of that in @script_index. + * If none of those is found either, %PANGO_OT_NO_SCRIPT is placed in + * @script_index. + * + * All other functions taking an input script_index parameter know + * how to handle %PANGO_OT_NO_SCRIPT, so one can ignore the return + * value of this function completely and proceed, to enjoy the automatic + * fallback to the 'DFLT'/'dflt' script. + * + * Return value: %TRUE if the script was found. + **/ +gboolean +pango_ot_info_find_script (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag script_tag, + guint *script_index) +{ + hb_tag_t tt = get_hb_table_type (table_type); + + return hb_ot_layout_table_find_script (info->hb_face, tt, + script_tag, + script_index); +} + +/** + * pango_ot_info_find_language: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * @script_index: the index of the script whose languages are searched. + * @language_tag: the tag of the language to find. + * @language_index: (out) (optional): location to store the index of + * the language, or %NULL. + * @required_feature_index: (out) (optional): location to store the + * required feature index of the language, or %NULL. + * + * Finds the index of a language and its required feature index. + * If the language is not found, sets @language_index to + * PANGO_OT_DEFAULT_LANGUAGE and the required feature of the default language + * system is returned in required_feature_index. For best compatibility with + * some fonts, also searches the language system tag 'dflt' before falling + * back to the default language system, but that is transparent to the user. + * The user can simply ignore the return value of this function to + * automatically fall back to the default language system. + * + * Return value: %TRUE if the language was found. + **/ +gboolean +pango_ot_info_find_language (PangoOTInfo *info, + PangoOTTableType table_type, + guint script_index, + PangoOTTag language_tag, + guint *language_index, + guint *required_feature_index) +{ + gboolean ret; + unsigned l_index; + hb_tag_t tt = get_hb_table_type (table_type); + + ret = hb_ot_layout_script_find_language (info->hb_face, tt, + script_index, + language_tag, + &l_index); + if (language_index) *language_index = l_index; + + hb_ot_layout_language_get_required_feature_index (info->hb_face, tt, + script_index, + l_index, + required_feature_index); + + return ret; +} + +/** + * pango_ot_info_find_feature: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * @feature_tag: the tag of the feature to find. + * @script_index: the index of the script. + * @language_index: the index of the language whose features are searched, + * or %PANGO_OT_DEFAULT_LANGUAGE to use the default language of the script. + * @feature_index: (out) (optional): location to store the index of + * the feature, or %NULL. + * + * Finds the index of a feature. If the feature is not found, sets + * @feature_index to PANGO_OT_NO_FEATURE, which is safe to pass to + * pango_ot_ruleset_add_feature() and similar functions. + * + * In the future, this may set @feature_index to an special value that if used + * in pango_ot_ruleset_add_feature() will ask Pango to synthesize the + * requested feature based on Unicode properties and data. However, this + * function will still return %FALSE in those cases. So, users may want to + * ignore the return value of this function in certain cases. + * + * Return value: %TRUE if the feature was found. + **/ +gboolean +pango_ot_info_find_feature (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag feature_tag, + guint script_index, + guint language_index, + guint *feature_index) +{ + hb_tag_t tt = get_hb_table_type (table_type); + + return hb_ot_layout_language_find_feature (info->hb_face, tt, + script_index, + language_index, + feature_tag, + feature_index); +} + +/** + * pango_ot_info_list_scripts: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * + * Obtains the list of available scripts. + * + * Return value: a newly-allocated zero-terminated array containing the tags of the + * available scripts. Should be freed using g_free(). + **/ +PangoOTTag * +pango_ot_info_list_scripts (PangoOTInfo *info, + PangoOTTableType table_type) +{ + hb_tag_t tt = get_hb_table_type (table_type); + PangoOTTag *result; + unsigned int count; + + count = hb_ot_layout_table_get_script_tags (info->hb_face, tt, 0, NULL, NULL); + result = g_new (PangoOTTag, count + 1); + hb_ot_layout_table_get_script_tags (info->hb_face, tt, 0, &count, result); + result[count] = 0; + + return result; +} + +/** + * pango_ot_info_list_languages: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * @script_index: the index of the script to list languages for. + * @language_tag: unused parameter. + * + * Obtains the list of available languages for a given script. + * + * Return value: a newly-allocated zero-terminated array containing the tags of the + * available languages. Should be freed using g_free(). + **/ +PangoOTTag * +pango_ot_info_list_languages (PangoOTInfo *info, + PangoOTTableType table_type, + guint script_index, + PangoOTTag language_tag G_GNUC_UNUSED) +{ + hb_tag_t tt = get_hb_table_type (table_type); + PangoOTTag *result; + unsigned int count; + + count = hb_ot_layout_script_get_language_tags (info->hb_face, tt, script_index, 0, NULL, NULL); + result = g_new (PangoOTTag, count + 1); + hb_ot_layout_script_get_language_tags (info->hb_face, tt, script_index, 0, &count, result); + result[count] = 0; + + return result; +} + +/** + * pango_ot_info_list_features: + * @info: a #PangoOTInfo. + * @table_type: the table type to obtain information about. + * @tag: unused parameter. + * @script_index: the index of the script to obtain information about. + * @language_index: the index of the language to list features for, or + * %PANGO_OT_DEFAULT_LANGUAGE, to list features for the default + * language of the script. + * + * Obtains the list of features for the given language of the given script. + * + * Return value: a newly-allocated zero-terminated array containing the tags of the + * available features. Should be freed using g_free(). + **/ +PangoOTTag * +pango_ot_info_list_features (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag tag G_GNUC_UNUSED, + guint script_index, + guint language_index) +{ + hb_tag_t tt = get_hb_table_type (table_type); + PangoOTTag *result; + unsigned int count; + + count = hb_ot_layout_language_get_feature_tags (info->hb_face, tt, script_index, language_index, 0, NULL, NULL); + result = g_new (PangoOTTag, count + 1); + hb_ot_layout_language_get_feature_tags (info->hb_face, tt, script_index, language_index, 0, &count, result); + result[count] = 0; + + return result; +} diff --git a/pango/pango-ot-private.h b/pango/pango-ot-private.h new file mode 100644 index 0000000..0d803ec --- /dev/null +++ b/pango/pango-ot-private.h @@ -0,0 +1,89 @@ +/* Pango + * pango-ot-private.h: Implementation details for Pango OpenType code + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_OT_PRIVATE_H__ +#define __PANGO_OT_PRIVATE_H__ + +#include + +#include +#include +#include +#include + +#include "pangofc-private.h" + +G_BEGIN_DECLS + +typedef struct _PangoOTInfoClass PangoOTInfoClass; + +/** + * PangoOTInfo: + * + * The #PangoOTInfo struct contains the various + * tables associated with an OpenType font. It contains only private fields and + * should only be accessed via the pango_ot_info_* functions + * which are documented below. To obtain a #PangoOTInfo, + * use pango_ot_info_get(). + */ +struct _PangoOTInfo +{ + GObject parent_instance; + + FT_Face face; + hb_face_t *hb_face; +}; + +struct _PangoOTInfoClass +{ + GObjectClass parent_class; +}; + + +typedef struct _PangoOTRulesetClass PangoOTRulesetClass; + +struct _PangoOTRuleset +{ + GObject parent_instance; +}; + +struct _PangoOTRulesetClass +{ + GObjectClass parent_class; +}; + +/** + * PangoOTBuffer: + * + * The #PangoOTBuffer structure is used to store strings of glyphs associated + * with a #PangoFcFont, suitable for OpenType layout processing. It contains + * only private fields and should only be accessed via the + * pango_ot_buffer_* functions which are documented below. + * To obtain a #PangoOTBuffer, use pango_ot_buffer_new(). + */ +struct _PangoOTBuffer +{ + hb_buffer_t *buffer; +}; + +G_END_DECLS + +#endif /* __PANGO_OT_PRIVATE_H__ */ diff --git a/pango/pango-ot-ruleset.c b/pango/pango-ot-ruleset.c new file mode 100644 index 0000000..36bf65a --- /dev/null +++ b/pango/pango-ot-ruleset.c @@ -0,0 +1,408 @@ +/* Pango + * pango-ot-ruleset.c: Shaping using OpenType features + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-ot-private.h" + +static void pango_ot_ruleset_finalize (GObject *object); + +/** + * PangoOTRuleset: + * + * The #PangoOTRuleset structure holds a + * set of features selected from the tables in an OpenType font. + * (A feature is an operation such as adjusting glyph positioning + * that should be applied to a text feature such as a certain + * type of accent.) A #PangoOTRuleset + * is created with pango_ot_ruleset_new(), features are added + * to it with pango_ot_ruleset_add_feature(), then it is + * applied to a #PangoGlyphString with pango_ot_ruleset_shape(). + */ +G_DEFINE_TYPE (PangoOTRuleset, pango_ot_ruleset, G_TYPE_OBJECT); + +static void +pango_ot_ruleset_class_init (PangoOTRulesetClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = pango_ot_ruleset_finalize; +} + +static void +pango_ot_ruleset_init (PangoOTRuleset *ruleset) +{ +} + +static void +pango_ot_ruleset_finalize (GObject *object) +{ + G_OBJECT_CLASS (pango_ot_ruleset_parent_class)->finalize (object); +} + +/** + * pango_ot_ruleset_get_for_description: + * @info: a #PangoOTInfo. + * @desc: a #PangoOTRulesetDescription. + * + * Returns a ruleset for the given OpenType info and ruleset + * description. Rulesets are created on demand using + * pango_ot_ruleset_new_from_description(). + * The returned ruleset should not be modified or destroyed. + * + * The static feature map members of @desc should be alive as + * long as @info is. + * + * Return value: the #PangoOTRuleset for @desc. This object will have + * the same lifetime as @info. + * + * Since: 1.18 + **/ +const PangoOTRuleset * +pango_ot_ruleset_get_for_description (PangoOTInfo *info, + const PangoOTRulesetDescription *desc) +{ + static PangoOTRuleset *ruleset; /* MT-safe */ + + if (g_once_init_enter (&ruleset)) + g_once_init_leave (&ruleset, g_object_new (PANGO_TYPE_OT_RULESET, NULL)); + + return ruleset; +} + +/** + * pango_ot_ruleset_new: + * @info: a #PangoOTInfo. + * + * Creates a new #PangoOTRuleset for the given OpenType info. + * + * Return value: the newly allocated #PangoOTRuleset, which + * should be freed with g_object_unref(). + **/ +PangoOTRuleset * +pango_ot_ruleset_new (PangoOTInfo *info) +{ + return g_object_new (PANGO_TYPE_OT_RULESET, NULL); +} + +/** + * pango_ot_ruleset_new_for: + * @info: a #PangoOTInfo. + * @script: a #PangoScript. + * @language: a #PangoLanguage. + * + * Creates a new #PangoOTRuleset for the given OpenType info, script, and + * language. + * + * This function is part of a convenience scheme that highly simplifies + * using a #PangoOTRuleset to represent features for a specific pair of script + * and language. So one can use this function passing in the script and + * language of interest, and later try to add features to the ruleset by just + * specifying the feature name or tag, without having to deal with finding + * script, language, or feature indices manually. + * + * In excess to what pango_ot_ruleset_new() does, this function will: + * + * + * Find the #PangoOTTag script and language tags associated with + * @script and @language using pango_ot_tag_from_script() and + * pango_ot_tag_from_language(), + * + * + * For each of table types %PANGO_OT_TABLE_GSUB and %PANGO_OT_TABLE_GPOS, + * find the script index of the script tag found and the language + * system index of the language tag found in that script system, using + * pango_ot_info_find_script() and pango_ot_info_find_language(), + * + * + * For found language-systems, if they have required feature + * index, add that feature to the ruleset using + * pango_ot_ruleset_add_feature(), + * + * + * Remember found script and language indices for both table types, + * and use them in future pango_ot_ruleset_maybe_add_feature() and + * pango_ot_ruleset_maybe_add_features(). + * + * + * + * Because of the way return values of pango_ot_info_find_script() and + * pango_ot_info_find_language() are ignored, this function automatically + * finds and uses the 'DFLT' script and the default language-system. + * + * Return value: the newly allocated #PangoOTRuleset, which + * should be freed with g_object_unref(). + * + * Since: 1.18 + **/ +PangoOTRuleset * +pango_ot_ruleset_new_for (PangoOTInfo *info, + PangoScript script, + PangoLanguage *language) +{ + return g_object_new (PANGO_TYPE_OT_RULESET, NULL); +} + +/** + * pango_ot_ruleset_new_from_description: + * @info: a #PangoOTInfo. + * @desc: a #PangoOTRulesetDescription. + * + * Creates a new #PangoOTRuleset for the given OpenType infor and + * matching the given ruleset description. + * + * This is a convenience function that calls pango_ot_ruleset_new_for() and + * adds the static GSUB/GPOS features to the resulting ruleset, followed by + * adding other features to both GSUB and GPOS. + * + * The static feature map members of @desc should be alive as + * long as @info is. + * + * Return value: the newly allocated #PangoOTRuleset, which + * should be freed with g_object_unref(). + * + * Since: 1.18 + **/ +PangoOTRuleset * +pango_ot_ruleset_new_from_description (PangoOTInfo *info, + const PangoOTRulesetDescription *desc) +{ + return g_object_new (PANGO_TYPE_OT_RULESET, NULL); +} + +/** + * pango_ot_ruleset_add_feature: + * @ruleset: a #PangoOTRuleset. + * @table_type: the table type to add a feature to. + * @feature_index: the index of the feature to add. + * @property_bit: the property bit to use for this feature. Used to identify + * the glyphs that this feature should be applied to, or + * %PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs. + * + * Adds a feature to the ruleset. + **/ +void +pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + guint feature_index, + gulong property_bit) +{ +} + +/** + * pango_ot_ruleset_maybe_add_feature: + * @ruleset: a #PangoOTRuleset. + * @table_type: the table type to add a feature to. + * @feature_tag: the tag of the feature to add. + * @property_bit: the property bit to use for this feature. Used to identify + * the glyphs that this feature should be applied to, or + * %PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs. + * + * This is a convenience function that first tries to find the feature + * using pango_ot_info_find_feature() and the ruleset script and language + * passed to pango_ot_ruleset_new_for(), + * and if the feature is found, adds it to the ruleset. + * + * If @ruleset was not created using pango_ot_ruleset_new_for(), this function + * does nothing. + * + * Return value: %TRUE if the feature was found and added to ruleset, + * %FALSE otherwise. + * + * Since: 1.18 + **/ +gboolean +pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + PangoOTTag feature_tag, + gulong property_bit) +{ + return FALSE; +} + +/** + * pango_ot_ruleset_maybe_add_features: + * @ruleset: a #PangoOTRuleset. + * @table_type: the table type to add features to. + * @features: array of feature name and property bits to add. + * @n_features: number of feature records in @features array. + * + * This is a convenience function that + * for each feature in the feature map array @features + * converts the feature name to a #PangoOTTag feature tag using PANGO_OT_TAG_MAKE() + * and calls pango_ot_ruleset_maybe_add_feature() on it. + * + * Return value: The number of features in @features that were found + * and added to @ruleset. + * + * Since: 1.18 + **/ +guint +pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + const PangoOTFeatureMap *features, + guint n_features) +{ + return 0; +} + +/** + * pango_ot_ruleset_get_feature_count: + * @ruleset: a #PangoOTRuleset. + * @n_gsub_features: (out) (optional): location to store number of + * GSUB features, or %NULL. + * @n_gpos_features: (out) (optional): location to store number of + * GPOS features, or %NULL. + * + * Gets the number of GSUB and GPOS features in the ruleset. + * + * Return value: Total number of features in the @ruleset. + * + * Since: 1.18 + **/ +guint +pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, + guint *n_gsub_features, + guint *n_gpos_features) +{ + return 0; +} + +/** + * pango_ot_ruleset_substitute: + * @ruleset: a #PangoOTRuleset. + * @buffer: a #PangoOTBuffer. + * + * Performs the OpenType GSUB substitution on @buffer using the features + * in @ruleset + * + * Since: 1.4 + **/ +void +pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, + PangoOTBuffer *buffer) +{ +} + +/** + * pango_ot_ruleset_position: + * @ruleset: a #PangoOTRuleset. + * @buffer: a #PangoOTBuffer. + * + * Performs the OpenType GPOS positioning on @buffer using the features + * in @ruleset + * + * Since: 1.4 + **/ +void +pango_ot_ruleset_position (const PangoOTRuleset *ruleset, + PangoOTBuffer *buffer) +{ +} + + +/* ruleset descriptions */ + +/** + * pango_ot_ruleset_description_hash: + * @desc: a ruleset description + * + * Computes a hash of a #PangoOTRulesetDescription structure suitable + * to be used, for example, as an argument to g_hash_table_new(). + * + * Return value: the hash value. + * + * Since: 1.18 + **/ +guint +pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc) +{ + return 0; +} + +/** + * pango_ot_ruleset_description_equal: + * @desc1: a ruleset description + * @desc2: a ruleset description + * + * Compares two ruleset descriptions for equality. + * Two ruleset descriptions are considered equal if the rulesets + * they describe are provably identical. This means that their + * script, language, and all feature sets should be equal. For static feature + * sets, the array addresses are compared directly, while for other + * features, the list of features is compared one by one. + * (Two ruleset descriptions may result in identical rulesets + * being created, but still compare %FALSE.) + * + * Return value: %TRUE if two ruleset descriptions are identical, + * %FALSE otherwise. + * + * Since: 1.18 + **/ +gboolean +pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, + const PangoOTRulesetDescription *desc2) +{ + return TRUE; +} + +/** + * pango_ot_ruleset_description_copy: + * @desc: ruleset description to copy + * + * Creates a copy of @desc, which should be freed with + * pango_ot_ruleset_description_free(). Primarily used internally + * by pango_ot_ruleset_get_for_description() to cache rulesets for + * ruleset descriptions. + * + * Return value: the newly allocated #PangoOTRulesetDescription, which + * should be freed with pango_ot_ruleset_description_free(). + * + * Since: 1.18 + **/ +PangoOTRulesetDescription * +pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc) +{ + PangoOTRulesetDescription *copy; + + g_return_val_if_fail (desc != NULL, NULL); + + copy = g_slice_new (PangoOTRulesetDescription); + + *copy = *desc; + + return copy; +} + +/** + * pango_ot_ruleset_description_free: + * @desc: an allocated #PangoOTRulesetDescription + * + * Frees a ruleset description allocated by + * pango_ot_ruleset_description_copy(). + * + * Since: 1.18 + **/ +void +pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc) +{ + g_slice_free (PangoOTRulesetDescription, desc); +} diff --git a/pango/pango-ot-tag.c b/pango/pango-ot-tag.c new file mode 100644 index 0000000..610b59d --- /dev/null +++ b/pango/pango-ot-tag.c @@ -0,0 +1,115 @@ +/* Pango + * pango-ot-tag.h: + * + * Copyright (C) 2007 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-ot-private.h" + +/** + * pango_ot_tag_from_script: + * @script: A #PangoScript + * + * Finds the OpenType script tag corresponding to @script. + * + * The %PANGO_SCRIPT_COMMON, %PANGO_SCRIPT_INHERITED, and + * %PANGO_SCRIPT_UNKNOWN scripts are mapped to the OpenType + * 'DFLT' script tag that is also defined as + * %PANGO_OT_TAG_DEFAULT_SCRIPT. + * + * Note that multiple #PangoScript values may map to the same + * OpenType script tag. In particular, %PANGO_SCRIPT_HIRAGANA + * and %PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'. + * + * Return value: #PangoOTTag corresponding to @script or + * %PANGO_OT_TAG_DEFAULT_SCRIPT if none found. + * + * Since: 1.18 + **/ +PangoOTTag +pango_ot_tag_from_script (PangoScript script) +{ + hb_tag_t tag1, tag2; + hb_ot_tags_from_script (hb_glib_script_to_script (script), &tag1, &tag2); + return (PangoOTTag) tag1; +} + +/** + * pango_ot_tag_to_script: + * @script_tag: A #PangoOTTag OpenType script tag + * + * Finds the #PangoScript corresponding to @script_tag. + * + * The 'DFLT' script tag is mapped to %PANGO_SCRIPT_COMMON. + * + * Note that an OpenType script tag may correspond to multiple + * #PangoScript values. In such cases, the #PangoScript value + * with the smallest value is returned. + * In particular, %PANGO_SCRIPT_HIRAGANA + * and %PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'. + * This function will return %PANGO_SCRIPT_HIRAGANA for + * 'kana'. + * + * Return value: #PangoScript corresponding to @script_tag or + * %PANGO_SCRIPT_UNKNOWN if none found. + * + * Since: 1.18 + **/ +PangoScript +pango_ot_tag_to_script (PangoOTTag script_tag) +{ + return (PangoScript) hb_glib_script_from_script (hb_ot_tag_to_script ((hb_tag_t) script_tag)); +} + + +/** + * pango_ot_tag_from_language: + * @language: (nullable): A #PangoLanguage, or %NULL + * + * Finds the OpenType language-system tag best describing @language. + * + * Return value: #PangoOTTag best matching @language or + * %PANGO_OT_TAG_DEFAULT_LANGUAGE if none found or if @language + * is %NULL. + * + * Since: 1.18 + **/ +PangoOTTag +pango_ot_tag_from_language (PangoLanguage *language) +{ + return (PangoOTTag) hb_ot_tag_from_language (hb_language_from_string (pango_language_to_string (language), -1)); +} + +/** + * pango_ot_tag_to_language: + * @language_tag: A #PangoOTTag OpenType language-system tag + * + * Finds a #PangoLanguage corresponding to @language_tag. + * + * Return value: #PangoLanguage best matching @language_tag or + * #PangoLanguage corresponding to the string "xx" if none found. + * + * Since: 1.18 + **/ +PangoLanguage * +pango_ot_tag_to_language (PangoOTTag language_tag) +{ + return pango_language_from_string (hb_language_to_string (hb_ot_tag_to_language ((hb_tag_t) language_tag))); +} diff --git a/pango/pango-ot.h b/pango/pango-ot.h new file mode 100644 index 0000000..45b1a1a --- /dev/null +++ b/pango/pango-ot.h @@ -0,0 +1,396 @@ +/* Pango + * pango-ot.h: + * + * Copyright (C) 2000,2007 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_OT_H__ +#define __PANGO_OT_H__ + +/* Deprecated. Use HarfBuzz directly! */ + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#ifdef PANGO_ENABLE_ENGINE + +/** + * PangoOTTag: + * + * The #PangoOTTag typedef is used to represent TrueType and OpenType + * four letter tags inside Pango. Use PANGO_OT_TAG_MAKE() + * or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create PangoOTTags manually. + */ +typedef guint32 PangoOTTag; + +/** + * PANGO_OT_TAG_MAKE: + * @c1: First character. + * @c2: Second character. + * @c3: Third character. + * @c4: Fourth character. + * + * Creates a #PangoOTTag from four characters. This is similar and + * compatible with the FT_MAKE_TAG() macro from FreeType. + */ +/** + * PANGO_OT_TAG_MAKE_FROM_STRING: + * @s: The string representation of the tag. + * + * Creates a #PangoOTTag from a string. The string should be at least + * four characters long (pad with space characters if needed), and need + * not be nul-terminated. This is a convenience wrapper around + * PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for + * example, as a switch expression, as it dereferences pointers. + */ +#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4) ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4)) +#define PANGO_OT_TAG_MAKE_FROM_STRING(s) (PANGO_OT_TAG_MAKE(((const char *) s)[0], \ + ((const char *) s)[1], \ + ((const char *) s)[2], \ + ((const char *) s)[3])) + +typedef struct _PangoOTInfo PangoOTInfo; +typedef struct _PangoOTBuffer PangoOTBuffer; +typedef struct _PangoOTGlyph PangoOTGlyph; +typedef struct _PangoOTRuleset PangoOTRuleset; +typedef struct _PangoOTFeatureMap PangoOTFeatureMap; +typedef struct _PangoOTRulesetDescription PangoOTRulesetDescription; + +/** + * PangoOTTableType: + * @PANGO_OT_TABLE_GSUB: The GSUB table. + * @PANGO_OT_TABLE_GPOS: The GPOS table. + * + * The PangoOTTableType enumeration values are used to + * identify the various OpenType tables in the + * pango_ot_info_* functions. + */ +typedef enum +{ + PANGO_OT_TABLE_GSUB, + PANGO_OT_TABLE_GPOS +} PangoOTTableType; + +/** + * PANGO_OT_ALL_GLYPHS: + * + * This is used as the property bit in pango_ot_ruleset_add_feature() when a + * feature should be applied to all glyphs. + * + * Since: 1.16 + */ +/** + * PANGO_OT_NO_FEATURE: + * + * This is used as a feature index that represent no feature, that is, should be + * skipped. It may be returned as feature index by pango_ot_info_find_feature() + * if the feature is not found, and pango_ot_ruleset_add_feature() function + * automatically skips this value, so no special handling is required by the user. + * + * Since: 1.18 + */ +/** + * PANGO_OT_NO_SCRIPT: + * + * This is used as a script index that represent no script, that is, when the + * requested script was not found, and a default ('DFLT') script was not found + * either. It may be returned as script index by pango_ot_info_find_script() + * if the script or a default script are not found, all other functions + * taking a script index essentially return if the input script index is + * this value, so no special handling is required by the user. + * + * Since: 1.18 + */ +/** + * PANGO_OT_DEFAULT_LANGUAGE: + * + * This is used as the language index in pango_ot_info_find_feature() when + * the default language system of the script is desired. + * + * It is also returned by pango_ot_info_find_language() if the requested language + * is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE. + * The end result is that one can always call pango_ot_tag_from_language() + * followed by pango_ot_info_find_language() and pass the result to + * pango_ot_info_find_feature() without having to worry about falling back to + * default language system explicitly. + * + * Since: 1.16 + */ +#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF) +#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF) +#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF) +#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF) + +/** + * PANGO_OT_TAG_DEFAULT_SCRIPT: + * + * This is a #PangoOTTag representing the special script tag 'DFLT'. It is + * returned as script tag by pango_ot_tag_from_script() if the requested script + * is not found. + * + * Since: 1.18 + */ +/** + * PANGO_OT_TAG_DEFAULT_LANGUAGE: + * + * This is a #PangoOTTag representing a special language tag 'dflt'. It is + * returned as language tag by pango_ot_tag_from_language() if the requested + * language is not found. It is safe to pass this value to + * pango_ot_info_find_language() as that function falls back to returning default + * language-system if the requested language tag is not found. + * + * Since: 1.18 + */ +#define PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T') +#define PANGO_OT_TAG_DEFAULT_LANGUAGE PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't') + +/* Note that this must match hb_glyph_info_t */ +/** + * PangoOTGlyph: + * @glyph: the glyph itself. + * @properties: the properties value, identifying which features should be + * applied on this glyph. See pango_ot_ruleset_add_feature(). + * @cluster: the cluster that this glyph belongs to. + * @component: a component value, set by the OpenType layout engine. + * @ligID: a ligature index value, set by the OpenType layout engine. + * @internal: for Pango internal use + * + * The #PangoOTGlyph structure represents a single glyph together with + * information used for OpenType layout processing of the glyph. + * It contains the following fields. + */ +struct _PangoOTGlyph +{ + guint32 glyph; + guint properties; + guint cluster; + gushort component; + gushort ligID; + + guint internal; +}; + +/** + * PangoOTFeatureMap: + * @feature_name: feature tag in represented as four-letter ASCII string. + * @property_bit: the property bit to use for this feature. See + * pango_ot_ruleset_add_feature() for details. + * + * The #PangoOTFeatureMap typedef is used to represent an OpenType + * feature with the property bit associated with it. The feature tag is + * represented as a char array instead of a #PangoOTTag for convenience. + * + * Since: 1.18 + */ +struct _PangoOTFeatureMap +{ + char feature_name[5]; + gulong property_bit; +}; + +/** + * PangoOTRulesetDescription: + * @script: a #PangoScript. + * @language: a #PangoLanguage. + * @static_gsub_features: (nullable): static map of GSUB features, + * or %NULL. + * @n_static_gsub_features: length of @static_gsub_features, or 0. + * @static_gpos_features: (nullable): static map of GPOS features, + * or %NULL. + * @n_static_gpos_features: length of @static_gpos_features, or 0. + * @other_features: (nullable): map of extra features to add to both + * GSUB and GPOS, or %NULL. Unlike the static maps, this pointer + * need not live beyond the life of function calls taking this + * struct. + * @n_other_features: length of @other_features, or 0. + * + * The #PangoOTRuleset structure holds all the information needed + * to build a complete #PangoOTRuleset from an OpenType font. + * The main use of this struct is to act as the key for a per-font + * hash of rulesets. The user populates a ruleset description and + * gets the ruleset using pango_ot_ruleset_get_for_description() + * or create a new one using pango_ot_ruleset_new_from_description(). + * + * Since: 1.18 + */ +struct _PangoOTRulesetDescription { + PangoScript script; + PangoLanguage *language; + const PangoOTFeatureMap *static_gsub_features; + guint n_static_gsub_features; + const PangoOTFeatureMap *static_gpos_features; + guint n_static_gpos_features; + const PangoOTFeatureMap *other_features; + guint n_other_features; +}; + + +#define PANGO_TYPE_OT_INFO (pango_ot_info_get_type ()) +#define PANGO_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_INFO, PangoOTInfo)) +#define PANGO_IS_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_INFO)) +PANGO_DEPRECATED +GType pango_ot_info_get_type (void) G_GNUC_CONST; + +#define PANGO_TYPE_OT_RULESET (pango_ot_ruleset_get_type ()) +#define PANGO_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_RULESET, PangoOTRuleset)) +#define PANGO_IS_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_RULESET)) +PANGO_DEPRECATED +GType pango_ot_ruleset_get_type (void) G_GNUC_CONST; + + +PANGO_DEPRECATED +PangoOTInfo *pango_ot_info_get (FT_Face face); + +PANGO_DEPRECATED +gboolean pango_ot_info_find_script (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag script_tag, + guint *script_index); + +PANGO_DEPRECATED +gboolean pango_ot_info_find_language (PangoOTInfo *info, + PangoOTTableType table_type, + guint script_index, + PangoOTTag language_tag, + guint *language_index, + guint *required_feature_index); +PANGO_DEPRECATED +gboolean pango_ot_info_find_feature (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag feature_tag, + guint script_index, + guint language_index, + guint *feature_index); + +PANGO_DEPRECATED +PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info, + PangoOTTableType table_type); +PANGO_DEPRECATED +PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info, + PangoOTTableType table_type, + guint script_index, + PangoOTTag language_tag); +PANGO_DEPRECATED +PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info, + PangoOTTableType table_type, + PangoOTTag tag, + guint script_index, + guint language_index); + +PANGO_DEPRECATED +PangoOTBuffer *pango_ot_buffer_new (PangoFcFont *font); +PANGO_DEPRECATED +void pango_ot_buffer_destroy (PangoOTBuffer *buffer); +PANGO_DEPRECATED +void pango_ot_buffer_clear (PangoOTBuffer *buffer); +PANGO_DEPRECATED +void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, + gboolean rtl); +PANGO_DEPRECATED +void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, + guint glyph, + guint properties, + guint cluster); +PANGO_DEPRECATED +void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, + PangoOTGlyph **glyphs, + int *n_glyphs); +PANGO_DEPRECATED +void pango_ot_buffer_output (const PangoOTBuffer *buffer, + PangoGlyphString *glyphs); + +PANGO_DEPRECATED +void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, + gboolean zero_width_marks); + +PANGO_DEPRECATED +const PangoOTRuleset *pango_ot_ruleset_get_for_description (PangoOTInfo *info, + const PangoOTRulesetDescription *desc); +PANGO_DEPRECATED +PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info); +PANGO_DEPRECATED +PangoOTRuleset *pango_ot_ruleset_new_for (PangoOTInfo *info, + PangoScript script, + PangoLanguage *language); +PANGO_DEPRECATED +PangoOTRuleset *pango_ot_ruleset_new_from_description (PangoOTInfo *info, + const PangoOTRulesetDescription *desc); +PANGO_DEPRECATED +void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + guint feature_index, + gulong property_bit); +PANGO_DEPRECATED +gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + PangoOTTag feature_tag, + gulong property_bit); +PANGO_DEPRECATED +guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, + PangoOTTableType table_type, + const PangoOTFeatureMap *features, + guint n_features); +PANGO_DEPRECATED +guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, + guint *n_gsub_features, + guint *n_gpos_features); + +PANGO_DEPRECATED +void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, + PangoOTBuffer *buffer); + +PANGO_DEPRECATED +void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, + PangoOTBuffer *buffer); + +PANGO_DEPRECATED +PangoScript pango_ot_tag_to_script (PangoOTTag script_tag) G_GNUC_CONST; + +PANGO_DEPRECATED +PangoOTTag pango_ot_tag_from_script (PangoScript script) G_GNUC_CONST; + +PANGO_DEPRECATED +PangoLanguage *pango_ot_tag_to_language (PangoOTTag language_tag) G_GNUC_CONST; + +PANGO_DEPRECATED +PangoOTTag pango_ot_tag_from_language (PangoLanguage *language) G_GNUC_CONST; + +PANGO_DEPRECATED +guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc) G_GNUC_PURE; + +PANGO_DEPRECATED +gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, + const PangoOTRulesetDescription *desc2) G_GNUC_PURE; + +PANGO_DEPRECATED +PangoOTRulesetDescription *pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc); + +PANGO_DEPRECATED +void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc); + + +#endif /* PANGO_ENABLE_ENGINE */ + +G_END_DECLS + +#endif /* __PANGO_OT_H__ */ diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c new file mode 100644 index 0000000..f82c4e4 --- /dev/null +++ b/pango/pango-renderer.c @@ -0,0 +1,1473 @@ +/* Pango + * pango-renderer.h: Base class for rendering + * + * Copyright (C) 2004 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include + +#include "pango-renderer.h" +#include "pango-impl-utils.h" +#include "pango-layout-private.h" + +#define N_RENDER_PARTS 4 + +#define PANGO_IS_RENDERER_FAST(renderer) (renderer != NULL) +#define IS_VALID_PART(part) ((guint)part < N_RENDER_PARTS) + +typedef struct _LineState LineState; +typedef struct _Point Point; + +struct _Point +{ + double x, y; +}; + +struct _LineState +{ + PangoUnderline underline; + PangoRectangle underline_rect; + + gboolean strikethrough; + PangoRectangle strikethrough_rect; + + int logical_rect_end; +}; + +struct _PangoRendererPrivate +{ + PangoColor color[N_RENDER_PARTS]; + gboolean color_set[N_RENDER_PARTS]; + guint16 alpha[N_RENDER_PARTS]; + + PangoLayoutLine *line; + LineState *line_state; +}; + +static void pango_renderer_finalize (GObject *gobject); +static void pango_renderer_default_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); +static void pango_renderer_default_draw_glyph_item (PangoRenderer *renderer, + const char *text, + PangoGlyphItem *glyph_item, + int x, + int y); +static void pango_renderer_default_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height); +static void pango_renderer_default_draw_error_underline (PangoRenderer *renderer, + int x, + int y, + int width, + int height); +static void pango_renderer_default_prepare_run (PangoRenderer *renderer, + PangoLayoutRun *run); + +static void pango_renderer_prepare_run (PangoRenderer *renderer, + PangoLayoutRun *run); + +static void +to_device (PangoMatrix *matrix, + double x, + double y, + Point *result) +{ + if (matrix) + { + result->x = (x * matrix->xx + y * matrix->xy) / PANGO_SCALE + matrix->x0; + result->y = (x * matrix->yx + y * matrix->yy) / PANGO_SCALE + matrix->y0; + } + else + { + result->x = x / PANGO_SCALE; + result->y = y / PANGO_SCALE; + } +} + +G_DEFINE_ABSTRACT_TYPE (PangoRenderer, pango_renderer, G_TYPE_OBJECT) + +static void +pango_renderer_class_init (PangoRendererClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + klass->draw_glyphs = pango_renderer_default_draw_glyphs; + klass->draw_glyph_item = pango_renderer_default_draw_glyph_item; + klass->draw_rectangle = pango_renderer_default_draw_rectangle; + klass->draw_error_underline = pango_renderer_default_draw_error_underline; + klass->prepare_run = pango_renderer_default_prepare_run; + + gobject_class->finalize = pango_renderer_finalize; + + g_type_class_add_private (gobject_class, sizeof (PangoRendererPrivate)); +} + +static void +pango_renderer_init (PangoRenderer *renderer) +{ + renderer->priv = G_TYPE_INSTANCE_GET_PRIVATE (renderer, + PANGO_TYPE_RENDERER, + PangoRendererPrivate); + renderer->matrix = NULL; +} + +static void +pango_renderer_finalize (GObject *gobject) +{ + PangoRenderer *renderer = PANGO_RENDERER (gobject); + + if (renderer->matrix) + pango_matrix_free (renderer->matrix); + + G_OBJECT_CLASS (pango_renderer_parent_class)->finalize (gobject); +} + +/** + * pango_renderer_draw_layout: + * @renderer: a #PangoRenderer + * @layout: a #PangoLayout + * @x: X position of left edge of baseline, in user space coordinates + * in Pango units. + * @y: Y position of left edge of baseline, in user space coordinates + * in Pango units. + * + * Draws @layout with the specified #PangoRenderer. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_layout (PangoRenderer *renderer, + PangoLayout *layout, + int x, + int y) +{ + PangoLayoutIter iter; + + g_return_if_fail (PANGO_IS_RENDERER (renderer)); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + /* We only change the matrix if the renderer isn't already + * active. + */ + if (!renderer->active_count) + { + PangoContext *context = pango_layout_get_context (layout); + pango_renderer_set_matrix (renderer, + pango_context_get_matrix (context)); + } + + pango_renderer_activate (renderer); + + _pango_layout_get_iter (layout, &iter); + + do + { + PangoRectangle logical_rect; + PangoLayoutLine *line; + int baseline; + + line = pango_layout_iter_get_line_readonly (&iter); + + pango_layout_iter_get_line_extents (&iter, NULL, &logical_rect); + baseline = pango_layout_iter_get_baseline (&iter); + + pango_renderer_draw_layout_line (renderer, + line, + x + logical_rect.x, + y + baseline); + } + while (pango_layout_iter_next_line (&iter)); + + _pango_layout_iter_destroy (&iter); + + pango_renderer_deactivate (renderer); +} + +static void +draw_underline (PangoRenderer *renderer, + LineState *state) +{ + PangoRectangle *rect = &state->underline_rect; + PangoUnderline underline = state->underline; + + state->underline = PANGO_UNDERLINE_NONE; + + switch (underline) + { + case PANGO_UNDERLINE_NONE: + break; + case PANGO_UNDERLINE_DOUBLE: + pango_renderer_draw_rectangle (renderer, + PANGO_RENDER_PART_UNDERLINE, + rect->x, + rect->y + 2 * rect->height, + rect->width, + rect->height); + /* Fall through */ + case PANGO_UNDERLINE_SINGLE: + case PANGO_UNDERLINE_LOW: + pango_renderer_draw_rectangle (renderer, + PANGO_RENDER_PART_UNDERLINE, + rect->x, + rect->y, + rect->width, + rect->height); + break; + case PANGO_UNDERLINE_ERROR: + pango_renderer_draw_error_underline (renderer, + rect->x, + rect->y, + rect->width, + 3 * rect->height); + break; + } +} + +static void +draw_strikethrough (PangoRenderer *renderer, + LineState *state) +{ + PangoRectangle *rect = &state->strikethrough_rect; + gboolean strikethrough = state->strikethrough; + + state->strikethrough = FALSE; + + if (strikethrough) + pango_renderer_draw_rectangle (renderer, + PANGO_RENDER_PART_STRIKETHROUGH, + rect->x, + rect->y, + rect->width, + rect->height); +} + +static void +handle_line_state_change (PangoRenderer *renderer, + PangoRenderPart part) +{ + LineState *state = renderer->priv->line_state; + if (!state) + return; + + if (part == PANGO_RENDER_PART_UNDERLINE && + state->underline != PANGO_UNDERLINE_NONE) + { + PangoRectangle *rect = &state->underline_rect; + + rect->width = state->logical_rect_end - rect->x; + draw_underline (renderer, state); + state->underline = renderer->underline; + rect->x = state->logical_rect_end; + rect->width = 0; + } + + if (part == PANGO_RENDER_PART_STRIKETHROUGH && + state->strikethrough) + { + PangoRectangle *rect = &state->strikethrough_rect; + + rect->width = state->logical_rect_end - rect->x; + draw_strikethrough (renderer, state); + state->strikethrough = renderer->strikethrough; + rect->x = state->logical_rect_end; + rect->width = 0; + } +} + +static void +add_underline (PangoRenderer *renderer, + LineState *state, + PangoFontMetrics *metrics, + int base_x, + int base_y, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoRectangle *current_rect = &state->underline_rect; + PangoRectangle new_rect; + + int underline_thickness = pango_font_metrics_get_underline_thickness (metrics); + int underline_position = pango_font_metrics_get_underline_position (metrics); + + new_rect.x = base_x + logical_rect->x; + new_rect.width = logical_rect->width; + new_rect.height = underline_thickness; + new_rect.y = base_y; + + switch (renderer->underline) + { + case PANGO_UNDERLINE_NONE: + g_assert_not_reached (); + break; + case PANGO_UNDERLINE_SINGLE: + case PANGO_UNDERLINE_DOUBLE: + case PANGO_UNDERLINE_ERROR: + new_rect.y -= underline_position; + break; + case PANGO_UNDERLINE_LOW: + new_rect.y += ink_rect->y + ink_rect->height + underline_thickness; + break; + } + + if (renderer->underline == state->underline && + new_rect.y == current_rect->y && + new_rect.height == current_rect->height) + { + current_rect->width = new_rect.x + new_rect.width - current_rect->x; + } + else + { + draw_underline (renderer, state); + + *current_rect = new_rect; + state->underline = renderer->underline; + } +} + +static void +add_strikethrough (PangoRenderer *renderer, + LineState *state, + PangoFontMetrics *metrics, + int base_x, + int base_y, + PangoRectangle *ink_rect G_GNUC_UNUSED, + PangoRectangle *logical_rect) +{ + PangoRectangle *current_rect = &state->strikethrough_rect; + PangoRectangle new_rect; + + int strikethrough_thickness = pango_font_metrics_get_strikethrough_thickness (metrics); + int strikethrough_position = pango_font_metrics_get_strikethrough_position (metrics); + + new_rect.x = base_x + logical_rect->x; + new_rect.width = logical_rect->width; + new_rect.y = base_y - strikethrough_position; + new_rect.height = strikethrough_thickness; + + if (state->strikethrough && + new_rect.y == current_rect->y && + new_rect.height == current_rect->height) + { + current_rect->width = new_rect.x + new_rect.width - current_rect->x; + } + else + { + draw_strikethrough (renderer, state); + + *current_rect = new_rect; + state->strikethrough = TRUE; + } +} + +static void +get_item_properties (PangoItem *item, + gint *rise, + PangoAttrShape **shape_attr) +{ + GSList *l; + + if (rise) + *rise = 0; + + if (shape_attr) + *shape_attr = NULL; + + for (l = item->analysis.extra_attrs; l; l = l->next) + { + PangoAttribute *attr = l->data; + + switch ((int) attr->klass->type) + { + case PANGO_ATTR_SHAPE: + if (shape_attr) + *shape_attr = (PangoAttrShape *)attr; + break; + + case PANGO_ATTR_RISE: + if (rise) + *rise = ((PangoAttrInt *)attr)->value; + break; + + default: + break; + } + } +} + +static void +draw_shaped_glyphs (PangoRenderer *renderer, + PangoGlyphString *glyphs, + PangoAttrShape *attr, + int x, + int y) +{ + PangoRendererClass *class = PANGO_RENDERER_GET_CLASS (renderer); + int i; + + if (!class->draw_shape) + return; + + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + class->draw_shape (renderer, attr, x, y); + + x += gi->geometry.width; + } +} + + +/** + * pango_renderer_draw_layout_line: + * @renderer: a #PangoRenderer + * @line: a #PangoLayoutLine + * @x: X position of left edge of baseline, in user space coordinates + * in Pango units. + * @y: Y position of left edge of baseline, in user space coordinates + * in Pango units. + * + * Draws @line with the specified #PangoRenderer. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_layout_line (PangoRenderer *renderer, + PangoLayoutLine *line, + int x, + int y) +{ + int x_off = 0; + int glyph_string_width; + LineState state; + GSList *l; + gboolean got_overall = FALSE; + PangoRectangle overall_rect; + const char *text; + + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + /* We only change the matrix if the renderer isn't already + * active. + */ + if (!renderer->active_count) + pango_renderer_set_matrix (renderer, + G_LIKELY (line->layout) ? + pango_context_get_matrix + (pango_layout_get_context (line->layout)) : + NULL); + + pango_renderer_activate (renderer); + + renderer->priv->line = line; + renderer->priv->line_state = &state; + + state.underline = PANGO_UNDERLINE_NONE; + state.strikethrough = FALSE; + + text = G_LIKELY (line->layout) ? pango_layout_get_text (line->layout) : NULL; + + for (l = line->runs; l; l = l->next) + { + PangoFontMetrics *metrics; + gint rise; + PangoLayoutRun *run = l->data; + PangoAttrShape *shape_attr; + PangoRectangle ink_rect, *ink = NULL; + PangoRectangle logical_rect, *logical = NULL; + + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) + logical = &logical_rect; + + pango_renderer_prepare_run (renderer, run); + + get_item_properties (run->item, &rise, &shape_attr); + + if (shape_attr) + { + ink = &ink_rect; + logical = &logical_rect; + _pango_shape_get_extents (run->glyphs->num_glyphs, + &shape_attr->ink_rect, + &shape_attr->logical_rect, + ink, + logical); + glyph_string_width = logical->width; + } + else + { + if (renderer->underline != PANGO_UNDERLINE_NONE || + renderer->strikethrough) + { + ink = &ink_rect; + logical = &logical_rect; + } + if (G_UNLIKELY (ink || logical)) + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, + ink, logical); + if (logical) + glyph_string_width = logical_rect.width; + else + glyph_string_width = pango_glyph_string_get_width (run->glyphs); + } + + state.logical_rect_end = x + x_off + glyph_string_width; + + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) + { + gboolean is_hinted = ((logical_rect.y | logical_rect.height) & (PANGO_SCALE - 1)) == 0; + int adjustment = logical_rect.y + logical_rect.height / 2; + + if (is_hinted) + adjustment = PANGO_UNITS_ROUND (adjustment); + + rise += adjustment; + } + + + if (renderer->priv->color_set[PANGO_RENDER_PART_BACKGROUND]) + { + if (!got_overall) + { + pango_layout_line_get_extents (line, NULL, &overall_rect); + got_overall = TRUE; + } + + pango_renderer_draw_rectangle (renderer, + PANGO_RENDER_PART_BACKGROUND, + x + x_off, + y + overall_rect.y, + glyph_string_width, + overall_rect.height); + } + + if (shape_attr) + { + draw_shaped_glyphs (renderer, run->glyphs, shape_attr, x + x_off, y - rise); + } + else + { + pango_renderer_draw_glyph_item (renderer, + text, + run, + x + x_off, y - rise); + } + + if (renderer->underline != PANGO_UNDERLINE_NONE || + renderer->strikethrough) + { + metrics = pango_font_get_metrics (run->item->analysis.font, + run->item->analysis.language); + + if (renderer->underline != PANGO_UNDERLINE_NONE) + add_underline (renderer, &state,metrics, + x + x_off, y - rise, + ink, logical); + + if (renderer->strikethrough) + add_strikethrough (renderer, &state, metrics, + x + x_off, y - rise, + ink, logical); + + pango_font_metrics_unref (metrics); + } + + if (renderer->underline == PANGO_UNDERLINE_NONE && + state.underline != PANGO_UNDERLINE_NONE) + draw_underline (renderer, &state); + + if (!renderer->strikethrough && state.strikethrough) + draw_strikethrough (renderer, &state); + + x_off += glyph_string_width; + } + + /* Finish off any remaining underlines + */ + draw_underline (renderer, &state); + draw_strikethrough (renderer, &state); + + renderer->priv->line_state = NULL; + renderer->priv->line = NULL; + + pango_renderer_deactivate (renderer); +} + +/** + * pango_renderer_draw_glyphs: + * @renderer: a #PangoRenderer + * @font: a #PangoFont + * @glyphs: a #PangoGlyphString + * @x: X position of left edge of baseline, in user space coordinates + * in Pango units. + * @y: Y position of left edge of baseline, in user space coordinates + * in Pango units. + * + * Draws the glyphs in @glyphs with the specified #PangoRenderer. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + pango_renderer_activate (renderer); + + PANGO_RENDERER_GET_CLASS (renderer)->draw_glyphs (renderer, font, glyphs, x, y); + + pango_renderer_deactivate (renderer); +} + +static void +pango_renderer_default_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + int i; + int x_position = 0; + + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + Point p; + + to_device (renderer->matrix, + x + x_position + gi->geometry.x_offset, + y + gi->geometry.y_offset, + &p); + + pango_renderer_draw_glyph (renderer, font, gi->glyph, p.x, p.y); + + x_position += gi->geometry.width; + } +} + +/** + * pango_renderer_draw_glyph_item: + * @renderer: a #PangoRenderer + * @text: (allow-none): the UTF-8 text that @glyph_item refers to, or %NULL + * @glyph_item: a #PangoGlyphItem + * @x: X position of left edge of baseline, in user space coordinates + * in Pango units. + * @y: Y position of left edge of baseline, in user space coordinates + * in Pango units. + * + * Draws the glyphs in @glyph_item with the specified #PangoRenderer, + * embedding the text associated with the glyphs in the output if the + * output format supports it (PDF for example). + * + * Note that @text is the start of the text for layout, which is then + * indexed by @glyph_item->item->offset. + * + * If @text is %NULL, this simply calls pango_renderer_draw_glyphs(). + * + * The default implementation of this method simply falls back to + * pango_renderer_draw_glyphs(). + * + * Since: 1.22 + **/ +void +pango_renderer_draw_glyph_item (PangoRenderer *renderer, + const char *text, + PangoGlyphItem *glyph_item, + int x, + int y) +{ + if (!text) + { + pango_renderer_draw_glyphs (renderer, + glyph_item->item->analysis.font, + glyph_item->glyphs, + x, y); + return; + } + + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + pango_renderer_activate (renderer); + + PANGO_RENDERER_GET_CLASS (renderer)->draw_glyph_item (renderer, text, glyph_item, x, y); + + pango_renderer_deactivate (renderer); +} + +static void +pango_renderer_default_draw_glyph_item (PangoRenderer *renderer, + const char *text G_GNUC_UNUSED, + PangoGlyphItem *glyph_item, + int x, + int y) +{ + pango_renderer_draw_glyphs (renderer, + glyph_item->item->analysis.font, + glyph_item->glyphs, + x, y); +} + +/** + * pango_renderer_draw_rectangle: + * @renderer: a #PangoRenderer + * @part: type of object this rectangle is part of + * @x: X position at which to draw rectangle, in user space coordinates in Pango units + * @y: Y position at which to draw rectangle, in user space coordinates in Pango units + * @width: width of rectangle in Pango units in user space coordinates + * @height: height of rectangle in Pango units in user space coordinates + * + * Draws an axis-aligned rectangle in user space coordinates with the + * specified #PangoRenderer. + * + * This should be called while @renderer is already active. Use + * pango_renderer_activate() to activate a renderer. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (IS_VALID_PART (part)); + g_return_if_fail (renderer->active_count > 0); + + PANGO_RENDERER_GET_CLASS (renderer)->draw_rectangle (renderer, part, x, y, width, height); +} + +static int +compare_points (const void *a, + const void *b) +{ + const Point *pa = a; + const Point *pb = b; + + if (pa->y < pb->y) + return -1; + else if (pa->y > pb->y) + return 1; + else if (pa->x < pb->x) + return -1; + else if (pa->x > pb->x) + return 1; + else + return 0; +} + +static void +draw_rectangle (PangoRenderer *renderer, + PangoMatrix *matrix, + PangoRenderPart part, + int x, + int y, + int width, + int height) +{ + Point points[4]; + + /* Convert the points to device coordinates, and sort + * in ascending Y order. (Ordering by X for ties) + */ + to_device (matrix, x, y, &points[0]); + to_device (matrix, x + width, y, &points[1]); + to_device (matrix, x, y + height, &points[2]); + to_device (matrix, x + width, y + height, &points[3]); + + qsort (points, 4, sizeof (Point), compare_points); + + /* There are essentially three cases. (There is a fourth + * case where trapezoid B is degenerate and we just have + * two triangles, but we don't need to handle it separately.) + * + * 1 2 3 + * + * ______ /\ /\ + * / / /A \ /A \ + * / B / /____\ /____\ + * /_____/ / B / \ B \ + * /_____/ \_____\ + * \ C / \ C / + * \ / \ / + * \/ \/ + */ + if (points[0].y == points[1].y) + { + /* Case 1 (pure shear) */ + pango_renderer_draw_trapezoid (renderer, part, /* B */ + points[0].y, points[0].x, points[1].x, + points[2].y, points[2].x, points[3].x); + } + else if (points[1].x < points[2].x) + { + /* Case 2 */ + double tmp_width = ((points[2].x - points[0].x) * (points[1].y - points[0].y)) / (points[2].y - points[0].y); + double base_width = tmp_width + points[0].x - points[1].x; + + pango_renderer_draw_trapezoid (renderer, part, /* A */ + points[0].y, points[0].x, points[0].x, + points[1].y, points[1].x, points[1].x + base_width); + pango_renderer_draw_trapezoid (renderer, part, /* B */ + points[1].y, points[1].x, points[1].x + base_width, + points[2].y, points[2].x - base_width, points[2].x); + pango_renderer_draw_trapezoid (renderer, part, /* C */ + points[2].y, points[2].x - base_width, points[2].x, + points[3].y, points[3].x, points[3].x); + } + else + { + /* case 3 */ + double tmp_width = ((points[0].x - points[2].x) * (points[1].y - points[0].y)) / (points[2].y - points[0].y); + double base_width = tmp_width + points[1].x - points[0].x; + + pango_renderer_draw_trapezoid (renderer, part, /* A */ + points[0].y, points[0].x, points[0].x, + points[1].y, points[1].x - base_width, points[1].x); + pango_renderer_draw_trapezoid (renderer, part, /* B */ + points[1].y, points[1].x - base_width, points[1].x, + points[2].y, points[2].x, points[2].x + base_width); + pango_renderer_draw_trapezoid (renderer, part, /* C */ + points[2].y, points[2].x, points[2].x + base_width, + points[3].y, points[3].x, points[3].x); + } +} + +static void +pango_renderer_default_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height) +{ + draw_rectangle (renderer, renderer->matrix, part, x, y, width, height); +} + +/** + * pango_renderer_draw_error_underline: + * @renderer: a #PangoRenderer + * @x: X coordinate of underline, in Pango units in user coordinate system + * @y: Y coordinate of underline, in Pango units in user coordinate system + * @width: width of underline, in Pango units in user coordinate system + * @height: height of underline, in Pango units in user coordinate system + * + * Draw a squiggly line that approximately covers the given rectangle + * in the style of an underline used to indicate a spelling error. + * (The width of the underline is rounded to an integer number + * of up/down segments and the resulting rectangle is centered + * in the original rectangle) + * + * This should be called while @renderer is already active. Use + * pango_renderer_activate() to activate a renderer. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_error_underline (PangoRenderer *renderer, + int x, + int y, + int width, + int height) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (renderer->active_count > 0); + + PANGO_RENDERER_GET_CLASS (renderer)->draw_error_underline (renderer, x, y, width, height); +} + +/* We are drawing an error underline that looks like one of: + * + * /\ /\ /\ /\ /\ - + * / \ / \ / \ / \ / \ | + * \ \ /\ \ / / \ \ /\ \ | + * \ \/B \ \/ C / \ \/B \ \ | height = HEIGHT_SQUARES * square + * \ A \ /\ A \ / \ A \ /\ A \ | + * \ \/ \ \/ \ \/ \ \ | + * \ / \ / \ / \ / | + * \/ \/ \/ \/ - + * |---| + * unit_width = (HEIGHT_SQUARES - 1) * square + * + * To do this conveniently, we work in a coordinate system where A,B,C + * are axis aligned rectangles. (If fonts were square, the diagrams + * would be clearer) + * + * (0,0) + * /\ /\ + * / \ / \ + * /\ /\ /\ / + * / \/ \/ \/ + * / \ /\ / + * Y axis \/ \/ + * \ /\ + * \/ \ + * \ X axis + * + * Note that the long side in this coordinate system is HEIGHT_SQUARES + 1 + * units long + * + * The diagrams above are shown with HEIGHT_SQUARES an integer, but + * that is actually incidental; the value 2.5 below seems better than + * either HEIGHT_SQUARES=3 (a little long and skinny) or + * HEIGHT_SQUARES=2 (a bit short and stubby) + */ + +#define HEIGHT_SQUARES 2.5 + +static void +get_total_matrix (PangoMatrix *total, + const PangoMatrix *global, + int x, + int y, + int square) +{ + PangoMatrix local; + gdouble scale = 0.5 * square; + + /* The local matrix translates from the axis aligned coordinate system + * to the original user space coordinate system. + */ + local.xx = scale; + local.xy = - scale; + local.yx = scale; + local.yy = scale; + local.x0 = 0; + local.y0 = 0; + + *total = *global; + pango_matrix_concat (total, &local); + + total->x0 = (global->xx * x + global->xy * y) / PANGO_SCALE + global->x0; + total->y0 = (global->yx * x + global->yy * y) / PANGO_SCALE + global->y0; +} + +static void +pango_renderer_default_draw_error_underline (PangoRenderer *renderer, + int x, + int y, + int width, + int height) +{ + int square = height / HEIGHT_SQUARES; + int unit_width = (HEIGHT_SQUARES - 1) * square; + int width_units = (width + unit_width / 2) / unit_width; + const PangoMatrix identity = PANGO_MATRIX_INIT; + const PangoMatrix *matrix; + double dx, dx0, dy0; + PangoMatrix total; + int i; + + x += (width - width_units * unit_width) / 2; + + if (renderer->matrix) + matrix = renderer->matrix; + else + matrix = &identity; + + get_total_matrix (&total, matrix, x, y, square); + dx = unit_width * 2; + dx0 = (matrix->xx * dx) / PANGO_SCALE; + dy0 = (matrix->yx * dx) / PANGO_SCALE; + + i = (width_units - 1) / 2; + while (TRUE) + { + draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* A */ + 0, 0, + HEIGHT_SQUARES * 2 - 1, 1); + + if (i <= 0) + break; + i--; + + draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* B */ + HEIGHT_SQUARES * 2 - 2, - (HEIGHT_SQUARES * 2 - 3), + 1, HEIGHT_SQUARES * 2 - 3); + + total.x0 += dx0; + total.y0 += dy0; + } + if (width_units % 2 == 0) + { + draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* C */ + HEIGHT_SQUARES * 2 - 2, - (HEIGHT_SQUARES * 2 - 2), + 1, HEIGHT_SQUARES * 2 - 2); + } +} + +/** + * pango_renderer_draw_trapezoid: + * @renderer: a #PangoRenderer + * @part: type of object this trapezoid is part of + * @y1_: Y coordinate of top of trapezoid + * @x11: X coordinate of left end of top of trapezoid + * @x21: X coordinate of right end of top of trapezoid + * @y2: Y coordinate of bottom of trapezoid + * @x12: X coordinate of left end of bottom of trapezoid + * @x22: X coordinate of right end of bottom of trapezoid + * + * Draws a trapezoid with the parallel sides aligned with the X axis + * using the given #PangoRenderer; coordinates are in device space. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1_, + double x11, + double x21, + double y2, + double x12, + double x22) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (renderer->active_count > 0); + + if (PANGO_RENDERER_GET_CLASS (renderer)->draw_trapezoid) + PANGO_RENDERER_GET_CLASS (renderer)->draw_trapezoid (renderer, part, + y1_, x11, x21, + y2, x12, x22); +} + +/** + * pango_renderer_draw_glyph: + * @renderer: a #PangoRenderer + * @font: a #PangoFont + * @glyph: the glyph index of a single glyph + * @x: X coordinate of left edge of baseline of glyph + * @y: Y coordinate of left edge of baseline of glyph + * + * Draws a single glyph with coordinates in device space. + * + * Since: 1.8 + **/ +void +pango_renderer_draw_glyph (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph, + double x, + double y) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (renderer->active_count > 0); + + if (glyph == PANGO_GLYPH_EMPTY) /* glyph PANGO_GLYPH_EMPTY never renders */ + return; + + if (PANGO_RENDERER_GET_CLASS (renderer)->draw_glyph) + PANGO_RENDERER_GET_CLASS (renderer)->draw_glyph (renderer, font, glyph, x, y); +} + +/** + * pango_renderer_activate: + * @renderer: a #PangoRenderer + * + * Does initial setup before rendering operations on @renderer. + * pango_renderer_deactivate() should be called when done drawing. + * Calls such as pango_renderer_draw_layout() automatically + * activate the layout before drawing on it. Calls to + * pango_renderer_activate() and pango_renderer_deactivate() can + * be nested and the renderer will only be initialized and + * deinitialized once. + * + * Since: 1.8 + **/ +void +pango_renderer_activate (PangoRenderer *renderer) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + renderer->active_count++; + if (renderer->active_count == 1) + { + if (PANGO_RENDERER_GET_CLASS (renderer)->begin) + PANGO_RENDERER_GET_CLASS (renderer)->begin (renderer); + } +} + +/** + * pango_renderer_deactivate: + * @renderer: a #PangoRenderer + * + * Cleans up after rendering operations on @renderer. See + * docs for pango_renderer_activate(). + * + * Since: 1.8 + **/ +void +pango_renderer_deactivate (PangoRenderer *renderer) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (renderer->active_count > 0); + + if (renderer->active_count == 1) + { + if (PANGO_RENDERER_GET_CLASS (renderer)->end) + PANGO_RENDERER_GET_CLASS (renderer)->end (renderer); + } + renderer->active_count--; +} + +/** + * pango_renderer_set_color: + * @renderer: a #PangoRenderer + * @part: the part to change the color of + * @color: (allow-none): the new color or %NULL to unset the current color + * + * Sets the color for part of the rendering. + * Also see pango_renderer_set_alpha(). + * + * Since: 1.8 + **/ +void +pango_renderer_set_color (PangoRenderer *renderer, + PangoRenderPart part, + const PangoColor *color) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (IS_VALID_PART (part)); + + if ((!color && !renderer->priv->color_set[part]) || + (color && renderer->priv->color_set[part] && + renderer->priv->color[part].red == color->red && + renderer->priv->color[part].green == color->green && + renderer->priv->color[part].blue == color->blue)) + return; + + pango_renderer_part_changed (renderer, part); + + if (color) + { + renderer->priv->color_set[part] = TRUE; + renderer->priv->color[part] = *color; + } + else + { + renderer->priv->color_set[part] = FALSE; + } +} + +/** + * pango_renderer_get_color: + * @renderer: a #PangoRenderer + * @part: the part to get the color for + * + * Gets the current rendering color for the specified part. + * + * Return value: (transfer none) (nullable): the color for the + * specified part, or %NULL if it hasn't been set and should be + * inherited from the environment. + * + * Since: 1.8 + **/ +PangoColor * +pango_renderer_get_color (PangoRenderer *renderer, + PangoRenderPart part) +{ + g_return_val_if_fail (PANGO_IS_RENDERER_FAST (renderer), NULL); + g_return_val_if_fail (IS_VALID_PART (part), NULL); + + if (renderer->priv->color_set[part]) + return &renderer->priv->color[part]; + else + return NULL; +} + +/** + * pango_renderer_set_alpha: + * @renderer: a #PangoRenderer + * @part: the part to set the alpha for + * @alpha: an alpha value between 1 and 65536, or 0 to unset the alpha + * + * Sets the alpha for part of the rendering. + * Note that the alpha may only be used if a color is + * specified for @part as well. + * + * Since: 1.38 + */ +void +pango_renderer_set_alpha (PangoRenderer *renderer, + PangoRenderPart part, + guint16 alpha) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (IS_VALID_PART (part)); + + if ((!alpha && !renderer->priv->alpha[part]) || + (alpha && renderer->priv->alpha[part] && + renderer->priv->alpha[part] == alpha)) + return; + + pango_renderer_part_changed (renderer, part); + + renderer->priv->alpha[part] = alpha; +} + +/** + * pango_renderer_get_alpha: + * @renderer: a #PangoRenderer + * @part: the part to get the alpha for + * + * Gets the current alpha for the specified part. + * + * Return value: the alpha for the specified part, + * or 0 if it hasn't been set and should be + * inherited from the environment. + * + * Since: 1.38 + */ +guint16 +pango_renderer_get_alpha (PangoRenderer *renderer, + PangoRenderPart part) +{ + g_return_val_if_fail (PANGO_IS_RENDERER_FAST (renderer), 0); + g_return_val_if_fail (IS_VALID_PART (part), 0); + + return renderer->priv->alpha[part]; +} + +/** + * pango_renderer_part_changed: + * @renderer: a #PangoRenderer + * @part: the part for which rendering has changed. + * + * Informs Pango that the way that the rendering is done + * for @part has changed in a way that would prevent multiple + * pieces being joined together into one drawing call. For + * instance, if a subclass of #PangoRenderer was to add a stipple + * option for drawing underlines, it needs to call + * + * + * pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE); + * + * + * When the stipple changes or underlines with different stipples + * might be joined together. Pango automatically calls this for + * changes to colors. (See pango_renderer_set_color()) + * + * Since: 1.8 + **/ +void +pango_renderer_part_changed (PangoRenderer *renderer, + PangoRenderPart part) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + g_return_if_fail (IS_VALID_PART (part)); + g_return_if_fail (renderer->active_count > 0); + + handle_line_state_change (renderer, part); + + if (PANGO_RENDERER_GET_CLASS (renderer)->part_changed) + PANGO_RENDERER_GET_CLASS (renderer)->part_changed (renderer, part); +} + +/** + * pango_renderer_prepare_run: + * @renderer: a #PangoRenderer + * @run: a #PangoLayoutRun + * + * Set up the state of the #PangoRenderer for rendering @run. + * + * Since: 1.8 + **/ +static void +pango_renderer_prepare_run (PangoRenderer *renderer, + PangoLayoutRun *run) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + PANGO_RENDERER_GET_CLASS (renderer)->prepare_run (renderer, run); +} + +static void +pango_renderer_default_prepare_run (PangoRenderer *renderer, + PangoLayoutRun *run) +{ + PangoColor *fg_color = NULL; + PangoColor *bg_color = NULL; + PangoColor *underline_color = NULL; + PangoColor *strikethrough_color = NULL; + guint16 fg_alpha = 0; + guint16 bg_alpha = 0; + GSList *l; + + renderer->underline = PANGO_UNDERLINE_NONE; + renderer->strikethrough = FALSE; + + for (l = run->item->analysis.extra_attrs; l; l = l->next) + { + PangoAttribute *attr = l->data; + + switch ((int) attr->klass->type) + { + case PANGO_ATTR_UNDERLINE: + renderer->underline = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_STRIKETHROUGH: + renderer->strikethrough = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_FOREGROUND: + fg_color = &((PangoAttrColor *)attr)->color; + break; + + case PANGO_ATTR_BACKGROUND: + bg_color = &((PangoAttrColor *)attr)->color; + break; + + case PANGO_ATTR_UNDERLINE_COLOR: + underline_color = &((PangoAttrColor *)attr)->color; + break; + + case PANGO_ATTR_STRIKETHROUGH_COLOR: + strikethrough_color = &((PangoAttrColor *)attr)->color; + break; + + case PANGO_ATTR_FOREGROUND_ALPHA: + fg_alpha = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_BACKGROUND_ALPHA: + bg_alpha = ((PangoAttrInt *)attr)->value; + break; + + default: + break; + } + } + + if (!underline_color) + underline_color = fg_color; + + if (!strikethrough_color) + strikethrough_color = fg_color; + + pango_renderer_set_color (renderer, PANGO_RENDER_PART_FOREGROUND, fg_color); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_BACKGROUND, bg_color); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_UNDERLINE, underline_color); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_STRIKETHROUGH, strikethrough_color); + + pango_renderer_set_alpha (renderer, PANGO_RENDER_PART_FOREGROUND, fg_alpha); + pango_renderer_set_alpha (renderer, PANGO_RENDER_PART_BACKGROUND, bg_alpha); + pango_renderer_set_alpha (renderer, PANGO_RENDER_PART_UNDERLINE, fg_alpha); + pango_renderer_set_alpha (renderer, PANGO_RENDER_PART_STRIKETHROUGH, fg_alpha); +} + +/** + * pango_renderer_set_matrix: + * @renderer: a #PangoRenderer + * @matrix: (allow-none): a #PangoMatrix, or %NULL to unset any existing matrix. + * (No matrix set is the same as setting the identity matrix.) + * + * Sets the transformation matrix that will be applied when rendering. + * + * Since: 1.8 + **/ +void +pango_renderer_set_matrix (PangoRenderer *renderer, + const PangoMatrix *matrix) +{ + g_return_if_fail (PANGO_IS_RENDERER_FAST (renderer)); + + pango_matrix_free (renderer->matrix); + renderer->matrix = pango_matrix_copy (matrix); +} + +/** + * pango_renderer_get_matrix: + * @renderer: a #PangoRenderer + * + * Gets the transformation matrix that will be applied when + * rendering. See pango_renderer_set_matrix(). + * + * Return value: (nullable): the matrix, or %NULL if no matrix has + * been set (which is the same as the identity matrix). The returned + * matrix is owned by Pango and must not be modified or freed. + * + * Since: 1.8 + **/ +const PangoMatrix * +pango_renderer_get_matrix (PangoRenderer *renderer) +{ + g_return_val_if_fail (PANGO_IS_RENDERER (renderer), NULL); + + return renderer->matrix; +} + +/** + * pango_renderer_get_layout: + * @renderer: a #PangoRenderer + * + * Gets the layout currently being rendered using @renderer. + * Calling this function only makes sense from inside a subclass's + * methods, like in its draw_shape() for example. + * + * The returned layout should not be modified while still being + * rendered. + * + * Return value: (transfer none) (nullable): the layout, or %NULL if + * no layout is being rendered using @renderer at this time. + * + * Since: 1.20 + **/ +PangoLayout * +pango_renderer_get_layout (PangoRenderer *renderer) +{ + if (G_UNLIKELY (renderer->priv->line == NULL)) + return NULL; + + return renderer->priv->line->layout; +} + +/** + * pango_renderer_get_layout_line: + * @renderer: a #PangoRenderer + * + * Gets the layout line currently being rendered using @renderer. + * Calling this function only makes sense from inside a subclass's + * methods, like in its draw_shape() for example. + * + * The returned layout line should not be modified while still being + * rendered. + * + * Return value: (transfer none) (nullable): the layout line, or %NULL + * if no layout line is being rendered using @renderer at this time. + * + * Since: 1.20 + **/ +PangoLayoutLine * +pango_renderer_get_layout_line (PangoRenderer *renderer) +{ + return renderer->priv->line; +} diff --git a/pango/pango-renderer.h b/pango/pango-renderer.h new file mode 100644 index 0000000..266cc3e --- /dev/null +++ b/pango/pango-renderer.h @@ -0,0 +1,287 @@ +/* Pango + * pango-renderer.h: Base class for rendering + * + * Copyright (C) 2004, Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __PANGO_RENDERER_H_ +#define __PANGO_RENDERER_H_ + +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_RENDERER (pango_renderer_get_type()) +#define PANGO_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_RENDERER, PangoRenderer)) +#define PANGO_IS_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_RENDERER)) +#define PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_RENDERER, PangoRendererClass)) +#define PANGO_IS_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_RENDERER)) +#define PANGO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_RENDERER, PangoRendererClass)) + +typedef struct _PangoRenderer PangoRenderer; +typedef struct _PangoRendererClass PangoRendererClass; +typedef struct _PangoRendererPrivate PangoRendererPrivate; + +/** + * PangoRenderPart: + * @PANGO_RENDER_PART_FOREGROUND: the text itself + * @PANGO_RENDER_PART_BACKGROUND: the area behind the text + * @PANGO_RENDER_PART_UNDERLINE: underlines + * @PANGO_RENDER_PART_STRIKETHROUGH: strikethrough lines + * + * #PangoRenderPart defines different items to render for such + * purposes as setting colors. + * + * Since: 1.8 + **/ +/* When extending, note N_RENDER_PARTS #define in pango-renderer.c */ +typedef enum +{ + PANGO_RENDER_PART_FOREGROUND, + PANGO_RENDER_PART_BACKGROUND, + PANGO_RENDER_PART_UNDERLINE, + PANGO_RENDER_PART_STRIKETHROUGH +} PangoRenderPart; + +/** + * PangoRenderer: + * @matrix: (nullable): the current transformation matrix for + * the Renderer; may be %NULL, which should be treated the + * same as the identity matrix. + * + * #PangoRenderer is a base class for objects that are used to + * render Pango objects such as #PangoGlyphString and + * #PangoLayout. + * + * Since: 1.8 + **/ +struct _PangoRenderer +{ + /*< private >*/ + GObject parent_instance; + + PangoUnderline underline; + gboolean strikethrough; + int active_count; + + /*< public >*/ + PangoMatrix *matrix; /* May be NULL */ + + /*< private >*/ + PangoRendererPrivate *priv; +}; + +/** + * PangoRendererClass: + * @draw_glyphs: draws a #PangoGlyphString + * @draw_rectangle: draws a rectangle + * @draw_error_underline: draws a squiggly line that approximately + * covers the given rectangle in the style of an underline used to + * indicate a spelling error. + * @draw_shape: draw content for a glyph shaped with #PangoAttrShape. + * @x, @y are the coordinates of the left edge of the baseline, + * in user coordinates. + * @draw_trapezoid: draws a trapezoidal filled area + * @draw_glyph: draws a single glyph + * @part_changed: do renderer specific processing when rendering + * attributes change + * @begin: Do renderer-specific initialization before drawing + * @end: Do renderer-specific cleanup after drawing + * @prepare_run: updates the renderer for a new run + * @draw_glyph_item: draws a #PangoGlyphItem + * + * Class structure for #PangoRenderer. + * + * Since: 1.8 + **/ +struct _PangoRendererClass +{ + /*< private >*/ + GObjectClass parent_class; + + /* vtable - not signals */ + /*< public >*/ + + /* All of the following have default implementations + * and take as coordinates user coordinates in Pango units + */ + void (*draw_glyphs) (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); + void (*draw_rectangle) (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height); + void (*draw_error_underline) (PangoRenderer *renderer, + int x, + int y, + int width, + int height); + + /* Nothing is drawn for shaped glyphs unless this is implemented */ + void (*draw_shape) (PangoRenderer *renderer, + PangoAttrShape *attr, + int x, + int y); + + /* These two must be implemented and take coordinates in + * device space as doubles. + */ + void (*draw_trapezoid) (PangoRenderer *renderer, + PangoRenderPart part, + double y1_, + double x11, + double x21, + double y2, + double x12, + double x22); + void (*draw_glyph) (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph, + double x, + double y); + + /* Notification of change in rendering attributes + */ + void (*part_changed) (PangoRenderer *renderer, + PangoRenderPart part); + + /* Paired around drawing operations + */ + void (*begin) (PangoRenderer *renderer); + void (*end) (PangoRenderer *renderer); + + /* Hooks into the details of layout rendering + */ + void (*prepare_run) (PangoRenderer *renderer, + PangoLayoutRun *run); + + /* All of the following have default implementations + * and take as coordinates user coordinates in Pango units + */ + void (*draw_glyph_item) (PangoRenderer *renderer, + const char *text, + PangoGlyphItem *glyph_item, + int x, + int y); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +PANGO_AVAILABLE_IN_1_8 +GType pango_renderer_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_layout (PangoRenderer *renderer, + PangoLayout *layout, + int x, + int y); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_layout_line (PangoRenderer *renderer, + PangoLayoutLine *line, + int x, + int y); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); +PANGO_AVAILABLE_IN_1_22 +void pango_renderer_draw_glyph_item (PangoRenderer *renderer, + const char *text, + PangoGlyphItem *glyph_item, + int x, + int y); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_error_underline (PangoRenderer *renderer, + int x, + int y, + int width, + int height); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1_, + double x11, + double x21, + double y2, + double x12, + double x22); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_draw_glyph (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph, + double x, + double y); + +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_activate (PangoRenderer *renderer); +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_deactivate (PangoRenderer *renderer); + +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_part_changed (PangoRenderer *renderer, + PangoRenderPart part); + +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_set_color (PangoRenderer *renderer, + PangoRenderPart part, + const PangoColor *color); +PANGO_AVAILABLE_IN_1_8 +PangoColor *pango_renderer_get_color (PangoRenderer *renderer, + PangoRenderPart part); + +PANGO_AVAILABLE_IN_1_38 +void pango_renderer_set_alpha (PangoRenderer *renderer, + PangoRenderPart part, + guint16 alpha); +PANGO_AVAILABLE_IN_1_38 +guint16 pango_renderer_get_alpha (PangoRenderer *renderer, + PangoRenderPart part); + +PANGO_AVAILABLE_IN_1_8 +void pango_renderer_set_matrix (PangoRenderer *renderer, + const PangoMatrix *matrix); +PANGO_AVAILABLE_IN_1_8 +const PangoMatrix *pango_renderer_get_matrix (PangoRenderer *renderer); + +PANGO_AVAILABLE_IN_1_20 +PangoLayout *pango_renderer_get_layout (PangoRenderer *renderer); +PANGO_AVAILABLE_IN_1_20 +PangoLayoutLine *pango_renderer_get_layout_line (PangoRenderer *renderer); + +G_END_DECLS + +#endif /* __PANGO_RENDERER_H_ */ + diff --git a/pango/pango-script-lang-table.h b/pango/pango-script-lang-table.h new file mode 100644 index 0000000..05af016 --- /dev/null +++ b/pango/pango-script-lang-table.h @@ -0,0 +1,259 @@ +/* pango-script-lang-table.h: + * + * Generated by gen-script-for-lang.c + * Date: 2015-12-14 + * Source: fontconfig-2.11.94 + * + * Do not edit. + */ +typedef struct _PangoScriptForLang { + const char lang[7]; + PangoScript scripts[3]; +} PangoScriptForLang; + +static const PangoScriptForLang pango_script_for_lang[] = { + { "aa", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "ab", { PANGO_SCRIPT_CYRILLIC/*90*/ } }, + { "af", { PANGO_SCRIPT_LATIN/*69*/ } }, + { "ak", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "am", { PANGO_SCRIPT_ETHIOPIC/*264*/ } }, + { "an", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "ar", { PANGO_SCRIPT_ARABIC/*36*/ } }, + { "as", { PANGO_SCRIPT_BENGALI/*64*/ } }, + { "ast", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "av", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "ay", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "az-az", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "az-ir", { PANGO_SCRIPT_ARABIC/*38*/ } }, + { "ba", { PANGO_SCRIPT_CYRILLIC/*82*/ } }, + { "be", { PANGO_SCRIPT_CYRILLIC/*68*/ } }, + { "ber-dz", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ber-ma", { PANGO_SCRIPT_TIFINAGH/*32*/ } }, + { "bg", { PANGO_SCRIPT_CYRILLIC/*60*/ } }, + { "bh", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "bho", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "bi", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "bin", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "bm", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "bn", { PANGO_SCRIPT_BENGALI/*63*/ } }, + { "bo", { PANGO_SCRIPT_TIBETAN/*95*/ } }, + { "br", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "brx", { PANGO_SCRIPT_DEVANAGARI/*78*/ } }, + { "bs", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "bua", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "byn", { PANGO_SCRIPT_ETHIOPIC/*255*/ } }, + { "ca", { PANGO_SCRIPT_LATIN/*74*/ } }, + { "ce", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "ch", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "chm", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "chr", { PANGO_SCRIPT_CHEROKEE/*85*/ } }, + { "co", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "crh", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "cs", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "csb", { PANGO_SCRIPT_LATIN/*74*/ } }, + { "cu", { PANGO_SCRIPT_CYRILLIC/*103*/ } }, + { "cv", { PANGO_SCRIPT_CYRILLIC/*72*/, PANGO_SCRIPT_LATIN/*2*/ } }, + { "cy", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "da", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "de", { PANGO_SCRIPT_LATIN/*59*/ } }, + { "doi", { PANGO_SCRIPT_DEVANAGARI/*81*/ } }, + { "dv", { PANGO_SCRIPT_THAANA/*49*/ } }, + { "dz", { PANGO_SCRIPT_TIBETAN/*95*/ } }, + { "ee", { PANGO_SCRIPT_LATIN/*96*/ } }, + { "el", { PANGO_SCRIPT_GREEK/*69*/ } }, + { "en", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "eo", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "es", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "et", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "eu", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "fa", { PANGO_SCRIPT_ARABIC/*38*/ } }, + { "fat", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ff", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "fi", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "fil", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "fj", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "fo", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "fr", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "fur", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "fy", { PANGO_SCRIPT_LATIN/*75*/ } }, + { "ga", { PANGO_SCRIPT_LATIN/*80*/ } }, + { "gd", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "gez", { PANGO_SCRIPT_ETHIOPIC/*218*/ } }, + { "gl", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "gn", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "gu", { PANGO_SCRIPT_GUJARATI/*68*/ } }, + { "gv", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "ha", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "haw", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "he", { PANGO_SCRIPT_HEBREW/*27*/ } }, + { "hi", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "hne", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "ho", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "hr", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "hsb", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "ht", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "hu", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "hy", { PANGO_SCRIPT_ARMENIAN/*77*/ } }, + { "hz", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "ia", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "id", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "ie", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ig", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "ii", { PANGO_SCRIPT_YI/*1165*/ } }, + { "ik", { PANGO_SCRIPT_CYRILLIC/*68*/ } }, + { "io", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "is", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "it", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "iu", { PANGO_SCRIPT_CANADIAN_ABORIGINAL/*161*/ } }, + { "ja", { PANGO_SCRIPT_HAN/*2134*/, PANGO_SCRIPT_KATAKANA/*88*/, PANGO_SCRIPT_HIRAGANA/*85*/ } }, + { "jv", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "ka", { PANGO_SCRIPT_GEORGIAN/*33*/ } }, + { "kaa", { PANGO_SCRIPT_CYRILLIC/*78*/ } }, + { "kab", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ki", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "kj", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "kk", { PANGO_SCRIPT_CYRILLIC/*77*/ } }, + { "kl", { PANGO_SCRIPT_LATIN/*81*/ } }, + { "km", { PANGO_SCRIPT_KHMER/*63*/ } }, + { "kn", { PANGO_SCRIPT_KANNADA/*70*/ } }, + { "ko", { PANGO_SCRIPT_HANGUL/*2442*/ } }, + { "kok", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "kr", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "ks", { PANGO_SCRIPT_ARABIC/*33*/ } }, + { "ku-am", { PANGO_SCRIPT_CYRILLIC/*64*/ } }, + { "ku-iq", { PANGO_SCRIPT_ARABIC/*32*/ } }, + { "ku-ir", { PANGO_SCRIPT_ARABIC/*32*/ } }, + { "ku-tr", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "kum", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "kv", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "kw", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "kwm", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ky", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "la", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "lah", { PANGO_SCRIPT_ARABIC/*27*/ } }, + { "lb", { PANGO_SCRIPT_LATIN/*75*/ } }, + { "lez", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "lg", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "li", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "ln", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "lo", { PANGO_SCRIPT_LAO/*55*/ } }, + { "lt", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "lv", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "mai", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "mg", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "mh", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "mi", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "mk", { PANGO_SCRIPT_CYRILLIC/*42*/ } }, + { "ml", { PANGO_SCRIPT_MALAYALAM/*68*/ } }, + { "mn-cn", { PANGO_SCRIPT_MONGOLIAN/*130*/ } }, + { "mn-mn", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "mni", { PANGO_SCRIPT_BENGALI/*75*/ } }, + { "mo", { PANGO_SCRIPT_CYRILLIC/*66*/, PANGO_SCRIPT_LATIN/*62*/ } }, + { "mr", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "ms", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "mt", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "my", { PANGO_SCRIPT_MYANMAR/*48*/ } }, + { "na", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "nb", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "nds", { PANGO_SCRIPT_LATIN/*59*/ } }, + { "ne", { PANGO_SCRIPT_DEVANAGARI/*70*/ } }, + { "ng", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "nl", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "nn", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "no", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "nqo", { PANGO_SCRIPT_NKO/*59*/ } }, + { "nr", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "nso", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "nv", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ny", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "oc", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "om", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "or", { PANGO_SCRIPT_ORIYA/*68*/ } }, + { "os", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "ota", { PANGO_SCRIPT_ARABIC/*37*/ } }, + { "pa", { PANGO_SCRIPT_GURMUKHI/*63*/ } }, + { "pa-pk", { PANGO_SCRIPT_ARABIC/*27*/ } }, + { "pap-an", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "pap-aw", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "pl", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ps-af", { PANGO_SCRIPT_ARABIC/*49*/ } }, + { "ps-pk", { PANGO_SCRIPT_ARABIC/*49*/ } }, + { "pt", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "qu", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "quz", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "rm", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "rn", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ro", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "ru", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "rw", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sa", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "sah", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "sat", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "sc", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "sco", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "sd", { PANGO_SCRIPT_ARABIC/*54*/ } }, + { "se", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "sel", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "sg", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "sh", { PANGO_SCRIPT_CYRILLIC/*94*/, PANGO_SCRIPT_LATIN/*62*/ } }, + { "shs", { PANGO_SCRIPT_LATIN/*46*/ } }, + { "si", { PANGO_SCRIPT_SINHALA/*73*/ } }, + { "sid", { PANGO_SCRIPT_ETHIOPIC/*281*/ } }, + { "sk", { PANGO_SCRIPT_LATIN/*86*/ } }, + { "sl", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "sm", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sma", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "smj", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "smn", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "sms", { PANGO_SCRIPT_LATIN/*80*/ } }, + { "sn", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "so", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sq", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "sr", { PANGO_SCRIPT_CYRILLIC/*60*/ } }, + { "ss", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "st", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "su", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "sv", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "sw", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "syr", { PANGO_SCRIPT_SYRIAC/*45*/ } }, + { "ta", { PANGO_SCRIPT_TAMIL/*48*/ } }, + { "te", { PANGO_SCRIPT_TELUGU/*70*/ } }, + { "tg", { PANGO_SCRIPT_CYRILLIC/*78*/ } }, + { "th", { PANGO_SCRIPT_THAI/*73*/ } }, + { "ti-er", { PANGO_SCRIPT_ETHIOPIC/*255*/ } }, + { "ti-et", { PANGO_SCRIPT_ETHIOPIC/*281*/ } }, + { "tig", { PANGO_SCRIPT_ETHIOPIC/*221*/ } }, + { "tk", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "tl", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "tn", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "to", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "tr", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ts", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "tt", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "tw", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ty", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "tyv", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "ug", { PANGO_SCRIPT_ARABIC/*33*/ } }, + { "uk", { PANGO_SCRIPT_CYRILLIC/*72*/ } }, + { "ur", { PANGO_SCRIPT_ARABIC/*27*/ } }, + { "uz", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ve", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "vi", { PANGO_SCRIPT_LATIN/*186*/ } }, + { "vo", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "vot", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "wa", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "wal", { PANGO_SCRIPT_ETHIOPIC/*281*/ } }, + { "wen", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "wo", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "xh", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "yap", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "yi", { PANGO_SCRIPT_HEBREW/*27*/ } }, + { "yo", { PANGO_SCRIPT_LATIN/*114*/ } }, + { "za", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "zh-cn", { PANGO_SCRIPT_HAN/*6763*/ } }, + { "zh-hk", { PANGO_SCRIPT_HAN/*1083*/ } }, + { "zh-mo", { PANGO_SCRIPT_HAN/*1083*/ } }, + { "zh-sg", { PANGO_SCRIPT_HAN/*6763*/ } }, + { "zh-tw", { PANGO_SCRIPT_HAN/*13063*/ } }, + { "zu", { PANGO_SCRIPT_LATIN/*52*/ } } +}; diff --git a/pango/pango-script-private.h b/pango/pango-script-private.h new file mode 100644 index 0000000..b77209c --- /dev/null +++ b/pango/pango-script-private.h @@ -0,0 +1,56 @@ +/* Pango + * pango-script-private.h: Script tag handling, private definitions + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_SCRIPT_PRIVATE_H__ +#define __PANGO_SCRIPT_PRIVATE_H__ + +#define PAREN_STACK_DEPTH 128 + +typedef struct _ParenStackEntry ParenStackEntry; + +struct _ParenStackEntry +{ + int pair_index; + PangoScript script_code; +}; + +struct _PangoScriptIter +{ + const gchar *text_start; + const gchar *text_end; + + const gchar *script_start; + const gchar *script_end; + PangoScript script_code; + + ParenStackEntry paren_stack[PAREN_STACK_DEPTH]; + int paren_sp; +}; + +PangoScriptIter * +_pango_script_iter_init (PangoScriptIter *iter, + const char *text, + int length); + +void +_pango_script_iter_fini (PangoScriptIter *iter); + +#endif /* __PANGO_SCRIPT_PRIVATE_H__ */ diff --git a/pango/pango-script.c b/pango/pango-script.c new file mode 100644 index 0000000..43be3fa --- /dev/null +++ b/pango/pango-script.c @@ -0,0 +1,353 @@ +/* Pango + * pango-script.c: Script tag handling + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Implementation of pango_script_iter is derived from ICU: + * + * icu/sources/common/usc_impl.c + * + ********************************************************************** + * Copyright (C) 1999-2002, International Business Machines + * Corporation and others. All Rights Reserved. + ********************************************************************** + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. + */ + +/** + * SECTION:scripts + * @short_description:Identifying writing systems and languages + * @title:Scripts and Languages + * + * The functions in this section are used to identify the writing + * system, or script of individual characters + * and of ranges within a larger text string. + */ +#include "config.h" +#include +#include + +#include "pango-script.h" +#include "pango-script-private.h" + +/** + * pango_script_for_unichar: + * @ch: a Unicode character + * + * Looks up the #PangoScript for a particular character (as defined by + * Unicode Standard Annex \#24). No check is made for @ch being a + * valid Unicode character; if you pass in invalid character, the + * result is undefined. + * + * As of Pango 1.18, this function simply returns the return value of + * g_unichar_get_script(). + * + * Return value: the #PangoScript for the character. + * + * Since: 1.4 + **/ +PangoScript +pango_script_for_unichar (gunichar ch) +{ + return g_unichar_get_script (ch); +} + +/**********************************************************************/ + +PangoScriptIter * +_pango_script_iter_init (PangoScriptIter *iter, + const char *text, + int length) +{ + iter->text_start = text; + if (length >= 0) + iter->text_end = text + length; + else + iter->text_end = text + strlen (text); + + iter->script_start = text; + iter->script_end = text; + iter->script_code = PANGO_SCRIPT_COMMON; + + iter->paren_sp = -1; + + pango_script_iter_next (iter); + + return iter; +} + +/** + * pango_script_iter_new: + * @text: a UTF-8 string + * @length: length of @text, or -1 if @text is nul-terminated. + * + * Create a new #PangoScriptIter, used to break a string of + * Unicode text into runs by Unicode script. No copy is made of + * @text, so the caller needs to make sure it remains valid until + * the iterator is freed with pango_script_iter_free(). + * + * Return value: the new script iterator, initialized + * to point at the first range in the text, which should be + * freed with pango_script_iter_free(). If the string is + * empty, it will point at an empty range. + * + * Since: 1.4 + **/ +PangoScriptIter * +pango_script_iter_new (const char *text, + int length) +{ + return _pango_script_iter_init (g_slice_new (PangoScriptIter), text, length); +} + +void +_pango_script_iter_fini (PangoScriptIter *iter) +{ +} + +/** + * pango_script_iter_free: + * @iter: a #PangoScriptIter + * + * Frees a #PangoScriptIter created with pango_script_iter_new(). + * + * Since: 1.4 + **/ +void +pango_script_iter_free (PangoScriptIter *iter) +{ + _pango_script_iter_fini (iter); + g_slice_free (PangoScriptIter, iter); +} + +/** + * pango_script_iter_get_range: + * @iter: a #PangoScriptIter + * @start: (out) (allow-none): location to store start position of the range, or %NULL + * @end: (out) (allow-none): location to store end position of the range, or %NULL + * @script: (out) (allow-none): location to store script for range, or %NULL + * + * Gets information about the range to which @iter currently points. + * The range is the set of locations p where *start <= p < *end. + * (That is, it doesn't include the character stored at *end) + * + * Since: 1.4 + **/ +void +pango_script_iter_get_range (PangoScriptIter *iter, + const char **start, + const char **end, + PangoScript *script) +{ + if (start) + *start = iter->script_start; + if (end) + *end = iter->script_end; + if (script) + *script = iter->script_code; +} + +static const gunichar paired_chars[] = { + 0x0028, 0x0029, /* ascii paired punctuation */ + 0x003c, 0x003e, + 0x005b, 0x005d, + 0x007b, 0x007d, + 0x00ab, 0x00bb, /* guillemets */ + 0x2018, 0x2019, /* general punctuation */ + 0x201c, 0x201d, + 0x2039, 0x203a, + 0x3008, 0x3009, /* chinese paired punctuation */ + 0x300a, 0x300b, + 0x300c, 0x300d, + 0x300e, 0x300f, + 0x3010, 0x3011, + 0x3014, 0x3015, + 0x3016, 0x3017, + 0x3018, 0x3019, + 0x301a, 0x301b +}; + +static int +get_pair_index (gunichar ch) +{ + int lower = 0; + int upper = G_N_ELEMENTS (paired_chars) - 1; + + while (lower <= upper) + { + int mid = (lower + upper) / 2; + + if (ch < paired_chars[mid]) + upper = mid - 1; + else if (ch > paired_chars[mid]) + lower = mid + 1; + else + return mid; + } + + return -1; +} + +/* duplicated in pango-language.c */ +#define REAL_SCRIPT(script) \ + ((script) > PANGO_SCRIPT_INHERITED && (script) != PANGO_SCRIPT_UNKNOWN) + +#define SAME_SCRIPT(script1, script2) \ + (!REAL_SCRIPT (script1) || !REAL_SCRIPT (script2) || (script1) == (script2)) + +#define IS_OPEN(pair_index) (((pair_index) & 1) == 0) + +/** + * pango_script_iter_next: + * @iter: a #PangoScriptIter + * + * Advances a #PangoScriptIter to the next range. If @iter + * is already at the end, it is left unchanged and %FALSE + * is returned. + * + * Return value: %TRUE if @iter was successfully advanced. + * + * Since: 1.4 + **/ +gboolean +pango_script_iter_next (PangoScriptIter *iter) +{ + int start_sp; + + if (iter->script_end == iter->text_end) + return FALSE; + + start_sp = iter->paren_sp; + iter->script_code = PANGO_SCRIPT_COMMON; + iter->script_start = iter->script_end; + + for (; iter->script_end < iter->text_end; iter->script_end = g_utf8_next_char (iter->script_end)) + { + gunichar ch = g_utf8_get_char (iter->script_end); + PangoScript sc; + int pair_index; + + sc = g_unichar_get_script (ch); + if (sc != PANGO_SCRIPT_COMMON) + pair_index = -1; + else + pair_index = get_pair_index (ch); + + /* + * Paired character handling: + * + * if it's an open character, push it onto the stack. + * if it's a close character, find the matching open on the + * stack, and use that script code. Any non-matching open + * characters above it on the stack will be poped. + */ + if (pair_index >= 0) + { + if (IS_OPEN (pair_index)) + { + /* + * If the paren stack is full, empty it. This + * means that deeply nested paired punctuation + * characters will be ignored, but that's an unusual + * case, and it's better to ignore them than to + * write off the end of the stack... + */ + if (++iter->paren_sp >= PAREN_STACK_DEPTH) + iter->paren_sp = 0; + + iter->paren_stack[iter->paren_sp].pair_index = pair_index; + iter->paren_stack[iter->paren_sp].script_code = iter->script_code; + } + else if (iter->paren_sp >= 0) + { + int pi = pair_index & ~1; + + while (iter->paren_sp >= 0 && iter->paren_stack[iter->paren_sp].pair_index != pi) + iter->paren_sp--; + + if (iter->paren_sp < start_sp) + start_sp = iter->paren_sp; + + if (iter->paren_sp >= 0) + sc = iter->paren_stack[iter->paren_sp].script_code; + } + } + + if (SAME_SCRIPT (iter->script_code, sc)) + { + if (!REAL_SCRIPT (iter->script_code) && REAL_SCRIPT (sc)) + { + iter->script_code = sc; + + /* + * now that we have a final script code, fix any open + * characters we pushed before we knew the script code. + */ + while (start_sp < iter->paren_sp) + iter->paren_stack[++start_sp].script_code = iter->script_code; + } + + /* + * if this character is a close paired character, + * pop it from the stack + */ + if (pair_index >= 0 && !IS_OPEN (pair_index) && iter->paren_sp >= 0) + { + iter->paren_sp--; + + if (iter->paren_sp < start_sp) + start_sp = iter->paren_sp; + } + } + else + { + /* Different script, we're done */ + break; + } + } + + return TRUE; +} + +/********************************************************** + * End of code from ICU + **********************************************************/ diff --git a/pango/pango-script.h b/pango/pango-script.h new file mode 100644 index 0000000..6287602 --- /dev/null +++ b/pango/pango-script.h @@ -0,0 +1,330 @@ +/* Pango + * pango-script.h: Script tag handling + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_SCRIPT_H__ +#define __PANGO_SCRIPT_H__ + +#include + +G_BEGIN_DECLS + +/** + * PangoScriptIter: + * + * A #PangoScriptIter is used to iterate through a string + * and identify ranges in different scripts. + **/ +typedef struct _PangoScriptIter PangoScriptIter; + +/** + * PangoScript: + * @PANGO_SCRIPT_INVALID_CODE: a value never returned from pango_script_for_unichar() + * @PANGO_SCRIPT_COMMON: a character used by multiple different scripts + * @PANGO_SCRIPT_INHERITED: a mark glyph that takes its script from the + * base glyph to which it is attached + * @PANGO_SCRIPT_ARABIC: Arabic + * @PANGO_SCRIPT_ARMENIAN: Armenian + * @PANGO_SCRIPT_BENGALI: Bengali + * @PANGO_SCRIPT_BOPOMOFO: Bopomofo + * @PANGO_SCRIPT_CHEROKEE: Cherokee + * @PANGO_SCRIPT_COPTIC: Coptic + * @PANGO_SCRIPT_CYRILLIC: Cyrillic + * @PANGO_SCRIPT_DESERET: Deseret + * @PANGO_SCRIPT_DEVANAGARI: Devanagari + * @PANGO_SCRIPT_ETHIOPIC: Ethiopic + * @PANGO_SCRIPT_GEORGIAN: Georgian + * @PANGO_SCRIPT_GOTHIC: Gothic + * @PANGO_SCRIPT_GREEK: Greek + * @PANGO_SCRIPT_GUJARATI: Gujarati + * @PANGO_SCRIPT_GURMUKHI: Gurmukhi + * @PANGO_SCRIPT_HAN: Han + * @PANGO_SCRIPT_HANGUL: Hangul + * @PANGO_SCRIPT_HEBREW: Hebrew + * @PANGO_SCRIPT_HIRAGANA: Hiragana + * @PANGO_SCRIPT_KANNADA: Kannada + * @PANGO_SCRIPT_KATAKANA: Katakana + * @PANGO_SCRIPT_KHMER: Khmer + * @PANGO_SCRIPT_LAO: Lao + * @PANGO_SCRIPT_LATIN: Latin + * @PANGO_SCRIPT_MALAYALAM: Malayalam + * @PANGO_SCRIPT_MONGOLIAN: Mongolian + * @PANGO_SCRIPT_MYANMAR: Myanmar + * @PANGO_SCRIPT_OGHAM: Ogham + * @PANGO_SCRIPT_OLD_ITALIC: Old Italic + * @PANGO_SCRIPT_ORIYA: Oriya + * @PANGO_SCRIPT_RUNIC: Runic + * @PANGO_SCRIPT_SINHALA: Sinhala + * @PANGO_SCRIPT_SYRIAC: Syriac + * @PANGO_SCRIPT_TAMIL: Tamil + * @PANGO_SCRIPT_TELUGU: Telugu + * @PANGO_SCRIPT_THAANA: Thaana + * @PANGO_SCRIPT_THAI: Thai + * @PANGO_SCRIPT_TIBETAN: Tibetan + * @PANGO_SCRIPT_CANADIAN_ABORIGINAL: Canadian Aboriginal + * @PANGO_SCRIPT_YI: Yi + * @PANGO_SCRIPT_TAGALOG: Tagalog + * @PANGO_SCRIPT_HANUNOO: Hanunoo + * @PANGO_SCRIPT_BUHID: Buhid + * @PANGO_SCRIPT_TAGBANWA: Tagbanwa + * @PANGO_SCRIPT_BRAILLE: Braille + * @PANGO_SCRIPT_CYPRIOT: Cypriot + * @PANGO_SCRIPT_LIMBU: Limbu + * @PANGO_SCRIPT_OSMANYA: Osmanya + * @PANGO_SCRIPT_SHAVIAN: Shavian + * @PANGO_SCRIPT_LINEAR_B: Linear B + * @PANGO_SCRIPT_TAI_LE: Tai Le + * @PANGO_SCRIPT_UGARITIC: Ugaritic + * @PANGO_SCRIPT_NEW_TAI_LUE: New Tai Lue. Since 1.10 + * @PANGO_SCRIPT_BUGINESE: Buginese. Since 1.10 + * @PANGO_SCRIPT_GLAGOLITIC: Glagolitic. Since 1.10 + * @PANGO_SCRIPT_TIFINAGH: Tifinagh. Since 1.10 + * @PANGO_SCRIPT_SYLOTI_NAGRI: Syloti Nagri. Since 1.10 + * @PANGO_SCRIPT_OLD_PERSIAN: Old Persian. Since 1.10 + * @PANGO_SCRIPT_KHAROSHTHI: Kharoshthi. Since 1.10 + * @PANGO_SCRIPT_UNKNOWN: an unassigned code point. Since 1.14 + * @PANGO_SCRIPT_BALINESE: Balinese. Since 1.14 + * @PANGO_SCRIPT_CUNEIFORM: Cuneiform. Since 1.14 + * @PANGO_SCRIPT_PHOENICIAN: Phoenician. Since 1.14 + * @PANGO_SCRIPT_PHAGS_PA: Phags-pa. Since 1.14 + * @PANGO_SCRIPT_NKO: N'Ko. Since 1.14 + * @PANGO_SCRIPT_KAYAH_LI: Kayah Li. Since 1.20.1 + * @PANGO_SCRIPT_LEPCHA: Lepcha. Since 1.20.1 + * @PANGO_SCRIPT_REJANG: Rejang. Since 1.20.1 + * @PANGO_SCRIPT_SUNDANESE: Sundanese. Since 1.20.1 + * @PANGO_SCRIPT_SAURASHTRA: Saurashtra. Since 1.20.1 + * @PANGO_SCRIPT_CHAM: Cham. Since 1.20.1 + * @PANGO_SCRIPT_OL_CHIKI: Ol Chiki. Since 1.20.1 + * @PANGO_SCRIPT_VAI: Vai. Since 1.20.1 + * @PANGO_SCRIPT_CARIAN: Carian. Since 1.20.1 + * @PANGO_SCRIPT_LYCIAN: Lycian. Since 1.20.1 + * @PANGO_SCRIPT_LYDIAN: Lydian. Since 1.20.1 + * @PANGO_SCRIPT_BATAK: Batak. Since 1.32 + * @PANGO_SCRIPT_BRAHMI: Brahmi. Since 1.32 + * @PANGO_SCRIPT_MANDAIC: Mandaic. Since 1.32 + * @PANGO_SCRIPT_CHAKMA: Chakma. Since: 1.32 + * @PANGO_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 1.32 + * @PANGO_SCRIPT_MEROITIC_HIEROGLYPHS: Meroitic Hieroglyphs. Since: 1.32 + * @PANGO_SCRIPT_MIAO: Miao. Since: 1.32 + * @PANGO_SCRIPT_SHARADA: Sharada. Since: 1.32 + * @PANGO_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 1.32 + * @PANGO_SCRIPT_TAKRI: Takri. Since: 1.32 + * @PANGO_SCRIPT_BASSA_VAH: Bassa. Since: 1.40 + * @PANGO_SCRIPT_CAUCASIAN_ALBANIAN: Caucasian Albanian. Since: 1.40 + * @PANGO_SCRIPT_DUPLOYAN: Duployan. Since: 1.40 + * @PANGO_SCRIPT_ELBASAN: Elbasan. Since: 1.40 + * @PANGO_SCRIPT_GRANTHA: Grantha. Since: 1.40 + * @PANGO_SCRIPT_KHOJKI: Kjohki. Since: 1.40 + * @PANGO_SCRIPT_KHUDAWADI: Khudawadi, Sindhi. Since: 1.40 + * @PANGO_SCRIPT_LINEAR_A: Linear A. Since: 1.40 + * @PANGO_SCRIPT_MAHAJANI: Mahajani. Since: 1.40 + * @PANGO_SCRIPT_MANICHAEAN: Manichaean. Since: 1.40 + * @PANGO_SCRIPT_MENDE_KIKAKUI: Mende Kikakui. Since: 1.40 + * @PANGO_SCRIPT_MODI: Modi. Since: 1.40 + * @PANGO_SCRIPT_MRO: Mro. Since: 1.40 + * @PANGO_SCRIPT_NABATAEAN: Nabataean. Since: 1.40 + * @PANGO_SCRIPT_OLD_NORTH_ARABIAN: Old North Arabian. Since: 1.40 + * @PANGO_SCRIPT_OLD_PERMIC: Old Permic. Since: 1.40 + * @PANGO_SCRIPT_PAHAWH_HMONG: Pahawh Hmong. Since: 1.40 + * @PANGO_SCRIPT_PALMYRENE: Palmyrene. Since: 1.40 + * @PANGO_SCRIPT_PAU_CIN_HAU: Pau Cin Hau. Since: 1.40 + * @PANGO_SCRIPT_PSALTER_PAHLAVI: Psalter Pahlavi. Since: 1.40 + * @PANGO_SCRIPT_SIDDHAM: Siddham. Since: 1.40 + * @PANGO_SCRIPT_TIRHUTA: Tirhuta. Since: 1.40 + * @PANGO_SCRIPT_WARANG_CITI: Warang Citi. Since: 1.40 + * @PANGO_SCRIPT_AHOM: Ahom. Since: 1.40 + * @PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS: Anatolian Hieroglyphs. Since: 1.40 + * @PANGO_SCRIPT_HATRAN: Hatran. Since: 1.40 + * @PANGO_SCRIPT_MULTANI: Multani. Since: 1.40 + * @PANGO_SCRIPT_OLD_HUNGARIAN: Old Hungarian. Since: 1.40 + * @PANGO_SCRIPT_SIGNWRITING: Signwriting. Since: 1.40 + * + * The #PangoScript enumeration identifies different writing + * systems. The values correspond to the names as defined in the + * Unicode standard. + * Note that new types may be added in the future. Applications should be ready + * to handle unknown values. This enumeration is interchangeable with + * #GUnicodeScript. See Unicode Standard Annex + * #24: Script names. + */ +typedef enum { /* ISO 15924 code */ + PANGO_SCRIPT_INVALID_CODE = -1, + PANGO_SCRIPT_COMMON = 0, /* Zyyy */ + PANGO_SCRIPT_INHERITED, /* Qaai */ + PANGO_SCRIPT_ARABIC, /* Arab */ + PANGO_SCRIPT_ARMENIAN, /* Armn */ + PANGO_SCRIPT_BENGALI, /* Beng */ + PANGO_SCRIPT_BOPOMOFO, /* Bopo */ + PANGO_SCRIPT_CHEROKEE, /* Cher */ + PANGO_SCRIPT_COPTIC, /* Qaac */ + PANGO_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */ + PANGO_SCRIPT_DESERET, /* Dsrt */ + PANGO_SCRIPT_DEVANAGARI, /* Deva */ + PANGO_SCRIPT_ETHIOPIC, /* Ethi */ + PANGO_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */ + PANGO_SCRIPT_GOTHIC, /* Goth */ + PANGO_SCRIPT_GREEK, /* Grek */ + PANGO_SCRIPT_GUJARATI, /* Gujr */ + PANGO_SCRIPT_GURMUKHI, /* Guru */ + PANGO_SCRIPT_HAN, /* Hani */ + PANGO_SCRIPT_HANGUL, /* Hang */ + PANGO_SCRIPT_HEBREW, /* Hebr */ + PANGO_SCRIPT_HIRAGANA, /* Hira */ + PANGO_SCRIPT_KANNADA, /* Knda */ + PANGO_SCRIPT_KATAKANA, /* Kana */ + PANGO_SCRIPT_KHMER, /* Khmr */ + PANGO_SCRIPT_LAO, /* Laoo */ + PANGO_SCRIPT_LATIN, /* Latn (Latf, Latg) */ + PANGO_SCRIPT_MALAYALAM, /* Mlym */ + PANGO_SCRIPT_MONGOLIAN, /* Mong */ + PANGO_SCRIPT_MYANMAR, /* Mymr */ + PANGO_SCRIPT_OGHAM, /* Ogam */ + PANGO_SCRIPT_OLD_ITALIC, /* Ital */ + PANGO_SCRIPT_ORIYA, /* Orya */ + PANGO_SCRIPT_RUNIC, /* Runr */ + PANGO_SCRIPT_SINHALA, /* Sinh */ + PANGO_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */ + PANGO_SCRIPT_TAMIL, /* Taml */ + PANGO_SCRIPT_TELUGU, /* Telu */ + PANGO_SCRIPT_THAANA, /* Thaa */ + PANGO_SCRIPT_THAI, /* Thai */ + PANGO_SCRIPT_TIBETAN, /* Tibt */ + PANGO_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */ + PANGO_SCRIPT_YI, /* Yiii */ + PANGO_SCRIPT_TAGALOG, /* Tglg */ + PANGO_SCRIPT_HANUNOO, /* Hano */ + PANGO_SCRIPT_BUHID, /* Buhd */ + PANGO_SCRIPT_TAGBANWA, /* Tagb */ + + /* Unicode-4.0 additions */ + PANGO_SCRIPT_BRAILLE, /* Brai */ + PANGO_SCRIPT_CYPRIOT, /* Cprt */ + PANGO_SCRIPT_LIMBU, /* Limb */ + PANGO_SCRIPT_OSMANYA, /* Osma */ + PANGO_SCRIPT_SHAVIAN, /* Shaw */ + PANGO_SCRIPT_LINEAR_B, /* Linb */ + PANGO_SCRIPT_TAI_LE, /* Tale */ + PANGO_SCRIPT_UGARITIC, /* Ugar */ + + /* Unicode-4.1 additions */ + PANGO_SCRIPT_NEW_TAI_LUE, /* Talu */ + PANGO_SCRIPT_BUGINESE, /* Bugi */ + PANGO_SCRIPT_GLAGOLITIC, /* Glag */ + PANGO_SCRIPT_TIFINAGH, /* Tfng */ + PANGO_SCRIPT_SYLOTI_NAGRI, /* Sylo */ + PANGO_SCRIPT_OLD_PERSIAN, /* Xpeo */ + PANGO_SCRIPT_KHAROSHTHI, /* Khar */ + + /* Unicode-5.0 additions */ + PANGO_SCRIPT_UNKNOWN, /* Zzzz */ + PANGO_SCRIPT_BALINESE, /* Bali */ + PANGO_SCRIPT_CUNEIFORM, /* Xsux */ + PANGO_SCRIPT_PHOENICIAN, /* Phnx */ + PANGO_SCRIPT_PHAGS_PA, /* Phag */ + PANGO_SCRIPT_NKO, /* Nkoo */ + + /* Unicode-5.1 additions */ + PANGO_SCRIPT_KAYAH_LI, /* Kali */ + PANGO_SCRIPT_LEPCHA, /* Lepc */ + PANGO_SCRIPT_REJANG, /* Rjng */ + PANGO_SCRIPT_SUNDANESE, /* Sund */ + PANGO_SCRIPT_SAURASHTRA, /* Saur */ + PANGO_SCRIPT_CHAM, /* Cham */ + PANGO_SCRIPT_OL_CHIKI, /* Olck */ + PANGO_SCRIPT_VAI, /* Vaii */ + PANGO_SCRIPT_CARIAN, /* Cari */ + PANGO_SCRIPT_LYCIAN, /* Lyci */ + PANGO_SCRIPT_LYDIAN, /* Lydi */ + + /* Unicode-6.0 additions */ + PANGO_SCRIPT_BATAK, /* Batk */ + PANGO_SCRIPT_BRAHMI, /* Brah */ + PANGO_SCRIPT_MANDAIC, /* Mand */ + + /* Unicode-6.1 additions */ + PANGO_SCRIPT_CHAKMA, /* Cakm */ + PANGO_SCRIPT_MEROITIC_CURSIVE, /* Merc */ + PANGO_SCRIPT_MEROITIC_HIEROGLYPHS,/* Mero */ + PANGO_SCRIPT_MIAO, /* Plrd */ + PANGO_SCRIPT_SHARADA, /* Shrd */ + PANGO_SCRIPT_SORA_SOMPENG, /* Sora */ + PANGO_SCRIPT_TAKRI, /* Takr */ + + /* Unicode 7.0 additions */ + PANGO_SCRIPT_BASSA_VAH, /* Bass */ + PANGO_SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */ + PANGO_SCRIPT_DUPLOYAN, /* Dupl */ + PANGO_SCRIPT_ELBASAN, /* Elba */ + PANGO_SCRIPT_GRANTHA, /* Gran */ + PANGO_SCRIPT_KHOJKI, /* Khoj */ + PANGO_SCRIPT_KHUDAWADI, /* Sind */ + PANGO_SCRIPT_LINEAR_A, /* Lina */ + PANGO_SCRIPT_MAHAJANI, /* Mahj */ + PANGO_SCRIPT_MANICHAEAN, /* Manu */ + PANGO_SCRIPT_MENDE_KIKAKUI, /* Mend */ + PANGO_SCRIPT_MODI, /* Modi */ + PANGO_SCRIPT_MRO, /* Mroo */ + PANGO_SCRIPT_NABATAEAN, /* Nbat */ + PANGO_SCRIPT_OLD_NORTH_ARABIAN, /* Narb */ + PANGO_SCRIPT_OLD_PERMIC, /* Perm */ + PANGO_SCRIPT_PAHAWH_HMONG, /* Hmng */ + PANGO_SCRIPT_PALMYRENE, /* Palm */ + PANGO_SCRIPT_PAU_CIN_HAU, /* Pauc */ + PANGO_SCRIPT_PSALTER_PAHLAVI, /* Phlp */ + PANGO_SCRIPT_SIDDHAM, /* Sidd */ + PANGO_SCRIPT_TIRHUTA, /* Tirh */ + PANGO_SCRIPT_WARANG_CITI, /* Wara */ + + /* Unicode 8.0 additions */ + PANGO_SCRIPT_AHOM, /* Ahom */ + PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */ + PANGO_SCRIPT_HATRAN, /* Hatr */ + PANGO_SCRIPT_MULTANI, /* Mult */ + PANGO_SCRIPT_OLD_HUNGARIAN, /* Hung */ + PANGO_SCRIPT_SIGNWRITING /* Sgnw */ +} PangoScript; + +#include + +PANGO_AVAILABLE_IN_1_4 +PangoScript pango_script_for_unichar (gunichar ch) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_4 +PangoScriptIter *pango_script_iter_new (const char *text, + int length); +PANGO_AVAILABLE_IN_1_4 +void pango_script_iter_get_range (PangoScriptIter *iter, + const char **start, + const char **end, + PangoScript *script); +PANGO_AVAILABLE_IN_1_4 +gboolean pango_script_iter_next (PangoScriptIter *iter); +PANGO_AVAILABLE_IN_1_4 +void pango_script_iter_free (PangoScriptIter *iter); + +#include + +PANGO_AVAILABLE_IN_1_4 +PangoLanguage *pango_script_get_sample_language (PangoScript script) G_GNUC_PURE; + +G_END_DECLS + +#endif /* __PANGO_SCRIPT_H__ */ diff --git a/pango/pango-tabs.c b/pango/pango-tabs.c new file mode 100644 index 0000000..1ffa835 --- /dev/null +++ b/pango/pango-tabs.c @@ -0,0 +1,378 @@ +/* Pango + * pango-tabs.c: Tab-related stuff + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:tab-stops + * @short_description:Structures for storing tab stops + * @title:Tab Stops + * + * Functions in this section are used to deal with #PangoTabArray objects + * that can be used to set tab stop positions in a #PangoLayout. + */ +#include "config.h" +#include "pango-tabs.h" +#include "pango-impl-utils.h" +#include + +typedef struct _PangoTab PangoTab; + +struct _PangoTab +{ + gint location; /* Offset in pixels of this tab stop + * from the left margin of the text. + */ + PangoTabAlign alignment; /* Where the tab stop appears relative + * to the text. + */ +}; + +/** + * PangoTabArray: + * + * A #PangoTabArray struct contains an array + * of tab stops. Each tab stop has an alignment and a position. + */ +struct _PangoTabArray +{ + gint size; + gint allocated; + gboolean positions_in_pixels; + PangoTab *tabs; +}; + +static void +init_tabs (PangoTabArray *array, gint start, gint end) +{ + while (start < end) + { + array->tabs[start].location = 0; + array->tabs[start].alignment = PANGO_TAB_LEFT; + ++start; + } +} + +/** + * pango_tab_array_new: + * @initial_size: Initial number of tab stops to allocate, can be 0 + * @positions_in_pixels: whether positions are in pixel units + * + * Creates an array of @initial_size tab stops. Tab stops are specified in + * pixel units if @positions_in_pixels is %TRUE, otherwise in Pango + * units. All stops are initially at position 0. + * + * Return value: the newly allocated #PangoTabArray, which should + * be freed with pango_tab_array_free(). + **/ +PangoTabArray* +pango_tab_array_new (gint initial_size, + gboolean positions_in_pixels) +{ + PangoTabArray *array; + + g_return_val_if_fail (initial_size >= 0, NULL); + + /* alloc enough to treat array->tabs as an array of length + * size, though it's declared as an array of length 1. + * If we allowed tab array resizing we'd need to drop this + * optimization. + */ + array = g_slice_new (PangoTabArray); + array->size = initial_size; + array->allocated = initial_size; + + if (array->allocated > 0) + { + array->tabs = g_new (PangoTab, array->allocated); + init_tabs (array, 0, array->allocated); + } + else + array->tabs = NULL; + + array->positions_in_pixels = positions_in_pixels; + + return array; +} + +/** + * pango_tab_array_new_with_positions: + * @size: number of tab stops in the array + * @positions_in_pixels: whether positions are in pixel units + * @first_alignment: alignment of first tab stop + * @first_position: position of first tab stop + * @...: additional alignment/position pairs + * + * This is a convenience function that creates a #PangoTabArray + * and allows you to specify the alignment and position of each + * tab stop. You must provide an alignment + * and position for @size tab stops. + * + * Return value: the newly allocated #PangoTabArray, which should + * be freed with pango_tab_array_free(). + **/ +PangoTabArray * +pango_tab_array_new_with_positions (gint size, + gboolean positions_in_pixels, + PangoTabAlign first_alignment, + gint first_position, + ...) +{ + PangoTabArray *array; + va_list args; + int i; + + g_return_val_if_fail (size >= 0, NULL); + + array = pango_tab_array_new (size, positions_in_pixels); + + if (size == 0) + return array; + + array->tabs[0].alignment = first_alignment; + array->tabs[0].location = first_position; + + if (size == 1) + return array; + + va_start (args, first_position); + + i = 1; + while (i < size) + { + PangoTabAlign align = va_arg (args, PangoTabAlign); + int pos = va_arg (args, int); + + array->tabs[i].alignment = align; + array->tabs[i].location = pos; + + ++i; + } + + va_end (args); + + return array; +} + +G_DEFINE_BOXED_TYPE (PangoTabArray, pango_tab_array, + pango_tab_array_copy, + pango_tab_array_free); + +/** + * pango_tab_array_copy: + * @src: #PangoTabArray to copy + * + * Copies a #PangoTabArray + * + * Return value: the newly allocated #PangoTabArray, which should + * be freed with pango_tab_array_free(). + **/ +PangoTabArray* +pango_tab_array_copy (PangoTabArray *src) +{ + PangoTabArray *copy; + + g_return_val_if_fail (src != NULL, NULL); + + copy = pango_tab_array_new (src->size, src->positions_in_pixels); + + memcpy (copy->tabs, src->tabs, sizeof(PangoTab)*src->size); + + return copy; +} + +/** + * pango_tab_array_free: + * @tab_array: a #PangoTabArray + * + * Frees a tab array and associated resources. + * + **/ +void +pango_tab_array_free (PangoTabArray *tab_array) +{ + g_return_if_fail (tab_array != NULL); + + g_free (tab_array->tabs); + + g_slice_free (PangoTabArray, tab_array); +} + +/** + * pango_tab_array_get_size: + * @tab_array: a #PangoTabArray + * + * Gets the number of tab stops in @tab_array. + * + * Return value: the number of tab stops in the array. + **/ +gint +pango_tab_array_get_size (PangoTabArray *tab_array) +{ + g_return_val_if_fail (tab_array != NULL, 0); + + return tab_array->size; +} + +/** + * pango_tab_array_resize: + * @tab_array: a #PangoTabArray + * @new_size: new size of the array + * + * Resizes a tab array. You must subsequently initialize any tabs that + * were added as a result of growing the array. + * + **/ +void +pango_tab_array_resize (PangoTabArray *tab_array, + gint new_size) +{ + if (new_size > tab_array->allocated) + { + gint current_end = tab_array->allocated; + + /* Ratchet allocated size up above the index. */ + if (tab_array->allocated == 0) + tab_array->allocated = 2; + + while (new_size > tab_array->allocated) + tab_array->allocated = tab_array->allocated * 2; + + tab_array->tabs = g_renew (PangoTab, tab_array->tabs, + tab_array->allocated); + + init_tabs (tab_array, current_end, tab_array->allocated); + } + + tab_array->size = new_size; +} + +/** + * pango_tab_array_set_tab: + * @tab_array: a #PangoTabArray + * @tab_index: the index of a tab stop + * @alignment: tab alignment + * @location: tab location in Pango units + * + * Sets the alignment and location of a tab stop. + * @alignment must always be #PANGO_TAB_LEFT in the current + * implementation. + * + **/ +void +pango_tab_array_set_tab (PangoTabArray *tab_array, + gint tab_index, + PangoTabAlign alignment, + gint location) +{ + g_return_if_fail (tab_array != NULL); + g_return_if_fail (tab_index >= 0); + g_return_if_fail (alignment == PANGO_TAB_LEFT); + g_return_if_fail (location >= 0); + + if (tab_index >= tab_array->size) + pango_tab_array_resize (tab_array, tab_index + 1); + + tab_array->tabs[tab_index].alignment = alignment; + tab_array->tabs[tab_index].location = location; +} + +/** + * pango_tab_array_get_tab: + * @tab_array: a #PangoTabArray + * @tab_index: tab stop index + * @alignment: (out) (allow-none): location to store alignment, or %NULL + * @location: (out) (allow-none): location to store tab position, or %NULL + * + * Gets the alignment and position of a tab stop. + * + **/ +void +pango_tab_array_get_tab (PangoTabArray *tab_array, + gint tab_index, + PangoTabAlign *alignment, + gint *location) +{ + g_return_if_fail (tab_array != NULL); + g_return_if_fail (tab_index < tab_array->size); + g_return_if_fail (tab_index >= 0); + + if (alignment) + *alignment = tab_array->tabs[tab_index].alignment; + + if (location) + *location = tab_array->tabs[tab_index].location; +} + +/** + * pango_tab_array_get_tabs: + * @tab_array: a #PangoTabArray + * @alignments: (out) (allow-none): location to store an array of tab + * stop alignments, or %NULL + * @locations: (out) (allow-none) (array): location to store an array + * of tab positions, or %NULL + * + * If non-%NULL, @alignments and @locations are filled with allocated + * arrays of length pango_tab_array_get_size(). You must free the + * returned array. + * + **/ +void +pango_tab_array_get_tabs (PangoTabArray *tab_array, + PangoTabAlign **alignments, + gint **locations) +{ + gint i; + + g_return_if_fail (tab_array != NULL); + + if (alignments) + *alignments = g_new (PangoTabAlign, tab_array->size); + + if (locations) + *locations = g_new (gint, tab_array->size); + + i = 0; + while (i < tab_array->size) + { + if (alignments) + (*alignments)[i] = tab_array->tabs[i].alignment; + if (locations) + (*locations)[i] = tab_array->tabs[i].location; + + ++i; + } +} + +/** + * pango_tab_array_get_positions_in_pixels: + * @tab_array: a #PangoTabArray + * + * Returns %TRUE if the tab positions are in pixels, %FALSE if they are + * in Pango units. + * + * Return value: whether positions are in pixels. + **/ +gboolean +pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array) +{ + g_return_val_if_fail (tab_array != NULL, FALSE); + + return tab_array->positions_in_pixels; +} diff --git a/pango/pango-tabs.h b/pango/pango-tabs.h new file mode 100644 index 0000000..664cedb --- /dev/null +++ b/pango/pango-tabs.h @@ -0,0 +1,98 @@ +/* Pango + * pango-tabs.h: Tab-related stuff + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_TABS_H__ +#define __PANGO_TABS_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _PangoTabArray PangoTabArray; + +/** + * PangoTabAlign: + * @PANGO_TAB_LEFT: the tab stop appears to the left of the text. + * + * A #PangoTabAlign specifies where a tab stop appears relative to the text. + */ +typedef enum +{ + PANGO_TAB_LEFT + + /* These are not supported now, but may be in the + * future. + * + * PANGO_TAB_RIGHT, + * PANGO_TAB_CENTER, + * PANGO_TAB_NUMERIC + */ +} PangoTabAlign; + +/** + * PANGO_TYPE_TAB_ARRAY: + * + * The #GObject type for #PangoTabArray. + */ +#define PANGO_TYPE_TAB_ARRAY (pango_tab_array_get_type ()) + +PANGO_AVAILABLE_IN_ALL +PangoTabArray *pango_tab_array_new (gint initial_size, + gboolean positions_in_pixels); +PANGO_AVAILABLE_IN_ALL +PangoTabArray *pango_tab_array_new_with_positions (gint size, + gboolean positions_in_pixels, + PangoTabAlign first_alignment, + gint first_position, + ...); +PANGO_AVAILABLE_IN_ALL +GType pango_tab_array_get_type (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_ALL +PangoTabArray *pango_tab_array_copy (PangoTabArray *src); +PANGO_AVAILABLE_IN_ALL +void pango_tab_array_free (PangoTabArray *tab_array); +PANGO_AVAILABLE_IN_ALL +gint pango_tab_array_get_size (PangoTabArray *tab_array); +PANGO_AVAILABLE_IN_ALL +void pango_tab_array_resize (PangoTabArray *tab_array, + gint new_size); +PANGO_AVAILABLE_IN_ALL +void pango_tab_array_set_tab (PangoTabArray *tab_array, + gint tab_index, + PangoTabAlign alignment, + gint location); +PANGO_AVAILABLE_IN_ALL +void pango_tab_array_get_tab (PangoTabArray *tab_array, + gint tab_index, + PangoTabAlign *alignment, + gint *location); +PANGO_AVAILABLE_IN_ALL +void pango_tab_array_get_tabs (PangoTabArray *tab_array, + PangoTabAlign **alignments, + gint **locations); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array); + + +G_END_DECLS + +#endif /* __PANGO_TABS_H__ */ diff --git a/pango/pango-types.h b/pango/pango-types.h new file mode 100644 index 0000000..4662c71 --- /dev/null +++ b/pango/pango-types.h @@ -0,0 +1,205 @@ +/* Pango + * pango-types.h: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_TYPES_H__ +#define __PANGO_TYPES_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +typedef struct _PangoLogAttr PangoLogAttr; + +typedef struct _PangoEngineLang PangoEngineLang; +typedef struct _PangoEngineShape PangoEngineShape; + +typedef struct _PangoFont PangoFont; +typedef struct _PangoFontMap PangoFontMap; + +typedef struct _PangoRectangle PangoRectangle; + + + +/* A index of a glyph into a font. Rendering system dependent */ +/** + * PangoGlyph: + * + * A #PangoGlyph represents a single glyph in the output form of a string. + */ +typedef guint32 PangoGlyph; + + + +/** + * PANGO_SCALE: + * + * The %PANGO_SCALE macro represents the scale between dimensions used + * for Pango distances and device units. (The definition of device + * units is dependent on the output device; it will typically be pixels + * for a screen, and points for a printer.) %PANGO_SCALE is currently + * 1024, but this may be changed in the future. + * + * When setting font sizes, device units are always considered to be + * points (as in "12 point font"), rather than pixels. + */ +/** + * PANGO_PIXELS: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by rounding. + * + * Return value: rounded dimension in device units. + */ +/** + * PANGO_PIXELS_FLOOR: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by flooring. + * + * Return value: floored dimension in device units. + * Since: 1.14 + */ +/** + * PANGO_PIXELS_CEIL: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by ceiling. + * + * Return value: ceiled dimension in device units. + * Since: 1.14 + */ +#define PANGO_SCALE 1024 +#define PANGO_PIXELS(d) (((int)(d) + 512) >> 10) +#define PANGO_PIXELS_FLOOR(d) (((int)(d)) >> 10) +#define PANGO_PIXELS_CEIL(d) (((int)(d) + 1023) >> 10) +/* The above expressions are just slightly wrong for floating point d; + * For example we'd expect PANGO_PIXELS(-512.5) => -1 but instead we get 0. + * That's unlikely to matter for practical use and the expression is much + * more compact and faster than alternatives that work exactly for both + * integers and floating point. + * + * PANGO_PIXELS also behaves differently for +512 and -512. + */ + +/** + * PANGO_UNITS_ROUND: + * @d: a dimension in Pango units. + * + * Rounds a dimension to whole device units, but does not + * convert it to device units. + * + * Return value: rounded dimension in Pango units. + * Since: 1.18 + */ +#define PANGO_UNITS_ROUND(d) \ + (((d) + (PANGO_SCALE >> 1)) & ~(PANGO_SCALE - 1)) + + +PANGO_AVAILABLE_IN_1_16 +int pango_units_from_double (double d) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_16 +double pango_units_to_double (int i) G_GNUC_CONST; + + + +/** + * PangoRectangle: + * @x: X coordinate of the left side of the rectangle. + * @y: Y coordinate of the the top side of the rectangle. + * @width: width of the rectangle. + * @height: height of the rectangle. + * + * The #PangoRectangle structure represents a rectangle. It is frequently + * used to represent the logical or ink extents of a single glyph or section + * of text. (See, for instance, pango_font_get_glyph_extents()) + * + */ +struct _PangoRectangle +{ + int x; + int y; + int width; + int height; +}; + +/* Macros to translate from extents rectangles to ascent/descent/lbearing/rbearing + */ +/** + * PANGO_ASCENT: + * @rect: a #PangoRectangle + * + * Extracts the ascent from a #PangoRectangle + * representing glyph extents. The ascent is the distance from the + * baseline to the highest point of the character. This is positive if the + * glyph ascends above the baseline. + */ +/** + * PANGO_DESCENT: + * @rect: a #PangoRectangle + * + * Extracts the descent from a #PangoRectangle + * representing glyph extents. The descent is the distance from the + * baseline to the lowest point of the character. This is positive if the + * glyph descends below the baseline. + */ +/** + * PANGO_LBEARING: + * @rect: a #PangoRectangle + * + * Extracts the left bearing from a #PangoRectangle + * representing glyph extents. The left bearing is the distance from the + * horizontal origin to the farthest left point of the character. + * This is positive for characters drawn completely to the right of the + * glyph origin. + */ +/** + * PANGO_RBEARING: + * @rect: a #PangoRectangle + * + * Extracts the right bearing from a #PangoRectangle + * representing glyph extents. The right bearing is the distance from the + * horizontal origin to the farthest right point of the character. + * This is positive except for characters drawn completely to the left of the + * horizontal origin. + */ +#define PANGO_ASCENT(rect) (-(rect).y) +#define PANGO_DESCENT(rect) ((rect).y + (rect).height) +#define PANGO_LBEARING(rect) ((rect).x) +#define PANGO_RBEARING(rect) ((rect).x + (rect).width) + +PANGO_AVAILABLE_IN_1_16 +void pango_extents_to_pixels (PangoRectangle *inclusive, + PangoRectangle *nearest); + + +#include +#include +#include +#include +#include + + +G_END_DECLS + +#endif /* __PANGO_TYPES_H__ */ diff --git a/pango/pango-utils-internal.h b/pango/pango-utils-internal.h new file mode 100644 index 0000000..d6e55d7 --- /dev/null +++ b/pango/pango-utils-internal.h @@ -0,0 +1,49 @@ +/* Pango + * pango-utils.c: Utilities for internal functions and modules + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_UTILS_INTERNAL_H__ +#define __PANGO_UTILS_INTERNAL_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +gboolean _pango_scan_int (const char **pos, + int *out); + +gboolean _pango_parse_enum (GType type, + const char *str, + int *value, + gboolean warn, + char **possible_values); + +char *_pango_trim_string (const char *str); + +gboolean _pango_color_parse_with_alpha (PangoColor *color, + guint16 *alpha, + const char *spec); + + +G_END_DECLS + +#endif /* __PANGO_UTILS_H__ */ diff --git a/pango/pango-utils.c b/pango/pango-utils.c new file mode 100644 index 0000000..313471f --- /dev/null +++ b/pango/pango-utils.c @@ -0,0 +1,1086 @@ +/* Pango + * pango-utils.c: Utilities for internal functions and modules + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pango-version + * @short_description:Tools for checking Pango version at compile- and run-time. + * @title:Version Checking + * + * The capital-letter macros defined here can be used to check the version of Pango + * at compile-time, and to encode Pango versions into integers. + * + * The functions can be used to check the version of the linked Pango library at run-time. + */ +/** + * SECTION:utils + * @short_description:Various convenience and utility functions + * @title: Miscellaneous Utilities + * + * The functions and utilities in this section are mostly used from Pango + * backends and modules, but may be useful for other purposes too. + */ +#include "config.h" +#include +#include +#include +#include +#include + +#include "pango-font.h" +#include "pango-features.h" +#include "pango-impl-utils.h" +#include "pango-utils-internal.h" + +#include + +#ifndef HAVE_FLOCKFILE +# define flockfile(f) (void)1 +# define funlockfile(f) (void)1 +# define getc_unlocked(f) getc(f) +#endif /* !HAVE_FLOCKFILE */ + +#ifdef G_OS_WIN32 + +#include + +#define STRICT +#include + +#endif + +/** + * pango_version: + * + * This is similar to the macro %PANGO_VERSION except that + * it returns the encoded version of Pango available at run-time, + * as opposed to the version available at compile-time. + * + * A version number can be encoded into an integer using + * PANGO_VERSION_ENCODE(). + * + * Returns: The encoded version of Pango library + * available at run time. + * + * Since: 1.16 + **/ +int +pango_version (void) +{ + return PANGO_VERSION; +} + +/** + * pango_version_string: + * + * This is similar to the macro %PANGO_VERSION_STRING except that + * it returns the version of Pango available at run-time, as opposed to + * the version available at compile-time. + * + * Returns: A string containing the version of Pango library + * available at run time. + * The returned string is owned by Pango and should not be modified + * or freed. + * + * Since: 1.16 + **/ +const char * +pango_version_string (void) +{ + return PANGO_VERSION_STRING; +} + +/** + * pango_version_check: + * @required_major: the required major version. + * @required_minor: the required minor version. + * @required_micro: the required major version. + * + * Checks that the Pango library in use is compatible with the + * given version. Generally you would pass in the constants + * %PANGO_VERSION_MAJOR, %PANGO_VERSION_MINOR, %PANGO_VERSION_MICRO + * as the three arguments to this function; that produces + * a check that the library in use at run-time is compatible with + * the version of Pango the application or module was compiled against. + * + * Compatibility is defined by two things: first the version + * of the running library is newer than the version + * @required_major.required_minor.@required_micro. Second + * the running library must be binary compatible with the + * version @required_major.required_minor.@required_micro + * (same major version.) + * + * For compile-time version checking use PANGO_VERSION_CHECK(). + * + * Return value: (nullable): %NULL if the Pango library is compatible + * with the given version, or a string describing the version + * mismatch. The returned string is owned by Pango and should not + * be modified or freed. + * + * Since: 1.16 + **/ +const gchar* +pango_version_check (int required_major, + int required_minor, + int required_micro) +{ + gint pango_effective_micro = 100 * PANGO_VERSION_MINOR + PANGO_VERSION_MICRO; + gint required_effective_micro = 100 * required_minor + required_micro; + + if (required_major < PANGO_VERSION_MAJOR) + return "Pango version too new (major mismatch)"; + if (required_effective_micro < pango_effective_micro - PANGO_BINARY_AGE) + return "Pango version too new (micro mismatch)"; + if (required_effective_micro > pango_effective_micro) + return "Pango version too old (micro mismatch)"; + return NULL; +} + +/** + * pango_trim_string: + * @str: a string + * + * Trims leading and trailing whitespace from a string. + * + * Return value: A newly-allocated string that must be freed with g_free() + * + * Deprecated: 1.38 + **/ +char * +pango_trim_string (const char *str) +{ + return _pango_trim_string (str); +} + +char * +_pango_trim_string (const char *str) +{ + int len; + + g_return_val_if_fail (str != NULL, NULL); + + while (*str && g_ascii_isspace (*str)) + str++; + + len = strlen (str); + while (len > 0 && g_ascii_isspace (str[len-1])) + len--; + + return g_strndup (str, len); +} + +/** + * pango_split_file_list: + * @str: a %G_SEARCHPATH_SEPARATOR separated list of filenames + * + * Splits a %G_SEARCHPATH_SEPARATOR-separated list of files, stripping + * white space and substituting ~/ with $HOME/. + * + * Return value: (transfer full) (array zero-terminated=1): a list of + * strings to be freed with g_strfreev() + * + * Deprecated: 1.38 + **/ +char ** +pango_split_file_list (const char *str) +{ + int i = 0; + int j; + char **files; + + files = g_strsplit (str, G_SEARCHPATH_SEPARATOR_S, -1); + + while (files[i]) + { + char *file = _pango_trim_string (files[i]); + + /* If the resulting file is empty, skip it */ + if (file[0] == '\0') + { + g_free(file); + g_free (files[i]); + + for (j = i + 1; files[j]; j++) + files[j - 1] = files[j]; + + files[j - 1] = NULL; + + continue; + } +#ifndef G_OS_WIN32 + /* '~' is a quite normal and common character in file names on + * Windows, especially in the 8.3 versions of long file names, which + * still occur now and then. Also, few Windows user are aware of the + * Unix shell convention that '~' stands for the home directory, + * even if they happen to have a home directory. + */ + if (file[0] == '~' && file[1] == G_DIR_SEPARATOR) + { + char *tmp = g_strconcat (g_get_home_dir(), file + 1, NULL); + g_free (file); + file = tmp; + } + else if (file[0] == '~' && file[1] == '\0') + { + g_free (file); + file = g_strdup (g_get_home_dir()); + } +#endif + g_free (files[i]); + files[i] = file; + + i++; + } + + return files; +} + +/** + * pango_read_line: + * @stream: a stdio stream + * @str: (out): #GString buffer into which to write the result + * + * Reads an entire line from a file into a buffer. Lines may + * be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter + * is not written into the buffer. Text after a '#' character is treated as + * a comment and skipped. '\' can be used to escape a # character. + * '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding + * any other character is ignored and written into the output buffer + * unmodified. + * + * Return value: 0 if the stream was already at an %EOF character, otherwise + * the number of lines read (this is useful for maintaining + * a line number counter which doesn't combine lines with '\') + * + * Deprecated: 1.38 + **/ +gint +pango_read_line (FILE *stream, GString *str) +{ + gboolean quoted = FALSE; + gboolean comment = FALSE; + int n_read = 0; + int lines = 1; + + flockfile (stream); + + g_string_truncate (str, 0); + + while (1) + { + int c; + + c = getc_unlocked (stream); + + if (c == EOF) + { + if (quoted) + g_string_append_c (str, '\\'); + + goto done; + } + else + n_read++; + + if (quoted) + { + quoted = FALSE; + + switch (c) + { + case '#': + g_string_append_c (str, '#'); + break; + case '\r': + case '\n': + { + int next_c = getc_unlocked (stream); + + if (!(next_c == EOF || + (c == '\r' && next_c == '\n') || + (c == '\n' && next_c == '\r'))) + ungetc (next_c, stream); + + lines++; + + break; + } + default: + g_string_append_c (str, '\\'); + g_string_append_c (str, c); + } + } + else + { + switch (c) + { + case '#': + comment = TRUE; + break; + case '\\': + if (!comment) + quoted = TRUE; + break; + case '\r': + case '\n': + { + int next_c = getc_unlocked (stream); + + if (!(next_c == EOF || + (c == '\r' && next_c == '\n') || + (c == '\n' && next_c == '\r'))) + ungetc (next_c, stream); + + goto done; + } + default: + if (!comment) + g_string_append_c (str, c); + } + } + } + + done: + + funlockfile (stream); + + return (n_read > 0) ? lines : 0; +} + +/** + * pango_skip_space: + * @pos: (inout): in/out string position + * + * Skips 0 or more characters of white space. + * + * Return value: %FALSE if skipping the white space leaves + * the position at a '\0' character. + * + * Deprecated: 1.38 + **/ +gboolean +pango_skip_space (const char **pos) +{ + const char *p = *pos; + + while (g_ascii_isspace (*p)) + p++; + + *pos = p; + + return !(*p == '\0'); +} + +/** + * pango_scan_word: + * @pos: (inout): in/out string position + * @out: (out): a #GString into which to write the result + * + * Scans a word into a #GString buffer. A word consists + * of [A-Za-z_] followed by zero or more [A-Za-z_0-9] + * Leading white space is skipped. + * + * Return value: %FALSE if a parse error occurred. + * + * Deprecated: 1.38 + **/ +gboolean +pango_scan_word (const char **pos, GString *out) +{ + const char *p = *pos; + + while (g_ascii_isspace (*p)) + p++; + + if (!((*p >= 'A' && *p <= 'Z') || + (*p >= 'a' && *p <= 'z') || + *p == '_')) + return FALSE; + + g_string_truncate (out, 0); + g_string_append_c (out, *p); + p++; + + while ((*p >= 'A' && *p <= 'Z') || + (*p >= 'a' && *p <= 'z') || + (*p >= '0' && *p <= '9') || + *p == '_') + { + g_string_append_c (out, *p); + p++; + } + + *pos = p; + + return TRUE; +} + +/** + * pango_scan_string: + * @pos: (inout): in/out string position + * @out: (out): a #GString into which to write the result + * + * Scans a string into a #GString buffer. The string may either + * be a sequence of non-white-space characters, or a quoted + * string with '"'. Instead a quoted string, '\"' represents + * a literal quote. Leading white space outside of quotes is skipped. + * + * Return value: %FALSE if a parse error occurred. + * + * Deprecated: 1.38 + **/ +gboolean +pango_scan_string (const char **pos, GString *out) +{ + const char *p = *pos; + + while (g_ascii_isspace (*p)) + p++; + + if (G_UNLIKELY (!*p)) + return FALSE; + else if (*p == '"') + { + gboolean quoted = FALSE; + g_string_truncate (out, 0); + + p++; + + while (TRUE) + { + if (quoted) + { + int c = *p; + + switch (c) + { + case '\0': + return FALSE; + case 'n': + c = '\n'; + break; + case 't': + c = '\t'; + break; + default: + break; + } + + quoted = FALSE; + g_string_append_c (out, c); + } + else + { + switch (*p) + { + case '\0': + return FALSE; + case '\\': + quoted = TRUE; + break; + case '"': + p++; + goto done; + default: + g_string_append_c (out, *p); + break; + } + } + p++; + } + done: + ; + } + else + { + g_string_truncate (out, 0); + + while (*p && !g_ascii_isspace (*p)) + { + g_string_append_c (out, *p); + p++; + } + } + + *pos = p; + + return TRUE; +} + +/** + * pango_scan_int: + * @pos: (inout): in/out string position + * @out: (out): an int into which to write the result + * + * Scans an integer. + * Leading white space is skipped. + * + * Return value: %FALSE if a parse error occurred. + * + * Deprecated: 1.38 + **/ +gboolean +pango_scan_int (const char **pos, int *out) +{ + return _pango_scan_int (pos, out); +} + +gboolean +_pango_scan_int (const char **pos, int *out) +{ + char *end; + long temp; + + errno = 0; + temp = strtol (*pos, &end, 10); + if (errno == ERANGE) + { + errno = 0; + return FALSE; + } + + *out = (int)temp; + if ((long)(*out) != temp) + { + return FALSE; + } + + *pos = end; + + return TRUE; +} + +/** + * pango_config_key_get_system: + * @key: Key to look up, in the form "SECTION/KEY". + * + * Do not use. Does not do anything. + * + * Return value: %NULL + * + * Deprecated: 1.38 + **/ +char * +pango_config_key_get_system (const char *key) +{ + return NULL; +} + +/** + * pango_config_key_get: + * @key: Key to look up, in the form "SECTION/KEY". + * + * Do not use. Does not do anything. + * + * Return value: %NULL + * + * Deprecated: 1.38 + **/ +char * +pango_config_key_get (const char *key) +{ + return NULL; +} + +/** + * pango_get_sysconf_subdirectory: + * + * Returns the name of the "pango" subdirectory of SYSCONFDIR + * (which is set at compile time). + * + * Return value: the Pango sysconf directory. The returned string should + * not be freed. + * + * Deprecated: 1.38 + */ +const char * +pango_get_sysconf_subdirectory (void) +{ + static const gchar *result = NULL; /* MT-safe */ + + if (g_once_init_enter (&result)) + { + const char *tmp_result = NULL; + const char *sysconfdir = g_getenv ("PANGO_SYSCONFDIR"); + if (sysconfdir != NULL) + tmp_result = g_build_filename (sysconfdir, "pango", NULL); + else + tmp_result = SYSCONFDIR "/pango"; + g_once_init_leave(&result, tmp_result); + } + return result; +} + +/** + * pango_get_lib_subdirectory: + * + * Returns the name of the "pango" subdirectory of LIBDIR + * (which is set at compile time). + * + * Return value: the Pango lib directory. The returned string should + * not be freed. + * + * Deprecated: 1.38 + */ +const char * +pango_get_lib_subdirectory (void) +{ + static const gchar *result = NULL; /* MT-safe */ + + if (g_once_init_enter (&result)) + { + const gchar *tmp_result = NULL; + const char *libdir = g_getenv ("PANGO_LIBDIR"); + if (libdir != NULL) + tmp_result = g_build_filename (libdir, "pango", NULL); + else + tmp_result = LIBDIR "/pango"; + g_once_init_leave(&result, tmp_result); + } + return result; +} + + +static gboolean +parse_int (const char *word, + int *out) +{ + char *end; + long val; + int i; + + if (word == NULL) + return FALSE; + + val = strtol (word, &end, 10); + i = val; + + if (end != word && *end == '\0' && val >= 0 && val == i) + { + if (out) + *out = i; + + return TRUE; + } + + return FALSE; +} + +/** + * pango_parse_enum: + * @type: enum type to parse, eg. %PANGO_TYPE_ELLIPSIZE_MODE. + * @str: (allow-none): string to parse. May be %NULL. + * @value: (out) (allow-none): integer to store the result in, or %NULL. + * @warn: if %TRUE, issue a g_warning() on bad input. + * @possible_values: (out) (allow-none): place to store list of possible values on failure, or %NULL. + * + * Parses an enum type and stores the result in @value. + * + * If @str does not match the nick name of any of the possible values for the + * enum and is not an integer, %FALSE is returned, a warning is issued + * if @warn is %TRUE, and a + * string representing the list of possible values is stored in + * @possible_values. The list is slash-separated, eg. + * "none/start/middle/end". If failed and @possible_values is not %NULL, + * returned string should be freed using g_free(). + * + * Return value: %TRUE if @str was successfully parsed. + * + * Deprecated: 1.38 + * + * Since: 1.16 + **/ +gboolean +pango_parse_enum (GType type, + const char *str, + int *value, + gboolean warn, + char **possible_values) +{ + return _pango_parse_enum (type, str, value, warn, possible_values); +} + +gboolean +_pango_parse_enum (GType type, + const char *str, + int *value, + gboolean warn, + char **possible_values) +{ + GEnumClass *class = NULL; + gboolean ret = TRUE; + GEnumValue *v = NULL; + + class = g_type_class_ref (type); + + if (G_LIKELY (str)) + v = g_enum_get_value_by_nick (class, str); + + if (v) + { + if (G_LIKELY (value)) + *value = v->value; + } + else if (!parse_int (str, value)) + { + ret = FALSE; + if (G_LIKELY (warn || possible_values)) + { + int i; + GString *s = g_string_new (NULL); + + for (i = 0, v = g_enum_get_value (class, i); v; + i++ , v = g_enum_get_value (class, i)) + { + if (i) + g_string_append_c (s, '/'); + g_string_append (s, v->value_nick); + } + + if (warn) + g_warning ("%s must be one of %s", + G_ENUM_CLASS_TYPE_NAME(class), + s->str); + + if (possible_values) + *possible_values = s->str; + + g_string_free (s, possible_values ? FALSE : TRUE); + } + } + + g_type_class_unref (class); + + return ret; +} + +/** + * pango_lookup_aliases: + * @fontname: an ascii string + * @families: (out) (array length=n_families): will be set to an array of font family names. + * this array is owned by pango and should not be freed. + * @n_families: (out): will be set to the length of the @families array. + * + * Look up all user defined aliases for the alias @fontname. + * The resulting font family names will be stored in @families, + * and the number of families in @n_families. + * + * Deprecated: 1.32: This function is not thread-safe. + */ +void +pango_lookup_aliases (const char *fontname, + char ***families, + int *n_families) +{ + *families = NULL; + *n_families = 0; +} + +/** + * pango_find_base_dir: + * @text: the text to process + * @length: length of @text in bytes (may be -1 if @text is nul-terminated) + * + * Searches a string the first character that has a strong + * direction, according to the Unicode bidirectional algorithm. + * + * Return value: The direction corresponding to the first strong character. + * If no such character is found, then %PANGO_DIRECTION_NEUTRAL is returned. + * + * Since: 1.4 + */ +PangoDirection +pango_find_base_dir (const gchar *text, + gint length) +{ + PangoDirection dir = PANGO_DIRECTION_NEUTRAL; + const gchar *p; + + g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL); + + p = text; + while ((length < 0 || p < text + length) && *p) + { + gunichar wc = g_utf8_get_char (p); + + dir = pango_unichar_direction (wc); + + if (dir != PANGO_DIRECTION_NEUTRAL) + break; + + p = g_utf8_next_char (p); + } + + return dir; +} + +/** + * pango_is_zero_width: + * @ch: a Unicode character + * + * Checks @ch to see if it is a character that should not be + * normally rendered on the screen. This includes all Unicode characters + * with "ZERO WIDTH" in their name, as well as bidi formatting characters, and + * a few other ones. This is totally different from g_unichar_iszerowidth() + * and is at best misnamed. + * + * Return value: %TRUE if @ch is a zero-width character, %FALSE otherwise + * + * Since: 1.10 + */ +gboolean +pango_is_zero_width (gunichar ch) +{ +/* Zero Width characters: + * + * 00AD SOFT HYPHEN + * 034F COMBINING GRAPHEME JOINER + * + * 200B ZERO WIDTH SPACE + * 200C ZERO WIDTH NON-JOINER + * 200D ZERO WIDTH JOINER + * 200E LEFT-TO-RIGHT MARK + * 200F RIGHT-TO-LEFT MARK + * + * 2028 LINE SEPARATOR + * + * 202A LEFT-TO-RIGHT EMBEDDING + * 202B RIGHT-TO-LEFT EMBEDDING + * 202C POP DIRECTIONAL FORMATTING + * 202D LEFT-TO-RIGHT OVERRIDE + * 202E RIGHT-TO-LEFT OVERRIDE + * + * 2060 WORD JOINER + * 2061 FUNCTION APPLICATION + * 2062 INVISIBLE TIMES + * 2063 INVISIBLE SEPARATOR + * + * FEFF ZERO WIDTH NO-BREAK SPACE + */ + return ((ch & ~(gunichar)0x007F) == 0x2000 && ( + (ch >= 0x200B && ch <= 0x200F) || + (ch >= 0x202A && ch <= 0x202E) || + (ch >= 0x2060 && ch <= 0x2063) || + (ch == 0x2028) + )) || G_UNLIKELY (ch == 0x00AD + || ch == 0x034F + || ch == 0xFEFF); +} + +/** + * pango_quantize_line_geometry: + * @thickness: (inout): pointer to the thickness of a line, in Pango units + * @position: (inout): corresponding position + * + * Quantizes the thickness and position of a line, typically an + * underline or strikethrough, to whole device pixels, that is integer + * multiples of %PANGO_SCALE. The purpose of this function is to avoid + * such lines looking blurry. + * + * Care is taken to make sure @thickness is at least one pixel when this + * function returns, but returned @position may become zero as a result + * of rounding. + * + * Since: 1.12 + */ +void +pango_quantize_line_geometry (int *thickness, + int *position) +{ + int thickness_pixels = (*thickness + PANGO_SCALE / 2) / PANGO_SCALE; + if (thickness_pixels == 0) + thickness_pixels = 1; + + if (thickness_pixels & 1) + { + int new_center = ((*position - *thickness / 2) & ~(PANGO_SCALE - 1)) + PANGO_SCALE / 2; + *position = new_center + (PANGO_SCALE * thickness_pixels) / 2; + } + else + { + int new_center = ((*position - *thickness / 2 + PANGO_SCALE / 2) & ~(PANGO_SCALE - 1)); + *position = new_center + (PANGO_SCALE * thickness_pixels) / 2; + } + + *thickness = thickness_pixels * PANGO_SCALE; +} + +/** + * pango_units_from_double: + * @d: double floating-point value + * + * Converts a floating-point number to Pango units: multiplies + * it by %PANGO_SCALE and rounds to nearest integer. + * + * Return value: the value in Pango units. + * + * Since: 1.16 + */ +int +pango_units_from_double (double d) +{ + return (int)floor (d * PANGO_SCALE + 0.5); +} + +/** + * pango_units_to_double: + * @i: value in Pango units + * + * Converts a number in Pango units to floating-point: divides + * it by %PANGO_SCALE. + * + * Return value: the double value. + * + * Since: 1.16 + */ +double +pango_units_to_double (int i) +{ + return (double)i / PANGO_SCALE; +} + +/** + * pango_extents_to_pixels: + * @inclusive: (allow-none): rectangle to round to pixels inclusively, or %NULL. + * @nearest: (allow-none): rectangle to round to nearest pixels, or %NULL. + * + * Converts extents from Pango units to device units, dividing by the + * %PANGO_SCALE factor and performing rounding. + * + * The @inclusive rectangle is converted by flooring the x/y coordinates and extending + * width/height, such that the final rectangle completely includes the original + * rectangle. + * + * The @nearest rectangle is converted by rounding the coordinates + * of the rectangle to the nearest device unit (pixel). + * + * The rule to which argument to use is: if you want the resulting device-space + * rectangle to completely contain the original rectangle, pass it in as @inclusive. + * If you want two touching-but-not-overlapping rectangles stay + * touching-but-not-overlapping after rounding to device units, pass them in + * as @nearest. + * + * Since: 1.16 + **/ +void +pango_extents_to_pixels (PangoRectangle *inclusive, + PangoRectangle *nearest) +{ + if (inclusive) + { + int orig_x = inclusive->x; + int orig_y = inclusive->y; + + inclusive->x = PANGO_PIXELS_FLOOR (inclusive->x); + inclusive->y = PANGO_PIXELS_FLOOR (inclusive->y); + + inclusive->width = PANGO_PIXELS_CEIL (orig_x + inclusive->width ) - inclusive->x; + inclusive->height = PANGO_PIXELS_CEIL (orig_y + inclusive->height) - inclusive->y; + } + + if (nearest) + { + int orig_x = nearest->x; + int orig_y = nearest->y; + + nearest->x = PANGO_PIXELS (nearest->x); + nearest->y = PANGO_PIXELS (nearest->y); + + nearest->width = PANGO_PIXELS (orig_x + nearest->width ) - nearest->x; + nearest->height = PANGO_PIXELS (orig_y + nearest->height) - nearest->y; + } +} + + + + + +/********************************************************* + * Some internal functions for handling PANGO_ATTR_SHAPE * + ********************************************************/ + +void +_pango_shape_shape (const char *text, + unsigned int n_chars, + PangoRectangle *shape_ink G_GNUC_UNUSED, + PangoRectangle *shape_logical, + PangoGlyphString *glyphs) +{ + unsigned int i; + const char *p; + + pango_glyph_string_set_size (glyphs, n_chars); + + for (i=0, p = text; i < n_chars; i++, p = g_utf8_next_char (p)) + { + glyphs->glyphs[i].glyph = PANGO_GLYPH_EMPTY; + glyphs->glyphs[i].geometry.x_offset = 0; + glyphs->glyphs[i].geometry.y_offset = 0; + glyphs->glyphs[i].geometry.width = shape_logical->width; + glyphs->glyphs[i].attr.is_cluster_start = 1; + + glyphs->log_clusters[i] = p - text; + } +} + +void +_pango_shape_get_extents (gint n_chars, + PangoRectangle *shape_ink, + PangoRectangle *shape_logical, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + if (n_chars > 0) + { + if (ink_rect) + { + ink_rect->x = MIN (shape_ink->x, shape_ink->x + shape_logical->width * (n_chars - 1)); + ink_rect->width = MAX (shape_ink->width, shape_ink->width + shape_logical->width * (n_chars - 1)); + ink_rect->y = shape_ink->y; + ink_rect->height = shape_ink->height; + } + if (logical_rect) + { + logical_rect->x = MIN (shape_logical->x, shape_logical->x + shape_logical->width * (n_chars - 1)); + logical_rect->width = MAX (shape_logical->width, shape_logical->width + shape_logical->width * (n_chars - 1)); + logical_rect->y = shape_logical->y; + logical_rect->height = shape_logical->height; + } + } + else + { + if (ink_rect) + { + ink_rect->x = 0; + ink_rect->y = 0; + ink_rect->width = 0; + ink_rect->height = 0; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = 0; + logical_rect->width = 0; + logical_rect->height = 0; + } + } +} + diff --git a/pango/pango-utils.h b/pango/pango-utils.h new file mode 100644 index 0000000..bb9a462 --- /dev/null +++ b/pango/pango-utils.h @@ -0,0 +1,211 @@ +/* Pango + * pango-utils.c: Utilities for internal functions and modules + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_UTILS_H__ +#define __PANGO_UTILS_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +PANGO_DEPRECATED +char ** pango_split_file_list (const char *str); + +PANGO_DEPRECATED +char *pango_trim_string (const char *str); +PANGO_DEPRECATED +gint pango_read_line (FILE *stream, + GString *str); +PANGO_DEPRECATED +gboolean pango_skip_space (const char **pos); +PANGO_DEPRECATED +gboolean pango_scan_word (const char **pos, + GString *out); +PANGO_DEPRECATED +gboolean pango_scan_string (const char **pos, + GString *out); +PANGO_DEPRECATED +gboolean pango_scan_int (const char **pos, + int *out); + +#ifdef PANGO_ENABLE_BACKEND +PANGO_DEPRECATED_IN_1_38 +char * pango_config_key_get_system (const char *key); +PANGO_DEPRECATED_IN_1_38 +char * pango_config_key_get (const char *key); +PANGO_DEPRECATED_IN_1_32 +void pango_lookup_aliases (const char *fontname, + char ***families, + int *n_families); +#endif /* PANGO_ENABLE_BACKEND */ + +PANGO_DEPRECATED +gboolean pango_parse_enum (GType type, + const char *str, + int *value, + gboolean warn, + char **possible_values); + +/* Functions for parsing textual representations + * of PangoFontDescription fields. They return TRUE if the input string + * contains a valid value, which then has been assigned to the corresponding + * field in the PangoFontDescription. If the warn parameter is TRUE, + * a warning is printed (with g_warning) if the string does not + * contain a valid value. + */ +PANGO_AVAILABLE_IN_ALL +gboolean pango_parse_style (const char *str, + PangoStyle *style, + gboolean warn); +PANGO_AVAILABLE_IN_ALL +gboolean pango_parse_variant (const char *str, + PangoVariant *variant, + gboolean warn); +PANGO_AVAILABLE_IN_ALL +gboolean pango_parse_weight (const char *str, + PangoWeight *weight, + gboolean warn); +PANGO_AVAILABLE_IN_ALL +gboolean pango_parse_stretch (const char *str, + PangoStretch *stretch, + gboolean warn); + +#ifdef PANGO_ENABLE_BACKEND + +/* On Unix, return the name of the "pango" subdirectory of SYSCONFDIR + * (which is set at compile time). On Win32, return the Pango + * installation directory (which is set at installation time, and + * stored in the registry). The returned string should not be + * g_free'd. + */ +PANGO_DEPRECATED +const char * pango_get_sysconf_subdirectory (void) G_GNUC_PURE; + +/* Ditto for LIBDIR/pango. On Win32, use the same Pango + * installation directory. This returned string should not be + * g_free'd either. + */ +PANGO_DEPRECATED +const char * pango_get_lib_subdirectory (void) G_GNUC_PURE; + +#endif /* PANGO_ENABLE_BACKEND */ + +/* Hint line position and thickness. + */ +PANGO_AVAILABLE_IN_1_12 +void pango_quantize_line_geometry (int *thickness, + int *position); + +/* A routine from fribidi that we either wrap or provide ourselves. + */ +PANGO_AVAILABLE_IN_1_4 +guint8 * pango_log2vis_get_embedding_levels (const gchar *text, + int length, + PangoDirection *pbase_dir); + +/* Unicode characters that are zero-width and should not be rendered + * normally. + */ +PANGO_AVAILABLE_IN_1_10 +gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST; + +/* Pango version checking */ + +/* Encode a Pango version as an integer */ +/** + * PANGO_VERSION_ENCODE: + * @major: the major component of the version number + * @minor: the minor component of the version number + * @micro: the micro component of the version number + * + * This macro encodes the given Pango version into an integer. The numbers + * returned by %PANGO_VERSION and pango_version() are encoded using this macro. + * Two encoded version numbers can be compared as integers. + */ +#define PANGO_VERSION_ENCODE(major, minor, micro) ( \ + ((major) * 10000) \ + + ((minor) * 100) \ + + ((micro) * 1)) + +/* Encoded version of Pango at compile-time */ +/** + * PANGO_VERSION: + * + * The version of Pango available at compile-time, encoded using PANGO_VERSION_ENCODE(). + */ +/** + * PANGO_VERSION_STRING: + * + * A string literal containing the version of Pango available at compile-time. + */ +/** + * PANGO_VERSION_MAJOR: + * + * The major component of the version of Pango available at compile-time. + */ +/** + * PANGO_VERSION_MINOR: + * + * The minor component of the version of Pango available at compile-time. + */ +/** + * PANGO_VERSION_MICRO: + * + * The micro component of the version of Pango available at compile-time. + */ +#define PANGO_VERSION PANGO_VERSION_ENCODE( \ + PANGO_VERSION_MAJOR, \ + PANGO_VERSION_MINOR, \ + PANGO_VERSION_MICRO) + +/* Check that compile-time Pango is as new as required */ +/** + * PANGO_VERSION_CHECK: + * @major: the major component of the version number + * @minor: the minor component of the version number + * @micro: the micro component of the version number + * + * Checks that the version of Pango available at compile-time is not older than + * the provided version number. + */ +#define PANGO_VERSION_CHECK(major,minor,micro) \ + (PANGO_VERSION >= PANGO_VERSION_ENCODE(major,minor,micro)) + + +/* Return encoded version of Pango at run-time */ +PANGO_AVAILABLE_IN_1_16 +int pango_version (void) G_GNUC_CONST; + +/* Return run-time Pango version as an string */ +PANGO_AVAILABLE_IN_1_16 +const char * pango_version_string (void) G_GNUC_CONST; + +/* Check that run-time Pango is as new as required */ +PANGO_AVAILABLE_IN_1_16 +const char * pango_version_check (int required_major, + int required_minor, + int required_micro) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __PANGO_UTILS_H__ */ diff --git a/pango/pango-version-macros.h b/pango/pango-version-macros.h new file mode 100644 index 0000000..5d66ab8 --- /dev/null +++ b/pango/pango-version-macros.h @@ -0,0 +1,636 @@ +/* Pango - Internationalized text layout and rendering library + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2012 Ryan Lortie, Matthias Clasen and Emmanuele Bassi + * Copyright (C) 2016 Chun-wei Fan + * + * 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 GNU + * Library 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, see . + */ + +#ifndef __PANGO_VERSION_H__ +#define __PANGO_VERSION_H__ + +#include + +#include + +#ifndef _PANGO_EXTERN +#define _PANGO_EXTERN extern +#endif + +#define PANGO_AVAILABLE_IN_ALL _PANGO_EXTERN + +/* XXX: Every new stable minor release bump should add a macro here */ + +/** + * PANGO_VERSION_1_2: + * + * A macro that evaluates to the 1.2 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_2 (G_ENCODE_VERSION (1, 2)) + +/** + * PANGO_VERSION_1_4: + * + * A macro that evaluates to the 1.4 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_4 (G_ENCODE_VERSION (1, 4)) + +/** + * PANGO_VERSION_1_6: + * + * A macro that evaluates to the 1.6 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_6 (G_ENCODE_VERSION (1, 6)) + +/** + * PANGO_VERSION_1_8: + * + * A macro that evaluates to the 1.8 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_8 (G_ENCODE_VERSION (1, 8)) + +/** + * PANGO_VERSION_1_10: + * + * A macro that evaluates to the 1.10 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_10 (G_ENCODE_VERSION (1, 10)) + +/** + * PANGO_VERSION_1_12: + * + * A macro that evaluates to the 1.12 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_12 (G_ENCODE_VERSION (1, 12)) + +/** + * PANGO_VERSION_1_14: + * + * A macro that evaluates to the 1.14 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_14 (G_ENCODE_VERSION (1, 14)) + +/** + * PANGO_VERSION_1_16: + * + * A macro that evaluates to the 1.16 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_16 (G_ENCODE_VERSION (1, 16)) + +/** + * PANGO_VERSION_1_18: + * + * A macro that evaluates to the 1.18 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_18 (G_ENCODE_VERSION (1, 18)) + +/** + * PANGO_VERSION_1_20: + * + * A macro that evaluates to the 1.20 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_20 (G_ENCODE_VERSION (1, 20)) + +/** + * PANGO_VERSION_1_22: + * + * A macro that evaluates to the 1.22 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_22 (G_ENCODE_VERSION (1, 22)) + +/** + * PANGO_VERSION_1_24: + * + * A macro that evaluates to the 1.24 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_24 (G_ENCODE_VERSION (1, 24)) + +/** + * PANGO_VERSION_1_26: + * + * A macro that evaluates to the 1.26 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_26 (G_ENCODE_VERSION (1, 26)) + +/** + * PANGO_VERSION_1_28: + * + * A macro that evaluates to the 1.28 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_28 (G_ENCODE_VERSION (1, 28)) + +/** + * PANGO_VERSION_1_30: + * + * A macro that evaluates to the 1.30 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_30 (G_ENCODE_VERSION (1, 30)) + +/** + * PANGO_VERSION_1_32: + * + * A macro that evaluates to the 1.32 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_32 (G_ENCODE_VERSION (1, 32)) + +/** + * PANGO_VERSION_1_34: + * + * A macro that evaluates to the 1.34 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_34 (G_ENCODE_VERSION (1, 34)) + +/** + * PANGO_VERSION_1_36: + * + * A macro that evaluates to the 1.36 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_36 (G_ENCODE_VERSION (1, 36)) + +/** + * PANGO_VERSION_1_38: + * + * A macro that evaluates to the 1.38 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_38 (G_ENCODE_VERSION (1, 38)) + +/** + * PANGO_VERSION_1_40: + * + * A macro that evaluates to the 1.40 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_40 (G_ENCODE_VERSION (1, 40)) + +/** + * PANGO_VERSION_1_42: + * + * A macro that evaluates to the 2.38 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.42 + */ +#define PANGO_VERSION_1_42 (G_ENCODE_VERSION (1, 42)) + +/* evaluates to the current stable version; for development cycles, + * this means the next stable target + */ +#if (PANGO_VERSION_MINOR % 2) +#define PANGO_VERSION_CUR_STABLE (G_ENCODE_VERSION (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR + 1)) +#else +#define PANGO_VERSION_CUR_STABLE (G_ENCODE_VERSION (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR)) +#endif + +/* evaluates to the previous stable version */ +#if (PANGO_VERSION_MINOR % 2) +#define PANGO_VERSION_PREV_STABLE (G_ENCODE_VERSION (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR - 1)) +#else +#define PANGO_VERSION_PREV_STABLE (G_ENCODE_VERSION (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR - 2)) +#endif + +/** + * PANGO_VERSION_MIN_REQUIRED: + * + * A macro that should be defined by the user prior to including + * the pango.h header. + * The definition should be one of the predefined Pango version + * macros: %PANGO_VERSION_1_2, %PANGO_VERSION_1_4,... + * + * This macro defines the earliest version of Pango that the package is + * required to be able to compile against. + * + * If the compiler is configured to warn about the use of deprecated + * functions, then using functions that were deprecated in version + * %PANGO_VERSION_MIN_REQUIRED or earlier will cause warnings (but + * using functions deprecated in later releases will not). + * + * Since: 1.42 + */ +/* If the package sets PANGO_VERSION_MIN_REQUIRED to some future + * PANGO_VERSION_X_Y value that we don't know about, it will compare as + * 0 in preprocessor tests. + */ +#ifndef PANGO_VERSION_MIN_REQUIRED +# define PANGO_VERSION_MIN_REQUIRED (PANGO_VERSION_CUR_STABLE) +#elif PANGO_VERSION_MIN_REQUIRED == 0 +# undef PANGO_VERSION_MIN_REQUIRED +# define PANGO_VERSION_MIN_REQUIRED (PANGO_VERSION_CUR_STABLE + 2) +#endif + +/** + * PANGO_VERSION_MAX_ALLOWED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined Pango version + * macros: %PANGO_VERSION_1_2, %PANGO_VERSION_1_4,... + * + * This macro defines the latest version of the Pango API that the + * package is allowed to make use of. + * + * If the compiler is configured to warn about the use of deprecated + * functions, then using functions added after version + * %PANGO_VERSION_MAX_ALLOWED will cause warnings. + * + * Unless you are using PANGO_CHECK_VERSION() or the like to compile + * different code depending on the Pango version, then this should be + * set to the same value as %PANGO_VERSION_MIN_REQUIRED. + * + * Since: 1.42 + */ +#if !defined (PANGO_VERSION_MAX_ALLOWED) || (PANGO_VERSION_MAX_ALLOWED == 0) +# undef PANGO_VERSION_MAX_ALLOWED +# define PANGO_VERSION_MAX_ALLOWED (PANGO_VERSION_CUR_STABLE) +#endif + +/* sanity checks */ +#if PANGO_VERSION_MIN_REQUIRED > PANGO_VERSION_CUR_STABLE +#error "PANGO_VERSION_MIN_REQUIRED must be <= PANGO_VERSION_CUR_STABLE" +#endif +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_MIN_REQUIRED +#error "PANGO_VERSION_MAX_ALLOWED must be >= PANGO_VERSION_MIN_REQUIRED" +#endif +#if PANGO_VERSION_MIN_REQUIRED < PANGO_VERSION_1_2 +#error "PANGO_VERSION_MIN_REQUIRED must be >= PANGO_VERSION_1_2" +#endif + +/* These macros are used to mark deprecated functions in Pango headers, + * and thus have to be exposed in installed headers. + */ +#ifdef PANGO_DISABLE_DEPRECATION_WARNINGS +# define PANGO_DEPRECATED _PANGO_EXTERN +# define PANGO_DEPRECATED_FOR(f) _PANGO_EXTERN +# define PANGO_UNAVAILABLE(maj,min) _PANGO_EXTERN +#else +# define PANGO_DEPRECATED G_DEPRECATED _PANGO_EXTERN +# define PANGO_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _PANGO_EXTERN +# define PANGO_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _PANGO_EXTERN +#endif + +/* XXX: Every new stable minor release should add a set of macros here */ +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_2 +# define PANGO_DEPRECATED_IN_1_2 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_2_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_2 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_2_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_2 +# define PANGO_AVAILABLE_IN_1_2 PANGO_UNAVAILABLE(1, 2) +#else +# define PANGO_AVAILABLE_IN_1_2 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_4 +# define PANGO_DEPRECATED_IN_1_4 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_4_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_4 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_4_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_4 +# define PANGO_AVAILABLE_IN_1_4 PANGO_UNAVAILABLE(1, 4) +#else +# define PANGO_AVAILABLE_IN_1_4 _PANGO_EXTERN +#endif + + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_6 +# define PANGO_DEPRECATED_IN_1_6 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_6_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_6 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_6_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_6 +# define PANGO_AVAILABLE_IN_1_6 PANGO_UNAVAILABLE(1, 6) +#else +# define PANGO_AVAILABLE_IN_1_6 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_8 +# define PANGO_DEPRECATED_IN_1_8 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_8_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_8 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_8_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_8 +# define PANGO_AVAILABLE_IN_1_8 PANGO_UNAVAILABLE(1, 8) +#else +# define PANGO_AVAILABLE_IN_1_8 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_10 +# define PANGO_DEPRECATED_IN_1_10 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_10_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_10 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_10_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_10 +# define PANGO_AVAILABLE_IN_1_10 PANGO_UNAVAILABLE(1, 10) +#else +# define PANGO_AVAILABLE_IN_1_10 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_12 +# define PANGO_AVAILABLE_IN_1_12 PANGO_UNAVAILABLE(1, 12) +#else +# define PANGO_AVAILABLE_IN_1_12 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_12 +# define PANGO_DEPRECATED_IN_1_12 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_12_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_12 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_12_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_14 +# define PANGO_AVAILABLE_IN_1_14 PANGO_UNAVAILABLE(1, 14) +#else +# define PANGO_AVAILABLE_IN_1_14 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_14 +# define PANGO_DEPRECATED_IN_1_14 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_14_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_14 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_14_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_16 +# define PANGO_AVAILABLE_IN_1_16 PANGO_UNAVAILABLE(1, 16) +#else +# define PANGO_AVAILABLE_IN_1_16 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_16 +# define PANGO_DEPRECATED_IN_1_16 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_16_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_16 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_16_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_18 +# define PANGO_DEPRECATED_IN_1_18 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_18_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_18 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_18_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_18 +# define PANGO_AVAILABLE_IN_1_18 PANGO_UNAVAILABLE(1, 18) +#else +# define PANGO_AVAILABLE_IN_1_18 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_20 +# define PANGO_DEPRECATED_IN_1_20 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_20_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_20 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_20_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_20 +# define PANGO_AVAILABLE_IN_1_20 PANGO_UNAVAILABLE(1, 20) +#else +# define PANGO_AVAILABLE_IN_1_20 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_22 +# define PANGO_DEPRECATED_IN_1_22 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_22_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_22 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_22_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_22 +# define PANGO_AVAILABLE_IN_1_22 PANGO_UNAVAILABLE(1, 22) +#else +# define PANGO_AVAILABLE_IN_1_22 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_24 +# define PANGO_DEPRECATED_IN_1_24 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_24_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_24 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_24_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_24 +# define PANGO_AVAILABLE_IN_1_24 PANGO_UNAVAILABLE(1, 24) +#else +# define PANGO_AVAILABLE_IN_1_24 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_26 +# define PANGO_DEPRECATED_IN_1_26 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_26_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_26 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_26_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_26 +# define PANGO_AVAILABLE_IN_1_26 PANGO_UNAVAILABLE(1, 26) +#else +# define PANGO_AVAILABLE_IN_1_26 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_28 +# define PANGO_DEPRECATED_IN_1_28 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_28_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_28 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_28_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_28 +# define PANGO_AVAILABLE_IN_1_28 PANGO_UNAVAILABLE(1, 28) +#else +# define PANGO_AVAILABLE_IN_1_28 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_30 +# define PANGO_DEPRECATED_IN_1_30 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_30_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_30 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_30_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_30 +# define PANGO_AVAILABLE_IN_1_30 PANGO_UNAVAILABLE(1, 30) +#else +# define PANGO_AVAILABLE_IN_1_30 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_32 +# define PANGO_DEPRECATED_IN_1_32 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_32_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_32 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_32_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_32 +# define PANGO_AVAILABLE_IN_1_32 PANGO_UNAVAILABLE(1, 32) +#else +# define PANGO_AVAILABLE_IN_1_32 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_34 +# define PANGO_DEPRECATED_IN_1_34 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_34_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_34 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_34_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_34 +# define PANGO_AVAILABLE_IN_1_34 PANGO_UNAVAILABLE(1, 34) +#else +# define PANGO_AVAILABLE_IN_1_34 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_36 +# define PANGO_DEPRECATED_IN_1_36 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_36_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_36 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_36_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_36 +# define PANGO_AVAILABLE_IN_1_36 PANGO_UNAVAILABLE(1, 36) +#else +# define PANGO_AVAILABLE_IN_1_36 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_38 +# define PANGO_DEPRECATED_IN_1_38 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_38_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_38 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_38_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_38 +# define PANGO_AVAILABLE_IN_1_38 PANGO_UNAVAILABLE(1, 38) +#else +# define PANGO_AVAILABLE_IN_1_38 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_40 +# define PANGO_DEPRECATED_IN_1_40 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_40_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_40 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_40_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_40 +# define PANGO_AVAILABLE_IN_1_40 PANGO_UNAVAILABLE(1, 40) +#else +# define PANGO_AVAILABLE_IN_1_40 _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_42 +# define PANGO_DEPRECATED_IN_1_42 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_42_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_42 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_42_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_42 +# define PANGO_AVAILABLE_IN_1_42 PANGO_UNAVAILABLE(1, 42) +#else +# define PANGO_AVAILABLE_IN_1_42 _PANGO_EXTERN +#endif + +#endif /* __PANGO_VERSION_H__ */ diff --git a/pango/pango.h b/pango/pango.h new file mode 100644 index 0000000..bf68832 --- /dev/null +++ b/pango/pango.h @@ -0,0 +1,49 @@ +/* Pango + * pango.h: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_H__ +#define __PANGO_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* __PANGO_H__ */ diff --git a/pango/pango.rc b/pango/pango.rc new file mode 100644 index 0000000..dbd742f --- /dev/null +++ b/pango/pango.rc @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,42,4,0 + PRODUCTVERSION 1,42,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "Pango" + VALUE "FileVersion", "1.42.4.0" + VALUE "InternalName", "pango-1.0-0" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software." + VALUE "OriginalFilename", "pango-1.0-0.dll" + VALUE "ProductName", "Pango" + VALUE "ProductVersion", "1.42.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pango.rc.in b/pango/pango.rc.in new file mode 100644 index 0000000..3af8144 --- /dev/null +++ b/pango/pango.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "Pango" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pango-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software." + VALUE "OriginalFilename", "pango-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "Pango" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangocairo-context.c b/pango/pangocairo-context.c new file mode 100644 index 0000000..5949c44 --- /dev/null +++ b/pango/pangocairo-context.c @@ -0,0 +1,496 @@ +/* Pango + * pangocairo-fontmap.c: Cairo font handling + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pango-impl-utils.h" + +#include + +typedef struct _PangoCairoContextInfo PangoCairoContextInfo; + +struct _PangoCairoContextInfo +{ + double dpi; + gboolean set_options_explicit; + + cairo_font_options_t *set_options; + cairo_font_options_t *surface_options; + cairo_font_options_t *merged_options; + + PangoCairoShapeRendererFunc shape_renderer_func; + gpointer shape_renderer_data; + GDestroyNotify shape_renderer_notify; +}; + +static void +free_context_info (PangoCairoContextInfo *info) +{ + if (info->set_options) + cairo_font_options_destroy (info->set_options); + if (info->surface_options) + cairo_font_options_destroy (info->surface_options); + if (info->merged_options) + cairo_font_options_destroy (info->merged_options); + + if (info->shape_renderer_notify) + info->shape_renderer_notify (info->shape_renderer_data); + + g_slice_free (PangoCairoContextInfo, info); +} + +static PangoCairoContextInfo * +get_context_info (PangoContext *context, + gboolean create) +{ + static GQuark context_info_quark; /* MT-safe */ + PangoCairoContextInfo *info; + + if (G_UNLIKELY (!context_info_quark)) + context_info_quark = g_quark_from_static_string ("pango-cairo-context-info"); + +retry: + info = g_object_get_qdata (G_OBJECT (context), context_info_quark); + + if (G_UNLIKELY (!info) && create) + { + info = g_slice_new0 (PangoCairoContextInfo); + info->dpi = -1.0; + + if (!g_object_replace_qdata (G_OBJECT (context), context_info_quark, NULL, + info, (GDestroyNotify)free_context_info, + NULL)) + { + free_context_info (info); + goto retry; + } + } + + return info; +} + +static void +_pango_cairo_update_context (cairo_t *cr, + PangoContext *context) +{ + PangoCairoContextInfo *info; + cairo_matrix_t cairo_matrix; + cairo_surface_t *target; + PangoMatrix pango_matrix; + const PangoMatrix *current_matrix, identity_matrix = PANGO_MATRIX_INIT; + const cairo_font_options_t *merged_options; + cairo_font_options_t *old_merged_options; + gboolean changed = FALSE; + + info = get_context_info (context, TRUE); + + target = cairo_get_target (cr); + + if (!info->surface_options) + info->surface_options = cairo_font_options_create (); + cairo_surface_get_font_options (target, info->surface_options); + if (!info->set_options_explicit) + { + if (!info->set_options) + info->set_options = cairo_font_options_create (); + cairo_get_font_options (cr, info->set_options); + } + + old_merged_options = info->merged_options; + info->merged_options = NULL; + + merged_options = _pango_cairo_context_get_merged_font_options (context); + + if (old_merged_options) + { + if (!cairo_font_options_equal (merged_options, old_merged_options)) + changed = TRUE; + cairo_font_options_destroy (old_merged_options); + old_merged_options = NULL; + } + else + changed = TRUE; + + cairo_get_matrix (cr, &cairo_matrix); + pango_matrix.xx = cairo_matrix.xx; + pango_matrix.yx = cairo_matrix.yx; + pango_matrix.xy = cairo_matrix.xy; + pango_matrix.yy = cairo_matrix.yy; + pango_matrix.x0 = 0; + pango_matrix.y0 = 0; + + current_matrix = pango_context_get_matrix (context); + if (!current_matrix) + current_matrix = &identity_matrix; + + /* layout is matrix-independent if metrics-hinting is off. + * also ignore matrix translation offsets */ + if ((cairo_font_options_get_hint_metrics (merged_options) != CAIRO_HINT_METRICS_OFF) && + (0 != memcmp (&pango_matrix, current_matrix, sizeof (PangoMatrix)))) + changed = TRUE; + + pango_context_set_matrix (context, &pango_matrix); + + if (changed) + pango_context_changed (context); +} + +/** + * pango_cairo_update_context: + * @cr: a Cairo context + * @context: a #PangoContext, from a pangocairo font map + * + * Updates a #PangoContext previously created for use with Cairo to + * match the current transformation and target surface of a Cairo + * context. If any layouts have been created for the context, + * it's necessary to call pango_layout_context_changed() on those + * layouts. + * + * Since: 1.10 + **/ +void +pango_cairo_update_context (cairo_t *cr, + PangoContext *context) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (PANGO_IS_CONTEXT (context)); + + _pango_cairo_update_context (cr, context); +} + +/** + * pango_cairo_context_set_resolution: + * @context: a #PangoContext, from a pangocairo font map + * @dpi: the resolution in "dots per inch". (Physical inches aren't actually + * involved; the terminology is conventional.) A 0 or negative value + * means to use the resolution from the font map. + * + * Sets the resolution for the context. This is a scale factor between + * points specified in a #PangoFontDescription and Cairo units. The + * default value is 96, meaning that a 10 point font will be 13 + * units high. (10 * 96. / 72. = 13.3). + * + * Since: 1.10 + **/ +void +pango_cairo_context_set_resolution (PangoContext *context, + double dpi) +{ + PangoCairoContextInfo *info = get_context_info (context, TRUE); + info->dpi = dpi; +} + +/** + * pango_cairo_context_get_resolution: + * @context: a #PangoContext, from a pangocairo font map + * + * Gets the resolution for the context. See pango_cairo_context_set_resolution() + * + * Return value: the resolution in "dots per inch". A negative value will + * be returned if no resolution has previously been set. + * + * Since: 1.10 + **/ +double +pango_cairo_context_get_resolution (PangoContext *context) +{ + PangoCairoContextInfo *info = get_context_info (context, FALSE); + + if (info) + return info->dpi; + else + return -1.0; +} + +/** + * pango_cairo_context_set_font_options: + * @context: a #PangoContext, from a pangocairo font map + * @options: (nullable): a #cairo_font_options_t, or %NULL to unset + * any previously set options. A copy is made. + * + * Sets the font options used when rendering text with this context. + * These options override any options that pango_cairo_update_context() + * derives from the target surface. + * + * Since: 1.10 + */ +void +pango_cairo_context_set_font_options (PangoContext *context, + const cairo_font_options_t *options) +{ + PangoCairoContextInfo *info; + + g_return_if_fail (PANGO_IS_CONTEXT (context)); + + info = get_context_info (context, TRUE); + + if (info->set_options || options) + pango_context_changed (context); + + if (info->set_options) + cairo_font_options_destroy (info->set_options); + + if (options) + { + info->set_options = cairo_font_options_copy (options); + info->set_options_explicit = TRUE; + } + else + { + info->set_options = NULL; + info->set_options_explicit = FALSE; + } + + if (info->merged_options) + { + cairo_font_options_destroy (info->merged_options); + info->merged_options = NULL; + } +} + +/** + * pango_cairo_context_get_font_options: + * @context: a #PangoContext, from a pangocairo font map + * + * Retrieves any font rendering options previously set with + * pango_cairo_context_set_font_options(). This function does not report options + * that are derived from the target surface by pango_cairo_update_context() + * + * Return value: (nullable): the font options previously set on the + * context, or %NULL if no options have been set. This value is + * owned by the context and must not be modified or freed. + * + * Since: 1.10 + **/ +const cairo_font_options_t * +pango_cairo_context_get_font_options (PangoContext *context) +{ + PangoCairoContextInfo *info; + + g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + + info = get_context_info (context, FALSE); + + if (info) + return info->set_options; + else + return NULL; +} + +/** + * _pango_cairo_context_merge_font_options: + * @context: a #PangoContext + * @options: a #cairo_font_options_t + * + * Merge together options from the target surface and explicitly set + * on the context. + * + * Return value: the combined set of font options. This value is owned + * by the context and must not be modified or freed. + **/ +const cairo_font_options_t * +_pango_cairo_context_get_merged_font_options (PangoContext *context) +{ + PangoCairoContextInfo *info = get_context_info (context, TRUE); + + if (!info->merged_options) + { + info->merged_options = cairo_font_options_create (); + + if (info->surface_options) + cairo_font_options_merge (info->merged_options, info->surface_options); + if (info->set_options) + cairo_font_options_merge (info->merged_options, info->set_options); + } + + return info->merged_options; +} + +/** + * pango_cairo_context_set_shape_renderer: + * @context: a #PangoContext, from a pangocairo font map + * @func: (nullable): Callback function for rendering attributes of + * type %PANGO_ATTR_SHAPE, or %NULL to disable shape rendering. + * @data: User data that will be passed to @func. + * @dnotify: Callback that will be called when the + * context is freed to release @data, or %NULL. + * + * Sets callback function for context to use for rendering attributes + * of type %PANGO_ATTR_SHAPE. See #PangoCairoShapeRendererFunc for + * details. + * + * Since: 1.18 + */ +void +pango_cairo_context_set_shape_renderer (PangoContext *context, + PangoCairoShapeRendererFunc func, + gpointer data, + GDestroyNotify dnotify) +{ + PangoCairoContextInfo *info; + + g_return_if_fail (PANGO_IS_CONTEXT (context)); + + info = get_context_info (context, TRUE); + + if (info->shape_renderer_notify) + info->shape_renderer_notify (info->shape_renderer_data); + + info->shape_renderer_func = func; + info->shape_renderer_data = data; + info->shape_renderer_notify = dnotify; +} + +/** + * pango_cairo_context_get_shape_renderer: (skip) + * @context: a #PangoContext, from a pangocairo font map + * @data: Pointer to #gpointer to return user data + * + * Sets callback function for context to use for rendering attributes + * of type %PANGO_ATTR_SHAPE. See #PangoCairoShapeRendererFunc for + * details. + * + * Retrieves callback function and associated user data for rendering + * attributes of type %PANGO_ATTR_SHAPE as set by + * pango_cairo_context_set_shape_renderer(), if any. + * + * Return value: (nullable): the shape rendering callback previously + * set on the context, or %NULL if no shape rendering callback have + * been set. + * + * Since: 1.18 + */ +PangoCairoShapeRendererFunc +pango_cairo_context_get_shape_renderer (PangoContext *context, + gpointer *data) +{ + PangoCairoContextInfo *info; + + g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + + info = get_context_info (context, FALSE); + + if (info) + { + if (data) + *data = info->shape_renderer_data; + return info->shape_renderer_func; + } + else + { + if (data) + *data = NULL; + return NULL; + } +} + +/** + * pango_cairo_create_context: + * @cr: a Cairo context + * + * Creates a context object set up to match the current transformation + * and target surface of the Cairo context. This context can then be + * used to create a layout using pango_layout_new(). + * + * This function is a convenience function that creates a context using + * the default font map, then updates it to @cr. If you just need to + * create a layout for use with @cr and do not need to access #PangoContext + * directly, you can use pango_cairo_create_layout() instead. + * + * Return value: (transfer full): the newly created #PangoContext. Free with + * g_object_unref(). + * + * Since: 1.22 + **/ +PangoContext * +pango_cairo_create_context (cairo_t *cr) +{ + PangoFontMap *fontmap; + PangoContext *context; + + g_return_val_if_fail (cr != NULL, NULL); + + fontmap = pango_cairo_font_map_get_default (); + context = pango_font_map_create_context (fontmap); + pango_cairo_update_context (cr, context); + + return context; +} + +/** + * pango_cairo_create_layout: + * @cr: a Cairo context + * + * Creates a layout object set up to match the current transformation + * and target surface of the Cairo context. This layout can then be + * used for text measurement with functions like + * pango_layout_get_size() or drawing with functions like + * pango_cairo_show_layout(). If you change the transformation + * or target surface for @cr, you need to call pango_cairo_update_layout() + * + * This function is the most convenient way to use Cairo with Pango, + * however it is slightly inefficient since it creates a separate + * #PangoContext object for each layout. This might matter in an + * application that was laying out large amounts of text. + * + * Return value: (transfer full): the newly created #PangoLayout. Free with + * g_object_unref(). + * + * Since: 1.10 + **/ +PangoLayout * +pango_cairo_create_layout (cairo_t *cr) +{ + PangoContext *context; + PangoLayout *layout; + + g_return_val_if_fail (cr != NULL, NULL); + + context = pango_cairo_create_context (cr); + layout = pango_layout_new (context); + g_object_unref (context); + + return layout; +} + +/** + * pango_cairo_update_layout: + * @cr: a Cairo context + * @layout: a #PangoLayout, from pango_cairo_create_layout() + * + * Updates the private #PangoContext of a #PangoLayout created with + * pango_cairo_create_layout() to match the current transformation + * and target surface of a Cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_update_layout (cairo_t *cr, + PangoLayout *layout) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + _pango_cairo_update_context (cr, pango_layout_get_context (layout)); +} + diff --git a/pango/pangocairo-coretext.h b/pango/pangocairo-coretext.h new file mode 100644 index 0000000..ffc086c --- /dev/null +++ b/pango/pangocairo-coretext.h @@ -0,0 +1,55 @@ +/* Pango + * pangocairo-coretext.h: + * + * Copyright (C) 2005 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_CORETEXT_H__ +#define __PANGOCAIRO_CORETEXT_H__ + +#include "pangocoretext-private.h" +#include +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP (pango_cairo_core_text_font_map_get_type ()) +#define PANGO_CAIRO_CORE_TEXT_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP, PangoCairoCoreTextFontMap)) +#define PANGO_IS_CAIRO_CORE_TEXT_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP)) + +typedef struct _PangoCairoCoreTextFontMap PangoCairoCoreTextFontMap; + +struct _PangoCairoCoreTextFontMap +{ + PangoCoreTextFontMap parent_instance; + + guint serial; + gdouble dpi; +}; + +_PANGO_EXTERN +GType pango_cairo_core_text_font_map_get_type (void) G_GNUC_CONST; + +PangoCoreTextFont * +_pango_cairo_core_text_font_new (PangoCairoCoreTextFontMap *cafontmap, + PangoCoreTextFontKey *key); + +G_END_DECLS + +#endif /* __PANGOCAIRO_CORETEXT_H__ */ diff --git a/pango/pangocairo-coretextfont.c b/pango/pangocairo-coretextfont.c new file mode 100644 index 0000000..9dc3344 --- /dev/null +++ b/pango/pangocairo-coretextfont.c @@ -0,0 +1,257 @@ +/* Pango + * pangocairo-coretextfont.c + * + * Copyright (C) 2000-2005 Red Hat Software + * Copyright (C) 2005-2007 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "pango-impl-utils.h" +#include "pangocoretext-private.h" +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pangocairo-coretext.h" +#include "pangocairo-coretextfont.h" + +struct _PangoCairoCoreTextFont +{ + PangoCoreTextFont font; + PangoCairoFontPrivate cf_priv; + int abs_size; +}; + +struct _PangoCairoCoreTextFontClass +{ + PangoCoreTextFontClass parent_class; +}; + + + +static cairo_font_face_t *pango_cairo_core_text_font_create_font_face (PangoCairoFont *font); +static PangoFontMetrics *pango_cairo_core_text_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context); + +static void +cairo_font_iface_init (PangoCairoFontIface *iface) +{ + iface->create_font_face = pango_cairo_core_text_font_create_font_face; + iface->create_base_metrics_for_context = pango_cairo_core_text_font_create_base_metrics_for_context; + iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoCoreTextFont, cf_priv); +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoCoreTextFont, pango_cairo_core_text_font, PANGO_TYPE_CORE_TEXT_FONT, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) }); + +/* we want get_glyph_extents extremely fast, so we use a small wrapper here + * to avoid having to lookup the interface data like we do for get_metrics + * in _pango_cairo_font_get_metrics(). */ +static void +pango_cairo_core_text_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoCairoCoreTextFont *cafont = (PangoCairoCoreTextFont *) (font); + + _pango_cairo_font_private_get_glyph_extents (&cafont->cf_priv, + glyph, + ink_rect, + logical_rect); +} + +static cairo_font_face_t * +pango_cairo_core_text_font_create_font_face (PangoCairoFont *font) +{ + PangoCoreTextFont *ctfont = (PangoCoreTextFont *) (font); + CTFontRef font_id; + CGFontRef cgfont; + cairo_font_face_t *cairo_face; + + font_id = pango_core_text_font_get_ctfont (ctfont); + cgfont = CTFontCopyGraphicsFont (font_id, NULL); + + cairo_face = cairo_quartz_font_face_create_for_cgfont (cgfont); + + CFRelease (cgfont); + + return cairo_face; +} + +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + +static PangoFontMetrics * +pango_cairo_core_text_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context) +{ + PangoCoreTextFont *cfont = (PangoCoreTextFont *) font; + PangoFontMetrics *metrics; + PangoFontDescription *font_desc; + PangoLayout *layout; + PangoRectangle extents; + PangoLanguage *language = pango_context_get_language (context); + const char *sample_str = pango_language_get_sample_string (language); + CTFontRef ctfont; + + metrics = pango_font_metrics_new (); + + ctfont = pango_core_text_font_get_ctfont (cfont); + + metrics->ascent = CTFontGetAscent (ctfont) * PANGO_SCALE; + metrics->descent = CTFontGetDescent (ctfont) * PANGO_SCALE; + + metrics->underline_position = CTFontGetUnderlinePosition (ctfont) * PANGO_SCALE; + metrics->underline_thickness = CTFontGetUnderlineThickness (ctfont) * PANGO_SCALE; + + metrics->strikethrough_position = metrics->ascent / 3; + metrics->strikethrough_thickness = CTFontGetUnderlineThickness (ctfont) * PANGO_SCALE; + + layout = pango_layout_new (context); + font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font); + pango_layout_set_font_description (layout, font_desc); + pango_layout_set_text (layout, sample_str, -1); + pango_layout_get_extents (layout, NULL, &extents); + + metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str); + + pango_layout_set_text (layout, "0123456789", -1); + metrics->approximate_digit_width = max_glyph_width (layout); + + pango_font_description_free (font_desc); + g_object_unref (layout); + + return metrics; +} + +static PangoFontDescription * +pango_cairo_core_text_font_describe_absolute (PangoFont *font) +{ + PangoCairoCoreTextFont *cafont = (PangoCairoCoreTextFont *)font; + PangoFontDescription *desc = pango_font_describe (font); + + pango_font_description_set_absolute_size (desc, cafont->abs_size); + + return desc; +} + +static void +pango_cairo_core_text_font_finalize (GObject *object) +{ + PangoCairoCoreTextFont *cafont = (PangoCairoCoreTextFont *) object; + + _pango_cairo_font_private_finalize (&cafont->cf_priv); + + G_OBJECT_CLASS (pango_cairo_core_text_font_parent_class)->finalize (object); +} + +static void +pango_cairo_core_text_font_class_init (PangoCairoCoreTextFontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + + object_class->finalize = pango_cairo_core_text_font_finalize; + /* font_class->describe defined by parent class PangoCoreTextFont. */ + font_class->get_glyph_extents = pango_cairo_core_text_font_get_glyph_extents; + font_class->get_metrics = _pango_cairo_font_get_metrics; + font_class->describe_absolute = pango_cairo_core_text_font_describe_absolute; +} + +static void +pango_cairo_core_text_font_init (PangoCairoCoreTextFont *cafont G_GNUC_UNUSED) +{ +} + +PangoCoreTextFont * +_pango_cairo_core_text_font_new (PangoCairoCoreTextFontMap *cafontmap, + PangoCoreTextFontKey *key) +{ + gboolean synthesize_italic = FALSE; + PangoCairoCoreTextFont *cafont; + PangoCoreTextFont *cfont; + CTFontRef font_ref; + CTFontDescriptorRef ctdescriptor; + CGFontRef font_id; + double size; + cairo_matrix_t font_matrix; + + size = pango_units_to_double (pango_core_text_font_key_get_size (key)); + + size /= pango_matrix_get_font_scale_factor (pango_core_text_font_key_get_matrix (key)); + + ctdescriptor = pango_core_text_font_key_get_ctfontdescriptor (key); + font_ref = CTFontCreateWithFontDescriptor (ctdescriptor, size, NULL); + + if (pango_core_text_font_key_get_synthetic_italic (key)) + synthesize_italic = TRUE; + + font_id = CTFontCopyGraphicsFont (font_ref, NULL); + if (!font_id) + return NULL; + + cafont = g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT, NULL); + cfont = PANGO_CORE_TEXT_FONT (cafont); + + cafont->abs_size = pango_core_text_font_key_get_size (key); + + _pango_core_text_font_set_ctfont (cfont, font_ref); + + if (synthesize_italic) + cairo_matrix_init (&font_matrix, + 1, 0, + -0.25, 1, + 0, 0); + else + cairo_matrix_init_identity (&font_matrix); + + cairo_matrix_scale (&font_matrix, size, size); + + _pango_cairo_font_private_initialize (&cafont->cf_priv, + (PangoCairoFont *) cafont, + pango_core_text_font_key_get_gravity (key), + pango_core_text_font_key_get_context_key (key), + pango_core_text_font_key_get_matrix (key), + &font_matrix); + + return cfont; +} diff --git a/pango/pangocairo-coretextfont.h b/pango/pangocairo-coretextfont.h new file mode 100644 index 0000000..91bdc71 --- /dev/null +++ b/pango/pangocairo-coretextfont.h @@ -0,0 +1,38 @@ +/* Pango + * pangocairo-coretextfont.c + * + * Copyright (C) 2005 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_CORETEXTFONT_H__ +#define __PANGOCAIRO_CORETEXTFONT_H__ + +#define PANGO_TYPE_CAIRO_CORE_TEXT_FONT (pango_cairo_core_text_font_get_type ()) +#define PANGO_CAIRO_CORE_TEXT_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_CORE_TEXT_FONT, PangoCairoCoreTextFont)) +#define PANGO_CAIRO_CORE_TEXT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_CORE_TEXT_FONT, PangoCairoCoreTextFontClass)) +#define PANGO_IS_CAIRO_CORE_TEXT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CAIRO_CORE_TEXT_FONT)) +#define PANGO_CAIRO_CORE_TEXT_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CAIRO_CORE_TEXT_FONT, PangoCairoCoreTextFontClass)) + +typedef struct _PangoCairoCoreTextFont PangoCairoCoreTextFont; +typedef struct _PangoCairoCoreTextFontClass PangoCairoCoreTextFontClass; + +_PANGO_EXTERN +GType pango_cairo_core_text_font_get_type (void) G_GNUC_CONST; + +#endif /* __PANGOCAIRO_CORETEXTFONT_H__ */ diff --git a/pango/pangocairo-coretextfontmap.c b/pango/pangocairo-coretextfontmap.c new file mode 100644 index 0000000..5054b7a --- /dev/null +++ b/pango/pangocairo-coretextfontmap.c @@ -0,0 +1,190 @@ +/* Pango + * pangocairo-coretextfontmap.c + * + * Copyright (C) 2005 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pangocoretext-private.h" +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pangocairo-coretext.h" + +typedef struct _PangoCairoCoreTextFontMapClass PangoCairoCoreTextFontMapClass; + +struct _PangoCairoCoreTextFontMapClass +{ + PangoCoreTextFontMapClass parent_class; +}; + +static guint +pango_cairo_core_text_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (fontmap); + + return cafontmap->serial; +} + +static void +pango_cairo_core_text_font_map_changed (PangoFontMap *fontmap) +{ + PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (fontmap); + + cafontmap->serial++; + if (cafontmap->serial == 0) + cafontmap->serial++; +} + +static void +pango_cairo_core_text_font_map_set_resolution (PangoCairoFontMap *cfontmap, + double dpi) +{ + PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (cfontmap); + + cafontmap->serial++; + if (cafontmap->serial == 0) + cafontmap->serial++; + cafontmap->dpi = dpi; +} + +static double +pango_cairo_core_text_font_map_get_resolution_cairo (PangoCairoFontMap *cfontmap) +{ + PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (cfontmap); + + return cafontmap->dpi; +} + +static cairo_font_type_t +pango_cairo_core_text_font_map_get_font_type (PangoCairoFontMap *cfontmap) +{ + return CAIRO_FONT_TYPE_QUARTZ; +} + +static void +cairo_font_map_iface_init (PangoCairoFontMapIface *iface) +{ + iface->set_resolution = pango_cairo_core_text_font_map_set_resolution; + iface->get_resolution = pango_cairo_core_text_font_map_get_resolution_cairo; + iface->get_font_type = pango_cairo_core_text_font_map_get_font_type; +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoCoreTextFontMap, pango_cairo_core_text_font_map, PANGO_TYPE_CORE_TEXT_FONT_MAP, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) }); + + +static PangoCoreTextFont * +pango_cairo_core_text_font_map_create_font (PangoCoreTextFontMap *fontmap, + PangoCoreTextFontKey *key) + +{ + return _pango_cairo_core_text_font_new (PANGO_CAIRO_CORE_TEXT_FONT_MAP (fontmap), + key); +} + +static void +pango_cairo_core_text_font_map_finalize (GObject *object) +{ + G_OBJECT_CLASS (pango_cairo_core_text_font_map_parent_class)->finalize (object); +} + +static double +pango_cairo_core_text_font_map_get_resolution_core_text (PangoCoreTextFontMap *ctfontmap, + PangoContext *context) +{ + PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (ctfontmap); + double dpi; + + if (context) + { + dpi = pango_cairo_context_get_resolution (context); + + if (dpi <= 0) + dpi = cafontmap->dpi; + } + else + dpi = cafontmap->dpi; + + return dpi; +} + +static gconstpointer +pango_cairo_core_text_font_map_context_key_get (PangoCoreTextFontMap *fontmap G_GNUC_UNUSED, + PangoContext *context) +{ + return _pango_cairo_context_get_merged_font_options (context); +} + +static gpointer +pango_cairo_core_text_font_map_context_key_copy (PangoCoreTextFontMap *fontmap G_GNUC_UNUSED, + gconstpointer key) +{ + return cairo_font_options_copy (key); +} + +static void +pango_cairo_core_text_font_map_context_key_free (PangoCoreTextFontMap *fontmap G_GNUC_UNUSED, + gpointer key) +{ + cairo_font_options_destroy (key); +} + +static guint32 +pango_cairo_core_text_font_map_context_key_hash (PangoCoreTextFontMap *fontmap G_GNUC_UNUSED, + gconstpointer key) +{ + return (guint32)cairo_font_options_hash (key); +} + +static gboolean +pango_cairo_core_text_font_map_context_key_equal (PangoCoreTextFontMap *fontmap G_GNUC_UNUSED, + gconstpointer key_a, + gconstpointer key_b) +{ + return cairo_font_options_equal (key_a, key_b); +} + +static void +pango_cairo_core_text_font_map_class_init (PangoCairoCoreTextFontMapClass *class) +{ + PangoCoreTextFontMapClass *ctfontmapclass = (PangoCoreTextFontMapClass *)class; + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + GObjectClass *object_class = (GObjectClass *)class; + + object_class->finalize = pango_cairo_core_text_font_map_finalize; + + fontmap_class->get_serial = pango_cairo_core_text_font_map_get_serial; + fontmap_class->changed = pango_cairo_core_text_font_map_changed; + + ctfontmapclass->get_resolution = pango_cairo_core_text_font_map_get_resolution_core_text; + ctfontmapclass->create_font = pango_cairo_core_text_font_map_create_font; + ctfontmapclass->context_key_get = pango_cairo_core_text_font_map_context_key_get; + ctfontmapclass->context_key_copy = pango_cairo_core_text_font_map_context_key_copy; + ctfontmapclass->context_key_free = pango_cairo_core_text_font_map_context_key_free; + ctfontmapclass->context_key_hash = pango_cairo_core_text_font_map_context_key_hash; + ctfontmapclass->context_key_equal = pango_cairo_core_text_font_map_context_key_equal; +} + +static void +pango_cairo_core_text_font_map_init (PangoCairoCoreTextFontMap *cafontmap) +{ + cafontmap->serial = 1; + cafontmap->dpi = 96.; +} diff --git a/pango/pangocairo-fc.h b/pango/pangocairo-fc.h new file mode 100644 index 0000000..172700f --- /dev/null +++ b/pango/pangocairo-fc.h @@ -0,0 +1,56 @@ +/* Pango + * pangocairo-fc.h: Private header file for Cairo/fontconfig combination + * + * Copyright (C) 2005 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_FC_H__ +#define __PANGOCAIRO_FC_H__ + +#include +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_CAIRO_FC_FONT_MAP (pango_cairo_fc_font_map_get_type ()) +#define PANGO_CAIRO_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FC_FONT_MAP, PangoCairoFcFontMap)) +#define PANGO_IS_CAIRO_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FC_FONT_MAP)) + +typedef struct _PangoCairoFcFontMap PangoCairoFcFontMap; + +struct _PangoCairoFcFontMap +{ + PangoFcFontMap parent_instance; + + guint serial; + double dpi; + + FT_Library library; +}; + +PANGO_AVAILABLE_IN_ALL +GType pango_cairo_fc_font_map_get_type (void) G_GNUC_CONST; + +PangoFcFont *_pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap, + PangoFcFontKey *key); +FT_Library _pango_cairo_fc_font_map_get_library (PangoCairoFcFontMap *fontmap); + +G_END_DECLS + +#endif /* __PANGOCAIRO_FC_H__ */ + diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c new file mode 100644 index 0000000..e153c13 --- /dev/null +++ b/pango/pangocairo-fcfont.c @@ -0,0 +1,266 @@ +/* Pango + * pangocairofc-font.c: Cairo font handling, fontconfig backend + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +/* Freetype has undefined macros in its header */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" +#include +#pragma GCC diagnostic pop + +#include "pango-fontmap.h" +#include "pangocairo-private.h" +#include "pangocairo-fc.h" +#include "pangofc-private.h" +#include "pango-impl-utils.h" + +#include +#include + +#define PANGO_TYPE_CAIRO_FC_FONT (pango_cairo_fc_font_get_type ()) +#define PANGO_CAIRO_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FC_FONT, PangoCairoFcFont)) +#define PANGO_CAIRO_FC_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_FC_FONT, PangoCairoFcFontClass)) +#define PANGO_CAIRO_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CAIRO_FC_FONT)) +#define PANGO_CAIRO_FC_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CAIRO_FC_FONT, PangoCairoFcFontClass)) + +typedef struct _PangoCairoFcFont PangoCairoFcFont; +typedef struct _PangoCairoFcFontClass PangoCairoFcFontClass; + +struct _PangoCairoFcFont +{ + PangoFcFont font; + PangoCairoFontPrivate cf_priv; +}; + +struct _PangoCairoFcFontClass +{ + PangoFcFontClass parent_class; +}; + +_PANGO_EXTERN +GType pango_cairo_fc_font_get_type (void); + +/******************************** + * Method implementations * + ********************************/ + +static cairo_font_face_t * +pango_cairo_fc_font_create_font_face (PangoCairoFont *cfont) +{ + PangoFcFont *fcfont = (PangoFcFont *) (cfont); + + return cairo_ft_font_face_create_for_pattern (fcfont->font_pattern); +} + +static PangoFontMetrics * +pango_cairo_fc_font_create_base_metrics_for_context (PangoCairoFont *cfont, + PangoContext *context) +{ + PangoFcFont *fcfont = (PangoFcFont *) (cfont); + + return pango_fc_font_create_base_metrics_for_context (fcfont, context); +} + +static void +cairo_font_iface_init (PangoCairoFontIface *iface) +{ + iface->create_font_face = pango_cairo_fc_font_create_font_face; + iface->create_base_metrics_for_context = pango_cairo_fc_font_create_base_metrics_for_context; + iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoFcFont, cf_priv); +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFont, pango_cairo_fc_font, PANGO_TYPE_FC_FONT, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) }) + +static void +pango_cairo_fc_font_finalize (GObject *object) +{ + PangoCairoFcFont *cffont = (PangoCairoFcFont *) object; + + _pango_cairo_font_private_finalize (&cffont->cf_priv); + + G_OBJECT_CLASS (pango_cairo_fc_font_parent_class)->finalize (object); +} + +/* we want get_glyph_extents extremely fast, so we use a small wrapper here + * to avoid having to lookup the interface data like we do for get_metrics + * in _pango_cairo_font_get_metrics(). */ +static void +pango_cairo_fc_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoCairoFcFont *cffont = (PangoCairoFcFont *) (font); + + _pango_cairo_font_private_get_glyph_extents (&cffont->cf_priv, + glyph, + ink_rect, + logical_rect); +} + +static FT_Face +pango_cairo_fc_font_lock_face (PangoFcFont *font) +{ + PangoCairoFcFont *cffont = (PangoCairoFcFont *) (font); + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (&cffont->cf_priv); + + if (G_UNLIKELY (!scaled_font)) + return NULL; + + return cairo_ft_scaled_font_lock_face (scaled_font); +} + +static void +pango_cairo_fc_font_unlock_face (PangoFcFont *font) +{ + PangoCairoFcFont *cffont = (PangoCairoFcFont *) (font); + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (&cffont->cf_priv); + + if (G_UNLIKELY (!scaled_font)) + return; + + cairo_ft_scaled_font_unlock_face (scaled_font); +} + +static void +pango_cairo_fc_font_class_init (PangoCairoFcFontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + PangoFcFontClass *fc_font_class = PANGO_FC_FONT_CLASS (class); + + object_class->finalize = pango_cairo_fc_font_finalize; + + font_class->get_glyph_extents = pango_cairo_fc_font_get_glyph_extents; + font_class->get_metrics = _pango_cairo_font_get_metrics; + + fc_font_class->lock_face = pango_cairo_fc_font_lock_face; + fc_font_class->unlock_face = pango_cairo_fc_font_unlock_face; +} + +static void +pango_cairo_fc_font_init (PangoCairoFcFont *cffont G_GNUC_UNUSED) +{ +} + +/******************** + * Private API * + ********************/ + +static double +get_font_size (const FcPattern *pattern) +{ + double size; + double dpi; + + if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch) + return size; + + /* Just in case FC_PIXEL_SIZE got unset between pango_fc_make_pattern() + * and here. That would be very weird. + */ + + if (FcPatternGetDouble (pattern, FC_DPI, 0, &dpi) != FcResultMatch) + dpi = 72; + + if (FcPatternGetDouble (pattern, FC_SIZE, 0, &size) == FcResultMatch) + return size * dpi / 72.; + + /* Whatever */ + return 18.; +} + +static gpointer +get_gravity_class (void) +{ + static GEnumClass *class = NULL; /* MT-safe */ + + if (g_once_init_enter (&class)) + g_once_init_leave(&class, (gpointer)g_type_class_ref (PANGO_TYPE_GRAVITY)); + + return class; +} + +static PangoGravity +get_gravity (const FcPattern *pattern) +{ + char *s; + + if (FcPatternGetString (pattern, PANGO_FC_GRAVITY, 0, (FcChar8 **)(void *)&s) == FcResultMatch) + { + GEnumValue *value = g_enum_get_value_by_nick (get_gravity_class (), s); + return value->value; + } + + return PANGO_GRAVITY_SOUTH; +} + +PangoFcFont * +_pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap, + PangoFcFontKey *key) +{ + PangoCairoFcFont *cffont; + const FcPattern *pattern = pango_fc_font_key_get_pattern (key); + cairo_matrix_t font_matrix; + FcMatrix fc_matrix, *fc_matrix_val; + double size; + int i; + cairo_font_options_t *options; + + g_return_val_if_fail (PANGO_IS_CAIRO_FC_FONT_MAP (cffontmap), NULL); + g_return_val_if_fail (pattern != NULL, NULL); + + cffont = g_object_new (PANGO_TYPE_CAIRO_FC_FONT, + "pattern", pattern, + "fontmap", cffontmap, + NULL); + + size = get_font_size (pattern) / + pango_matrix_get_font_scale_factor (pango_fc_font_key_get_matrix (key)); + + FcMatrixInit (&fc_matrix); + for (i = 0; FcPatternGetMatrix (pattern, FC_MATRIX, i, &fc_matrix_val) == FcResultMatch; i++) + FcMatrixMultiply (&fc_matrix, &fc_matrix, fc_matrix_val); + + cairo_matrix_init (&font_matrix, + fc_matrix.xx, + - fc_matrix.yx, + - fc_matrix.xy, + fc_matrix.yy, + 0., 0.); + + cairo_matrix_scale (&font_matrix, size, size); + + options = pango_fc_font_key_get_context_key (key); + + _pango_cairo_font_private_initialize (&cffont->cf_priv, + (PangoCairoFont *) cffont, + get_gravity (pattern), + options, + pango_fc_font_key_get_matrix (key), + &font_matrix); + + ((PangoFcFont *)(cffont))->is_hinted = _pango_cairo_font_private_is_metrics_hinted (&cffont->cf_priv); + + return (PangoFcFont *) cffont; +} diff --git a/pango/pangocairo-fcfontmap.c b/pango/pangocairo-fcfontmap.c new file mode 100644 index 0000000..bce3665 --- /dev/null +++ b/pango/pangocairo-fcfontmap.c @@ -0,0 +1,235 @@ +/* Pango + * pangocairo-fontmap.c: Cairo font handling, fontconfig backend + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" + +/* Freetype has undefined macros in its headers */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" +#include +#pragma GCC diagnostic pop + +#include "pangofc-fontmap.h" +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pangocairo-fc.h" + +typedef struct _PangoCairoFcFontMapClass PangoCairoFcFontMapClass; + +struct _PangoCairoFcFontMapClass +{ + PangoFcFontMapClass parent_class; +}; + +static guint +pango_cairo_fc_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (fontmap); + + return cffontmap->serial; +} + +static void +pango_cairo_fc_font_map_changed (PangoFontMap *fontmap) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (fontmap); + + cffontmap->serial++; + if (cffontmap->serial == 0) + cffontmap->serial++; +} + +static void +pango_cairo_fc_font_map_set_resolution (PangoCairoFontMap *cfontmap, + double dpi) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (cfontmap); + + if (dpi != cffontmap->dpi) + { + cffontmap->serial++; + if (cffontmap->serial == 0) + cffontmap->serial++; + cffontmap->dpi = dpi; + + pango_fc_font_map_cache_clear ((PangoFcFontMap *) (cfontmap)); + } +} + +static double +pango_cairo_fc_font_map_get_resolution_cairo (PangoCairoFontMap *cfontmap) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (cfontmap); + + return cffontmap->dpi; +} + +static cairo_font_type_t +pango_cairo_fc_font_map_get_font_type (PangoCairoFontMap *cfontmap G_GNUC_UNUSED) +{ + return CAIRO_FONT_TYPE_FT; +} + +static void +cairo_font_map_iface_init (PangoCairoFontMapIface *iface) +{ + iface->set_resolution = pango_cairo_fc_font_map_set_resolution; + iface->get_resolution = pango_cairo_fc_font_map_get_resolution_cairo; + iface->get_font_type = pango_cairo_fc_font_map_get_font_type; +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFontMap, pango_cairo_fc_font_map, PANGO_TYPE_FC_FONT_MAP, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) }) + +static void +pango_cairo_fc_font_map_finalize (GObject *object) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (object); + + G_OBJECT_CLASS (pango_cairo_fc_font_map_parent_class)->finalize (object); + + FT_Done_FreeType (cffontmap->library); +} + +static void +pango_cairo_fc_font_map_fontset_key_substitute (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + PangoFcFontsetKey *fontkey, + FcPattern *pattern) +{ + FcConfigSubstitute (NULL, pattern, FcMatchPattern); + + if (fontkey) + cairo_ft_font_options_substitute (pango_fc_fontset_key_get_context_key (fontkey), + pattern); + + FcDefaultSubstitute (pattern); +} + +static double +pango_cairo_fc_font_map_get_resolution_fc (PangoFcFontMap *fcfontmap, + PangoContext *context) +{ + PangoCairoFcFontMap *cffontmap = (PangoCairoFcFontMap *) (fcfontmap); + double dpi; + + if (context) + { + dpi = pango_cairo_context_get_resolution (context); + + if (dpi <= 0) + dpi = cffontmap->dpi; + } + else + dpi = cffontmap->dpi; + + return dpi; +} + +static gconstpointer +pango_cairo_fc_font_map_context_key_get (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + PangoContext *context) +{ + return _pango_cairo_context_get_merged_font_options (context); +} + +static gpointer +pango_cairo_fc_font_map_context_key_copy (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + gconstpointer key) +{ + return cairo_font_options_copy (key); +} + +static void +pango_cairo_fc_font_map_context_key_free (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + gpointer key) +{ + cairo_font_options_destroy (key); +} + + +static guint32 +pango_cairo_fc_font_map_context_key_hash (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + gconstpointer key) +{ + return (guint32)cairo_font_options_hash (key); +} + +static gboolean +pango_cairo_fc_font_map_context_key_equal (PangoFcFontMap *fcfontmap G_GNUC_UNUSED, + gconstpointer key_a, + gconstpointer key_b) +{ + return cairo_font_options_equal (key_a, key_b); +} + +static PangoFcFont * +pango_cairo_fc_font_map_create_font (PangoFcFontMap *fcfontmap, + PangoFcFontKey *key) +{ + return _pango_cairo_fc_font_new ((PangoCairoFcFontMap *) (fcfontmap), + key); +} + +static void +pango_cairo_fc_font_map_class_init (PangoCairoFcFontMapClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + PangoFcFontMapClass *fcfontmap_class = PANGO_FC_FONT_MAP_CLASS (class); + + gobject_class->finalize = pango_cairo_fc_font_map_finalize; + + fontmap_class->get_serial = pango_cairo_fc_font_map_get_serial; + fontmap_class->changed = pango_cairo_fc_font_map_changed; + + fcfontmap_class->fontset_key_substitute = pango_cairo_fc_font_map_fontset_key_substitute; + fcfontmap_class->get_resolution = pango_cairo_fc_font_map_get_resolution_fc; + + fcfontmap_class->context_key_get = pango_cairo_fc_font_map_context_key_get; + fcfontmap_class->context_key_copy = pango_cairo_fc_font_map_context_key_copy; + fcfontmap_class->context_key_free = pango_cairo_fc_font_map_context_key_free; + fcfontmap_class->context_key_hash = pango_cairo_fc_font_map_context_key_hash; + fcfontmap_class->context_key_equal = pango_cairo_fc_font_map_context_key_equal; + + fcfontmap_class->create_font = pango_cairo_fc_font_map_create_font; +} + +static void +pango_cairo_fc_font_map_init (PangoCairoFcFontMap *cffontmap) +{ + FT_Error error; + + cffontmap->library = NULL; + error = FT_Init_FreeType (&cffontmap->library); + if (error != FT_Err_Ok) + g_critical ("pango_cairo_font_map_init: Could not initialize freetype"); + + cffontmap->serial = 1; + cffontmap->dpi = 96.0; +} + +FT_Library +_pango_cairo_fc_font_map_get_library (PangoCairoFcFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_CAIRO_FC_FONT_MAP (fontmap), NULL); + + return fontmap->library; +} + diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c new file mode 100644 index 0000000..b86f85b --- /dev/null +++ b/pango/pangocairo-font.c @@ -0,0 +1,844 @@ +/* Pango + * pangocairo-font.c: Cairo font handling + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include + +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pango-impl-utils.h" + +#define PANGO_CAIRO_FONT_PRIVATE(font) \ + ((PangoCairoFontPrivate *) \ + (font == NULL ? NULL : \ + G_STRUCT_MEMBER_P (font, \ + PANGO_CAIRO_FONT_GET_IFACE(PANGO_CAIRO_FONT(font))->cf_priv_offset))) + +typedef PangoCairoFontIface PangoCairoFontInterface; +G_DEFINE_INTERFACE (PangoCairoFont, pango_cairo_font, PANGO_TYPE_FONT) + +static void +pango_cairo_font_default_init (PangoCairoFontIface *iface) +{ +} + + +static PangoCairoFontPrivateScaledFontData * +_pango_cairo_font_private_scaled_font_data_create (void) +{ + return g_slice_new (PangoCairoFontPrivateScaledFontData); +} + +static void +_pango_cairo_font_private_scaled_font_data_destroy (PangoCairoFontPrivateScaledFontData *data) +{ + if (data) + { + cairo_font_options_destroy (data->options); + g_slice_free (PangoCairoFontPrivateScaledFontData, data); + } +} + +cairo_scaled_font_t * +_pango_cairo_font_private_get_scaled_font (PangoCairoFontPrivate *cf_priv) +{ + cairo_font_face_t *font_face; + + if (G_LIKELY (cf_priv->scaled_font)) + return cf_priv->scaled_font; + + /* need to create it */ + + if (G_UNLIKELY (cf_priv->data == NULL)) + { + /* we have tried to create and failed before */ + return NULL; + } + + font_face = (* PANGO_CAIRO_FONT_GET_IFACE (cf_priv->cfont)->create_font_face) (cf_priv->cfont); + if (G_UNLIKELY (font_face == NULL)) + goto done; + + cf_priv->scaled_font = cairo_scaled_font_create (font_face, + &cf_priv->data->font_matrix, + &cf_priv->data->ctm, + cf_priv->data->options); + + cairo_font_face_destroy (font_face); + +done: + + if (G_UNLIKELY (cf_priv->scaled_font == NULL || cairo_scaled_font_status (cf_priv->scaled_font) != CAIRO_STATUS_SUCCESS)) + { + cairo_scaled_font_t *scaled_font = cf_priv->scaled_font; + PangoFont *font = PANGO_FONT (cf_priv->cfont); + static GQuark warned_quark = 0; /* MT-safe */ + if (!warned_quark) + warned_quark = g_quark_from_static_string ("pangocairo-scaledfont-warned"); + + if (!g_object_get_qdata (G_OBJECT (font), warned_quark)) + { + PangoFontDescription *desc; + char *s; + + desc = pango_font_describe (font); + s = pango_font_description_to_string (desc); + pango_font_description_free (desc); + + g_warning ("failed to create cairo %s, expect ugly output. the offending font is '%s'", + font_face ? "scaled font" : "font face", + s); + + if (!font_face) + g_warning ("font_face is NULL"); + else + g_warning ("font_face status is: %s", + cairo_status_to_string (cairo_font_face_status (font_face))); + + if (!scaled_font) + g_warning ("scaled_font is NULL"); + else + g_warning ("scaled_font status is: %s", + cairo_status_to_string (cairo_scaled_font_status (scaled_font))); + + g_free (s); + + g_object_set_qdata_full (G_OBJECT (font), warned_quark, + GINT_TO_POINTER (1), NULL); + } + } + + _pango_cairo_font_private_scaled_font_data_destroy (cf_priv->data); + cf_priv->data = NULL; + + return cf_priv->scaled_font; +} + +/** + * pango_cairo_font_get_scaled_font: + * @font: a #PangoFont from a #PangoCairoFontMap + * + * Gets the #cairo_scaled_font_t used by @font. + * The scaled font can be referenced and kept using + * cairo_scaled_font_reference(). + * + * Return value: (nullable): the #cairo_scaled_font_t used by @font, + * or %NULL if @font is %NULL. + * + * Since: 1.18 + **/ +cairo_scaled_font_t * +pango_cairo_font_get_scaled_font (PangoCairoFont *cfont) +{ + PangoCairoFontPrivate *cf_priv; + + if (G_UNLIKELY (!cfont)) + return NULL; + + cf_priv = PANGO_CAIRO_FONT_PRIVATE (cfont); + + return _pango_cairo_font_private_get_scaled_font (cf_priv); +} + +/** + * _pango_cairo_font_install: + * @font: a #PangoCairoFont + * @cr: a #cairo_t + * + * Makes @font the current font for rendering in the specified + * Cairo context. + * + * Return value: %TRUE if font was installed successfully, %FALSE otherwise. + **/ +gboolean +_pango_cairo_font_install (PangoFont *font, + cairo_t *cr) +{ + cairo_scaled_font_t *scaled_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *)font); + + if (G_UNLIKELY (scaled_font == NULL || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS)) + return FALSE; + + cairo_set_scaled_font (cr, scaled_font); + + return TRUE; +} + + +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + +typedef struct _PangoCairoFontMetricsInfo +{ + const char *sample_str; + PangoFontMetrics *metrics; +} PangoCairoFontMetricsInfo; + +PangoFontMetrics * +_pango_cairo_font_get_metrics (PangoFont *font, + PangoLanguage *language) +{ + PangoCairoFont *cfont = (PangoCairoFont *) font; + PangoCairoFontPrivate *cf_priv = PANGO_CAIRO_FONT_PRIVATE (font); + PangoCairoFontMetricsInfo *info = NULL; /* Quiet gcc */ + GSList *tmp_list; + + const char *sample_str = pango_language_get_sample_string (language); + + tmp_list = cf_priv->metrics_by_lang; + while (tmp_list) + { + info = tmp_list->data; + + if (info->sample_str == sample_str) /* We _don't_ need strcmp */ + break; + + tmp_list = tmp_list->next; + } + + if (!tmp_list) + { + PangoFontMap *fontmap; + PangoContext *context; + cairo_font_options_t *font_options; + PangoLayout *layout; + PangoRectangle extents; + PangoFontDescription *desc; + cairo_scaled_font_t *scaled_font; + cairo_matrix_t cairo_matrix; + PangoMatrix pango_matrix; + PangoMatrix identity = PANGO_MATRIX_INIT; + glong sample_str_width; + + int height, shift; + + /* XXX this is racy. need a ref'ing getter... */ + fontmap = pango_font_get_font_map (font); + if (!fontmap) + return pango_font_metrics_new (); + fontmap = g_object_ref (fontmap); + + info = g_slice_new0 (PangoCairoFontMetricsInfo); + + cf_priv->metrics_by_lang = g_slist_prepend (cf_priv->metrics_by_lang, info); + + info->sample_str = sample_str; + + scaled_font = _pango_cairo_font_private_get_scaled_font (cf_priv); + + context = pango_font_map_create_context (fontmap); + pango_context_set_language (context, language); + + font_options = cairo_font_options_create (); + cairo_scaled_font_get_font_options (scaled_font, font_options); + pango_cairo_context_set_font_options (context, font_options); + cairo_font_options_destroy (font_options); + + info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_base_metrics_for_context) (cfont, context); + + /* We now need to adjust the base metrics for ctm */ + cairo_scaled_font_get_ctm (scaled_font, &cairo_matrix); + pango_matrix.xx = cairo_matrix.xx; + pango_matrix.yx = cairo_matrix.yx; + pango_matrix.xy = cairo_matrix.xy; + pango_matrix.yy = cairo_matrix.yy; + pango_matrix.x0 = 0; + pango_matrix.y0 = 0; + if (G_UNLIKELY (0 != memcmp (&identity, &pango_matrix, 4 * sizeof (double)))) + { + double xscale = pango_matrix_get_font_scale_factor (&pango_matrix); + if (xscale) xscale = 1 / xscale; + + info->metrics->ascent *= xscale; + info->metrics->descent *= xscale; + info->metrics->underline_position *= xscale; + info->metrics->underline_thickness *= xscale; + info->metrics->strikethrough_position *= xscale; + info->metrics->strikethrough_thickness *= xscale; + } + + + /* Set the matrix on the context so we don't have to adjust the derived + * metrics. */ + pango_context_set_matrix (context, &pango_matrix); + + /* Update approximate_*_width now */ + layout = pango_layout_new (context); + desc = pango_font_describe_with_absolute_size (font); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, sample_str, -1); + pango_layout_get_extents (layout, NULL, &extents); + + sample_str_width = pango_utf8_strwidth (sample_str); + g_assert (sample_str_width > 0); + info->metrics->approximate_char_width = extents.width / sample_str_width; + + pango_layout_set_text (layout, "0123456789", -1); + info->metrics->approximate_digit_width = max_glyph_width (layout); + + g_object_unref (layout); + + + /* We may actually reuse ascent/descent we got from cairo here. that's + * in cf_priv->font_extents. + */ + height = info->metrics->ascent + info->metrics->descent; + switch (cf_priv->gravity) + { + default: + case PANGO_GRAVITY_AUTO: + case PANGO_GRAVITY_SOUTH: + break; + case PANGO_GRAVITY_NORTH: + info->metrics->ascent = info->metrics->descent; + break; + case PANGO_GRAVITY_EAST: + case PANGO_GRAVITY_WEST: + { + int ascent = height / 2; + if (cf_priv->is_hinted) + ascent = PANGO_UNITS_ROUND (ascent); + info->metrics->ascent = ascent; + } + } + shift = (height - info->metrics->ascent) - info->metrics->descent; + info->metrics->descent += shift; + info->metrics->underline_position -= shift; + info->metrics->strikethrough_position -= shift; + info->metrics->ascent = height - info->metrics->descent; + + g_object_unref (context); + g_object_unref (fontmap); + } + + return pango_font_metrics_ref (info->metrics); +} + +static PangoCairoFontHexBoxInfo * +_pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv) +{ + const char hexdigits[] = "0123456789ABCDEF"; + char c[2] = {0, 0}; + PangoFont *mini_font; + PangoCairoFontHexBoxInfo *hbi; + + /* for metrics hinting */ + double scale_x = 1., scale_x_inv = 1., scale_y = 1., scale_y_inv = 1.; + gboolean is_hinted; + + int i; + int rows; + double pad; + double width = 0; + double height = 0; + cairo_font_options_t *font_options; + cairo_font_extents_t font_extents; + double size, mini_size; + PangoFontDescription *desc; + cairo_scaled_font_t *scaled_font, *scaled_mini_font; + PangoMatrix pango_ctm, pango_font_matrix; + cairo_matrix_t cairo_ctm, cairo_font_matrix; + /*PangoGravity gravity;*/ + + if (!cf_priv) + return NULL; + + if (cf_priv->hbi) + return cf_priv->hbi; + + scaled_font = _pango_cairo_font_private_get_scaled_font (cf_priv); + if (G_UNLIKELY (scaled_font == NULL || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS)) + return NULL; + + is_hinted = cf_priv->is_hinted; + + font_options = cairo_font_options_create (); + desc = pango_font_describe_with_absolute_size ((PangoFont *)cf_priv->cfont); + /*gravity = pango_font_description_get_gravity (desc);*/ + + cairo_scaled_font_get_ctm (scaled_font, &cairo_ctm); + cairo_scaled_font_get_font_matrix (scaled_font, &cairo_font_matrix); + cairo_scaled_font_get_font_options (scaled_font, font_options); + /* I started adding support for vertical hexboxes here, but it's too much + * work. Easier to do with cairo user fonts and vertical writing mode + * support in cairo. + */ + /*cairo_matrix_rotate (&cairo_ctm, pango_gravity_to_rotation (gravity));*/ + pango_ctm.xx = cairo_ctm.xx; + pango_ctm.yx = cairo_ctm.yx; + pango_ctm.xy = cairo_ctm.xy; + pango_ctm.yy = cairo_ctm.yy; + pango_ctm.x0 = cairo_ctm.x0; + pango_ctm.y0 = cairo_ctm.y0; + pango_font_matrix.xx = cairo_font_matrix.xx; + pango_font_matrix.yx = cairo_font_matrix.yx; + pango_font_matrix.xy = cairo_font_matrix.xy; + pango_font_matrix.yy = cairo_font_matrix.yy; + pango_font_matrix.x0 = cairo_font_matrix.x0; + pango_font_matrix.y0 = cairo_font_matrix.y0; + + size = pango_matrix_get_font_scale_factor (&pango_font_matrix) / + pango_matrix_get_font_scale_factor (&pango_ctm); + + if (is_hinted) + { + /* prepare for some hinting */ + double x, y; + + x = 1.; y = 0.; + cairo_matrix_transform_distance (&cairo_ctm, &x, &y); + scale_x = sqrt (x*x + y*y); + scale_x_inv = 1 / scale_x; + + x = 0.; y = 1.; + cairo_matrix_transform_distance (&cairo_ctm, &x, &y); + scale_y = sqrt (x*x + y*y); + scale_y_inv = 1 / scale_y; + } + +/* we hint to the nearest device units */ +#define HINT(value, scale, scale_inv) (ceil ((value-1e-5) * scale) * scale_inv) +#define HINT_X(value) HINT ((value), scale_x, scale_x_inv) +#define HINT_Y(value) HINT ((value), scale_y, scale_y_inv) + + /* create mini_font description */ + { + PangoFontMap *fontmap; + PangoContext *context; + + /* XXX this is racy. need a ref'ing getter... */ + fontmap = pango_font_get_font_map ((PangoFont *)cf_priv->cfont); + if (!fontmap) + return NULL; + fontmap = g_object_ref (fontmap); + + /* we inherit most font properties for the mini font. just + * change family and size. means, you get bold hex digits + * in the hexbox for a bold font. + */ + + /* We should rotate the box, not glyphs */ + pango_font_description_unset_fields (desc, PANGO_FONT_MASK_GRAVITY); + + pango_font_description_set_family_static (desc, "monospace"); + + rows = 2; + mini_size = size / 2.2; + if (is_hinted) + { + mini_size = HINT_Y (mini_size); + + if (mini_size < 6.0) + { + rows = 1; + mini_size = MIN (MAX (size - 1, 0), 6.0); + } + } + + pango_font_description_set_absolute_size (desc, pango_units_from_double (mini_size)); + + /* load mini_font */ + + context = pango_font_map_create_context (fontmap); + + pango_context_set_matrix (context, &pango_ctm); + pango_context_set_language (context, pango_script_get_sample_language (PANGO_SCRIPT_LATIN)); + pango_cairo_context_set_font_options (context, font_options); + mini_font = pango_font_map_load_font (fontmap, context, desc); + + g_object_unref (context); + g_object_unref (fontmap); + } + + pango_font_description_free (desc); + cairo_font_options_destroy (font_options); + + + scaled_mini_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *) mini_font); + if (G_UNLIKELY (scaled_mini_font == NULL || cairo_scaled_font_status (scaled_mini_font) != CAIRO_STATUS_SUCCESS)) + return NULL; + + for (i = 0 ; i < 16 ; i++) + { + cairo_text_extents_t extents; + + c[0] = hexdigits[i]; + cairo_scaled_font_text_extents (scaled_mini_font, c, &extents); + width = MAX (width, extents.width); + height = MAX (height, extents.height); + } + + cairo_scaled_font_extents (scaled_font, &font_extents); + if (font_extents.ascent + font_extents.descent <= 0) + { + font_extents.ascent = PANGO_UNKNOWN_GLYPH_HEIGHT; + font_extents.descent = 0; + } + + pad = (font_extents.ascent + font_extents.descent) / 43; + pad = MIN (pad, mini_size); + + hbi = g_slice_new (PangoCairoFontHexBoxInfo); + hbi->font = (PangoCairoFont *) mini_font; + hbi->rows = rows; + + hbi->digit_width = width; + hbi->digit_height = height; + + hbi->pad_x = pad; + hbi->pad_y = pad; + + if (is_hinted) + { + hbi->digit_width = HINT_X (hbi->digit_width); + hbi->digit_height = HINT_Y (hbi->digit_height); + hbi->pad_x = HINT_X (hbi->pad_x); + hbi->pad_y = HINT_Y (hbi->pad_y); + } + + hbi->line_width = MIN (hbi->pad_x, hbi->pad_y); + + hbi->box_height = 3 * hbi->pad_y + rows * (hbi->pad_y + hbi->digit_height); + + if (rows == 1 || hbi->box_height <= font_extents.ascent) + { + hbi->box_descent = 2 * hbi->pad_y; + } + else if (hbi->box_height <= font_extents.ascent + font_extents.descent - 2 * hbi->pad_y) + { + hbi->box_descent = 2 * hbi->pad_y + hbi->box_height - font_extents.ascent; + } + else + { + hbi->box_descent = font_extents.descent * hbi->box_height / + (font_extents.ascent + font_extents.descent); + } + if (is_hinted) + { + hbi->box_descent = HINT_Y (hbi->box_descent); + } + + cf_priv->hbi = hbi; + return hbi; +} + +static void +_pango_cairo_font_hex_box_info_destroy (PangoCairoFontHexBoxInfo *hbi) +{ + if (hbi) + { + g_object_unref (hbi->font); + g_slice_free (PangoCairoFontHexBoxInfo, hbi); + } +} + +PangoCairoFontHexBoxInfo * +_pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont) +{ + PangoCairoFontPrivate *cf_priv = PANGO_CAIRO_FONT_PRIVATE (cfont); + + return _pango_cairo_font_private_get_hex_box_info (cf_priv); +} + +void +_pango_cairo_font_private_initialize (PangoCairoFontPrivate *cf_priv, + PangoCairoFont *cfont, + PangoGravity gravity, + const cairo_font_options_t *font_options, + const PangoMatrix *pango_ctm, + const cairo_matrix_t *font_matrix) +{ + cairo_matrix_t gravity_matrix; + + cf_priv->cfont = cfont; + cf_priv->gravity = gravity; + + cf_priv->data = _pango_cairo_font_private_scaled_font_data_create (); + + /* first apply gravity rotation, then font_matrix, such that + * vertical italic text comes out "correct". we don't do anything + * like baseline adjustment etc though. should be specially + * handled when we support italic correction. */ + cairo_matrix_init_rotate(&gravity_matrix, + pango_gravity_to_rotation (cf_priv->gravity)); + cairo_matrix_multiply (&cf_priv->data->font_matrix, + font_matrix, + &gravity_matrix); + + if (pango_ctm) + cairo_matrix_init (&cf_priv->data->ctm, + pango_ctm->xx, + pango_ctm->yx, + pango_ctm->xy, + pango_ctm->yy, + 0., 0.); + else + cairo_matrix_init_identity (&cf_priv->data->ctm); + + cf_priv->data->options = cairo_font_options_copy (font_options); + cf_priv->is_hinted = cairo_font_options_get_hint_metrics (font_options) != CAIRO_HINT_METRICS_OFF; + + cf_priv->scaled_font = NULL; + cf_priv->hbi = NULL; + cf_priv->glyph_extents_cache = NULL; + cf_priv->metrics_by_lang = NULL; +} + +static void +free_metrics_info (PangoCairoFontMetricsInfo *info) +{ + pango_font_metrics_unref (info->metrics); + g_slice_free (PangoCairoFontMetricsInfo, info); +} + +void +_pango_cairo_font_private_finalize (PangoCairoFontPrivate *cf_priv) +{ + _pango_cairo_font_private_scaled_font_data_destroy (cf_priv->data); + + if (cf_priv->scaled_font) + cairo_scaled_font_destroy (cf_priv->scaled_font); + cf_priv->scaled_font = NULL; + + _pango_cairo_font_hex_box_info_destroy (cf_priv->hbi); + cf_priv->hbi = NULL; + + if (cf_priv->glyph_extents_cache) + g_free (cf_priv->glyph_extents_cache); + cf_priv->glyph_extents_cache = NULL; + + g_slist_foreach (cf_priv->metrics_by_lang, (GFunc)free_metrics_info, NULL); + g_slist_free (cf_priv->metrics_by_lang); + cf_priv->metrics_by_lang = NULL; +} + +gboolean +_pango_cairo_font_private_is_metrics_hinted (PangoCairoFontPrivate *cf_priv) +{ + return cf_priv->is_hinted; +} + +static void +_pango_cairo_font_private_get_glyph_extents_missing (PangoCairoFontPrivate *cf_priv, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoCairoFontHexBoxInfo *hbi; + gunichar ch; + gint rows, cols; + + hbi = _pango_cairo_font_private_get_hex_box_info (cf_priv); + if (!hbi) + { + pango_font_get_glyph_extents (NULL, glyph, ink_rect, logical_rect); + return; + } + + ch = glyph & ~PANGO_GLYPH_UNKNOWN_FLAG; + + rows = hbi->rows; + if (G_UNLIKELY (glyph == PANGO_GLYPH_INVALID_INPUT || ch > 0x10FFFF)) + cols = 1; + else + cols = ((glyph & ~PANGO_GLYPH_UNKNOWN_FLAG) > 0xffff ? 6 : 4) / rows; + + if (ink_rect) + { + ink_rect->x = PANGO_SCALE * hbi->pad_x; + ink_rect->y = PANGO_SCALE * (hbi->box_descent - hbi->box_height); + ink_rect->width = PANGO_SCALE * (3 * hbi->pad_x + cols * (hbi->digit_width + hbi->pad_x)); + ink_rect->height = PANGO_SCALE * hbi->box_height; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = PANGO_SCALE * (hbi->box_descent - (hbi->box_height + hbi->pad_y)); + logical_rect->width = PANGO_SCALE * (5 * hbi->pad_x + cols * (hbi->digit_width + hbi->pad_x)); + logical_rect->height = PANGO_SCALE * (hbi->box_height + 2 * hbi->pad_y); + } +} + +#define GLYPH_CACHE_NUM_ENTRIES 256 /* should be power of two */ +#define GLYPH_CACHE_MASK (GLYPH_CACHE_NUM_ENTRIES - 1) +/* An entry in the fixed-size cache for the glyph->extents mapping. + * The cache is indexed by the lower N bits of the glyph (see + * GLYPH_CACHE_NUM_ENTRIES). For scripts with few glyphs, + * this should provide pretty much instant lookups. + */ +struct _PangoCairoFontGlyphExtentsCacheEntry +{ + PangoGlyph glyph; + int width; + PangoRectangle ink_rect; +}; + +static gboolean +_pango_cairo_font_private_glyph_extents_cache_init (PangoCairoFontPrivate *cf_priv) +{ + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (cf_priv); + cairo_font_extents_t font_extents; + + if (G_UNLIKELY (scaled_font == NULL || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS)) + return FALSE; + + cairo_scaled_font_extents (scaled_font, &font_extents); + + cf_priv->font_extents.x = 0; + cf_priv->font_extents.width = 0; + cf_priv->font_extents.height = pango_units_from_double (font_extents.ascent + font_extents.descent); + switch (cf_priv->gravity) + { + default: + case PANGO_GRAVITY_AUTO: + case PANGO_GRAVITY_SOUTH: + cf_priv->font_extents.y = - pango_units_from_double (font_extents.ascent); + break; + case PANGO_GRAVITY_NORTH: + cf_priv->font_extents.y = - pango_units_from_double (font_extents.descent); + break; + case PANGO_GRAVITY_EAST: + case PANGO_GRAVITY_WEST: + { + int ascent = pango_units_from_double (font_extents.ascent + font_extents.descent) / 2; + if (cf_priv->is_hinted) + ascent = PANGO_UNITS_ROUND (ascent); + cf_priv->font_extents.y = - ascent; + } + } + + cf_priv->glyph_extents_cache = g_new0 (PangoCairoFontGlyphExtentsCacheEntry, GLYPH_CACHE_NUM_ENTRIES); + /* Make sure all cache entries are invalid initially */ + cf_priv->glyph_extents_cache[0].glyph = 1; /* glyph 1 cannot happen in bucket 0 */ + + return TRUE; +} + +/* Fills in the glyph extents cache entry + */ +static void +compute_glyph_extents (PangoCairoFontPrivate *cf_priv, + PangoGlyph glyph, + PangoCairoFontGlyphExtentsCacheEntry *entry) +{ + cairo_text_extents_t extents; + cairo_glyph_t cairo_glyph; + + cairo_glyph.index = glyph; + cairo_glyph.x = 0; + cairo_glyph.y = 0; + + cairo_scaled_font_glyph_extents (_pango_cairo_font_private_get_scaled_font (cf_priv), + &cairo_glyph, 1, &extents); + + entry->glyph = glyph; + entry->width = pango_units_from_double (extents.x_advance); + entry->ink_rect.x = pango_units_from_double (extents.x_bearing); + entry->ink_rect.y = pango_units_from_double (extents.y_bearing); + entry->ink_rect.width = pango_units_from_double (extents.width); + entry->ink_rect.height = pango_units_from_double (extents.height); +} + +static PangoCairoFontGlyphExtentsCacheEntry * +_pango_cairo_font_private_get_glyph_extents_cache_entry (PangoCairoFontPrivate *cf_priv, + PangoGlyph glyph) +{ + PangoCairoFontGlyphExtentsCacheEntry *entry; + guint idx; + + idx = glyph & GLYPH_CACHE_MASK; + entry = cf_priv->glyph_extents_cache + idx; + + if (entry->glyph != glyph) + { + compute_glyph_extents (cf_priv, glyph, entry); + } + + return entry; +} + +void +_pango_cairo_font_private_get_glyph_extents (PangoCairoFontPrivate *cf_priv, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoCairoFontGlyphExtentsCacheEntry *entry; + + if (!cf_priv || + (cf_priv->glyph_extents_cache == NULL && + !_pango_cairo_font_private_glyph_extents_cache_init (cf_priv))) + { + /* Get generic unknown-glyph extents. */ + pango_font_get_glyph_extents (NULL, glyph, ink_rect, logical_rect); + return; + } + + if (glyph == PANGO_GLYPH_EMPTY) + { + if (ink_rect) + ink_rect->x = ink_rect->y = ink_rect->width = ink_rect->height = 0; + if (logical_rect) + *logical_rect = cf_priv->font_extents; + return; + } + else if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + _pango_cairo_font_private_get_glyph_extents_missing(cf_priv, glyph, ink_rect, logical_rect); + return; + } + + entry = _pango_cairo_font_private_get_glyph_extents_cache_entry (cf_priv, glyph); + + if (ink_rect) + *ink_rect = entry->ink_rect; + if (logical_rect) + { + *logical_rect = cf_priv->font_extents; + logical_rect->width = entry->width; + } +} diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c new file mode 100644 index 0000000..177dbbc --- /dev/null +++ b/pango/pangocairo-fontmap.c @@ -0,0 +1,306 @@ +/* Pango + * pangocairo-fontmap.c: Cairo font handling + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pango-impl-utils.h" + +#if defined (HAVE_CORE_TEXT) && defined (HAVE_CAIRO_QUARTZ) +# include "pangocairo-coretext.h" +#endif +#if defined (HAVE_CAIRO_WIN32) +# include "pangocairo-win32.h" +#endif +#if defined (HAVE_CAIRO_FREETYPE) +# include "pangocairo-fc.h" +#endif + + +typedef PangoCairoFontMapIface PangoCairoFontMapInterface; +G_DEFINE_INTERFACE (PangoCairoFontMap, pango_cairo_font_map, PANGO_TYPE_FONT_MAP) + +static void +pango_cairo_font_map_default_init (PangoCairoFontMapIface *iface) +{ +} + +/** + * pango_cairo_font_map_new: + * + * Creates a new #PangoCairoFontMap object; a fontmap is used + * to cache information about available fonts, and holds + * certain global parameters such as the resolution. + * In most cases, you can use pango_cairo_font_map_get_default() + * instead. + * + * Note that the type of the returned object will depend + * on the particular font backend Cairo was compiled to use; + * You generally should only use the #PangoFontMap and + * #PangoCairoFontMap interfaces on the returned object. + * + * You can override the type of backend returned by using an + * environment variable %PANGOCAIRO_BACKEND. Supported types, + * based on your build, are fc (fontconfig), win32, and coretext. + * If requested type is not available, NULL is returned. Ie. + * this is only useful for testing, when at least two backends + * are compiled in. + * + * Return value: (transfer full): the newly allocated #PangoFontMap, + * which should be freed with g_object_unref(). + * + * Since: 1.10 + **/ +PangoFontMap * +pango_cairo_font_map_new (void) +{ + const char *backend = getenv ("PANGOCAIRO_BACKEND"); + if (backend && !*backend) + backend = NULL; +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* Make sure that the type system is initialized */ + g_type_init (); +#endif +#if defined(HAVE_CORE_TEXT) && defined (HAVE_CAIRO_QUARTZ) + if (!backend || 0 == strcmp (backend, "coretext")) + return g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP, NULL); +#endif +#if defined(HAVE_CAIRO_WIN32) + if (!backend || 0 == strcmp (backend, "win32")) + return g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT_MAP, NULL); +#endif +#if defined(HAVE_CAIRO_FREETYPE) + if (!backend || 0 == strcmp (backend, "fc") + || 0 == strcmp (backend, "fontconfig")) + return g_object_new (PANGO_TYPE_CAIRO_FC_FONT_MAP, NULL); +#endif + { + const char backends[] = "" +#if defined(HAVE_CORE_TEXT) && defined (HAVE_CAIRO_QUARTZ) + " coretext" +#endif +#if defined(HAVE_CAIRO_WIN32) + " win32" +#endif +#if defined(HAVE_CAIRO_FREETYPE) + " fontconfig" +#endif + ; + g_error ("Unknown $PANGOCAIRO_BACKEND value.\n Available backends are:%s", backends); + } + return NULL; +} + +/** + * pango_cairo_font_map_new_for_font_type: + * @fonttype: desired #cairo_font_type_t + * + * Creates a new #PangoCairoFontMap object of the type suitable + * to be used with cairo font backend of type @fonttype. + * + * In most cases one should simply use @pango_cairo_font_map_new(), + * or in fact in most of those cases, just use + * @pango_cairo_font_map_get_default(). + * + * Return value: (transfer full) (nullable): the newly allocated + * #PangoFontMap of suitable type which should be freed + * with g_object_unref(), or %NULL if the requested + * cairo font backend is not supported / compiled in. + * + * Since: 1.18 + **/ +PangoFontMap * +pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype) +{ +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* Make sure that the type system is initialized */ + g_type_init (); +#endif + switch ((int) fonttype) + { +#if defined(HAVE_CORE_TEXT) && defined (HAVE_CAIRO_QUARTZ) + case CAIRO_FONT_TYPE_QUARTZ: + return g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP, NULL); +#endif +#if defined(HAVE_CAIRO_WIN32) + case CAIRO_FONT_TYPE_WIN32: + return g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT_MAP, NULL); +#endif +#if defined(HAVE_CAIRO_FREETYPE) + case CAIRO_FONT_TYPE_FT: + return g_object_new (PANGO_TYPE_CAIRO_FC_FONT_MAP, NULL); +#endif + default: + return NULL; + } +} + +static GPrivate default_font_map = G_PRIVATE_INIT (g_object_unref); /* MT-safe */ + +/** + * pango_cairo_font_map_get_default: + * + * Gets a default #PangoCairoFontMap to use with Cairo. + * + * Note that the type of the returned object will depend + * on the particular font backend Cairo was compiled to use; + * You generally should only use the #PangoFontMap and + * #PangoCairoFontMap interfaces on the returned object. + * + * The default Cairo fontmap can be changed by using + * pango_cairo_font_map_set_default(). This can be used to + * change the Cairo font backend that the default fontmap + * uses for example. + * + * Note that since Pango 1.32.6, the default fontmap is per-thread. + * Each thread gets its own default fontmap. In this way, + * PangoCairo can be used safely from multiple threads. + * + * Return value: (transfer none): the default PangoCairo fontmap + * for the current thread. This object is owned by Pango and must not be freed. + * + * Since: 1.10 + **/ +PangoFontMap * +pango_cairo_font_map_get_default (void) +{ + PangoFontMap *fontmap = g_private_get (&default_font_map); + + if (G_UNLIKELY (!fontmap)) + { + fontmap = pango_cairo_font_map_new (); + g_private_replace (&default_font_map, fontmap); + } + + return fontmap; +} + +/** + * pango_cairo_font_map_set_default: + * @fontmap: (nullable): The new default font map, or %NULL + * + * Sets a default #PangoCairoFontMap to use with Cairo. + * + * This can be used to change the Cairo font backend that the + * default fontmap uses for example. The old default font map + * is unreffed and the new font map referenced. + * + * Note that since Pango 1.32.6, the default fontmap is per-thread. + * This function only changes the default fontmap for + * the current thread. Default fontmaps of exisiting threads + * are not changed. Default fontmaps of any new threads will + * still be created using pango_cairo_font_map_new(). + * + * A value of %NULL for @fontmap will cause the current default + * font map to be released and a new default font + * map to be created on demand, using pango_cairo_font_map_new(). + * + * Since: 1.22 + **/ +void +pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap) +{ + g_return_if_fail (fontmap == NULL || PANGO_IS_CAIRO_FONT_MAP (fontmap)); + + if (fontmap) + g_object_ref (fontmap); + + g_private_replace (&default_font_map, fontmap); +} + +/** + * pango_cairo_font_map_set_resolution: + * @fontmap: a #PangoCairoFontMap + * @dpi: the resolution in "dots per inch". (Physical inches aren't actually + * involved; the terminology is conventional.) + * + * Sets the resolution for the fontmap. This is a scale factor between + * points specified in a #PangoFontDescription and Cairo units. The + * default value is 96, meaning that a 10 point font will be 13 + * units high. (10 * 96. / 72. = 13.3). + * + * Since: 1.10 + **/ +void +pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap, + double dpi) +{ + g_return_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap)); + + (* PANGO_CAIRO_FONT_MAP_GET_IFACE (fontmap)->set_resolution) (fontmap, dpi); +} + +/** + * pango_cairo_font_map_get_resolution: + * @fontmap: a #PangoCairoFontMap + * + * Gets the resolution for the fontmap. See pango_cairo_font_map_set_resolution() + * + * Return value: the resolution in "dots per inch" + * + * Since: 1.10 + **/ +double +pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap), 96.); + + return (* PANGO_CAIRO_FONT_MAP_GET_IFACE (fontmap)->get_resolution) (fontmap); +} + +/** + * pango_cairo_font_map_create_context: (skip) + * @fontmap: a #PangoCairoFontMap + * + * Create a #PangoContext for the given fontmap. + * + * Return value: the newly created context; free with g_object_unref(). + * + * Since: 1.10 + * + * Deprecated: 1.22: Use pango_font_map_create_context() instead. + **/ +PangoContext * +pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap), NULL); + + return pango_font_map_create_context (PANGO_FONT_MAP (fontmap)); +} + +/** + * pango_cairo_font_map_get_font_type: + * @fontmap: a #PangoCairoFontMap + * + * Gets the type of Cairo font backend that @fontmap uses. + * + * Return value: the #cairo_font_type_t cairo font backend type + * + * Since: 1.18 + **/ +cairo_font_type_t +pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap) +{ + g_return_val_if_fail (PANGO_IS_CAIRO_FONT_MAP (fontmap), CAIRO_FONT_TYPE_TOY); + + return (* PANGO_CAIRO_FONT_MAP_GET_IFACE (fontmap)->get_font_type) (fontmap); +} diff --git a/pango/pangocairo-private.h b/pango/pangocairo-private.h new file mode 100644 index 0000000..704ae49 --- /dev/null +++ b/pango/pangocairo-private.h @@ -0,0 +1,139 @@ +/* Pango + * pangocairo-private.h: private symbols for the Cairo backend + * + * Copyright (C) 2000,2004 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_PRIVATE_H__ +#define __PANGOCAIRO_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + + +#define PANGO_CAIRO_FONT_MAP_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PANGO_TYPE_CAIRO_FONT_MAP, PangoCairoFontMapIface)) + +typedef struct _PangoCairoFontMapIface PangoCairoFontMapIface; + +struct _PangoCairoFontMapIface +{ + GTypeInterface g_iface; + + void (*set_resolution) (PangoCairoFontMap *fontmap, + double dpi); + double (*get_resolution) (PangoCairoFontMap *fontmap); + + cairo_font_type_t (*get_font_type) (PangoCairoFontMap *fontmap); +}; + + +#define PANGO_CAIRO_FONT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PANGO_TYPE_CAIRO_FONT, PangoCairoFontIface)) + +typedef struct _PangoCairoFontIface PangoCairoFontIface; +typedef struct _PangoCairoFontPrivate PangoCairoFontPrivate; +typedef struct _PangoCairoFontHexBoxInfo PangoCairoFontHexBoxInfo; +typedef struct _PangoCairoFontPrivateScaledFontData PangoCairoFontPrivateScaledFontData; +typedef struct _PangoCairoFontGlyphExtentsCacheEntry PangoCairoFontGlyphExtentsCacheEntry; + +struct _PangoCairoFontHexBoxInfo +{ + PangoCairoFont *font; + int rows; + double digit_width; + double digit_height; + double pad_x; + double pad_y; + double line_width; + double box_descent; + double box_height; +}; + +struct _PangoCairoFontPrivateScaledFontData +{ + cairo_matrix_t font_matrix; + cairo_matrix_t ctm; + cairo_font_options_t *options; +}; + +struct _PangoCairoFontPrivate +{ + PangoCairoFont *cfont; + + PangoCairoFontPrivateScaledFontData *data; + + cairo_scaled_font_t *scaled_font; + PangoCairoFontHexBoxInfo *hbi; + + gboolean is_hinted; + PangoGravity gravity; + + PangoRectangle font_extents; + PangoCairoFontGlyphExtentsCacheEntry *glyph_extents_cache; + + GSList *metrics_by_lang; +}; + +struct _PangoCairoFontIface +{ + GTypeInterface g_iface; + + cairo_font_face_t *(*create_font_face) (PangoCairoFont *cfont); + PangoFontMetrics *(*create_base_metrics_for_context) (PangoCairoFont *cfont, + PangoContext *context); + + gssize cf_priv_offset; +}; + +gboolean _pango_cairo_font_install (PangoFont *font, + cairo_t *cr); +PangoFontMetrics * _pango_cairo_font_get_metrics (PangoFont *font, + PangoLanguage *language); +PangoCairoFontHexBoxInfo *_pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont); + +void _pango_cairo_font_private_initialize (PangoCairoFontPrivate *cf_priv, + PangoCairoFont *font, + PangoGravity gravity, + const cairo_font_options_t *font_options, + const PangoMatrix *pango_ctm, + const cairo_matrix_t *font_matrix); +void _pango_cairo_font_private_finalize (PangoCairoFontPrivate *cf_priv); +cairo_scaled_font_t *_pango_cairo_font_private_get_scaled_font (PangoCairoFontPrivate *cf_priv); +gboolean _pango_cairo_font_private_is_metrics_hinted (PangoCairoFontPrivate *cf_priv); +void _pango_cairo_font_private_get_glyph_extents (PangoCairoFontPrivate *cf_priv, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +#define PANGO_TYPE_CAIRO_RENDERER (pango_cairo_renderer_get_type()) +#define PANGO_CAIRO_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_RENDERER, PangoCairoRenderer)) +#define PANGO_IS_CAIRO_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_RENDERER)) + +typedef struct _PangoCairoRenderer PangoCairoRenderer; + +_PANGO_EXTERN +GType pango_cairo_renderer_get_type (void) G_GNUC_CONST; + + +const cairo_font_options_t *_pango_cairo_context_get_merged_font_options (PangoContext *context); + + +G_END_DECLS + +#endif /* __PANGOCAIRO_PRIVATE_H__ */ diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c new file mode 100644 index 0000000..b39b815 --- /dev/null +++ b/pango/pangocairo-render.c @@ -0,0 +1,1293 @@ +/* Pango + * pangocairo-render.c: Rendering routines to Cairo surfaces + * + * Copyright (C) 2004 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pangocairo + * @short_description:Rendering with the Cairo backend + * @title:Cairo Rendering + * + * The Cairo library is a + * vector graphics library with a powerful rendering model. It has such + * features as anti-aliased primitives, alpha-compositing, and + * gradients. Multiple backends for Cairo are available, to allow + * rendering to images, to PDF files, and to the screen on X and on other + * windowing systems. The functions in this section allow using Pango + * to render to Cairo surfaces. + * + * Using Pango with Cairo is straightforward. A #PangoContext created + * with pango_cairo_font_map_create_context() can be used on any + * Cairo context (cairo_t), but needs to be updated to match the + * current transformation matrix and target surface of the Cairo context + * using pango_cairo_update_context(). The convenience functions + * pango_cairo_create_layout() and pango_cairo_update_layout() handle + * the common case where the program doesn't need to manipulate the + * properties of the #PangoContext. + * + * When you get the metrics of a layout or of a piece of a layout using + * functions such as pango_layout_get_extents(), the reported metrics + * are in user-space coordinates. If a piece of text is 10 units long, + * and you call cairo_scale (cr, 2.0), it still is more-or-less 10 + * units long. However, the results will be affected by hinting + * (that is, the process of adjusting the text to look good on the + * pixel grid), so you shouldn't assume they are completely independent + * of the current transformation matrix. Note that the basic metrics + * functions in Pango report results in integer Pango units. To get + * to the floating point units used in Cairo divide by %PANGO_SCALE. + * + * ## Using Pango with Cairo ## {#rotated-example} + * + * |[ + * #include + * #include + * + * static void + * draw_text (cairo_t *cr) + * { + * #define RADIUS 150 + * #define N_WORDS 10 + * #define FONT "Sans Bold 27" + * + * PangoLayout *layout; + * PangoFontDescription *desc; + * int i; + * + * /* Center coordinates on the middle of the region we are drawing + * */ + * cairo_translate (cr, RADIUS, RADIUS); + * + * /* Create a PangoLayout, set the font and text */ + * layout = pango_cairo_create_layout (cr); + * + * pango_layout_set_text (layout, "Text", -1); + * desc = pango_font_description_from_string (FONT); + * pango_layout_set_font_description (layout, desc); + * pango_font_description_free (desc); + * + * /* Draw the layout N_WORDS times in a circle */ + * for (i = 0; i < N_WORDS; i++) + * { + * int width, height; + * double angle = (360. * i) / N_WORDS; + * double red; + * + * cairo_save (cr); + * + * /* Gradient from red at angle == 60 to blue at angle == 240 */ + * red = (1 + cos ((angle - 60) * G_PI / 180.)) / 2; + * cairo_set_source_rgb (cr, red, 0, 1.0 - red); + * + * cairo_rotate (cr, angle * G_PI / 180.); + * + * /* Inform Pango to re-layout the text with the new transformation */ + * pango_cairo_update_layout (cr, layout); + * + * pango_layout_get_size (layout, &width, &height); + * cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS); + * pango_cairo_show_layout (cr, layout); + * + * cairo_restore (cr); + * } + * + * /* free the layout object */ + * g_object_unref (layout); + * } + * + * int main (int argc, char **argv) + * { + * cairo_t *cr; + * char *filename; + * cairo_status_t status; + * cairo_surface_t *surface; + * + * if (argc != 2) + * { + * g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n"); + * return 1; + * } + * + * filename = argv[1]; + * + * surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + * 2 * RADIUS, 2 * RADIUS); + * cr = cairo_create (surface); + * + * cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + * cairo_paint (cr); + * draw_text (cr); + * cairo_destroy (cr); + * + * status = cairo_surface_write_to_png (surface, filename); + * cairo_surface_destroy (surface); + * + * if (status != CAIRO_STATUS_SUCCESS) + * { + * g_printerr ("Could not save png to '%s'\n", filename); + * return 1; + * } + * + * return 0; + * } + * ]| + * + * Once you build and run the example code above, you should see the + * following result: + * + * ![Output of rotated-example](rotated-text.png) + */ +#include "config.h" + +#include + +#include "pangocairo-private.h" +#include "pango-glyph-item.h" + +typedef struct _PangoCairoRendererClass PangoCairoRendererClass; + +#define PANGO_CAIRO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_RENDERER, PangoCairoRendererClass)) +#define PANGO_IS_CAIRO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CAIRO_RENDERER)) +#define PANGO_CAIRO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CAIRO_RENDERER, PangoCairoRendererClass)) + +struct _PangoCairoRenderer +{ + PangoRenderer parent_instance; + + cairo_t *cr; + gboolean do_path; + gboolean has_show_text_glyphs; + double x_offset, y_offset; + + /* house-keeping options */ + gboolean is_cached_renderer; + gboolean cr_had_current_point; +}; + +struct _PangoCairoRendererClass +{ + PangoRendererClass parent_class; +}; + +G_DEFINE_TYPE (PangoCairoRenderer, pango_cairo_renderer, PANGO_TYPE_RENDERER) + +static void +set_color (PangoCairoRenderer *crenderer, + PangoRenderPart part) +{ + PangoColor *color = pango_renderer_get_color ((PangoRenderer *) (crenderer), part); + guint16 a = pango_renderer_get_alpha ((PangoRenderer *) (crenderer), part); + gdouble red, green, blue, alpha; + + if (!a && !color) + return; + + if (color) + { + red = color->red / 65535.; + green = color->green / 65535.; + blue = color->blue / 65535.; + alpha = 1.; + } + else + { + cairo_pattern_t *pattern = cairo_get_source (crenderer->cr); + + if (pattern && cairo_pattern_get_type (pattern) == CAIRO_PATTERN_TYPE_SOLID) + cairo_pattern_get_rgba (pattern, &red, &green, &blue, &alpha); + else + { + red = 0.; + green = 0.; + blue = 0.; + alpha = 1.; + } + } + + if (a) + alpha = a / 65535.; + + cairo_set_source_rgba (crenderer->cr, red, green, blue, alpha); +} + +/* note: modifies crenderer->cr without doing cairo_save/restore() */ +static void +_pango_cairo_renderer_draw_frame (PangoCairoRenderer *crenderer, + double x, + double y, + double width, + double height, + double line_width, + gboolean invalid) +{ + cairo_t *cr = crenderer->cr; + + if (crenderer->do_path) + { + double d2 = line_width * .5, d = line_width; + + /* we draw an outer box in one winding direction and an inner one in the + * opposite direction. This works for both cairo windings rules. + * + * what we really want is cairo_stroke_to_path(), but that's not + * implemented in cairo yet. + */ + + /* outer */ + cairo_rectangle (cr, x-d2, y-d2, width+d, height+d); + + /* inner */ + if (invalid) + { + /* delicacies of computing the joint... this is REALLY slow */ + + double alpha, tan_alpha2, cos_alpha; + double sx, sy; + + alpha = atan2 (height, width); + + tan_alpha2 = tan (alpha * .5); + if (tan_alpha2 < 1e-5 || (sx = d2 / tan_alpha2, 2. * sx > width - d)) + sx = (width - d) * .5; + + cos_alpha = cos (alpha); + if (cos_alpha < 1e-5 || (sy = d2 / cos_alpha, 2. * sy > height - d)) + sy = (height - d) * .5; + + /* top triangle */ + cairo_new_sub_path (cr); + cairo_line_to (cr, x+width-sx, y+d2); + cairo_line_to (cr, x+sx, y+d2); + cairo_line_to (cr, x+.5*width, y+.5*height-sy); + cairo_close_path (cr); + + /* bottom triangle */ + cairo_new_sub_path (cr); + cairo_line_to (cr, x+width-sx, y+height-d2); + cairo_line_to (cr, x+.5*width, y+.5*height+sy); + cairo_line_to (cr, x+sx, y+height-d2); + cairo_close_path (cr); + + + alpha = G_PI_2 - alpha; + tan_alpha2 = tan (alpha * .5); + if (tan_alpha2 < 1e-5 || (sy = d2 / tan_alpha2, 2. * sy > height - d)) + sy = (height - d) * .5; + + cos_alpha = cos (alpha); + if (cos_alpha < 1e-5 || (sx = d2 / cos_alpha, 2. * sx > width - d)) + sx = (width - d) * .5; + + /* left triangle */ + cairo_new_sub_path (cr); + cairo_line_to (cr, x+d2, y+sy); + cairo_line_to (cr, x+d2, y+height-sy); + cairo_line_to (cr, x+.5*width-sx, y+.5*height); + cairo_close_path (cr); + + /* right triangle */ + cairo_new_sub_path (cr); + cairo_line_to (cr, x+width-d2, y+sy); + cairo_line_to (cr, x+.5*width+sx, y+.5*height); + cairo_line_to (cr, x+width-d2, y+height-sy); + cairo_close_path (cr); + } + else + cairo_rectangle (cr, x+width-d2, y+d2, - (width-d), height-d); + } + else + { + cairo_rectangle (cr, x, y, width, height); + + if (invalid) + { + /* draw an X */ + + cairo_new_sub_path (cr); + cairo_move_to (cr, x, y); + cairo_rel_line_to (cr, width, height); + + cairo_new_sub_path (cr); + cairo_move_to (cr, x + width, y); + cairo_rel_line_to (cr, -width, height); + + cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); + } + + cairo_set_line_width (cr, line_width); + cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); + cairo_set_miter_limit (cr, 2.); + cairo_stroke (cr); + } +} + +static void +_pango_cairo_renderer_draw_box_glyph (PangoCairoRenderer *crenderer, + PangoGlyphInfo *gi, + double cx, + double cy, + gboolean invalid) +{ + cairo_save (crenderer->cr); + + _pango_cairo_renderer_draw_frame (crenderer, + cx + 1.5, + cy + 1.5 - PANGO_UNKNOWN_GLYPH_HEIGHT, + (double)gi->geometry.width / PANGO_SCALE - 3.0, + PANGO_UNKNOWN_GLYPH_HEIGHT - 3.0, + 1.0, + invalid); + + cairo_restore (crenderer->cr); +} + +static void +_pango_cairo_renderer_draw_unknown_glyph (PangoCairoRenderer *crenderer, + PangoFont *font, + PangoGlyphInfo *gi, + double cx, + double cy) +{ + char buf[7]; + double x0, y0; + int row, col; + int rows, cols; + double width, lsb; + char hexbox_string[2] = {0, 0}; + PangoCairoFontHexBoxInfo *hbi; + gunichar ch; + gboolean invalid_input; + + cairo_save (crenderer->cr); + + ch = gi->glyph & ~PANGO_GLYPH_UNKNOWN_FLAG; + invalid_input = G_UNLIKELY (gi->glyph == PANGO_GLYPH_INVALID_INPUT || ch > 0x10FFFF); + + hbi = _pango_cairo_font_get_hex_box_info ((PangoCairoFont *)font); + if (!hbi || !_pango_cairo_font_install ((PangoFont *)(hbi->font), crenderer->cr)) + { + _pango_cairo_renderer_draw_box_glyph (crenderer, gi, cx, cy, invalid_input); + goto done; + } + + rows = hbi->rows; + if (G_UNLIKELY (invalid_input)) + { + cols = 1; + } + else + { + cols = (ch > 0xffff ? 6 : 4) / rows; + g_snprintf (buf, sizeof(buf), (ch > 0xffff) ? "%06X" : "%04X", ch); + } + + width = (3 * hbi->pad_x + cols * (hbi->digit_width + hbi->pad_x)); + lsb = ((double)gi->geometry.width / PANGO_SCALE - width) * .5; + lsb = floor (lsb / hbi->pad_x) * hbi->pad_x; + + _pango_cairo_renderer_draw_frame (crenderer, + cx + lsb + .5 * hbi->pad_x, + cy + hbi->box_descent - hbi->box_height + hbi->pad_y * 0.5, + width - hbi->pad_x, + (hbi->box_height - hbi->pad_y), + hbi->line_width, + invalid_input); + + if (invalid_input) + goto done; + + x0 = cx + lsb + hbi->pad_x * 2; + y0 = cy + hbi->box_descent - hbi->pad_y * 2; + + for (row = 0; row < rows; row++) + { + double y = y0 - (rows - 1 - row) * (hbi->digit_height + hbi->pad_y); + for (col = 0; col < cols; col++) + { + double x = x0 + col * (hbi->digit_width + hbi->pad_x); + + cairo_move_to (crenderer->cr, x, y); + + hexbox_string[0] = buf[row * cols + col]; + + if (crenderer->do_path) + cairo_text_path (crenderer->cr, hexbox_string); + else + cairo_show_text (crenderer->cr, hexbox_string); + } + } + +done: + cairo_restore (crenderer->cr); +} + +#ifndef STACK_BUFFER_SIZE +#define STACK_BUFFER_SIZE (512 * sizeof (int)) +#endif + +#define STACK_ARRAY_LENGTH(T) (STACK_BUFFER_SIZE / sizeof(T)) + +static void +pango_cairo_renderer_show_text_glyphs (PangoRenderer *renderer, + const char *text, + int text_len, + PangoGlyphString *glyphs, + cairo_text_cluster_t *clusters, + int num_clusters, + gboolean backward, + PangoFont *font, + int x, + int y) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + + int i, count; + int x_position = 0; + cairo_glyph_t *cairo_glyphs; + cairo_glyph_t stack_glyphs[STACK_ARRAY_LENGTH (cairo_glyph_t)]; + double base_x = crenderer->x_offset + (double)x / PANGO_SCALE; + double base_y = crenderer->y_offset + (double)y / PANGO_SCALE; + + cairo_save (crenderer->cr); + if (!crenderer->do_path) + set_color (crenderer, PANGO_RENDER_PART_FOREGROUND); + + if (!_pango_cairo_font_install (font, crenderer->cr)) + { + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + if (gi->glyph != PANGO_GLYPH_EMPTY) + { + double cx = base_x + (double)(x_position + gi->geometry.x_offset) / PANGO_SCALE; + double cy = gi->geometry.y_offset == 0 ? + base_y : + base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE; + + _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy); + } + x_position += gi->geometry.width; + } + + goto done; + } + + if (glyphs->num_glyphs > (int) G_N_ELEMENTS (stack_glyphs)) + cairo_glyphs = g_new (cairo_glyph_t, glyphs->num_glyphs); + else + cairo_glyphs = stack_glyphs; + + count = 0; + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + if (gi->glyph != PANGO_GLYPH_EMPTY) + { + double cx = base_x + (double)(x_position + gi->geometry.x_offset) / PANGO_SCALE; + double cy = gi->geometry.y_offset == 0 ? + base_y : + base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE; + + if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) + _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy); + else + { + cairo_glyphs[count].index = gi->glyph; + cairo_glyphs[count].x = cx; + cairo_glyphs[count].y = cy; + count++; + } + } + x_position += gi->geometry.width; + } + + if (G_UNLIKELY (crenderer->do_path)) + cairo_glyph_path (crenderer->cr, cairo_glyphs, count); + else + if (G_UNLIKELY (clusters)) + cairo_show_text_glyphs (crenderer->cr, + text, text_len, + cairo_glyphs, count, + clusters, num_clusters, + backward ? CAIRO_TEXT_CLUSTER_FLAG_BACKWARD : 0); + else + cairo_show_glyphs (crenderer->cr, cairo_glyphs, count); + + if (cairo_glyphs != stack_glyphs) + g_free (cairo_glyphs); + +done: + cairo_restore (crenderer->cr); +} + +static void +pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + pango_cairo_renderer_show_text_glyphs (renderer, + NULL, 0, + glyphs, + NULL, 0, + FALSE, + font, + x, y); +} + +static void +pango_cairo_renderer_draw_glyph_item (PangoRenderer *renderer, + const char *text, + PangoGlyphItem *glyph_item, + int x, + int y) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + PangoFont *font = glyph_item->item->analysis.font; + PangoGlyphString *glyphs = glyph_item->glyphs; + PangoItem *item = glyph_item->item; + gboolean backward = (item->analysis.level & 1) != 0; + + PangoGlyphItemIter iter; + cairo_text_cluster_t *cairo_clusters; + cairo_text_cluster_t stack_clusters[STACK_ARRAY_LENGTH (cairo_text_cluster_t)]; + int num_clusters; + + if (!crenderer->has_show_text_glyphs || crenderer->do_path) + { + pango_cairo_renderer_show_text_glyphs (renderer, + NULL, 0, + glyphs, + NULL, 0, + FALSE, + font, + x, y); + return; + } + + if (glyphs->num_glyphs > (int) G_N_ELEMENTS (stack_clusters)) + cairo_clusters = g_new (cairo_text_cluster_t, glyphs->num_glyphs); + else + cairo_clusters = stack_clusters; + + num_clusters = 0; + if (pango_glyph_item_iter_init_start (&iter, glyph_item, text)) + { + do { + int num_bytes, num_glyphs, i; + + num_bytes = iter.end_index - iter.start_index; + num_glyphs = backward ? iter.start_glyph - iter.end_glyph : iter.end_glyph - iter.start_glyph; + + if (num_bytes < 1) + g_warning ("pango_cairo_renderer_draw_glyph_item: bad cluster has num_bytes %d", num_bytes); + if (num_glyphs < 1) + g_warning ("pango_cairo_renderer_draw_glyph_item: bad cluster has num_glyphs %d", num_glyphs); + + /* Discount empty and unknown glyphs */ + for (i = MIN (iter.start_glyph, iter.end_glyph+1); + i < MAX (iter.start_glyph+1, iter.end_glyph); + i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + if (gi->glyph == PANGO_GLYPH_EMPTY || + gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) + num_glyphs--; + } + + cairo_clusters[num_clusters].num_bytes = num_bytes; + cairo_clusters[num_clusters].num_glyphs = num_glyphs; + num_clusters++; + } while (pango_glyph_item_iter_next_cluster (&iter)); + } + + pango_cairo_renderer_show_text_glyphs (renderer, + text + item->offset, item->length, + glyphs, + cairo_clusters, num_clusters, + backward, + font, + x, y); + + if (cairo_clusters != stack_clusters) + g_free (cairo_clusters); +} + +static void +pango_cairo_renderer_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + + if (!crenderer->do_path) + { + cairo_save (crenderer->cr); + + set_color (crenderer, part); + } + + cairo_rectangle (crenderer->cr, + crenderer->x_offset + (double)x / PANGO_SCALE, + crenderer->y_offset + (double)y / PANGO_SCALE, + (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); + + if (!crenderer->do_path) + { + cairo_fill (crenderer->cr); + + cairo_restore (crenderer->cr); + } +} + +static void +pango_cairo_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1_, + double x11, + double x21, + double y2, + double x12, + double x22) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + cairo_t *cr; + double x, y; + + cr = crenderer->cr; + + cairo_save (cr); + + if (!crenderer->do_path) + set_color (crenderer, part); + + x = crenderer->x_offset, + y = crenderer->y_offset; + cairo_user_to_device_distance (cr, &x, &y); + cairo_identity_matrix (cr); + cairo_translate (cr, x, y); + + cairo_move_to (cr, x11, y1_); + cairo_line_to (cr, x21, y1_); + cairo_line_to (cr, x22, y2); + cairo_line_to (cr, x12, y2); + cairo_close_path (cr); + + if (!crenderer->do_path) + cairo_fill (cr); + + cairo_restore (cr); +} + +/* Draws an error underline that looks like one of: + * H E H + * /\ /\ /\ /\ /\ - + * A/ \ / \ / \ A/ \ / \ | + * \ \ / \ / /D \ \ / \ | + * \ \/ C \/ / \ \/ C \ | height = HEIGHT_SQUARES * square + * \ /\ F / \ F /\ \ | + * \ / \ / \ / \ \G | + * \ / \ / \ / \ / | + * \/ \/ \/ \/ - + * B B + * |---| + * unit_width = (HEIGHT_SQUARES - 1) * square + * + * The x, y, width, height passed in give the desired bounding box; + * x/width are adjusted to make the underline a integer number of units + * wide. + */ +#define HEIGHT_SQUARES 2.5 + +static void +draw_error_underline (cairo_t *cr, + double x, + double y, + double width, + double height) +{ + double square = height / HEIGHT_SQUARES; + double unit_width = (HEIGHT_SQUARES - 1) * square; + double double_width = 2 * unit_width; + int width_units = (width + unit_width / 2) / unit_width; + double y_top, y_bottom; + double x_left, x_middle, x_right; + int i; + + x += (width - width_units * unit_width) / 2; + + y_top = y; + y_bottom = y + height; + + /* Bottom of squiggle */ + x_middle = x + unit_width; + x_right = x + double_width; + cairo_move_to (cr, x - square / 2, y_top + square / 2); /* A */ + for (i = 0; i < width_units-2; i += 2) + { + cairo_line_to (cr, x_middle, y_bottom); /* B */ + cairo_line_to (cr, x_right, y_top + square); /* C */ + + x_middle += double_width; + x_right += double_width; + } + cairo_line_to (cr, x_middle, y_bottom); /* B */ + + if (i + 1 == width_units) + cairo_line_to (cr, x_middle + square / 2, y_bottom - square / 2); /* G */ + else if (i + 2 == width_units) { + cairo_line_to (cr, x_right + square / 2, y_top + square / 2); /* D */ + cairo_line_to (cr, x_right, y_top); /* E */ + } + + /* Top of squiggle */ + x_left = x_middle - unit_width; + for (; i >= 0; i -= 2) + { + cairo_line_to (cr, x_middle, y_bottom - square); /* F */ + cairo_line_to (cr, x_left, y_top); /* H */ + + x_left -= double_width; + x_middle -= double_width; + } +} + +static void +pango_cairo_renderer_draw_error_underline (PangoRenderer *renderer, + int x, + int y, + int width, + int height) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + cairo_t *cr = crenderer->cr; + + if (!crenderer->do_path) + { + cairo_save (cr); + + set_color (crenderer, PANGO_RENDER_PART_UNDERLINE); + + cairo_new_path (cr); + } + + draw_error_underline (cr, + crenderer->x_offset + (double)x / PANGO_SCALE, + crenderer->y_offset + (double)y / PANGO_SCALE, + (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); + + if (!crenderer->do_path) + { + cairo_fill (cr); + + cairo_restore (cr); + } +} + +static void +pango_cairo_renderer_draw_shape (PangoRenderer *renderer, + PangoAttrShape *attr, + int x, + int y) +{ + PangoCairoRenderer *crenderer = (PangoCairoRenderer *) (renderer); + cairo_t *cr = crenderer->cr; + PangoLayout *layout; + PangoCairoShapeRendererFunc shape_renderer; + gpointer shape_renderer_data; + double base_x, base_y; + + layout = pango_renderer_get_layout (renderer); + + if (!layout) + return; + + shape_renderer = pango_cairo_context_get_shape_renderer (pango_layout_get_context (layout), + &shape_renderer_data); + + if (!shape_renderer) + return; + + base_x = crenderer->x_offset + (double)x / PANGO_SCALE; + base_y = crenderer->y_offset + (double)y / PANGO_SCALE; + + cairo_save (cr); + if (!crenderer->do_path) + set_color (crenderer, PANGO_RENDER_PART_FOREGROUND); + + cairo_move_to (cr, base_x, base_y); + + shape_renderer (cr, attr, crenderer->do_path, shape_renderer_data); + + cairo_restore (cr); +} + +static void +pango_cairo_renderer_init (PangoCairoRenderer *renderer G_GNUC_UNUSED) +{ +} + +static void +pango_cairo_renderer_class_init (PangoCairoRendererClass *klass) +{ + PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); + + renderer_class->draw_glyphs = pango_cairo_renderer_draw_glyphs; + renderer_class->draw_glyph_item = pango_cairo_renderer_draw_glyph_item; + renderer_class->draw_rectangle = pango_cairo_renderer_draw_rectangle; + renderer_class->draw_trapezoid = pango_cairo_renderer_draw_trapezoid; + renderer_class->draw_error_underline = pango_cairo_renderer_draw_error_underline; + renderer_class->draw_shape = pango_cairo_renderer_draw_shape; +} + +static PangoCairoRenderer *cached_renderer = NULL; /* MT-safe */ +G_LOCK_DEFINE_STATIC (cached_renderer); + +static PangoCairoRenderer * +acquire_renderer (void) +{ + PangoCairoRenderer *renderer; + + if (G_LIKELY (G_TRYLOCK (cached_renderer))) + { + if (G_UNLIKELY (!cached_renderer)) + { + cached_renderer = g_object_new (PANGO_TYPE_CAIRO_RENDERER, NULL); + cached_renderer->is_cached_renderer = TRUE; + } + + renderer = cached_renderer; + } + else + { + renderer = g_object_new (PANGO_TYPE_CAIRO_RENDERER, NULL); + } + + return renderer; +} + +static void +release_renderer (PangoCairoRenderer *renderer) +{ + if (G_LIKELY (renderer->is_cached_renderer)) + { + renderer->cr = NULL; + renderer->do_path = FALSE; + renderer->has_show_text_glyphs = FALSE; + renderer->x_offset = 0.; + renderer->y_offset = 0.; + + G_UNLOCK (cached_renderer); + } + else + g_object_unref (renderer); +} + +static void +save_current_point (PangoCairoRenderer *renderer) +{ + renderer->cr_had_current_point = cairo_has_current_point (renderer->cr); + cairo_get_current_point (renderer->cr, &renderer->x_offset, &renderer->y_offset); + + /* abuse save_current_point() to cache cairo_has_show_text_glyphs() result */ + renderer->has_show_text_glyphs = cairo_surface_has_show_text_glyphs (cairo_get_target (renderer->cr)); +} + +static void +restore_current_point (PangoCairoRenderer *renderer) +{ + if (renderer->cr_had_current_point) + /* XXX should do cairo_set_current_point() when we have that function */ + cairo_move_to (renderer->cr, renderer->x_offset, renderer->y_offset); + else + cairo_new_sub_path (renderer->cr); +} + + +/* convenience wrappers using the default renderer */ + + +static void +_pango_cairo_do_glyph_string (cairo_t *cr, + PangoFont *font, + PangoGlyphString *glyphs, + gboolean do_path) +{ + PangoCairoRenderer *crenderer = acquire_renderer (); + PangoRenderer *renderer = (PangoRenderer *) crenderer; + + crenderer->cr = cr; + crenderer->do_path = do_path; + save_current_point (crenderer); + + if (!do_path) + { + /* unset all part colors, since when drawing just a glyph string, + * prepare_run() isn't called. + */ + + pango_renderer_activate (renderer); + + pango_renderer_set_color (renderer, PANGO_RENDER_PART_FOREGROUND, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_BACKGROUND, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_UNDERLINE, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_STRIKETHROUGH, NULL); + } + + pango_renderer_draw_glyphs (renderer, font, glyphs, 0, 0); + + if (!do_path) + { + pango_renderer_deactivate (renderer); + } + + restore_current_point (crenderer); + + release_renderer (crenderer); +} + +static void +_pango_cairo_do_glyph_item (cairo_t *cr, + const char *text, + PangoGlyphItem *glyph_item, + gboolean do_path) +{ + PangoCairoRenderer *crenderer = acquire_renderer (); + PangoRenderer *renderer = (PangoRenderer *) crenderer; + + crenderer->cr = cr; + crenderer->do_path = do_path; + save_current_point (crenderer); + + if (!do_path) + { + /* unset all part colors, since when drawing just a glyph string, + * prepare_run() isn't called. + */ + + pango_renderer_activate (renderer); + + pango_renderer_set_color (renderer, PANGO_RENDER_PART_FOREGROUND, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_BACKGROUND, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_UNDERLINE, NULL); + pango_renderer_set_color (renderer, PANGO_RENDER_PART_STRIKETHROUGH, NULL); + } + + pango_renderer_draw_glyph_item (renderer, text, glyph_item, 0, 0); + + if (!do_path) + { + pango_renderer_deactivate (renderer); + } + + restore_current_point (crenderer); + + release_renderer (crenderer); +} + +static void +_pango_cairo_do_layout_line (cairo_t *cr, + PangoLayoutLine *line, + gboolean do_path) +{ + PangoCairoRenderer *crenderer = acquire_renderer (); + PangoRenderer *renderer = (PangoRenderer *) crenderer; + + crenderer->cr = cr; + crenderer->do_path = do_path; + save_current_point (crenderer); + + pango_renderer_draw_layout_line (renderer, line, 0, 0); + + restore_current_point (crenderer); + + release_renderer (crenderer); +} + +static void +_pango_cairo_do_layout (cairo_t *cr, + PangoLayout *layout, + gboolean do_path) +{ + PangoCairoRenderer *crenderer = acquire_renderer (); + PangoRenderer *renderer = (PangoRenderer *) crenderer; + + crenderer->cr = cr; + crenderer->do_path = do_path; + save_current_point (crenderer); + + pango_renderer_draw_layout (renderer, layout, 0, 0); + + restore_current_point (crenderer); + + release_renderer (crenderer); +} + +static void +_pango_cairo_do_error_underline (cairo_t *cr, + double x, + double y, + double width, + double height, + gboolean do_path) +{ + /* We don't use a renderer here, for a simple reason: + * the only renderer we can get is the default renderer, that + * is all implemented here, so we shortcircuit and make our + * life way easier. + */ + + if (!do_path) + cairo_new_path (cr); + + draw_error_underline (cr, x, y, width, height); + + if (!do_path) + cairo_fill (cr); +} + + +/* public wrapper of above to show or append path */ + + +/** + * pango_cairo_show_glyph_string: + * @cr: a Cairo context + * @font: a #PangoFont from a #PangoCairoFontMap + * @glyphs: a #PangoGlyphString + * + * Draws the glyphs in @glyphs in the specified cairo context. + * The origin of the glyphs (the left edge of the baseline) will + * be drawn at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_show_glyph_string (cairo_t *cr, + PangoFont *font, + PangoGlyphString *glyphs) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (glyphs != NULL); + + _pango_cairo_do_glyph_string (cr, font, glyphs, FALSE); +} + + +/** + * pango_cairo_show_glyph_item: + * @cr: a Cairo context + * @text: the UTF-8 text that @glyph_item refers to + * @glyph_item: a #PangoGlyphItem + * + * Draws the glyphs in @glyph_item in the specified cairo context, + * embedding the text associated with the glyphs in the output if the + * output format supports it (PDF for example), otherwise it acts + * similar to pango_cairo_show_glyph_string(). + * + * The origin of the glyphs (the left edge of the baseline) will + * be drawn at the current point of the cairo context. + * + * Note that @text is the start of the text for layout, which is then + * indexed by @glyph_item->item->offset. + * + * Since: 1.22 + **/ +void +pango_cairo_show_glyph_item (cairo_t *cr, + const char *text, + PangoGlyphItem *glyph_item) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (text != NULL); + g_return_if_fail (glyph_item != NULL); + + _pango_cairo_do_glyph_item (cr, text, glyph_item, FALSE); +} + +/** + * pango_cairo_show_layout_line: + * @cr: a Cairo context + * @line: a #PangoLayoutLine + * + * Draws a #PangoLayoutLine in the specified cairo context. + * The origin of the glyphs (the left edge of the line) will + * be drawn at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_show_layout_line (cairo_t *cr, + PangoLayoutLine *line) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (line != NULL); + + _pango_cairo_do_layout_line (cr, line, FALSE); +} + +/** + * pango_cairo_show_layout: + * @cr: a Cairo context + * @layout: a Pango layout + * + * Draws a #PangoLayout in the specified cairo context. + * The top-left corner of the #PangoLayout will be drawn + * at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_show_layout (cairo_t *cr, + PangoLayout *layout) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + _pango_cairo_do_layout (cr, layout, FALSE); +} + +/** + * pango_cairo_show_error_underline: + * @cr: a Cairo context + * @x: The X coordinate of one corner of the rectangle + * @y: The Y coordinate of one corner of the rectangle + * @width: Non-negative width of the rectangle + * @height: Non-negative height of the rectangle + * + * Draw a squiggly line in the specified cairo context that approximately + * covers the given rectangle in the style of an underline used to indicate a + * spelling error. (The width of the underline is rounded to an integer + * number of up/down segments and the resulting rectangle is centered in the + * original rectangle) + * + * Since: 1.14 + **/ +void +pango_cairo_show_error_underline (cairo_t *cr, + double x, + double y, + double width, + double height) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail ((width >= 0) && (height >= 0)); + + _pango_cairo_do_error_underline (cr, x, y, width, height, FALSE); +} + +/** + * pango_cairo_glyph_string_path: + * @cr: a Cairo context + * @font: a #PangoFont from a #PangoCairoFontMap + * @glyphs: a #PangoGlyphString + * + * Adds the glyphs in @glyphs to the current path in the specified + * cairo context. The origin of the glyphs (the left edge of the baseline) + * will be at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_glyph_string_path (cairo_t *cr, + PangoFont *font, + PangoGlyphString *glyphs) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (glyphs != NULL); + + _pango_cairo_do_glyph_string (cr, font, glyphs, TRUE); +} + +/** + * pango_cairo_layout_line_path: + * @cr: a Cairo context + * @line: a #PangoLayoutLine + * + * Adds the text in #PangoLayoutLine to the current path in the + * specified cairo context. The origin of the glyphs (the left edge + * of the line) will be at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_layout_line_path (cairo_t *cr, + PangoLayoutLine *line) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (line != NULL); + + _pango_cairo_do_layout_line (cr, line, TRUE); +} + +/** + * pango_cairo_layout_path: + * @cr: a Cairo context + * @layout: a Pango layout + * + * Adds the text in a #PangoLayout to the current path in the + * specified cairo context. The top-left corner of the #PangoLayout + * will be at the current point of the cairo context. + * + * Since: 1.10 + **/ +void +pango_cairo_layout_path (cairo_t *cr, + PangoLayout *layout) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + _pango_cairo_do_layout (cr, layout, TRUE); +} + +/** + * pango_cairo_error_underline_path: + * @cr: a Cairo context + * @x: The X coordinate of one corner of the rectangle + * @y: The Y coordinate of one corner of the rectangle + * @width: Non-negative width of the rectangle + * @height: Non-negative height of the rectangle + * + * Add a squiggly line to the current path in the specified cairo context that + * approximately covers the given rectangle in the style of an underline used + * to indicate a spelling error. (The width of the underline is rounded to an + * integer number of up/down segments and the resulting rectangle is centered + * in the original rectangle) + * + * Since: 1.14 + **/ +void +pango_cairo_error_underline_path (cairo_t *cr, + double x, + double y, + double width, + double height) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail ((width >= 0) && (height >= 0)); + + _pango_cairo_do_error_underline (cr, x, y, width, height, TRUE); +} diff --git a/pango/pangocairo-win32.h b/pango/pangocairo-win32.h new file mode 100644 index 0000000..325963c --- /dev/null +++ b/pango/pangocairo-win32.h @@ -0,0 +1,55 @@ +/* Pango + * pangocairo-win32.h: Private header file for Cairo/Win32 combination + * + * Copyright (C) 2005 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_WIN32_H__ +#define __PANGOCAIRO_WIN32_H__ + +#include +#include "pangowin32-private.h" +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_CAIRO_WIN32_FONT_MAP (pango_cairo_win32_font_map_get_type ()) +#define PANGO_CAIRO_WIN32_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_WIN32_FONT_MAP, PangoCairoWin32FontMap)) +#define PANGO_IS_CAIRO_WIN32_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_WIN32_FONT_MAP)) + +typedef struct _PangoCairoWin32FontMap PangoCairoWin32FontMap; + +struct _PangoCairoWin32FontMap +{ + PangoWin32FontMap parent_instance; + + guint serial; + double dpi; +}; + +PANGO_AVAILABLE_IN_ALL +GType pango_cairo_win32_font_map_get_type (void) G_GNUC_CONST; + +PangoFont *_pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *desc); +G_END_DECLS + +#endif /* __PANGOCAIRO_WIN32_H__ */ + diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c new file mode 100644 index 0000000..2a8e9ed --- /dev/null +++ b/pango/pangocairo-win32font.c @@ -0,0 +1,284 @@ +/* Pango + * pangocairowin32-font.c: Cairo font handling, Win32 backend + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include + +#include "pango-fontmap.h" +#include "pango-impl-utils.h" +#include "pangocairo-private.h" +#include "pangocairo-win32.h" + +#include + +#define PANGO_TYPE_CAIRO_WIN32_FONT (pango_cairo_win32_font_get_type ()) +#define PANGO_CAIRO_WIN32_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32Font)) +#define PANGO_CAIRO_WIN32_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32FontClass)) +#define PANGO_CAIRO_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CAIRO_WIN32_FONT)) +#define PANGO_CAIRO_WIN32_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32FontClass)) + +typedef struct _PangoCairoWin32Font PangoCairoWin32Font; +typedef struct _PangoCairoWin32FontClass PangoCairoWin32FontClass; + +struct _PangoCairoWin32Font +{ + PangoWin32Font font; + PangoCairoFontPrivate cf_priv; +}; + +struct _PangoCairoWin32FontClass +{ + PangoWin32FontClass parent_class; +}; + +GType pango_cairo_win32_font_get_type (void); + +static cairo_font_face_t *pango_cairo_win32_font_create_font_face (PangoCairoFont *font); +static PangoFontMetrics *pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context); + + +static void +cairo_font_iface_init (PangoCairoFontIface *iface) +{ + iface->create_font_face = pango_cairo_win32_font_create_font_face; + iface->create_base_metrics_for_context = pango_cairo_win32_font_create_base_metrics_for_context; + iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoWin32Font, cf_priv); +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoWin32Font, pango_cairo_win32_font, PANGO_TYPE_WIN32_FONT, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) }); + +static cairo_font_face_t * +pango_cairo_win32_font_create_font_face (PangoCairoFont *font) +{ + PangoCairoWin32Font *cwfont = PANGO_CAIRO_WIN32_FONT (font); + PangoWin32Font *win32font = &cwfont->font; + + return cairo_win32_font_face_create_for_logfontw (&win32font->logfontw); +} + +static PangoFontMetrics * +pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context) +{ + PangoFontMetrics *metrics; + cairo_scaled_font_t *scaled_font; + cairo_font_extents_t font_extents; + double height; + + metrics = pango_font_metrics_new (); + + scaled_font = pango_cairo_font_get_scaled_font (font); + + cairo_scaled_font_extents (scaled_font, &font_extents); + cairo_win32_scaled_font_done_font (scaled_font); + + metrics->ascent = font_extents.ascent * PANGO_SCALE; + metrics->descent = font_extents.descent * PANGO_SCALE; + + /* FIXME: Should get the real settings for these from the TrueType + * font file. + */ + height = metrics->ascent + metrics->descent; + metrics->underline_thickness = height / 14; + metrics->underline_position = - metrics->underline_thickness; + metrics->strikethrough_thickness = metrics->underline_thickness; + metrics->strikethrough_position = height / 4; + + pango_quantize_line_geometry (&metrics->underline_thickness, + &metrics->underline_position); + pango_quantize_line_geometry (&metrics->strikethrough_thickness, + &metrics->strikethrough_position); + /* Quantizing may have pushed underline_position to 0. Not good */ + if (metrics->underline_position == 0) + metrics->underline_position = - metrics->underline_thickness; + + return metrics; +} + +static void +pango_cairo_win32_font_finalize (GObject *object) +{ + PangoCairoWin32Font *cwfont = (PangoCairoWin32Font *) object; + + _pango_cairo_font_private_finalize (&cwfont->cf_priv); + + G_OBJECT_CLASS (pango_cairo_win32_font_parent_class)->finalize (object); +} + +static void +pango_cairo_win32_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoCairoWin32Font *cwfont = (PangoCairoWin32Font *) font; + + _pango_cairo_font_private_get_glyph_extents (&cwfont->cf_priv, + glyph, + ink_rect, + logical_rect); +} + +static gboolean +pango_cairo_win32_font_select_font (PangoFont *font, + HDC hdc) +{ + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (&PANGO_CAIRO_WIN32_FONT (font)->cf_priv); + + return cairo_win32_scaled_font_select_font (scaled_font, hdc) == CAIRO_STATUS_SUCCESS; +} + +static void +pango_cairo_win32_font_done_font (PangoFont *font) +{ + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (&PANGO_CAIRO_WIN32_FONT (font)->cf_priv); + + cairo_win32_scaled_font_done_font (scaled_font); +} + +static double +pango_cairo_win32_font_get_metrics_factor (PangoFont *font) +{ + PangoWin32Font *win32font = PANGO_WIN32_FONT (font); + cairo_scaled_font_t *scaled_font = _pango_cairo_font_private_get_scaled_font (&PANGO_CAIRO_WIN32_FONT (font)->cf_priv); + + return cairo_win32_scaled_font_get_metrics_factor (scaled_font) * win32font->size; +} + +static void +pango_cairo_win32_font_class_init (PangoCairoWin32FontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + PangoWin32FontClass *win32_font_class = PANGO_WIN32_FONT_CLASS (class); + + object_class->finalize = pango_cairo_win32_font_finalize; + + font_class->get_glyph_extents = pango_cairo_win32_font_get_glyph_extents; + font_class->get_metrics = _pango_cairo_font_get_metrics; + + win32_font_class->select_font = pango_cairo_win32_font_select_font; + win32_font_class->done_font = pango_cairo_win32_font_done_font; + win32_font_class->get_metrics_factor = pango_cairo_win32_font_get_metrics_factor; +} + +static void +pango_cairo_win32_font_init (PangoCairoWin32Font *cwfont G_GNUC_UNUSED) +{ +} + +/******************** + * Private API * + ********************/ + +PangoFont * +_pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *desc) +{ + PangoCairoWin32Font *cwfont; + PangoWin32Font *win32font; + double size; + double dpi; +#define USE_FACE_CACHED_FONTS +#ifdef USE_FACE_CACHED_FONTS + PangoWin32FontMap *win32fontmap; + GSList *tmp_list; +#endif + cairo_matrix_t font_matrix; + + g_return_val_if_fail (PANGO_IS_CAIRO_WIN32_FONT_MAP (cwfontmap), NULL); + + size = (double) pango_font_description_get_size (desc) / PANGO_SCALE; + + if (context) + { + dpi = pango_cairo_context_get_resolution (context); + + if (dpi <= 0) + dpi = cwfontmap->dpi; + } + else + dpi = cwfontmap->dpi; + + if (!pango_font_description_get_size_is_absolute (desc)) + size *= dpi / 72.; + +#ifdef USE_FACE_CACHED_FONTS + win32fontmap = PANGO_WIN32_FONT_MAP (cwfontmap); + + tmp_list = face->cached_fonts; + while (tmp_list) + { + win32font = tmp_list->data; + if (ABS (win32font->size - size * PANGO_SCALE) < 2) + { + g_object_ref (win32font); + if (win32font->in_cache) + _pango_win32_fontmap_cache_remove (PANGO_FONT_MAP (win32fontmap), win32font); + + return PANGO_FONT (win32font); + } + tmp_list = tmp_list->next; + } +#endif + cwfont = g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT, NULL); + win32font = PANGO_WIN32_FONT (cwfont); + + g_assert (win32font->fontmap == NULL); + win32font->fontmap = (PangoFontMap *) cwfontmap; + g_object_add_weak_pointer (G_OBJECT (win32font->fontmap), (gpointer *) (gpointer) &win32font->fontmap); + + win32font->win32face = face; + +#ifdef USE_FACE_CACHED_FONTS + face->cached_fonts = g_slist_prepend (face->cached_fonts, win32font); +#endif + + /* FIXME: This is a pixel size, so not really what we want for describe(), + * but it's what we need when computing the scale factor. + */ + win32font->size = size * PANGO_SCALE; + + _pango_win32_make_matching_logfontw (win32font->fontmap, + &face->logfontw, + win32font->size, + &win32font->logfontw); + + cairo_matrix_init_identity (&font_matrix); + + cairo_matrix_scale (&font_matrix, size, size); + + _pango_cairo_font_private_initialize (&cwfont->cf_priv, + (PangoCairoFont *) cwfont, + pango_font_description_get_gravity (desc), + _pango_cairo_context_get_merged_font_options (context), + pango_context_get_matrix (context), + &font_matrix); + + return PANGO_FONT (cwfont); +} diff --git a/pango/pangocairo-win32fontmap.c b/pango/pangocairo-win32fontmap.c new file mode 100644 index 0000000..b58d16f --- /dev/null +++ b/pango/pangocairo-win32fontmap.c @@ -0,0 +1,125 @@ +/* Pango + * pangocairo-win32fontmap.c: Cairo font handling, Win32 backend + * + * Copyright (C) 2000-2005 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pangowin32-private.h" +#include "pangocairo.h" +#include "pangocairo-private.h" +#include "pangocairo-win32.h" + +typedef struct _PangoCairoWin32FontMapClass PangoCairoWin32FontMapClass; + +struct _PangoCairoWin32FontMapClass +{ + PangoWin32FontMapClass parent_class; +}; + +static guint +pango_cairo_win32_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (fontmap); + + return cwfontmap->serial; +} + +static void +pango_cairo_win32_font_map_changed (PangoFontMap *fontmap) +{ + PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (fontmap); + + cwfontmap->serial++; + if (cwfontmap->serial == 0) + cwfontmap->serial++; +} + +static void +pango_cairo_win32_font_map_set_resolution (PangoCairoFontMap *cfontmap, + double dpi) +{ + PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (cfontmap); + + cwfontmap->serial++; + if (cwfontmap->serial == 0) + cwfontmap->serial++; + cwfontmap->dpi = dpi; +} + +static double +pango_cairo_win32_font_map_get_resolution (PangoCairoFontMap *cfontmap) +{ + PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (cfontmap); + + return cwfontmap->dpi; +} + +static cairo_font_type_t +pango_cairo_win32_font_map_get_font_type (PangoCairoFontMap *cfontmap) +{ + return CAIRO_FONT_TYPE_WIN32; +} + +static void +cairo_font_map_iface_init (PangoCairoFontMapIface *iface) +{ + iface->set_resolution = pango_cairo_win32_font_map_set_resolution; + iface->get_resolution = pango_cairo_win32_font_map_get_resolution; + iface->get_font_type = pango_cairo_win32_font_map_get_font_type; +} + +G_DEFINE_TYPE_WITH_CODE (PangoCairoWin32FontMap, pango_cairo_win32_font_map, PANGO_TYPE_WIN32_FONT_MAP, + { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) }); + +static void +pango_cairo_win32_font_map_finalize (GObject *object) +{ + G_OBJECT_CLASS (pango_cairo_win32_font_map_parent_class)->finalize (object); +} + +static PangoFont * +pango_cairo_win32_font_map_find_font (PangoWin32FontMap *fontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *desc) +{ + return _pango_cairo_win32_font_new (PANGO_CAIRO_WIN32_FONT_MAP (fontmap), + context, face, desc); +} + +static void +pango_cairo_win32_font_map_class_init (PangoCairoWin32FontMapClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + PangoWin32FontMapClass *win32fontmap_class = PANGO_WIN32_FONT_MAP_CLASS (class); + + gobject_class->finalize = pango_cairo_win32_font_map_finalize; + fontmap_class->get_serial = pango_cairo_win32_font_map_get_serial; + fontmap_class->changed = pango_cairo_win32_font_map_changed; + win32fontmap_class->find_font = pango_cairo_win32_font_map_find_font; +} + +static void +pango_cairo_win32_font_map_init (PangoCairoWin32FontMap *cwfontmap) +{ + cwfontmap->serial = 1; + cwfontmap->dpi = GetDeviceCaps (pango_win32_get_dc (), LOGPIXELSY); +} diff --git a/pango/pangocairo.h b/pango/pangocairo.h new file mode 100644 index 0000000..d15d879 --- /dev/null +++ b/pango/pangocairo.h @@ -0,0 +1,198 @@ +/* Pango + * pangocairo.h: + * + * Copyright (C) 1999, 2004 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCAIRO_H__ +#define __PANGOCAIRO_H__ + +#include +#include + +G_BEGIN_DECLS + +/** + * PangoCairoFont: + * + * #PangoCairoFont is an interface exported by fonts for + * use with Cairo. The actual type of the font will depend + * on the particular font technology Cairo was compiled to use. + * + * Since: 1.18 + **/ +typedef struct _PangoCairoFont PangoCairoFont; +#define PANGO_TYPE_CAIRO_FONT (pango_cairo_font_get_type ()) +#define PANGO_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT, PangoCairoFont)) +#define PANGO_IS_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT)) + +/** + * PangoCairoFontMap: + * + * #PangoCairoFontMap is an interface exported by font maps for + * use with Cairo. The actual type of the font map will depend + * on the particular font technology Cairo was compiled to use. + * + * Since: 1.10 + **/ +typedef struct _PangoCairoFontMap PangoCairoFontMap; +#define PANGO_TYPE_CAIRO_FONT_MAP (pango_cairo_font_map_get_type ()) +#define PANGO_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT_MAP, PangoCairoFontMap)) +#define PANGO_IS_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT_MAP)) + +/** + * PangoCairoShapeRendererFunc: + * @cr: a Cairo context with current point set to where the shape should + * be rendered + * @attr: the %PANGO_ATTR_SHAPE to render + * @do_path: whether only the shape path should be appended to current + * path of @cr and no filling/stroking done. This will be set + * to %TRUE when called from pango_cairo_layout_path() and + * pango_cairo_layout_line_path() rendering functions. + * @data: user data passed to pango_cairo_context_set_shape_renderer() + * + * Function type for rendering attributes of type %PANGO_ATTR_SHAPE + * with Pango's Cairo renderer. + */ +typedef void (* PangoCairoShapeRendererFunc) (cairo_t *cr, + PangoAttrShape *attr, + gboolean do_path, + gpointer data); + +/* + * PangoCairoFontMap + */ +PANGO_AVAILABLE_IN_1_10 +GType pango_cairo_font_map_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_10 +PangoFontMap *pango_cairo_font_map_new (void); +PANGO_AVAILABLE_IN_1_18 +PangoFontMap *pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype); +PANGO_AVAILABLE_IN_1_10 +PangoFontMap *pango_cairo_font_map_get_default (void); +PANGO_AVAILABLE_IN_1_22 +void pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap); +PANGO_AVAILABLE_IN_1_18 +cairo_font_type_t pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap); + +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap, + double dpi); +PANGO_AVAILABLE_IN_1_10 +double pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap); +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_IN_1_22_FOR(pango_font_map_create_context) +PangoContext *pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap); +#endif + +/* + * PangoCairoFont + */ +PANGO_AVAILABLE_IN_1_18 +GType pango_cairo_font_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_18 +cairo_scaled_font_t *pango_cairo_font_get_scaled_font (PangoCairoFont *font); + +/* Update a Pango context for the current state of a cairo context + */ +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_update_context (cairo_t *cr, + PangoContext *context); + +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_context_set_font_options (PangoContext *context, + const cairo_font_options_t *options); +PANGO_AVAILABLE_IN_1_10 +const cairo_font_options_t *pango_cairo_context_get_font_options (PangoContext *context); + +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_context_set_resolution (PangoContext *context, + double dpi); +PANGO_AVAILABLE_IN_1_10 +double pango_cairo_context_get_resolution (PangoContext *context); + +PANGO_AVAILABLE_IN_1_18 +void pango_cairo_context_set_shape_renderer (PangoContext *context, + PangoCairoShapeRendererFunc func, + gpointer data, + GDestroyNotify dnotify); +PANGO_AVAILABLE_IN_1_18 +PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer (PangoContext *context, + gpointer *data); + +/* Convenience + */ +PANGO_AVAILABLE_IN_1_22 +PangoContext *pango_cairo_create_context (cairo_t *cr); +PANGO_AVAILABLE_IN_ALL +PangoLayout *pango_cairo_create_layout (cairo_t *cr); +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_update_layout (cairo_t *cr, + PangoLayout *layout); + +/* + * Rendering + */ +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_show_glyph_string (cairo_t *cr, + PangoFont *font, + PangoGlyphString *glyphs); +PANGO_AVAILABLE_IN_1_22 +void pango_cairo_show_glyph_item (cairo_t *cr, + const char *text, + PangoGlyphItem *glyph_item); +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_show_layout_line (cairo_t *cr, + PangoLayoutLine *line); +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_show_layout (cairo_t *cr, + PangoLayout *layout); + +PANGO_AVAILABLE_IN_1_14 +void pango_cairo_show_error_underline (cairo_t *cr, + double x, + double y, + double width, + double height); + +/* + * Rendering to a path + */ +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_glyph_string_path (cairo_t *cr, + PangoFont *font, + PangoGlyphString *glyphs); +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_layout_line_path (cairo_t *cr, + PangoLayoutLine *line); +PANGO_AVAILABLE_IN_1_10 +void pango_cairo_layout_path (cairo_t *cr, + PangoLayout *layout); + +PANGO_AVAILABLE_IN_1_14 +void pango_cairo_error_underline_path (cairo_t *cr, + double x, + double y, + double width, + double height); + +G_END_DECLS + +#endif /* __PANGOCAIRO_H__ */ diff --git a/pango/pangocairo.rc b/pango/pangocairo.rc new file mode 100644 index 0000000..723e635 --- /dev/null +++ b/pango/pangocairo.rc @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,42,4,0 + PRODUCTVERSION 1,42,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoCairo" + VALUE "FileVersion", "1.42.4.0" + VALUE "InternalName", "pangocairo-1.0-0" + VALUE "LegalCopyright", "Copyright 2010 Red Hat Software." + VALUE "OriginalFilename", "pangocairo-1.0-0.dll" + VALUE "ProductName", "PangoCairo" + VALUE "ProductVersion", "1.42.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangocairo.rc.in b/pango/pangocairo.rc.in new file mode 100644 index 0000000..26ce7da --- /dev/null +++ b/pango/pangocairo.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoCairo" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright 2010 Red Hat Software." + VALUE "OriginalFilename", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "PangoCairo" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c new file mode 100644 index 0000000..6fc8a27 --- /dev/null +++ b/pango/pangocoretext-fontmap.c @@ -0,0 +1,1823 @@ +/* Pango + * pangocoretext-fontmap.c + * + * Copyright (C) 2000-2003 Red Hat, Inc. + * Copyright (C) 2005-2007 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "pango-fontmap.h" +#include "pangocoretext-private.h" +#include "pango-impl-utils.h" + +#include + +typedef struct _FontHashKey FontHashKey; + +typedef struct _PangoCoreTextFontset PangoCoreTextFontset; + +#define PANGO_TYPE_CORE_TEXT_FAMILY (pango_core_text_family_get_type ()) +#define PANGO_CORE_TEXT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CORE_TEXT_FAMILY, PangoCoreTextFamily)) +#define PANGO_IS_CORE_TEXT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CORE_TEXT_FAMILY)) +#define PANGO_CORE_TEXT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_CORE_TEXT_FAMILY, PangoCoreTextFamilyClass)) +#define PANGO_IS_CORE_TEXT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_CORE_TEXT_FAMILY)) +#define PANGO_CORE_TEXT_FAMILY_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), PANGO_CORE_TEXT_FAMILY, PangoCoreTextFamilyClass)) + +#define PANGO_TYPE_CORE_TEXT_FONTSET (pango_core_text_fontset_get_type ()) +#define PANGO_CORE_TEXT_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CORE_TEXT_FONTSET, PangoCoreTextFontset)) +#define PANGO_IS_CORE_TEXT_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CORE_TEXT_FONTSET)) + + +struct _PangoCoreTextFamily +{ + PangoFontFamily parent_instance; + + char *family_name; + + guint is_monospace : 1; + + PangoFontFace **faces; + gint n_faces; +}; + +struct _PangoCoreTextFamilyClass +{ + PangoFontFamilyClass parent_class; +}; + +typedef struct _PangoCoreTextFamilyClass PangoCoreTextFamilyClass; + +#define PANGO_TYPE_CORE_TEXT_FACE (pango_core_text_face_get_type ()) +#define PANGO_CORE_TEXT_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CORE_TEXT_FACE, PangoCoreTextFace)) +#define PANGO_IS_CORE_TEXT_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CORE_TEXT_FACE)) +#define PANGO_CORE_TEXT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_CORE_TEXT_FACE, PangoCoreTextFaceClass)) +#define PANGO_IS_CORE_TEXT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_CORE_TEXT_FACE)) +#define PANGO_CORE_TEXT_FACE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), PANGO_CORE_TEXT_FACE, PangoCoreTextFaceClass)) + +struct _PangoCoreTextFace +{ + PangoFontFace parent_instance; + + PangoCoreTextFamily *family; + + CTFontDescriptorRef ctfontdescriptor; + + char *style_name; + PangoWeight weight; + CTFontSymbolicTraits traits; + guint synthetic_italic : 1; +}; + +struct _PangoCoreTextFaceClass +{ + PangoFontFaceClass parent_class; +}; + +typedef struct _PangoCoreTextFaceClass PangoCoreTextFaceClass; + +static GType pango_core_text_family_get_type (void); +static GType pango_core_text_face_get_type (void); +static GType pango_core_text_fontset_get_type (void); + +static PangoCoreTextFontset *pango_core_text_fontset_new (PangoCoreTextFontsetKey *key, + const PangoFontDescription *description); +static PangoCoreTextFontsetKey *pango_core_text_fontset_get_key (PangoCoreTextFontset *fontset); + +/* + * Helper functions to translate CoreText data to Pango + */ + +typedef struct +{ + float ct_weight; + PangoWeight pango_weight; +} PangoCTWeight; + +#define ct_weight_min -0.7f +#define ct_weight_max 0.8f + +/* This map is based on empirical data from analyzing a large collection of + * fonts and comparing the opentype value with the value that OSX returns. + * see: https://bugzilla.gnome.org/show_bug.cgi?id=766148 + */ + +static const PangoCTWeight ct_weight_map[] = { + { ct_weight_min, PANGO_WEIGHT_THIN }, + { -0.5, PANGO_WEIGHT_ULTRALIGHT }, + { -0.23, PANGO_WEIGHT_LIGHT }, + { -0.115, PANGO_WEIGHT_SEMILIGHT }, + { 0.00, PANGO_WEIGHT_NORMAL }, + { 0.2, PANGO_WEIGHT_MEDIUM }, + { 0.3, PANGO_WEIGHT_SEMIBOLD }, + { 0.4, PANGO_WEIGHT_BOLD }, + { 0.6, PANGO_WEIGHT_ULTRABOLD }, + { ct_weight_max, PANGO_WEIGHT_HEAVY } +}; + +static const char * +get_real_family (const char *family_name) +{ + switch (family_name[0]) + { + case 'm': + case 'M': + if (g_ascii_strcasecmp (family_name, "monospace") == 0) + return "Courier"; + break; + case 's': + case 'S': + if (g_ascii_strcasecmp (family_name, "sans") == 0) + return "Helvetica"; + else if (g_ascii_strcasecmp (family_name, "serif") == 0) + return "Times"; + break; + } + + return family_name; +} + +static gchar * +gchar_from_cf_string (CFStringRef str) +{ + CFIndex len; + gchar *buffer; + + /* GetLength returns the number of UTF-16 pairs, so this number + * times 2 should definitely gives us enough space for UTF8. + * We add one for the terminating zero. + */ + len = CFStringGetLength (str) * 2 + 1; + buffer = g_new0 (char, len); + CFStringGetCString (str, buffer, len, kCFStringEncodingUTF8); + + return buffer; +} + +static char * +ct_font_descriptor_get_family_name (CTFontDescriptorRef desc, + gboolean may_fail) +{ + CFStringRef cf_str; + char *buffer; + + cf_str = CTFontDescriptorCopyAttribute (desc, kCTFontFamilyNameAttribute); + if (!cf_str) + { + int i; + + /* No font family name is set, try to retrieve font name and deduce + * the family name from that instead. + */ + cf_str = CTFontDescriptorCopyAttribute (desc, kCTFontNameAttribute); + if (!cf_str) + { + if (may_fail) + return NULL; + + /* This font is likely broken, return a default family name ... */ + return g_strdup ("Sans"); + } + + buffer = gchar_from_cf_string (cf_str); + CFRelease (cf_str); + + for (i = 0; i < strlen (buffer); i++) + if (buffer[i] == '-') + break; + + if (i < strlen (buffer)) + { + char *ret; + + ret = g_strndup (buffer, i); + g_free (buffer); + + return ret; + } + else + return buffer; + } + /* else */ + + buffer = gchar_from_cf_string (cf_str); + CFRelease (cf_str); + + return buffer; +} + +static char * +ct_font_descriptor_get_style_name (CTFontDescriptorRef desc) +{ + CFStringRef cf_str; + char *buffer; + + cf_str = CTFontDescriptorCopyAttribute (desc, kCTFontStyleNameAttribute); + if (!cf_str) + return NULL; + + buffer = gchar_from_cf_string (cf_str); + CFRelease (cf_str); + + return buffer; +} + +static CTFontSymbolicTraits +ct_font_descriptor_get_traits (CTFontDescriptorRef desc) +{ + CFDictionaryRef dict; + CFNumberRef cf_number; + SInt64 traits; + + /* This is interesting, the value stored is a CTFontSymbolicTraits which + * is defined as uint32_t. CFNumber does not have an obvious type which + * deals with unsigned values. Upon inspection with CFNumberGetType, + * it turns out this value is stored as SInt64, so we use that to + * obtain the value from the CFNumber. + */ + dict = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute); + cf_number = (CFNumberRef)CFDictionaryGetValue (dict, kCTFontSymbolicTrait); + if (!CFNumberGetValue (cf_number, kCFNumberSInt64Type, &traits)) + traits = 0; + CFRelease (dict); + + return (CTFontSymbolicTraits)traits; +} + +static CTFontDescriptorRef +cf_font_descriptor_copy_with_traits (CTFontDescriptorRef desc, + const CTFontSymbolicTraits traits) +{ + CFMutableDictionaryRef dict, traits_dict; + CFDictionaryRef tmp; + CTFontDescriptorRef new_desc; + SInt64 tmp_traits; + + tmp = CTFontDescriptorCopyAttributes (desc); + dict = CFDictionaryCreateMutableCopy (kCFAllocatorDefault, 0, tmp); + CFRelease (tmp); + + tmp = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute); + traits_dict = CFDictionaryCreateMutableCopy (kCFAllocatorDefault, 0, tmp); + CFRelease (tmp); + + tmp_traits = traits; + CFDictionarySetValue (traits_dict, (CFTypeRef) kCTFontSymbolicTrait, + CFNumberCreate (kCFAllocatorDefault, kCFNumberSInt64Type, &tmp_traits)); + + CFDictionarySetValue (dict, (CFTypeRef)kCTFontTraitsAttribute, traits_dict); + + new_desc = CTFontDescriptorCreateCopyWithAttributes (desc, dict); + CFRelease (dict); + + return new_desc; +} + +static int +lerp(float x, float x1, float x2, int y1, int y2) { + float dx = x2 - x1; + int dy = y2 - y1; + return y1 + (dy*(x-x1) + dx/2) / dx; +} + +static PangoWeight +ct_font_descriptor_get_weight (CTFontDescriptorRef desc) +{ + CFDictionaryRef dict; + CFNumberRef cf_number; + CGFloat value; + PangoWeight weight = PANGO_WEIGHT_NORMAL; + + dict = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute); + cf_number = (CFNumberRef)CFDictionaryGetValue (dict, + kCTFontWeightTrait); + + if (cf_number != NULL && CFNumberGetValue (cf_number, kCFNumberCGFloatType, &value)) + { + if (value < ct_weight_min || value > ct_weight_max) + { + /* This is really an error */ + weight = PANGO_WEIGHT_NORMAL; + } + else + { + guint i; + for (i = 1; value > ct_weight_map[i].ct_weight; ++i) + ; + + weight = lerp(value, ct_weight_map[i-1].ct_weight, ct_weight_map[i].ct_weight, + ct_weight_map[i-1].pango_weight, ct_weight_map[i].pango_weight); + + } + } + else + weight = PANGO_WEIGHT_NORMAL; + + CFRelease (dict); + + return weight; +} + +static gboolean +ct_font_descriptor_is_small_caps (CTFontDescriptorRef desc) +{ + CFIndex i, count; + CFArrayRef array; + CFStringRef str; + gboolean retval = FALSE; + + /* See http://stackoverflow.com/a/4811371 for why this works and an + * explanation of the magic number "3" used below. + */ + array = CTFontDescriptorCopyAttribute (desc, kCTFontFeaturesAttribute); + if (!array) + return FALSE; + + str = CFStringCreateWithCString (NULL, "CTFeatureTypeIdentifier", + kCFStringEncodingASCII); + + count = CFArrayGetCount (array); + for (i = 0; i < count; i++) + { + CFDictionaryRef dict = CFArrayGetValueAtIndex (array, i); + CFNumberRef num; + + num = (CFNumberRef)CFDictionaryGetValue (dict, str); + if (num) + { + int value = 0; + + if (CFNumberGetValue (num, kCFNumberSInt32Type, &value) && + value == 3) + { + /* This font supports small caps. */ + retval = TRUE; + break; + } + } + } + + CFRelease (str); + CFRelease (array); + + return retval; +} + +static inline gboolean +pango_core_text_style_name_is_oblique (const char *style_name) +{ + if (!style_name) + return FALSE; + + return g_strrstr (style_name, "Oblique") != NULL; +} + +PangoFontDescription * +_pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef desc) +{ + SInt64 font_traits; + char *family_name; + char *style_name; + PangoFontDescription *font_desc; + + font_desc = pango_font_description_new (); + + /* Family name */ + + /* FIXME: Should we actually retrieve the family name from the list of + * families in a font map? + */ + family_name = ct_font_descriptor_get_family_name (desc, FALSE); + pango_font_description_set_family (font_desc, family_name); + g_free (family_name); + + /* Weight */ + pango_font_description_set_weight (font_desc, + ct_font_descriptor_get_weight (desc)); + + /* Font traits, style name; from this we deduce style and variant */ + font_traits = ct_font_descriptor_get_traits (desc); + style_name = ct_font_descriptor_get_style_name (desc); + + if ((font_traits & kCTFontItalicTrait) == kCTFontItalicTrait) + pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC); + else if (pango_core_text_style_name_is_oblique (style_name)) + pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE); + else + pango_font_description_set_style (font_desc, PANGO_STYLE_NORMAL); + + if ((font_traits & kCTFontCondensedTrait) == kCTFontCondensedTrait) + pango_font_description_set_stretch (font_desc, PANGO_STRETCH_CONDENSED); + + if (ct_font_descriptor_is_small_caps (desc)) + pango_font_description_set_variant (font_desc, PANGO_VARIANT_SMALL_CAPS); + else + pango_font_description_set_variant (font_desc, PANGO_VARIANT_NORMAL); + + g_free (style_name); + + return font_desc; +} + +/* + * PangoCoreTextFace + */ + +static inline gboolean +pango_core_text_face_is_oblique (PangoCoreTextFace *face) +{ + return pango_core_text_style_name_is_oblique (face->style_name); +} + +static void +pango_core_text_face_make_italic (PangoCoreTextFace *ctface, + gboolean synthetic_italic) +{ + CTFontDescriptorRef new_desc; + + ctface->traits |= kCTFontItalicTrait; + if (synthetic_italic) + ctface->synthetic_italic = TRUE; + + /* Update the font descriptor */ + new_desc = cf_font_descriptor_copy_with_traits (ctface->ctfontdescriptor, + ctface->traits); + CFRelease (ctface->ctfontdescriptor); + ctface->ctfontdescriptor = new_desc; +} + +static inline PangoCoreTextFace * +pango_core_text_face_copy (const PangoCoreTextFace *old) +{ + PangoCoreTextFace *face; + + face = g_object_new (PANGO_TYPE_CORE_TEXT_FACE, NULL); + face->family = old->family; + face->ctfontdescriptor = CFRetain (old->ctfontdescriptor); + face->style_name = g_strdup (old->style_name); + face->weight = old->weight; + face->traits = old->traits; + face->synthetic_italic = old->synthetic_italic; + + return face; +} + +static inline PangoCoreTextFace * +pango_core_text_face_from_ct_font_descriptor (CTFontDescriptorRef desc) +{ + PangoCoreTextFace *face = g_object_new (PANGO_TYPE_CORE_TEXT_FACE, + NULL); + + face->synthetic_italic = FALSE; + + face->ctfontdescriptor = CFRetain (desc); + + face->style_name = ct_font_descriptor_get_style_name (desc); + face->traits = ct_font_descriptor_get_traits (desc); + face->weight = ct_font_descriptor_get_weight (desc); + + return face; +} + +static PangoFontDescription * +pango_core_text_face_describe (PangoFontFace *face) +{ + PangoCoreTextFace *ctface = PANGO_CORE_TEXT_FACE (face); + + return _pango_core_text_font_description_from_ct_font_descriptor (ctface->ctfontdescriptor); +} + +static const char * +pango_core_text_face_get_face_name (PangoFontFace *face) +{ + PangoCoreTextFace *ctface = PANGO_CORE_TEXT_FACE (face); + + return ctface->style_name; +} + +static void +pango_core_text_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes) +{ + *n_sizes = 0; + *sizes = NULL; +} + +G_DEFINE_TYPE (PangoCoreTextFace, pango_core_text_face, PANGO_TYPE_FONT_FACE); + +static void +pango_core_text_face_init (PangoCoreTextFace *face) +{ + face->family = NULL; +} + +static void +pango_core_text_face_finalize (GObject *object) +{ + PangoCoreTextFace *ctface = PANGO_CORE_TEXT_FACE (object); + + g_free (ctface->style_name); + CFRelease (ctface->ctfontdescriptor); + + G_OBJECT_CLASS (pango_core_text_face_parent_class)->finalize (object); +} + +static gboolean +pango_core_text_face_is_synthesized (PangoFontFace *face) +{ + PangoCoreTextFace *cface = PANGO_CORE_TEXT_FACE (face); + + return cface->synthetic_italic; +} + +static void +pango_core_text_face_class_init (PangoCoreTextFaceClass *klass) +{ + GObjectClass *object_class = (GObjectClass *)klass; + PangoFontFaceClass *pfclass = PANGO_FONT_FACE_CLASS(klass); + + object_class->finalize = pango_core_text_face_finalize; + + pfclass->describe = pango_core_text_face_describe; + pfclass->get_face_name = pango_core_text_face_get_face_name; + pfclass->list_sizes = pango_core_text_face_list_sizes; + pfclass->is_synthesized = pango_core_text_face_is_synthesized; +} + +/* + * PangoCoreTextFamily + */ + +static void +pango_core_text_family_list_faces (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces) +{ + PangoCoreTextFamily *ctfamily = PANGO_CORE_TEXT_FAMILY (family); + + if (ctfamily->n_faces < 0) + { + GList *l; + GList *faces = NULL; + GList *synthetic_faces = NULL; + GHashTable *italic_faces; + const char *real_family = get_real_family (ctfamily->family_name); + CTFontCollectionRef collection; + CFArrayRef ctfaces; + CFArrayRef font_descriptors; + CFDictionaryRef attributes; + CFIndex i, count; + + CFTypeRef keys[] = { + (CFTypeRef) kCTFontFamilyNameAttribute + }; + + CFStringRef values[] = { + CFStringCreateWithCString (kCFAllocatorDefault, + real_family, + kCFStringEncodingUTF8) + }; + + CTFontDescriptorRef descriptors[1]; + + attributes = CFDictionaryCreate (kCFAllocatorDefault, + (const void **)keys, + (const void **)values, + 1, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + descriptors[0] = CTFontDescriptorCreateWithAttributes (attributes); + font_descriptors = CFArrayCreate (kCFAllocatorDefault, + (const void **)descriptors, + 1, + &kCFTypeArrayCallBacks); + collection = CTFontCollectionCreateWithFontDescriptors (font_descriptors, + NULL); + + ctfaces = CTFontCollectionCreateMatchingFontDescriptors (collection); + + italic_faces = g_hash_table_new (g_direct_hash, g_direct_equal); + + count = CFArrayGetCount (ctfaces); + for (i = 0; i < count; i++) + { + PangoCoreTextFace *face; + CTFontDescriptorRef desc = CFArrayGetValueAtIndex (ctfaces, i); + + face = pango_core_text_face_from_ct_font_descriptor (desc); + face->family = ctfamily; + + faces = g_list_prepend (faces, face); + + if ((face->traits & kCTFontItalicTrait) == kCTFontItalicTrait || + pango_core_text_face_is_oblique (face)) + g_hash_table_insert (italic_faces, + GINT_TO_POINTER ((gint)face->weight), + face); + } + + CFRelease (font_descriptors); + CFRelease (attributes); + CFRelease (ctfaces); + + /* For all fonts for which a non-synthetic italic variant does + * not exist on the system, we create synthesized versions here. + */ + for (l = faces; l; l = l->next) + { + PangoCoreTextFace *face = l->data; + + if (!g_hash_table_lookup (italic_faces, + GINT_TO_POINTER ((gint)face->weight))) + { + PangoCoreTextFace *italic_face; + + italic_face = pango_core_text_face_copy (face); + + italic_face->family = ctfamily; + pango_core_text_face_make_italic (italic_face, TRUE); + + /* Try to create a sensible face name. */ + g_free (italic_face->style_name); + if (strcasecmp (face->style_name, "regular") == 0) + italic_face->style_name = g_strdup ("Oblique"); + else + italic_face->style_name = g_strdup_printf ("%s Oblique", + face->style_name); + + synthetic_faces = g_list_prepend (synthetic_faces, italic_face); + } + } + + faces = g_list_concat (faces, synthetic_faces); + + ctfamily->n_faces = g_list_length (faces); + ctfamily->faces = g_new (PangoFontFace *, ctfamily->n_faces); + + for (l = faces, i = 0; l; l = l->next, i++) + ctfamily->faces[i] = l->data; + + g_list_free (faces); + g_hash_table_destroy (italic_faces); + } + + if (n_faces) + *n_faces = ctfamily->n_faces; + + if (faces) + *faces = g_memdup (ctfamily->faces, ctfamily->n_faces * sizeof (PangoFontFace *)); +} + +static const char * +pango_core_text_family_get_name (PangoFontFamily *family) +{ + PangoCoreTextFamily *ctfamily = PANGO_CORE_TEXT_FAMILY (family); + + return ctfamily->family_name; +} + +static gboolean +pango_core_text_family_is_monospace (PangoFontFamily *family) +{ + PangoCoreTextFamily *ctfamily = PANGO_CORE_TEXT_FAMILY (family); + + return ctfamily->is_monospace; +} + +G_DEFINE_TYPE (PangoCoreTextFamily, pango_core_text_family, PANGO_TYPE_FONT_FAMILY); + +static void +pango_core_text_family_finalize (GObject *object) +{ + PangoCoreTextFamily *family = PANGO_CORE_TEXT_FAMILY (object); + int i; + + g_free (family->family_name); + + if (family->n_faces != -1) + { + for (i = 0; i < family->n_faces; i++) + g_object_unref (family->faces[i]); + + g_free (family->faces); + } + + G_OBJECT_CLASS (pango_core_text_family_parent_class)->finalize (object); +} + + +static void +pango_core_text_family_class_init (PangoCoreTextFamilyClass *klass) +{ + GObjectClass *object_class = (GObjectClass *)klass; + PangoFontFamilyClass *pfclass = PANGO_FONT_FAMILY_CLASS(klass); + + object_class->finalize = pango_core_text_family_finalize; + + pfclass->list_faces = pango_core_text_family_list_faces; + pfclass->get_name = pango_core_text_family_get_name; + pfclass->is_monospace = pango_core_text_family_is_monospace; +} + +static void +pango_core_text_family_init (PangoCoreTextFamily *family) +{ + family->n_faces = -1; +} + + + +static void pango_core_text_font_map_class_init (PangoCoreTextFontMapClass *class); +static void pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap); + + +G_DEFINE_TYPE (PangoCoreTextFontMap, pango_core_text_font_map, PANGO_TYPE_FONT_MAP); + +static void +pango_core_text_font_map_finalize (GObject *object) +{ + PangoCoreTextFontMap *fontmap = PANGO_CORE_TEXT_FONT_MAP (object); + + g_hash_table_destroy (fontmap->fontset_hash); + g_hash_table_destroy (fontmap->font_hash); + g_hash_table_destroy (fontmap->families); + + G_OBJECT_CLASS (pango_core_text_font_map_parent_class)->finalize (object); +} + +/* Fowler / Noll / Vo (FNV) Hash (http://www.isthe.com/chongo/tech/comp/fnv/) + * + * Not necessarily better than a lot of other hashes, but should be OK, and + * well tested with binary data. + */ + +#define FNV_32_PRIME ((guint32)0x01000193) +#define FNV1_32_INIT ((guint32)0x811c9dc5) + +static guint32 +hash_bytes_fnv (unsigned char *buffer, + int len, + guint32 hval) +{ + while (len--) + { + hval *= FNV_32_PRIME; + hval ^= *buffer++; + } + + return hval; +} + +static void +get_context_matrix (PangoContext *context, + PangoMatrix *matrix) +{ + const PangoMatrix *set_matrix; + const PangoMatrix identity = PANGO_MATRIX_INIT; + + if (context) + set_matrix = pango_context_get_matrix (context); + else + set_matrix = NULL; + + if (set_matrix) + *matrix = *set_matrix; + else + *matrix = identity; +} + +/* + * Helper functions for PangoCoreTextFontsetKey + */ +static const double ppi = 72.0; /* typographic points per inch */ + +static double +pango_core_text_font_map_get_resolution (PangoCoreTextFontMap *fontmap, + PangoContext *context) +{ + if (PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (fontmap)->get_resolution) + return PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (fontmap)->get_resolution (fontmap, context); + + /* FIXME: acquire DPI from CoreText using some deafault font */ + g_warning ("FIXME: returning default DPI"); + + return ppi; +} + +static int +get_scaled_size (PangoCoreTextFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc) +{ + double size = pango_font_description_get_size (desc); + PangoMatrix *matrix = pango_context_get_matrix (context); + double scale_factor = pango_matrix_get_font_scale_factor (matrix); + + if (!pango_font_description_get_size_is_absolute(desc)) + { + double dpi = pango_core_text_font_map_get_resolution (fontmap, context); + size *= (dpi/ppi); + } + + return .5 + scale_factor * size; +} + + +/* + * PangoCoreTextFontsetKey + */ +struct _PangoCoreTextFontsetKey +{ + PangoCoreTextFontMap *fontmap; + PangoLanguage *language; + PangoFontDescription *desc; + PangoMatrix matrix; + int pointsize; + double resolution; + PangoGravity gravity; + gpointer context_key; +}; + +static void +pango_core_text_fontset_key_init (PangoCoreTextFontsetKey *key, + PangoCoreTextFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + if (!language && context) + language = pango_context_get_language (context); + + key->fontmap = fontmap; + get_context_matrix (context, &key->matrix); + key->language = language; + key->pointsize = get_scaled_size (fontmap, context, desc); + key->resolution = pango_core_text_font_map_get_resolution (fontmap, context); + key->gravity = pango_context_get_gravity (context); + key->desc = pango_font_description_copy_static (desc); + pango_font_description_unset_fields (key->desc, PANGO_FONT_MASK_SIZE); + + if (context && PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (fontmap)->context_key_get) + key->context_key = (gpointer)PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (fontmap)->context_key_get (fontmap, context); + else + key->context_key = NULL; +} + +static PangoCoreTextFontsetKey * +pango_core_text_fontset_key_copy (const PangoCoreTextFontsetKey *old) +{ + PangoCoreTextFontsetKey *key = g_slice_new (PangoCoreTextFontsetKey); + + key->fontmap = old->fontmap; + key->matrix = old->matrix; + key->language = old->language; + key->pointsize = old->pointsize; + key->resolution = old->resolution; + key->gravity = old->gravity; + key->desc = pango_font_description_copy (old->desc); + if (old->context_key) + key->context_key = PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_copy (key->fontmap, old->context_key); + else + key->context_key = NULL; + + return key; +} + +static void +pango_core_text_fontset_key_free (PangoCoreTextFontsetKey *key) +{ + pango_font_description_free (key->desc); + + if (key->context_key) + PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap, key->context_key); + + g_slice_free (PangoCoreTextFontsetKey, key); +} + +static guint +pango_core_text_fontset_key_hash (const PangoCoreTextFontsetKey *key) +{ + guint32 hash = FNV1_32_INIT; + + hash = hash_bytes_fnv ((unsigned char *)(&key->matrix), sizeof (double) * 4, hash); + hash ^= hash_bytes_fnv ((unsigned char *)(&key->resolution), sizeof (double), hash); + + if (key->context_key) + hash ^= PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_hash (key->fontmap, key->context_key); + + return (hash ^ + GPOINTER_TO_UINT (key->language) ^ + pango_font_description_hash (key->desc)); +} + +static gboolean +pango_core_text_fontset_key_equal (const PangoCoreTextFontsetKey *key_a, + const PangoCoreTextFontsetKey *key_b) +{ + if (key_a->language == key_b->language && + key_a->pointsize == key_b->pointsize && + key_a->resolution == key_b->resolution && + key_a->gravity == key_b->gravity && + pango_font_description_equal (key_a->desc, key_b->desc) && + memcmp ((void *)&key_a->matrix, (void *)&key_b->matrix, 4 * sizeof (double)) == 0) + { + if (key_a->context_key) + return PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key_a->fontmap)->context_key_equal (key_a->fontmap, + key_a->context_key, + key_b->context_key); + else + return key_a->context_key == key_b->context_key; + } + /* else */ + return FALSE; +} + +static PangoLanguage * +pango_core_text_fontset_key_get_language (const PangoCoreTextFontsetKey *key) +{ + return key->language; +} + +static const PangoMatrix * +pango_core_text_fontset_key_get_matrix (const PangoCoreTextFontsetKey *key) +{ + return &key->matrix; +} + +static PangoGravity +pango_core_text_fontset_key_get_gravity (const PangoCoreTextFontsetKey *key) +{ + return key->gravity; +} + +static gpointer +pango_core_text_fontset_key_get_context_key (const PangoCoreTextFontsetKey *key) +{ + return key->context_key; +} + +/* + * PangoCoreTextFontKey + */ +struct _PangoCoreTextFontKey +{ + PangoCoreTextFontMap *fontmap; + CTFontDescriptorRef ctfontdescriptor; + PangoMatrix matrix; + PangoGravity gravity; + int pointsize; + double resolution; + gboolean synthetic_italic; + gpointer context_key; +}; + +static void +pango_core_text_font_key_init (PangoCoreTextFontKey *key, + PangoCoreTextFontMap *ctfontmap, + PangoCoreTextFontsetKey *fontset_key, + CTFontDescriptorRef ctdescriptor, + gboolean synthetic_italic) +{ + key->fontmap = ctfontmap; + key->ctfontdescriptor = ctdescriptor; + key->matrix = *pango_core_text_fontset_key_get_matrix (fontset_key); + key->pointsize = fontset_key->pointsize; + key->resolution = fontset_key->resolution; + key->synthetic_italic = synthetic_italic; + key->gravity = pango_core_text_fontset_key_get_gravity (fontset_key); + key->context_key = pango_core_text_fontset_key_get_context_key (fontset_key); +} + +static PangoCoreTextFontKey * +pango_core_text_font_key_copy (const PangoCoreTextFontKey *old) +{ + PangoCoreTextFontKey *key = g_slice_new (PangoCoreTextFontKey); + + key->fontmap = old->fontmap; + key->ctfontdescriptor = old->ctfontdescriptor; + CFRetain (key->ctfontdescriptor); + key->matrix = old->matrix; + key->pointsize = old->pointsize; + key->resolution = old->resolution; + key->synthetic_italic = old->synthetic_italic; + key->gravity = old->gravity; + if (old->context_key) + key->context_key = PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_copy (key->fontmap, old->context_key); + else + key->context_key = NULL; + + return key; +} + +static void +pango_core_text_font_key_free (PangoCoreTextFontKey *key) +{ + if (key->ctfontdescriptor) + CFRelease (key->ctfontdescriptor); + + if (key->context_key) + PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap, key->context_key); + + g_slice_free (PangoCoreTextFontKey, key); +} + +static guint +pango_core_text_font_key_hash (const PangoCoreTextFontKey *key) +{ + guint32 hash = FNV1_32_INIT; + + /* Not everything is included here, probably good enough for a hash */ + + hash = hash_bytes_fnv ((unsigned char *)(&key->matrix), sizeof (double) * 4, hash); + + if (key->context_key) + hash ^= PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key->fontmap)->context_key_hash (key->fontmap, key->context_key); + + return (hash ^ CFHash (key->ctfontdescriptor)); +} + +static gboolean +pango_core_text_font_key_equal (const PangoCoreTextFontKey *key_a, + const PangoCoreTextFontKey *key_b) +{ + if (CFEqual (key_a->ctfontdescriptor, key_b->ctfontdescriptor) && + memcmp (&key_a->matrix, &key_b->matrix, 4 * sizeof (double)) == 0 && + key_a->gravity == key_b->gravity && + key_a->pointsize == key_b->pointsize && + key_a->resolution == key_b->resolution && + key_a->synthetic_italic == key_b->synthetic_italic) + { + if (key_a->context_key && key_b->context_key) + return PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (key_a->fontmap)->context_key_equal (key_a->fontmap, + key_a->context_key, + key_b->context_key); + else + return key_a->context_key == key_b->context_key; + } + else + return FALSE; +} + +int +pango_core_text_font_key_get_size (const PangoCoreTextFontKey *key) +{ + return key->pointsize; +} + +double +pango_core_text_font_key_get_resolution (const PangoCoreTextFontKey *key) +{ + return key->resolution; +} + +gboolean +pango_core_text_font_key_get_synthetic_italic (const PangoCoreTextFontKey *key) +{ + return key->synthetic_italic; +} + +gpointer +pango_core_text_font_key_get_context_key (const PangoCoreTextFontKey *key) +{ + return key->context_key; +} + +const PangoMatrix * +pango_core_text_font_key_get_matrix (const PangoCoreTextFontKey *key) +{ + return &key->matrix; +} + +PangoGravity +pango_core_text_font_key_get_gravity (const PangoCoreTextFontKey *key) +{ + return key->gravity; +} + +CTFontDescriptorRef +pango_core_text_font_key_get_ctfontdescriptor (const PangoCoreTextFontKey *key) +{ + return key->ctfontdescriptor; +} + + + +static void +pango_core_text_font_map_add (PangoCoreTextFontMap *ctfontmap, + PangoCoreTextFontKey *key, + PangoCoreTextFont *ctfont) +{ + PangoCoreTextFontKey *key_copy; + + _pango_core_text_font_set_font_map (ctfont, ctfontmap); + + key_copy = pango_core_text_font_key_copy (key); + _pango_core_text_font_set_font_key (ctfont, key_copy); + g_hash_table_insert (ctfontmap->font_hash, key_copy, ctfont); +} + +static PangoCoreTextFont * +pango_core_text_font_map_new_font (PangoCoreTextFontMap *fontmap, + PangoCoreTextFontsetKey *fontset_key, + CTFontDescriptorRef ctfontdescriptor, + gboolean synthetic_italic) +{ + PangoCoreTextFontMapClass *klass; + PangoCoreTextFont *font; + PangoCoreTextFontKey key; + + pango_core_text_font_key_init (&key, fontmap, fontset_key, ctfontdescriptor, + synthetic_italic); + + font = g_hash_table_lookup (fontmap->font_hash, &key); + if (font) + return g_object_ref (font); + + /* Call create_font */ + klass = PANGO_CORE_TEXT_FONT_MAP_GET_CLASS (fontmap); + font = klass->create_font (fontmap, &key); + + if (!font) + return NULL; + + pango_core_text_font_map_add (fontmap, &key, font); + + return font; +} + +static gboolean +find_best_match (PangoCoreTextFamily *font_family, + const PangoFontDescription *description, + PangoCoreTextFace **best_face) +{ + PangoFontDescription *new_desc; + PangoFontDescription *best_description = NULL; + int i; + + *best_face = NULL; + + for (i = 0; i < font_family->n_faces; i++) + { + new_desc = pango_font_face_describe (font_family->faces[i]); + + if (pango_font_description_better_match (description, best_description, + new_desc)) + { + pango_font_description_free (best_description); + best_description = new_desc; + *best_face = (PangoCoreTextFace *)font_family->faces[i]; + } + else + pango_font_description_free (new_desc); + } + + if (best_description) + { + pango_font_description_free (best_description); + return TRUE; + } + return FALSE; +} + +static gboolean +get_first_font (PangoFontset *fontset G_GNUC_UNUSED, + PangoFont *font, + gpointer data) +{ + *(PangoFont **)data = font; + + return TRUE; +} + +static guint +pango_core_text_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoCoreTextFontMap *ctfontmap = PANGO_CORE_TEXT_FONT_MAP (fontmap); + + return ctfontmap->serial; +} + +static void +pango_core_text_font_map_changed (PangoFontMap *fontmap) +{ + PangoCoreTextFontMap *ctfontmap = PANGO_CORE_TEXT_FONT_MAP (fontmap); + + ctfontmap->serial++; + if (ctfontmap->serial == 0) + ctfontmap->serial++; +} + +static PangoFont * +pango_core_text_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *description) +{ + PangoLanguage *language; + PangoFontset *fontset; + PangoFont *font = NULL; + + if (context) + language = pango_context_get_language (context); + else + language = NULL; + + fontset = pango_font_map_load_fontset (fontmap, context, + description, language); + + if (fontset) + { + pango_fontset_foreach (fontset, get_first_font, &font); + + if (font) + g_object_ref (font); + + g_object_unref (fontset); + } + + return font; +} + +static void +list_families_foreach (gpointer key, + gpointer value, + gpointer user_data) +{ + GSList **list = user_data; + + *list = g_slist_prepend (*list, value); +} + +static void +pango_core_text_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families) +{ + GSList *family_list = NULL; + GSList *tmp_list; + PangoCoreTextFontMap *ctfontmap = (PangoCoreTextFontMap *)fontmap; + + if (!n_families) + return; + + g_hash_table_foreach (ctfontmap->families, + list_families_foreach, &family_list); + + *n_families = g_slist_length (family_list); + + if (families) + { + int i = 0; + + *families = g_new (PangoFontFamily *, *n_families); + + tmp_list = family_list; + while (tmp_list) + { + (*families)[i] = tmp_list->data; + i++; + tmp_list = tmp_list->next; + } + } + + g_slist_free (family_list); +} + +static PangoFontset * +pango_core_text_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + PangoCoreTextFontset *fontset; + PangoCoreTextFontsetKey key; + PangoCoreTextFontMap *ctfontmap = PANGO_CORE_TEXT_FONT_MAP (fontmap); + static gboolean warned_full_fallback = FALSE; /* MT-safe */ + + pango_core_text_fontset_key_init (&key, ctfontmap, + context, desc, language); + + fontset = g_hash_table_lookup (ctfontmap->fontset_hash, &key); + + if (G_UNLIKELY (!fontset)) + { + gboolean insert_in_hash = TRUE; + + fontset = pango_core_text_fontset_new (&key, desc); + + if (G_UNLIKELY (!fontset)) + { + /* If no font(set) could be loaded, we fallback to "Sans", + * which should always work on Mac. We try to adhere to the + * requested style at first. + */ + PangoFontDescription *tmp_desc; + + /* Cannot use pango_core_text_fontset_key_free() here */ + pango_font_description_free (key.desc); + + tmp_desc = pango_font_description_copy_static (desc); + pango_font_description_set_family_static (tmp_desc, "Sans"); + + pango_core_text_fontset_key_init (&key, ctfontmap, context, tmp_desc, + language); + + fontset = g_hash_table_lookup (ctfontmap->fontset_hash, &key); + if (G_LIKELY (fontset)) + insert_in_hash = FALSE; + else + fontset = pango_core_text_fontset_new (&key, tmp_desc); + + if (G_UNLIKELY (!fontset)) + { + /* We could not load Sans in the requested style; reset + * variant, weight and stretch to sensible defaults (we should + * be able to adhere the PangoStyle with "Sans"). + */ + pango_font_description_set_variant (tmp_desc, PANGO_VARIANT_NORMAL); + pango_font_description_set_weight (tmp_desc, PANGO_WEIGHT_NORMAL); + pango_font_description_set_stretch (tmp_desc, PANGO_STRETCH_NORMAL); + + if (!warned_full_fallback) + { + char *ctmp; + + warned_full_fallback = TRUE; + + ctmp = pango_font_description_to_string (desc); + g_warning ("couldn't load font \"%s\", modified variant/" + "weight/stretch as fallback, expect ugly output.", + ctmp); + g_free (ctmp); + } + + fontset = g_hash_table_lookup (ctfontmap->fontset_hash, &key); + if (G_LIKELY (fontset)) + insert_in_hash = FALSE; + else + fontset = pango_core_text_fontset_new (&key, tmp_desc); + + if (G_UNLIKELY (!fontset)) + { + /* If even that failed, display a sensible error message + * and bail out, in contrast to failing randomly. + */ + g_error ("Could not load fallback font, bailing out."); + } + } + } + + if (insert_in_hash) + g_hash_table_insert (ctfontmap->fontset_hash, + pango_core_text_fontset_get_key (fontset), + fontset); + } + + /* Cannot use pango_core_text_fontset_key_free() here */ + pango_font_description_free (key.desc); + + return g_object_ref (fontset); +} + +static void +pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap) +{ + PangoCoreTextFamily *family; + CTFontCollectionRef collection; + CFArrayRef ctfaces; + CFIndex i, count; + + ctfontmap->serial = 1; + ctfontmap->families = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_object_unref); + + + ctfontmap->font_hash = g_hash_table_new_full ((GHashFunc)pango_core_text_font_key_hash, + (GEqualFunc)pango_core_text_font_key_equal, + (GDestroyNotify)pango_core_text_font_key_free, + NULL); + + ctfontmap->fontset_hash = g_hash_table_new_full ((GHashFunc)pango_core_text_fontset_key_hash, + (GEqualFunc)pango_core_text_fontset_key_equal, + NULL, + (GDestroyNotify)g_object_unref); + + collection = CTFontCollectionCreateFromAvailableFonts (0); + ctfaces = CTFontCollectionCreateMatchingFontDescriptors (collection); + count = CFArrayGetCount (ctfaces); + + for (i = 0; i < count; i++) + { + SInt64 font_traits; + char *buffer; + char *family_name; + CFNumberRef number; + CFDictionaryRef dict; + CTFontDescriptorRef desc = CFArrayGetValueAtIndex (ctfaces, i); + + buffer = ct_font_descriptor_get_family_name (desc, TRUE); + if (!buffer) + continue; + + family_name = g_utf8_casefold (buffer, -1); + + family = g_hash_table_lookup (ctfontmap->families, family_name); + if (!family) + { + family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); + g_hash_table_insert (ctfontmap->families, g_strdup (family_name), + family); + + family->family_name = g_strdup (buffer); + } + + g_free (buffer); + + g_free (family_name); + + /* We assume that all faces in the family are monospaced or none. */ + dict = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute); + number = (CFNumberRef)CFDictionaryGetValue (dict, + kCTFontSymbolicTrait); + + if (CFNumberGetValue (number, kCFNumberSInt64Type, &font_traits)) + { + if ((font_traits & kCTFontMonoSpaceTrait) == kCTFontMonoSpaceTrait) + family->is_monospace = TRUE; + } + + CFRelease (dict); + } + + /* Insert aliases */ + family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); + family->family_name = g_strdup ("Sans"); + g_hash_table_insert (ctfontmap->families, + g_utf8_casefold (family->family_name, -1), family); + + family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); + family->family_name = g_strdup ("Serif"); + g_hash_table_insert (ctfontmap->families, + g_utf8_casefold (family->family_name, -1), family); + + family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); + family->family_name = g_strdup ("Monospace"); + family->is_monospace = TRUE; + g_hash_table_insert (ctfontmap->families, + g_utf8_casefold (family->family_name, -1), family); +} + +static void +pango_core_text_font_map_class_init (PangoCoreTextFontMapClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + + object_class->finalize = pango_core_text_font_map_finalize; + + fontmap_class->load_font = pango_core_text_font_map_load_font; + fontmap_class->list_families = pango_core_text_font_map_list_families; + fontmap_class->load_fontset = pango_core_text_font_map_load_fontset; + fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_CORE_TEXT; + fontmap_class->get_serial = pango_core_text_font_map_get_serial; + fontmap_class->changed = pango_core_text_font_map_changed; +} + +/* + * PangoCoreTextFontSet + */ + +static void pango_core_text_fontset_finalize (GObject *object); +static void pango_core_text_fontset_init (PangoCoreTextFontset *fontset); +static PangoLanguage * pango_core_text_fontset_get_language (PangoFontset *fontset); +static PangoFont * pango_core_text_fontset_get_font (PangoFontset *fontset, + guint wc); +static void pango_core_text_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data); + +struct _PangoCoreTextFontset +{ + PangoFontset parent_instance; + + const gchar *orig_family; + PangoFontDescription *orig_description; + + PangoCoreTextFontsetKey *key; + CFArrayRef cascade_list; + + GPtrArray *fonts; + GPtrArray *coverages; +}; + +struct _PangoCoreTextFontsetClass +{ + PangoFontsetClass parent_instance; +}; + +typedef struct _PangoCoreTextFontsetClass PangoCoreTextFontsetClass; + +G_DEFINE_TYPE (PangoCoreTextFontset, + pango_core_text_fontset, + PANGO_TYPE_FONTSET); + +#if !defined(MAC_OS_X_VERSION_10_8) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 +/* This symbol does exist in the CoreText library shipped with Snow + * Leopard and Lion, however, it is not found in the public header files. + */ +CFArrayRef CTFontCopyDefaultCascadeList (CTFontRef font_ref); +#endif + +static PangoCoreTextFontset * +pango_core_text_fontset_new (PangoCoreTextFontsetKey *key, + const PangoFontDescription *description) +{ + PangoCoreTextFamily *font_family; + PangoCoreTextFontset *fontset; + PangoCoreTextFont *best_font = NULL; + gchar **family_names; + const gchar *family; + gchar *name; + GPtrArray *fonts; + int i; + + fonts = g_ptr_array_new (); + family = pango_font_description_get_family (description); + family_names = g_strsplit (family ? family : "", ",", -1); + + for (i = 0; family_names[i]; ++i) + { + name = g_utf8_casefold (family_names[i], -1); + font_family = g_hash_table_lookup (key->fontmap->families, name); + g_free (name); + + if (font_family) + { + PangoCoreTextFace *family_face; + PangoCoreTextFont *font; + + /* Force a listing of the available faces */ + pango_font_family_list_faces ((PangoFontFamily *)font_family, NULL, NULL); + + if (find_best_match (font_family, description, &family_face)) + { + font = pango_core_text_font_map_new_font (key->fontmap, + key, + family_face->ctfontdescriptor, + family_face->synthetic_italic); + + if (font) + { + g_ptr_array_add (fonts, font); + if (best_font == NULL) best_font = font; + } + } + } + } + + g_strfreev (family_names); + + if (!best_font) + { + g_ptr_array_free (fonts, false); + return NULL; + } + + /* Create a font set with best font */ + fontset = g_object_new (PANGO_TYPE_CORE_TEXT_FONTSET, NULL); + fontset->key = pango_core_text_fontset_key_copy (key); + fontset->orig_description = pango_font_description_copy (description); + + fontset->fonts = fonts; + fontset->coverages = g_ptr_array_new (); + + /* Add the cascade list for this language */ +#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 + { + CFArrayRef language_pref_list = NULL; + CFStringRef languages[1]; + + if (key->language) + { + languages[0] = CFStringCreateWithCString (NULL, + pango_language_to_string (key->language), + kCFStringEncodingASCII); + language_pref_list = CFArrayCreate (kCFAllocatorDefault, + (const void **) languages, + 1, + &kCFTypeArrayCallBacks); + } + + fontset->cascade_list = CTFontCopyDefaultCascadeListForLanguages (pango_core_text_font_get_ctfont (best_font), language_pref_list); + + if (language_pref_list) + { + CFRelease (languages[0]); + CFRelease (language_pref_list); + } + } +#else + /* There is unfortunately no public API to retrieve the cascade list + * on Mac OS X < 10.8, so we use the following undocumented public function. + */ + fontset->cascade_list = CTFontCopyDefaultCascadeList (pango_core_text_font_get_ctfont (best_font)); +#endif + + /* length of cascade list + 1 for the "real" font at the front */ + g_ptr_array_set_size (fontset->fonts, CFArrayGetCount (fontset->cascade_list) + fonts->len); + g_ptr_array_set_size (fontset->coverages, CFArrayGetCount (fontset->cascade_list) + fonts->len); + + return fontset; +} + +static PangoFont * +pango_core_text_fontset_load_font (PangoCoreTextFontset *ctfontset, + CTFontDescriptorRef ctdescriptor) +{ + PangoCoreTextFontsetKey *key; + PangoCoreTextFont *font; + + key = pango_core_text_fontset_get_key (ctfontset); + + /* For now, we will default the fallbacks to not have synthetic italic, + * in the future this may be improved. + */ + font = pango_core_text_font_map_new_font (ctfontset->key->fontmap, + ctfontset->key, + ctdescriptor, + FALSE); + + return PANGO_FONT (font); +} + +static PangoFont * +pango_core_text_fontset_get_font_at (PangoCoreTextFontset *ctfontset, + unsigned int i) +{ + /* The first font is loaded as soon as the fontset is created */ + if (i == 0) + return g_ptr_array_index (ctfontset->fonts, i); + + if (i >= ctfontset->fonts->len) + return NULL; + + if (g_ptr_array_index (ctfontset->fonts, i) == NULL) + { + CTFontDescriptorRef ctdescriptor = CFArrayGetValueAtIndex (ctfontset->cascade_list, i - 1); + PangoFont *font = pango_core_text_fontset_load_font (ctfontset, ctdescriptor); + g_ptr_array_index (ctfontset->fonts, i) = font; + g_ptr_array_index (ctfontset->coverages, i) = NULL; + } + + return g_ptr_array_index (ctfontset->fonts, i); +} + +static void +pango_core_text_fontset_class_init (PangoCoreTextFontsetClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + PangoFontsetClass *fontset_class = PANGO_FONTSET_CLASS (klass); + + object_class->finalize = pango_core_text_fontset_finalize; + + fontset_class->get_font = pango_core_text_fontset_get_font; + fontset_class->get_language = pango_core_text_fontset_get_language; + fontset_class->foreach = pango_core_text_fontset_foreach; +} + +static void +pango_core_text_fontset_init (PangoCoreTextFontset *ctfontset) +{ + ctfontset->key = NULL; + ctfontset->cascade_list = NULL; + ctfontset->fonts = g_ptr_array_new (); + ctfontset->coverages = g_ptr_array_new (); +} + +static void +pango_core_text_fontset_finalize (GObject *object) +{ + PangoCoreTextFontset *ctfontset = PANGO_CORE_TEXT_FONTSET (object); + unsigned int i; + + for (i = 0; i < ctfontset->fonts->len; i++) + { + PangoFont *font = g_ptr_array_index (ctfontset->fonts, i); + if (font) + g_object_unref (font); + } + g_ptr_array_free (ctfontset->fonts, TRUE); + + for (i = 0; i < ctfontset->coverages->len; i++) + { + PangoCoverage *coverage = g_ptr_array_index (ctfontset->coverages, i); + if (coverage) + pango_coverage_unref (coverage); + } + g_ptr_array_free (ctfontset->coverages, TRUE); + + CFRelease (ctfontset->cascade_list); + + pango_font_description_free (ctfontset->orig_description); + + if (ctfontset->key) + pango_core_text_fontset_key_free (ctfontset->key); + + G_OBJECT_CLASS (pango_core_text_fontset_parent_class)->finalize (object); +} + +static PangoCoreTextFontsetKey * +pango_core_text_fontset_get_key (PangoCoreTextFontset *fontset) +{ + return fontset->key; +} + +static PangoLanguage * +pango_core_text_fontset_get_language (PangoFontset *fontset) +{ + PangoCoreTextFontset *ctfontset = PANGO_CORE_TEXT_FONTSET (fontset); + + return pango_core_text_fontset_key_get_language (pango_core_text_fontset_get_key (ctfontset)); +} + +static PangoFont * +pango_core_text_fontset_get_font (PangoFontset *fontset, + guint wc) +{ + PangoCoreTextFontset *ctfontset = PANGO_CORE_TEXT_FONTSET (fontset); + PangoCoverageLevel best_level = PANGO_COVERAGE_NONE; + PangoCoverageLevel level; + PangoFont *font; + PangoCoverage *coverage; + int result = -1; + unsigned int i; + + for (i = 0; i < ctfontset->fonts->len; i++) + { + PangoFont *font = pango_core_text_fontset_get_font_at (ctfontset, i); + if (!font) + continue; + + coverage = g_ptr_array_index (ctfontset->coverages, i); + + if (coverage == NULL) + { + font = g_ptr_array_index (ctfontset->fonts, i); + + coverage = pango_font_get_coverage (font, ctfontset->key->language); + g_ptr_array_index (ctfontset->coverages, i) = coverage; + } + + level = pango_coverage_get (coverage, wc); + + if (result == -1 || level > best_level) + { + result = i; + best_level = level; + if (level == PANGO_COVERAGE_EXACT) + break; + } + } + + if (G_UNLIKELY (result == -1)) + return NULL; + + font = g_ptr_array_index (ctfontset->fonts, result); + return g_object_ref (font); +} + +static void +pango_core_text_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data) +{ + PangoCoreTextFontset *ctfontset = PANGO_CORE_TEXT_FONTSET (fontset); + unsigned int i; + + for (i = 0; i < ctfontset->fonts->len; i++) + { + PangoFont *font = pango_core_text_fontset_get_font_at (ctfontset, i); + if (!font) + continue; + + if ((* func) (fontset, font, data)) + return; + } +} + diff --git a/pango/pangocoretext-private.h b/pango/pangocoretext-private.h new file mode 100644 index 0000000..76eb1eb --- /dev/null +++ b/pango/pangocoretext-private.h @@ -0,0 +1,129 @@ +/* Pango + * pangocoretext-private.h: + * + * Copyright (C) 2003 Red Hat Software + * Copyright (C) 2005-2007 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCORETEXT_PRIVATE_H__ +#define __PANGOCORETEXT_PRIVATE_H__ + +#include "pangocoretext.h" + +G_BEGIN_DECLS + +#define PANGO_TYPE_CORE_TEXT_FONT_MAP (pango_core_text_font_map_get_type ()) +#define PANGO_CORE_TEXT_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CORE_TEXT_FONT_MAP, PangoCoreTextFontMap)) +#define PANGO_CORE_TEXT_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CORE_TEXT_FONT_MAP)) +#define PANGO_CORE_TEXT_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CORE_TEXT_FONT_MAP, PangoCoreTextFontMapClass)) +#define PANGO_IS_CORE_TEXT_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CORE_TEXT_FONT_MAP)) +#define PANGO_CORE_TEXT_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CORE_TEXT_FONT_MAP, PangoCoreTextFontMapClass)) + + +typedef struct _PangoCoreTextFamily PangoCoreTextFamily; +typedef struct _PangoCoreTextFace PangoCoreTextFace; + +typedef struct _PangoCoreTextFontMap PangoCoreTextFontMap; +typedef struct _PangoCoreTextFontMapClass PangoCoreTextFontMapClass; + +typedef struct _PangoCoreTextFontsetKey PangoCoreTextFontsetKey; +typedef struct _PangoCoreTextFontKey PangoCoreTextFontKey; + +struct _PangoCoreTextFontMap +{ + PangoFontMap parent_instance; + + guint serial; + GHashTable *fontset_hash; + GHashTable *font_hash; + + GHashTable *families; +}; + +struct _PangoCoreTextFontMapClass +{ + PangoFontMapClass parent_class; + + gconstpointer (*context_key_get) (PangoCoreTextFontMap *ctfontmap, + PangoContext *context); + gpointer (*context_key_copy) (PangoCoreTextFontMap *ctfontmap, + gconstpointer key); + void (*context_key_free) (PangoCoreTextFontMap *ctfontmap, + gpointer key); + guint32 (*context_key_hash) (PangoCoreTextFontMap *ctfontmap, + gconstpointer key); + gboolean (*context_key_equal) (PangoCoreTextFontMap *ctfontmap, + gconstpointer key_a, + gconstpointer key_b); + + PangoCoreTextFont * (* create_font) (PangoCoreTextFontMap *fontmap, + PangoCoreTextFontKey *key); + + double (* get_resolution) (PangoCoreTextFontMap *fontmap, + PangoContext *context); +}; + + +_PANGO_EXTERN +GType pango_core_text_font_map_get_type (void) G_GNUC_CONST; + +void _pango_core_text_font_set_font_map (PangoCoreTextFont *afont, + PangoCoreTextFontMap *fontmap); +void _pango_core_text_font_set_face (PangoCoreTextFont *afont, + PangoCoreTextFace *aface); +PangoCoreTextFace * _pango_core_text_font_get_face (PangoCoreTextFont *font); +gpointer _pango_core_text_font_get_context_key (PangoCoreTextFont *afont); +void _pango_core_text_font_set_context_key (PangoCoreTextFont *afont, + gpointer context_key); +void _pango_core_text_font_set_font_key (PangoCoreTextFont *font, + PangoCoreTextFontKey *key); +void _pango_core_text_font_set_ctfont (PangoCoreTextFont *font, + CTFontRef font_ref); + +PangoFontDescription *_pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef desc); + +_PANGO_EXTERN +int pango_core_text_font_key_get_size (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +int pango_core_text_font_key_get_size (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +double pango_core_text_font_key_get_resolution (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +gboolean pango_core_text_font_key_get_synthetic_italic (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +gpointer pango_core_text_font_key_get_context_key (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +const PangoMatrix *pango_core_text_font_key_get_matrix (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +PangoGravity pango_core_text_font_key_get_gravity (const PangoCoreTextFontKey *key); +_PANGO_EXTERN +CTFontDescriptorRef pango_core_text_font_key_get_ctfontdescriptor (const PangoCoreTextFontKey *key); + +void +_pango_core_text_shape (PangoFont *font, + const char *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED); + +G_END_DECLS + +#endif /* __PANGOCORETEXT_PRIVATE_H__ */ diff --git a/pango/pangocoretext-shape.c b/pango/pangocoretext-shape.c new file mode 100644 index 0000000..061279a --- /dev/null +++ b/pango/pangocoretext-shape.c @@ -0,0 +1,554 @@ +/* Pango + * pangocoretext-shape.c + * + * Copyright (C) 2005 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * Copyright (C) 2012 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include +#include "pango-utils.h" +#include "pangocoretext-private.h" +#include "pango-impl-utils.h" + +#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +CF_INLINE Boolean CFStringIsSurrogateHighCharacter(UniChar character) { + return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false); +} + +CF_INLINE Boolean CFStringIsSurrogateLowCharacter(UniChar character) { + return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false); +} + +CF_INLINE UTF32Char CFStringGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) { + return ((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL; +} +#endif + +static void +set_glyph (PangoFont *font, + PangoGlyphString *glyphs, + int i, + int offset, + PangoGlyph glyph) +{ + PangoRectangle logical_rect; + + glyphs->glyphs[i].glyph = glyph; + + glyphs->glyphs[i].geometry.x_offset = 0; + glyphs->glyphs[i].geometry.y_offset = 0; + + glyphs->log_clusters[i] = offset; + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect); + glyphs->glyphs[i].geometry.width = logical_rect.width; +} + + +/* The "RunIterator" helps us to iterate over the array of runs that is obtained from + * the CoreText type setter. Even though Pango considers the string that is passed to + * the shape function a single run, CoreText might consider it to consist out of + * multiple runs. Because of this, we have an interface around the CoreText array of + * runs that works like iterating a single array, which makes our job in the shape + * function easier. + */ + +struct RunIterator +{ + CTLineRef line; + CFStringRef cstr; + CFArrayRef runs; + CFIndex glyph_count; + + CFIndex total_ct_i; + CFIndex ct_i; + + CFIndex *chr_idx_lut; + + int current_run_number; + CTRunRef current_run; + CFIndex *current_indices; + const CGGlyph *current_cgglyphs; + CGGlyph *current_cgglyphs_buffer; + CTRunStatus current_run_status; +}; + +static void +run_iterator_free_current_run (struct RunIterator *iter) +{ + iter->current_run_number = -1; + iter->current_run = NULL; + iter->current_cgglyphs = NULL; + if (iter->current_cgglyphs_buffer) + free (iter->current_cgglyphs_buffer); + iter->current_cgglyphs_buffer = NULL; + if (iter->current_indices) + free (iter->current_indices); + iter->current_indices = NULL; +} + +static void +run_iterator_set_current_run (struct RunIterator *iter, + const int run_number) +{ + CFIndex ct_glyph_count; + + run_iterator_free_current_run (iter); + + iter->current_run_number = run_number; + iter->current_run = CFArrayGetValueAtIndex (iter->runs, run_number); + ct_glyph_count = CTRunGetGlyphCount (iter->current_run); + + iter->current_run_status = CTRunGetStatus (iter->current_run); + iter->current_cgglyphs = CTRunGetGlyphsPtr (iter->current_run); + if (!iter->current_cgglyphs) + { + iter->current_cgglyphs_buffer = (CGGlyph *)malloc (sizeof (CGGlyph) * ct_glyph_count); + CTRunGetGlyphs (iter->current_run, CFRangeMake (0, ct_glyph_count), + iter->current_cgglyphs_buffer); + iter->current_cgglyphs = iter->current_cgglyphs_buffer; + } + + iter->current_indices = malloc (sizeof (CFIndex) * ct_glyph_count); + CTRunGetStringIndices (iter->current_run, CFRangeMake (0, ct_glyph_count), + iter->current_indices); + + iter->ct_i = 0; +} + +static CFIndex +run_iterator_get_glyph_count (struct RunIterator *iter) +{ + CFIndex accumulator = 0; + CFIndex i; + + for (i = 0; i < CFArrayGetCount (iter->runs); i++) + accumulator += CTRunGetGlyphCount (CFArrayGetValueAtIndex (iter->runs, i)); + + return accumulator; +} + +/* This function generates a lookup table to match string indices of glyphs to + * actual unicode character indices. This also takes unicode characters into + * account that are encoded using 2 UTF16 code points in CFStrings. We use the + * unicode character index to match up with the unicode characters in the UTF8 + * string provided by Pango. + */ +static CFIndex * +run_iterator_get_chr_idx_lut (CFStringRef cstr) +{ + CFIndex cstr_length = CFStringGetLength (cstr); + CFIndex *chr_idx_lut = malloc (sizeof (CFIndex) * cstr_length); + CFIndex i; + CFIndex current_value = 0; + + for (i = 0; i < cstr_length; i++) + { + chr_idx_lut[i] = current_value; + + if (CFStringIsSurrogateHighCharacter (CFStringGetCharacterAtIndex (cstr, i)) && + i + 1 < cstr_length && + CFStringIsSurrogateLowCharacter (CFStringGetCharacterAtIndex (cstr, i + 1))) + continue; + + current_value++; + } + + return chr_idx_lut; +} + +/* These functions are commented out to silence the compiler, but + * kept around because they might be of use when fixing the more + * intricate issues noted in the comment in the function + * pangocoretext_shape() below. + */ +#if 0 +static gboolean +run_iterator_is_rtl (struct RunIterator *iter) +{ + /* Assume run status is equal for all runs? */ + CTRunStatus run_status = CTRunGetStatus (CFArrayGetValueAtIndex (iter->runs, 0)); + + return run_status & kCTRunStatusRightToLeft; +} + +static gboolean +run_iterator_run_is_non_monotonic (struct RunIterator *iter) +{ + CTRunStatus run_status = CTRunGetStatus (iter->current_run); + + return run_status & kCTRunStatusNonMonotonic; +} +#endif + +static gunichar +run_iterator_get_character (struct RunIterator *iter) +{ + UniChar ch = CFStringGetCharacterAtIndex (iter->cstr, iter->current_indices[iter->ct_i]); + + if (CFStringIsSurrogateHighCharacter (ch) && + iter->current_indices[iter->ct_i] + 1 < CFStringGetLength (iter->cstr)) + { + UniChar ch2 = CFStringGetCharacterAtIndex (iter->cstr, iter->current_indices[iter->ct_i]+1); + + if (CFStringIsSurrogateLowCharacter (ch2)) + return CFStringGetLongCharacterForSurrogatePair (ch, ch2); + } + + return ch; +} + +static CGGlyph +run_iterator_get_cgglyph (struct RunIterator *iter) +{ + return iter->current_cgglyphs[iter->ct_i]; +} + +static CFIndex +run_iterator_get_index (struct RunIterator *iter) +{ + return iter->chr_idx_lut[iter->current_indices[iter->ct_i]]; +} + +static gboolean +run_iterator_create (struct RunIterator *iter, + const char *text, + const gint length, + CTFontRef ctfont) +{ + char *copy; + CFDictionaryRef attributes; + CFAttributedStringRef attstr; + + CFTypeRef keys[] = { + (CFTypeRef) kCTFontAttributeName + }; + + CFTypeRef values[] = { + ctfont + }; + + /* Initialize RunIterator structure */ + iter->current_run_number = -1; + iter->current_run = NULL; + iter->current_indices = NULL; + iter->chr_idx_lut = NULL; + iter->current_cgglyphs = NULL; + iter->current_cgglyphs_buffer = NULL; + + /* Create CTLine */ + attributes = CFDictionaryCreate (kCFAllocatorDefault, + (const void **)keys, + (const void **)values, + 1, + &kCFCopyStringDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + copy = g_strndup (text, length + 1); + copy[length] = 0; + + iter->cstr = CFStringCreateWithCString (kCFAllocatorDefault, copy, + kCFStringEncodingUTF8); + g_free (copy); + + if (!iter->cstr) + /* Creating a CFString can fail if the input string does not + * adhere to the specified encoding (i.e. it contains invalid UTF8). + */ + return FALSE; + + attstr = CFAttributedStringCreate (kCFAllocatorDefault, + iter->cstr, + attributes); + + iter->line = CTLineCreateWithAttributedString (attstr); + iter->runs = CTLineGetGlyphRuns (iter->line); + + CFRelease (attstr); + CFRelease (attributes); + + iter->chr_idx_lut = run_iterator_get_chr_idx_lut (iter->cstr); + + iter->total_ct_i = 0; + iter->glyph_count = run_iterator_get_glyph_count (iter); + + /* If CoreText did not render any glyphs for this string (can happen, + * e.g. a run solely consisting of a BOM), glyph_count will be zero and + * we immediately set the iterator variable to indicate end of glyph list. + */ + if (iter->glyph_count > 0) + run_iterator_set_current_run (iter, 0); + else + iter->total_ct_i = -1; + + return TRUE; +} + +static void +run_iterator_free (struct RunIterator *iter) +{ + run_iterator_free_current_run (iter); + + free (iter->chr_idx_lut); + + CFRelease (iter->line); + CFRelease (iter->cstr); +} + +static gboolean +run_iterator_at_end (struct RunIterator *iter) +{ + if (iter->total_ct_i == -1) + return TRUE; + + return FALSE; +} + +static void +run_iterator_advance (struct RunIterator *iter) +{ + if (iter->total_ct_i >= iter->glyph_count - 1) + { + run_iterator_free_current_run (iter); + iter->ct_i = iter->total_ct_i = -1; + } + else + { + iter->total_ct_i++; + iter->ct_i++; + + if (iter->total_ct_i < iter->glyph_count && + iter->ct_i >= CTRunGetGlyphCount (iter->current_run)) + { + iter->current_run_number++; + run_iterator_set_current_run (iter, iter->current_run_number); + } + } +} + + + +struct GlyphInfo +{ + CFIndex index; + CGGlyph cgglyph; + gunichar wc; +}; + +static gint +glyph_info_compare_func (gconstpointer a, gconstpointer b) +{ + const struct GlyphInfo *gi_a = a; + const struct GlyphInfo *gi_b = b; + + if (gi_a->index < gi_b->index) + return -1; + else if (gi_a->index > gi_b->index) + return 1; + /* else */ + return 0; +} + +static void +glyph_info_free (gpointer data, gpointer user_data) +{ + g_slice_free (struct GlyphInfo, data); +} + +static GSList * +create_core_text_glyph_list (const char *text, + gint length, + CTFontRef ctfont) +{ + GSList *glyph_list = NULL; + struct RunIterator riter; + + if (!run_iterator_create (&riter, text, length, ctfont)) + return NULL; + + while (!run_iterator_at_end (&riter)) + { + struct GlyphInfo *gi; + + gi = g_slice_new (struct GlyphInfo); + gi->index = run_iterator_get_index (&riter); + gi->cgglyph = run_iterator_get_cgglyph (&riter); + gi->wc = run_iterator_get_character (&riter); + + glyph_list = g_slist_prepend (glyph_list, gi); + + run_iterator_advance (&riter); + } + + glyph_list = g_slist_sort (glyph_list, glyph_info_compare_func); + + run_iterator_free (&riter); + + return glyph_list; +} + + +void +_pango_core_text_shape (PangoFont *font, + const char *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED) +{ + const char *p; + gulong n_chars, gs_i, gs_prev_i; + PangoCoreTextFont *cfont = PANGO_CORE_TEXT_FONT (font); + PangoCoverage *coverage; + GSList *glyph_list; + GSList *glyph_iter; + + /* We first fully iterate over the glyph sequence generated by CoreText and + * store this into a list, which is sorted after the iteration. We make a pass + * over the sorted linked list to build up the PangoGlyphString. + * + * We have to do this in order to properly handle a bunch of characteristics of the + * glyph sequence generated by the CoreText typesetter: + * # E.g. zero-width spaces do not end up in the CoreText glyph sequence. We have + * to manually account for the gap in the character indices. + * # Sometimes, CoreText generates two glyph for the same character index. We + * currently handle this "properly" as in we do not crash or corrupt memory, + * but that's about it. + * # Due to mismatches in size, the CoreText glyph sequence can either be longer or + * shorter than the PangoGlyphString. Note that the size of the PangoGlyphString + * should match the number of characters in "text". + * + * If performance becomes a problem, it is certainly possible to use a faster code + * that only does a single iteration over the string for "simple cases". Simple cases + * could include these that only consist out of one run (simple Latin text), which + * don't have gaps in the glyph sequence and which are monotonically + * increasing/decreasing. + * + * FIXME items for future fixing: + * # We currently don't bother about LTR, Pango core appears to fix this up for us. + * (Even when we cared warnings were generated that strings were in the wrong + * order, this should be investigated). + * # When CoreText generates two glyphs for one character, only one is stored. + * This breaks the example strings for e.g. Georgian and Gothic. + */ + + glyph_list = create_core_text_glyph_list (text, length, + pango_core_text_font_get_ctfont (cfont)); + if (!glyph_list) + return; + + /* Set up for translation of the glyph list to a PangoGlyphString. */ + n_chars = pango_utf8_strlen (text, length); + pango_glyph_string_set_size (glyphs, n_chars); + + glyph_iter = glyph_list; + + coverage = pango_font_get_coverage (PANGO_FONT (cfont), + analysis->language); + + /* gs_i is the index into the Pango glyph string. gi is the iterator into + * the (CoreText) glyph list, gi->index is the index into the CFString. + * In matching, we want gs_i and gi->index to match up. + */ + for (gs_prev_i = -1, gs_i = 0, p = text; gs_i < n_chars; + gs_prev_i = gs_i, gs_i++, p = g_utf8_next_char (p)) + { + struct GlyphInfo *gi = glyph_iter != NULL ? glyph_iter->data : NULL; + + if (gi == NULL || gi->index > gs_i) + { + /* The glyph string is behind, insert an empty glyph to catch + * up with the CoreText glyph list. This occurs for instance when + * CoreText inserts a ligature that covers two characters. + */ + set_glyph (font, glyphs, gs_i, p - text, PANGO_GLYPH_EMPTY); + continue; + } + else if (gi->index < gs_i) + { + /* The CoreText glyph list is behind, fast forward the iterator + * to catch up. This can happen when CoreText emits two glyphs + * for once character, which is (as noted in the FIXME) above + * not handled by us yet. + */ + while (gi && gi->index < gs_i) + { + glyph_iter = g_slist_next (glyph_iter); + if (glyph_iter) + gi = glyph_iter->data; + else + gi = NULL; + } + } + + if (gi != NULL && gi->index == gs_i) + { + gunichar mirrored_ch; + PangoCoverageLevel result; + + if (analysis->level % 2) + if (g_unichar_get_mirror_char (gi->wc, &mirrored_ch)) + gi->wc = mirrored_ch; + + if (gi->wc == 0xa0) /* non-break-space */ + gi->wc = 0x20; + + result = pango_coverage_get (coverage, gi->wc); + + if (result != PANGO_COVERAGE_NONE) + { + set_glyph (font, glyphs, gs_i, p - text, gi->cgglyph); + + if (g_unichar_type (gi->wc) == G_UNICODE_NON_SPACING_MARK) + { + if (gi->index > 0) + { + PangoRectangle logical_rect, ink_rect; + + glyphs->glyphs[gs_i].geometry.width = MAX (glyphs->glyphs[gs_prev_i].geometry.width, + glyphs->glyphs[gs_i].geometry.width); + glyphs->glyphs[gs_prev_i].geometry.width = 0; + glyphs->log_clusters[gs_i] = glyphs->log_clusters[gs_prev_i]; + + /* Some heuristics to try to guess how overstrike glyphs are + * done and compensate + */ + pango_font_get_glyph_extents (font, glyphs->glyphs[gs_i].glyph, &ink_rect, &logical_rect); + if (logical_rect.width == 0 && ink_rect.x == 0) + glyphs->glyphs[gs_i].geometry.x_offset = (glyphs->glyphs[gs_i].geometry.width - ink_rect.width) / 2; + } + } + } + else + set_glyph (font, glyphs, gs_i, p - text, PANGO_GET_UNKNOWN_GLYPH (gi->wc)); + + glyph_iter = g_slist_next (glyph_iter); + } + } + + pango_coverage_unref (coverage); + g_slist_foreach (glyph_list, glyph_info_free, NULL); + g_slist_free (glyph_list); + + if (analysis->level & 1) + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); +} diff --git a/pango/pangocoretext.c b/pango/pangocoretext.c new file mode 100644 index 0000000..2aa1810 --- /dev/null +++ b/pango/pangocoretext.c @@ -0,0 +1,320 @@ +/* Pango + * pangocoretext.c + * + * Copyright (C) 2005-2007 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:coretext-fonts + * @short_description:Font handling with CoreText fonts + * @title:CoreText Fonts + * + * The macros and functions in this section are used to access fonts natively on + * OS X using the CoreText text rendering subsystem. + */ +#include "config.h" + +#include "pangocoretext.h" +#include "pangocoretext-private.h" + +G_DEFINE_TYPE (PangoCoreTextFont, pango_core_text_font, PANGO_TYPE_FONT); + +struct _PangoCoreTextFontPrivate +{ + PangoCoreTextFace *face; + gpointer context_key; + + CTFontRef font_ref; + PangoCoreTextFontKey *key; + + PangoCoverage *coverage; + + PangoFontMap *fontmap; +}; + +static void +pango_core_text_font_finalize (GObject *object) +{ + PangoCoreTextFont *ctfont = (PangoCoreTextFont *)object; + PangoCoreTextFontPrivate *priv = ctfont->priv; + PangoCoreTextFontMap* fontmap = g_weak_ref_get ((GWeakRef *)&priv->fontmap); + if (fontmap) + { + g_weak_ref_clear ((GWeakRef *)&priv->fontmap); + g_object_unref (fontmap); + } + + if (priv->coverage) + pango_coverage_unref (priv->coverage); + + G_OBJECT_CLASS (pango_core_text_font_parent_class)->finalize (object); +} + +static PangoFontDescription * +pango_core_text_font_describe (PangoFont *font) +{ + PangoCoreTextFont *ctfont = (PangoCoreTextFont *)font; + PangoCoreTextFontPrivate *priv = ctfont->priv; + CTFontDescriptorRef ctfontdesc; + + ctfontdesc = pango_core_text_font_key_get_ctfontdescriptor (priv->key); + + return _pango_core_text_font_description_from_ct_font_descriptor (ctfontdesc); +} + +static PangoCoverage * +ct_font_descriptor_get_coverage (CTFontDescriptorRef desc) +{ + CFCharacterSetRef charset; + CFIndex i, length; + CFDataRef bitmap; + const UInt8 *ptr, *plane_ptr; + const UInt32 plane_size = 8192; + PangoCoverage *coverage; + + coverage = pango_coverage_new (); + + charset = CTFontDescriptorCopyAttribute (desc, kCTFontCharacterSetAttribute); + if (!charset) + /* Return an empty coverage */ + return coverage; + + bitmap = CFCharacterSetCreateBitmapRepresentation (kCFAllocatorDefault, + charset); + ptr = CFDataGetBytePtr (bitmap); + + /* First handle the BMP plane. */ + length = MIN (CFDataGetLength (bitmap), plane_size); + + /* FIXME: can and should this be done more efficiently? */ + for (i = 0; i < length; i++) + { + int j; + + for (j = 0; j < 8; j++) + if ((ptr[i] & (1 << j)) == (1 << j)) + pango_coverage_set (coverage, i * 8 + j, PANGO_COVERAGE_EXACT); + } + + /* Next, handle the other planes. The plane number is encoded first as + * a single byte. In the following 8192 bytes that plane's coverage bitmap + * is stored. + */ + plane_ptr = ptr + plane_size; + while (plane_ptr - ptr < CFDataGetLength (bitmap)) + { + const UInt8 plane_number = *plane_ptr; + plane_ptr++; + + for (i = 0; i < plane_size; i++) + { + int j; + + for (j = 0; j < 8; j++) + if ((plane_ptr[i] & (1 << j)) == (1 << j)) + pango_coverage_set (coverage, (plane_number * plane_size + i) * 8 + j, + PANGO_COVERAGE_EXACT); + } + + plane_ptr += plane_size; + } + + CFRelease (bitmap); + CFRelease (charset); + + return coverage; +} + +static PangoCoverage * +pango_core_text_font_get_coverage (PangoFont *font, + PangoLanguage *language G_GNUC_UNUSED) +{ + PangoCoreTextFont *ctfont = (PangoCoreTextFont *)font; + PangoCoreTextFontPrivate *priv = ctfont->priv; + + if (!priv->coverage) + { + CTFontDescriptorRef ctfontdesc; + + ctfontdesc = pango_core_text_font_key_get_ctfontdescriptor (priv->key); + + priv->coverage = ct_font_descriptor_get_coverage (ctfontdesc); + } + + return pango_coverage_ref (priv->coverage); +} + +/* Wrap shaper in PangoEngineShape to pass it through old API, + * from times when there were modules and engines. */ +typedef PangoEngineShape PangoCoreTextShapeEngine; +typedef PangoEngineShapeClass PangoCoreTextShapeEngineClass; +static GType pango_core_text_shape_engine_get_type (void) G_GNUC_CONST; +G_DEFINE_TYPE (PangoCoreTextShapeEngine, pango_core_text_shape_engine, PANGO_TYPE_ENGINE_SHAPE); +static void +_pango_core_text_shape_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length) +{ + _pango_core_text_shape (font, item_text, item_length, analysis, glyphs, + paragraph_text, paragraph_length); +} +static void +pango_core_text_shape_engine_class_init (PangoEngineShapeClass *class) +{ + class->script_shape = _pango_core_text_shape_engine_shape; +} +static void +pango_core_text_shape_engine_init (PangoEngineShape *object) +{ +} + +static PangoEngineShape * +pango_core_text_font_find_shaper (PangoFont *font, + PangoLanguage *language G_GNUC_UNUSED, + guint32 ch) +{ + static PangoEngineShape *shaper; + if (g_once_init_enter (&shaper)) + g_once_init_leave (&shaper, g_object_new (pango_core_text_shape_engine_get_type(), NULL)); + return shaper; +} + +static PangoFontMap * +pango_core_text_font_get_font_map (PangoFont *font) +{ + PangoCoreTextFont *ctfont = (PangoCoreTextFont *)font; + /* FIXME: Not thread safe! */ + return ctfont->priv->fontmap; +} + +static void +pango_core_text_font_init (PangoCoreTextFont *ctfont) +{ + ctfont->priv = G_TYPE_INSTANCE_GET_PRIVATE (ctfont, + PANGO_TYPE_CORE_TEXT_FONT, + PangoCoreTextFontPrivate); +} + +static void +pango_core_text_font_class_init (PangoCoreTextFontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + + object_class->finalize = pango_core_text_font_finalize; + + font_class->describe = pango_core_text_font_describe; + /* font_class->describe_absolute is left virtual for PangoCairoCoreTextFont. */ + font_class->get_coverage = pango_core_text_font_get_coverage; + font_class->find_shaper = pango_core_text_font_find_shaper; + font_class->get_font_map = pango_core_text_font_get_font_map; + + g_type_class_add_private (object_class, sizeof (PangoCoreTextFontPrivate)); +} + +void +_pango_core_text_font_set_font_map (PangoCoreTextFont *font, + PangoCoreTextFontMap *fontmap) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + g_return_if_fail (priv->fontmap == NULL); + g_weak_ref_set((GWeakRef *) &priv->fontmap, fontmap); +} + +void +_pango_core_text_font_set_face (PangoCoreTextFont *ctfont, + PangoCoreTextFace *ctface) +{ + PangoCoreTextFontPrivate *priv = ctfont->priv; + + priv->face = ctface; +} + +PangoCoreTextFace * +_pango_core_text_font_get_face (PangoCoreTextFont *font) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + return priv->face; +} + +gpointer +_pango_core_text_font_get_context_key (PangoCoreTextFont *font) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + return priv->context_key; +} + +void +_pango_core_text_font_set_context_key (PangoCoreTextFont *font, + gpointer context_key) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + priv->context_key = context_key; +} + +void +_pango_core_text_font_set_font_key (PangoCoreTextFont *font, + PangoCoreTextFontKey *key) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + priv->key = key; + + if (priv->coverage) + { + pango_coverage_unref (priv->coverage); + priv->coverage = NULL; + } +} + +void +_pango_core_text_font_set_ctfont (PangoCoreTextFont *font, + CTFontRef font_ref) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + priv->font_ref = font_ref; +} + +/** + * pango_core_text_font_get_ctfont: + * @font: A #PangoCoreTextFont + * + * Returns the CTFontRef of a font. + * + * Return value: the CTFontRef associated to @font. + * + * Since: 1.24 + */ +CTFontRef +pango_core_text_font_get_ctfont (PangoCoreTextFont *font) +{ + PangoCoreTextFontPrivate *priv = font->priv; + + return priv->font_ref; +} diff --git a/pango/pangocoretext.h b/pango/pangocoretext.h new file mode 100644 index 0000000..3bb9fcd --- /dev/null +++ b/pango/pangocoretext.h @@ -0,0 +1,87 @@ +/* Pango + * pangocoretext.h: + * + * Copyright (C) 2005 Imendio AB + * Copyright (C) 2010 Kristian Rietveld + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOCORETEXT_H__ +#define __PANGOCORETEXT_H__ + +#include +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_CORE_TEXT_FONT (pango_core_text_font_get_type ()) +#define PANGO_CORE_TEXT_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CORE_TEXT_FONT, PangoCoreTextFont)) +#define PANGO_IS_CORE_TEXT_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CORE_TEXT_FONT)) + +typedef struct _PangoCoreTextFont PangoCoreTextFont; +typedef struct _PangoCoreTextFontClass PangoCoreTextFontClass; + +#if defined(PANGO_ENABLE_ENGINE) || defined(PANGO_ENABLE_BACKEND) + +/** + * PANGO_RENDER_TYPE_CORE_TEXT: + * + * A string constant identifying the CoreText renderer. The associated quark (see + * g_quark_from_string()) is used to identify the renderer in pango_find_map(). + */ +#define PANGO_RENDER_TYPE_CORE_TEXT "PangoRenderCoreText" + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_CORE_TEXT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CORE_TEXT_FONT, PangoCoreTextFontClass)) +#define PANGO_IS_CORE_TEXT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CORE_TEXT_FONT)) +#define PANGO_CORE_TEXT_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CORE_TEXT_FONT, PangoCoreTextFontClass)) + +typedef struct _PangoCoreTextFontPrivate PangoCoreTextFontPrivate; + +struct _PangoCoreTextFont +{ + PangoFont parent_instance; + PangoCoreTextFontPrivate *priv; +}; + +struct _PangoCoreTextFontClass +{ + PangoFontClass parent_class; + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +#endif /* PANGO_ENABLE_BACKEND */ + +PANGO_AVAILABLE_IN_1_24 +CTFontRef pango_core_text_font_get_ctfont (PangoCoreTextFont *font); + +#endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */ + +PANGO_AVAILABLE_IN_ALL +GType pango_core_text_font_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __PANGOCORETEXT_H__ */ diff --git a/pango/pangofc-decoder.c b/pango/pangofc-decoder.c new file mode 100644 index 0000000..f11b4e0 --- /dev/null +++ b/pango/pangofc-decoder.c @@ -0,0 +1,94 @@ +/* Pango + * pangofc-decoder.c: Custom font encoder/decoders + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pangofc-decoder + * @short_description:Custom font encoding handling + * @title:PangoFcDecoder + * + * PangoFcDecoder represents a decoder that an application provides + * for handling a font that is encoded in a custom way. + */ +#include "config.h" +#include "pangofc-decoder.h" + +G_DEFINE_ABSTRACT_TYPE (PangoFcDecoder, pango_fc_decoder, G_TYPE_OBJECT) + +static void +pango_fc_decoder_init (PangoFcDecoder *decoder G_GNUC_UNUSED) +{ +} + +static void +pango_fc_decoder_class_init (PangoFcDecoderClass *klass G_GNUC_UNUSED) +{ +} + +/** + * pango_fc_decoder_get_charset: + * @decoder: a #PangoFcDecoder + * @fcfont: the #PangoFcFont to query. + * + * Generates an #FcCharSet of supported characters for the fcfont + * given. The returned #FcCharSet will be a reference to an + * internal value stored by the #PangoFcDecoder and must not + * be modified or freed. + * + * Return value: the #FcCharset for @fcfont; must not be modified + * or freed. + * + * Since: 1.6 + **/ +FcCharSet * +pango_fc_decoder_get_charset (PangoFcDecoder *decoder, + PangoFcFont *fcfont) +{ + g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), NULL); + + return PANGO_FC_DECODER_GET_CLASS (decoder)->get_charset (decoder, fcfont); +} + +/** + * pango_fc_decoder_get_glyph: + * @decoder: a #PangoFcDecoder + * @fcfont: a #PangoFcFont to query. + * @wc: the Unicode code point to convert to a single #PangoGlyph. + * + * Generates a #PangoGlyph for the given Unicode point using the + * custom decoder. For complex scripts where there can be multiple + * glyphs for a single character, the decoder will return whatever + * glyph is most convenient for it. (Usually whatever glyph is directly + * in the fonts character map table.) + * + * Return value: the glyph index, or 0 if the glyph isn't + * covered by the font. + * + * Since: 1.6 + **/ +PangoGlyph +pango_fc_decoder_get_glyph (PangoFcDecoder *decoder, + PangoFcFont *fcfont, + guint32 wc) +{ + g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), 0); + + return PANGO_FC_DECODER_GET_CLASS (decoder)->get_glyph (decoder, fcfont, wc); +} diff --git a/pango/pangofc-decoder.h b/pango/pangofc-decoder.h new file mode 100644 index 0000000..f4b8cc8 --- /dev/null +++ b/pango/pangofc-decoder.h @@ -0,0 +1,113 @@ +/* Pango + * pangofc-decoder.h: Custom encoders/decoders on a per-font basis. + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_DECODER_H_ +#define __PANGO_DECODER_H_ + +#include + +G_BEGIN_DECLS + +#define PANGO_TYPE_FC_DECODER (pango_fc_decoder_get_type()) +#define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder)) +#define PANGO_IS_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER)) + +typedef struct _PangoFcDecoder PangoFcDecoder; +typedef struct _PangoFcDecoderClass PangoFcDecoderClass; + +#define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass)) +#define PANGO_IS_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER)) +#define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass)) + +/** + * PangoFcDecoder: + * + * #PangoFcDecoder is a virtual base class that implementations will + * inherit from. It's the interface that is used to define a custom + * encoding for a font. These objects are created in your code from a + * function callback that was originally registered with + * pango_fc_font_map_add_decoder_find_func(). Pango requires + * information about the supported charset for a font as well as the + * individual character to glyph conversions. Pango gets that + * information via the #get_charset and #get_glyph callbacks into your + * object implementation. + * + * Since: 1.6 + **/ +struct _PangoFcDecoder +{ + /*< private >*/ + GObject parent_instance; +}; + +/** + * PangoFcDecoderClass: + * @get_charset: This returns an #FcCharset given a #PangoFcFont that + * includes a list of supported characters in the font. The + * #FcCharSet that is returned should be an internal reference to your + * code. Pango will not free this structure. It is important that + * you make this callback fast because this callback is called + * separately for each character to determine Unicode coverage. + * @get_glyph: This returns a single #PangoGlyph for a given Unicode + * code point. + * + * Class structure for #PangoFcDecoder. + * + * Since: 1.6 + **/ +struct _PangoFcDecoderClass +{ + /*< private >*/ + GObjectClass parent_class; + + /* vtable - not signals */ + /*< public >*/ + FcCharSet *(*get_charset) (PangoFcDecoder *decoder, + PangoFcFont *fcfont); + PangoGlyph (*get_glyph) (PangoFcDecoder *decoder, + PangoFcFont *fcfont, + guint32 wc); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +PANGO_AVAILABLE_IN_1_6 +GType pango_fc_decoder_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_6 +FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder, + PangoFcFont *fcfont); + +PANGO_AVAILABLE_IN_1_6 +PangoGlyph pango_fc_decoder_get_glyph (PangoFcDecoder *decoder, + PangoFcFont *fcfont, + guint32 wc); + +G_END_DECLS + +#endif /* __PANGO_DECODER_H_ */ + diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c new file mode 100644 index 0000000..c35b77e --- /dev/null +++ b/pango/pangofc-font.c @@ -0,0 +1,1072 @@ +/* Pango + * pangofc-font.c: Shared interfaces for fontconfig-based backends + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pangofc-font + * @short_description:Base font class for Fontconfig-based backends + * @title:PangoFcFont + * @see_also: + * #PangoFcFontMap The base class for font maps; creating a new + * Fontconfig-based backend involves deriving from both + * #PangoFcFontMap and #PangoFcFont. + * + * #PangoFcFont is a base class for font implementation using the + * Fontconfig and FreeType libraries. It is used in the + * Xft and + * FreeType + * backends shipped with Pango, but can also be used when creating + * new backends. Any backend deriving from this base class will + * take advantage of the wide range of shapers implemented using + * FreeType that come with Pango. + */ +#include "config.h" + +#include "pangofc-font.h" +#include "pangofc-fontmap.h" +#include "pangofc-private.h" +#include "pango-engine.h" +#include "pango-layout.h" +#include "pango-impl-utils.h" + +#include + +#include FT_TRUETYPE_TABLES_H + +enum { + PROP_0, + PROP_PATTERN, + PROP_FONTMAP +}; + +typedef struct _PangoFcFontPrivate PangoFcFontPrivate; + +struct _PangoFcFontPrivate +{ + PangoFcDecoder *decoder; + PangoFcFontKey *key; + PangoFcCmapCache *cmap_cache; +}; + +static gboolean pango_fc_font_real_has_char (PangoFcFont *font, + gunichar wc); +static guint pango_fc_font_real_get_glyph (PangoFcFont *font, + gunichar wc); + +static void pango_fc_font_finalize (GObject *object); +static void pango_fc_font_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void pango_fc_font_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static PangoEngineShape * pango_fc_font_find_shaper (PangoFont *font, + PangoLanguage *language, + guint32 ch); +static PangoCoverage * pango_fc_font_get_coverage (PangoFont *font, + PangoLanguage *language); +static PangoFontMetrics * pango_fc_font_get_metrics (PangoFont *font, + PangoLanguage *language); +static PangoFontMap * pango_fc_font_get_font_map (PangoFont *font); +static PangoFontDescription *pango_fc_font_describe (PangoFont *font); +static PangoFontDescription *pango_fc_font_describe_absolute (PangoFont *font); + + +#define PANGO_FC_FONT_LOCK_FACE(font) (PANGO_FC_FONT_GET_CLASS (font)->lock_face (font)) +#define PANGO_FC_FONT_UNLOCK_FACE(font) (PANGO_FC_FONT_GET_CLASS (font)->unlock_face (font)) + +G_DEFINE_ABSTRACT_TYPE (PangoFcFont, pango_fc_font, PANGO_TYPE_FONT) + +static void +pango_fc_font_class_init (PangoFcFontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + + class->has_char = pango_fc_font_real_has_char; + class->get_glyph = pango_fc_font_real_get_glyph; + class->get_unknown_glyph = NULL; + + object_class->finalize = pango_fc_font_finalize; + object_class->set_property = pango_fc_font_set_property; + object_class->get_property = pango_fc_font_get_property; + font_class->describe = pango_fc_font_describe; + font_class->describe_absolute = pango_fc_font_describe_absolute; + font_class->find_shaper = pango_fc_font_find_shaper; + font_class->get_coverage = pango_fc_font_get_coverage; + font_class->get_metrics = pango_fc_font_get_metrics; + font_class->get_font_map = pango_fc_font_get_font_map; + + g_object_class_install_property (object_class, PROP_PATTERN, + g_param_spec_pointer ("pattern", + "Pattern", + "The fontconfig pattern for this font", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, PROP_FONTMAP, + g_param_spec_object ("fontmap", + "Font Map", + "The PangoFc font map this font is associated with (Since: 1.26)", + PANGO_TYPE_FC_FONT_MAP, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof (PangoFcFontPrivate)); +} + +static void +pango_fc_font_init (PangoFcFont *fcfont) +{ + fcfont->priv = G_TYPE_INSTANCE_GET_PRIVATE (fcfont, + PANGO_TYPE_FC_FONT, + PangoFcFontPrivate); +} + +static void +free_metrics_info (PangoFcMetricsInfo *info) +{ + pango_font_metrics_unref (info->metrics); + g_slice_free (PangoFcMetricsInfo, info); +} + +static void +pango_fc_font_finalize (GObject *object) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (object); + PangoFcFontPrivate *priv = fcfont->priv; + PangoFcFontMap *fontmap; + + g_slist_foreach (fcfont->metrics_by_lang, (GFunc)free_metrics_info, NULL); + g_slist_free (fcfont->metrics_by_lang); + + fontmap = g_weak_ref_get ((GWeakRef *) &fcfont->fontmap); + if (fontmap) + { + _pango_fc_font_map_remove (PANGO_FC_FONT_MAP (fcfont->fontmap), fcfont); + g_weak_ref_clear ((GWeakRef *) &fcfont->fontmap); + g_object_unref (fontmap); + } + + FcPatternDestroy (fcfont->font_pattern); + pango_font_description_free (fcfont->description); + + if (priv->decoder) + _pango_fc_font_set_decoder (fcfont, NULL); + + if (priv->cmap_cache) + _pango_fc_cmap_cache_unref (priv->cmap_cache); + + G_OBJECT_CLASS (pango_fc_font_parent_class)->finalize (object); +} + +static gboolean +pattern_is_hinted (FcPattern *pattern) +{ + FcBool hinting; + + if (FcPatternGetBool (pattern, + FC_HINTING, 0, &hinting) != FcResultMatch) + hinting = FcTrue; + + return hinting; +} + +static gboolean +pattern_is_transformed (FcPattern *pattern) +{ + FcMatrix *fc_matrix; + + if (FcPatternGetMatrix (pattern, FC_MATRIX, 0, &fc_matrix) == FcResultMatch) + { + FT_Matrix ft_matrix; + + ft_matrix.xx = 0x10000L * fc_matrix->xx; + ft_matrix.yy = 0x10000L * fc_matrix->yy; + ft_matrix.xy = 0x10000L * fc_matrix->xy; + ft_matrix.yx = 0x10000L * fc_matrix->yx; + + return ((ft_matrix.xy | ft_matrix.yx) != 0 || + ft_matrix.xx != 0x10000L || + ft_matrix.yy != 0x10000L); + } + else + return FALSE; +} + +static void +pango_fc_font_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (object); + + switch (prop_id) + { + case PROP_PATTERN: + { + FcPattern *pattern = g_value_get_pointer (value); + + g_return_if_fail (pattern != NULL); + g_return_if_fail (fcfont->font_pattern == NULL); + + FcPatternReference (pattern); + fcfont->font_pattern = pattern; + fcfont->description = pango_fc_font_description_from_pattern (pattern, TRUE); + fcfont->is_hinted = pattern_is_hinted (pattern); + fcfont->is_transformed = pattern_is_transformed (pattern); + } + goto set_decoder; + + case PROP_FONTMAP: + { + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (g_value_get_object (value)); + + g_return_if_fail (fcfont->fontmap == NULL); + g_weak_ref_set ((GWeakRef *) &fcfont->fontmap, fcfontmap); + } + goto set_decoder; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return; + } + +set_decoder: + /* set decoder if both pattern and fontmap are set now */ + if (fcfont->font_pattern && fcfont->fontmap) + _pango_fc_font_set_decoder (fcfont, + pango_fc_font_map_find_decoder ((PangoFcFontMap *) fcfont->fontmap, + fcfont->font_pattern)); +} + +static void +pango_fc_font_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_PATTERN: + { + PangoFcFont *fcfont = PANGO_FC_FONT (object); + g_value_set_pointer (value, fcfont->font_pattern); + } + break; + case PROP_FONTMAP: + { + PangoFcFont *fcfont = PANGO_FC_FONT (object); + PangoFontMap *fontmap = g_weak_ref_get ((GWeakRef *) &fcfont->fontmap); + g_value_take_object (value, fontmap); + } + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static PangoFontDescription * +pango_fc_font_describe (PangoFont *font) +{ + PangoFcFont *fcfont = (PangoFcFont *)font; + + return pango_font_description_copy (fcfont->description); +} + +static PangoFontDescription * +pango_fc_font_describe_absolute (PangoFont *font) +{ + PangoFcFont *fcfont = (PangoFcFont *)font; + PangoFontDescription *desc = pango_font_description_copy (fcfont->description); + double size; + + if (FcPatternGetDouble (fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch) + pango_font_description_set_absolute_size (desc, size * PANGO_SCALE); + + return desc; +} + +/* Wrap shaper in PangoEngineShape to pass it through old API, + * from times when there were modules and engines. */ +typedef PangoEngineShape PangoFcShapeEngine; +typedef PangoEngineShapeClass PangoFcShapeEngineClass; +static GType pango_fc_shape_engine_get_type (void) G_GNUC_CONST; +G_DEFINE_TYPE (PangoFcShapeEngine, pango_fc_shape_engine, PANGO_TYPE_ENGINE_SHAPE); +static void +_pango_fc_shape_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length) +{ + _pango_fc_shape (font, item_text, item_length, analysis, glyphs, + paragraph_text, paragraph_length); +} +static void +pango_fc_shape_engine_class_init (PangoEngineShapeClass *class) +{ + class->script_shape = _pango_fc_shape_engine_shape; +} +static void +pango_fc_shape_engine_init (PangoEngineShape *object) +{ +} + +static PangoEngineShape * +pango_fc_font_find_shaper (PangoFont *font G_GNUC_UNUSED, + PangoLanguage *language, + guint32 ch) +{ + static PangoEngineShape *shaper; + if (g_once_init_enter (&shaper)) + g_once_init_leave (&shaper, g_object_new (pango_fc_shape_engine_get_type(), NULL)); + return shaper; +} + +static PangoCoverage * +pango_fc_font_get_coverage (PangoFont *font, + PangoLanguage *language G_GNUC_UNUSED) +{ + PangoFcFont *fcfont = (PangoFcFont *)font; + PangoFcFontPrivate *priv = fcfont->priv; + FcCharSet *charset; + PangoFcFontMap *fontmap; + PangoCoverage *coverage; + + if (priv->decoder) + { + charset = pango_fc_decoder_get_charset (priv->decoder, fcfont); + return _pango_fc_font_map_fc_to_coverage (charset); + } + + fontmap = g_weak_ref_get ((GWeakRef *) &fcfont->fontmap); + if (!fontmap) + return pango_coverage_new (); + + coverage = _pango_fc_font_map_get_coverage (fontmap, fcfont); + g_object_unref (fontmap); + return coverage; +} + +/* For Xft, it would be slightly more efficient to simply to + * call Xft, and also more robust against changes in Xft. + * But for now, we simply use the same code for all backends. + * + * The code in this function is partly based on code from Xft, + * Copyright 2000 Keith Packard + */ +static void +get_face_metrics (PangoFcFont *fcfont, + PangoFontMetrics *metrics) +{ + FT_Face face = PANGO_FC_FONT_LOCK_FACE (fcfont); + FcMatrix *fc_matrix; + FT_Matrix ft_matrix; + TT_OS2 *os2; + gboolean have_transform = FALSE; + + if (G_UNLIKELY (!face)) + { + metrics->descent = 0; + metrics->ascent = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_HEIGHT; + metrics->underline_thickness = PANGO_SCALE; + metrics->underline_position = - PANGO_SCALE; + metrics->strikethrough_thickness = PANGO_SCALE; + metrics->strikethrough_position = PANGO_SCALE * (PANGO_UNKNOWN_GLYPH_HEIGHT/2); + return; + } + + if (FcPatternGetMatrix (fcfont->font_pattern, + FC_MATRIX, 0, &fc_matrix) == FcResultMatch) + { + ft_matrix.xx = 0x10000L * fc_matrix->xx; + ft_matrix.yy = 0x10000L * fc_matrix->yy; + ft_matrix.xy = 0x10000L * fc_matrix->xy; + ft_matrix.yx = 0x10000L * fc_matrix->yx; + + have_transform = (ft_matrix.xx != 0x10000 || ft_matrix.xy != 0 || + ft_matrix.yx != 0 || ft_matrix.yy != 0x10000); + } + + if (have_transform) + { + FT_Vector vector; + + vector.x = 0; + vector.y = face->size->metrics.descender; + FT_Vector_Transform (&vector, &ft_matrix); + metrics->descent = - PANGO_UNITS_26_6 (vector.y); + + vector.x = 0; + vector.y = face->size->metrics.ascender; + FT_Vector_Transform (&vector, &ft_matrix); + metrics->ascent = PANGO_UNITS_26_6 (vector.y); + } + else if (fcfont->is_hinted || + (face->face_flags & FT_FACE_FLAG_SCALABLE) == 0) + { + metrics->descent = - PANGO_UNITS_26_6 (face->size->metrics.descender); + metrics->ascent = PANGO_UNITS_26_6 (face->size->metrics.ascender); + } + else + { + FT_Fixed ascender, descender; + + descender = FT_MulFix (face->descender, face->size->metrics.y_scale); + metrics->descent = - PANGO_UNITS_26_6 (descender); + + ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale); + metrics->ascent = PANGO_UNITS_26_6 (ascender); + } + + + metrics->underline_thickness = 0; + metrics->underline_position = 0; + + { + FT_Fixed ft_thickness, ft_position; + + ft_thickness = FT_MulFix (face->underline_thickness, face->size->metrics.y_scale); + metrics->underline_thickness = PANGO_UNITS_26_6 (ft_thickness); + + ft_position = FT_MulFix (face->underline_position, face->size->metrics.y_scale); + metrics->underline_position = PANGO_UNITS_26_6 (ft_position); + } + + if (metrics->underline_thickness == 0 || metrics->underline_position == 0) + { + metrics->underline_thickness = (PANGO_SCALE * face->size->metrics.y_ppem) / 14; + metrics->underline_position = - metrics->underline_thickness; + } + + + metrics->strikethrough_thickness = 0; + metrics->strikethrough_position = 0; + + os2 = FT_Get_Sfnt_Table (face, ft_sfnt_os2); + if (os2 && os2->version != 0xFFFF) + { + FT_Fixed ft_thickness, ft_position; + + ft_thickness = FT_MulFix (os2->yStrikeoutSize, face->size->metrics.y_scale); + metrics->strikethrough_thickness = PANGO_UNITS_26_6 (ft_thickness); + + ft_position = FT_MulFix (os2->yStrikeoutPosition, face->size->metrics.y_scale); + metrics->strikethrough_position = PANGO_UNITS_26_6 (ft_position); + } + + if (metrics->strikethrough_thickness == 0 || metrics->strikethrough_position == 0) + { + metrics->strikethrough_thickness = metrics->underline_thickness; + metrics->strikethrough_position = (PANGO_SCALE * face->size->metrics.y_ppem) / 4; + } + + + /* If hinting is on for this font, quantize the underline and strikethrough position + * to integer values. + */ + if (fcfont->is_hinted) + { + pango_quantize_line_geometry (&metrics->underline_thickness, + &metrics->underline_position); + pango_quantize_line_geometry (&metrics->strikethrough_thickness, + &metrics->strikethrough_position); + + /* Quantizing may have pushed underline_position to 0. Not good */ + if (metrics->underline_position == 0) + metrics->underline_position = - metrics->underline_thickness; + } + + + PANGO_FC_FONT_UNLOCK_FACE (fcfont); +} + +PangoFontMetrics * +pango_fc_font_create_base_metrics_for_context (PangoFcFont *fcfont, + PangoContext *context) +{ + PangoFontMetrics *metrics; + metrics = pango_font_metrics_new (); + + get_face_metrics (fcfont, metrics); + + return metrics; +} + +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + +static PangoFontMetrics * +pango_fc_font_get_metrics (PangoFont *font, + PangoLanguage *language) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (font); + PangoFcMetricsInfo *info = NULL; /* Quiet gcc */ + GSList *tmp_list; + + const char *sample_str = pango_language_get_sample_string (language); + + tmp_list = fcfont->metrics_by_lang; + while (tmp_list) + { + info = tmp_list->data; + + if (info->sample_str == sample_str) /* We _don't_ need strcmp */ + break; + + tmp_list = tmp_list->next; + } + + if (!tmp_list) + { + PangoFontMap *fontmap; + PangoContext *context; + + fontmap = g_weak_ref_get ((GWeakRef *) &fcfont->fontmap); + if (!fontmap) + return pango_font_metrics_new (); + + info = g_slice_new0 (PangoFcMetricsInfo); + + fcfont->metrics_by_lang = g_slist_prepend (fcfont->metrics_by_lang, + info); + + info->sample_str = sample_str; + + context = pango_font_map_create_context (fontmap); + pango_context_set_language (context, language); + + info->metrics = pango_fc_font_create_base_metrics_for_context (fcfont, context); + + { /* Compute derived metrics */ + PangoLayout *layout; + PangoRectangle extents; + const char *sample_str = pango_language_get_sample_string (language); + PangoFontDescription *desc = pango_font_describe_with_absolute_size (font); + gulong sample_str_width; + + layout = pango_layout_new (context); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, sample_str, -1); + pango_layout_get_extents (layout, NULL, &extents); + + sample_str_width = pango_utf8_strwidth (sample_str); + g_assert (sample_str_width > 0); + info->metrics->approximate_char_width = extents.width / sample_str_width; + + pango_layout_set_text (layout, "0123456789", -1); + info->metrics->approximate_digit_width = max_glyph_width (layout); + + g_object_unref (layout); + } + + g_object_unref (context); + g_object_unref (fontmap); + } + + return pango_font_metrics_ref (info->metrics); +} + +static PangoFontMap * +pango_fc_font_get_font_map (PangoFont *font) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (font); + + /* MT-unsafe. Oh well... The API is unsafe. */ + return fcfont->fontmap; +} + +static gboolean +pango_fc_font_real_has_char (PangoFcFont *font, + gunichar wc) +{ + FcCharSet *charset; + + if (FcPatternGetCharSet (font->font_pattern, + FC_CHARSET, 0, &charset) != FcResultMatch) + return FALSE; + + return FcCharSetHasChar (charset, wc); +} + +static guint +pango_fc_font_real_get_glyph (PangoFcFont *font, + gunichar wc) +{ + PangoFcFontPrivate *priv = font->priv; + FT_Face face; + FT_UInt index; + + guint idx; + PangoFcCmapCacheEntry *entry; + + + if (G_UNLIKELY (priv->cmap_cache == NULL)) + { + PangoFcFontMap *fontmap = g_weak_ref_get ((GWeakRef *) &font->fontmap); + if (G_UNLIKELY (!fontmap)) + return 0; + + priv->cmap_cache = _pango_fc_font_map_get_cmap_cache (fontmap, font); + + g_object_unref (fontmap); + + if (G_UNLIKELY (!priv->cmap_cache)) + return 0; + } + + idx = wc & CMAP_CACHE_MASK; + entry = priv->cmap_cache->entries + idx; + + if (entry->ch != wc) + { + face = PANGO_FC_FONT_LOCK_FACE (font); + if (G_LIKELY (face)) + { + index = FcFreeTypeCharIndex (face, wc); + if (index > (FT_UInt)face->num_glyphs) + index = 0; + + PANGO_FC_FONT_UNLOCK_FACE (font); + } + else + index = 0; + + entry->ch = wc; + entry->glyph = index; + } + + return entry->glyph; +} + +/** + * pango_fc_font_lock_face: + * @font: a #PangoFcFont. + * + * Gets the FreeType FT_Face associated with a font, + * This face will be kept around until you call + * pango_fc_font_unlock_face(). + * + * Return value: the FreeType FT_Face associated with @font. + * + * Since: 1.4 + **/ +FT_Face +pango_fc_font_lock_face (PangoFcFont *font) +{ + g_return_val_if_fail (PANGO_IS_FC_FONT (font), NULL); + + return PANGO_FC_FONT_LOCK_FACE (font); +} + +/** + * pango_fc_font_unlock_face: + * @font: a #PangoFcFont. + * + * Releases a font previously obtained with + * pango_fc_font_lock_face(). + * + * Since: 1.4 + **/ +void +pango_fc_font_unlock_face (PangoFcFont *font) +{ + g_return_if_fail (PANGO_IS_FC_FONT (font)); + + PANGO_FC_FONT_UNLOCK_FACE (font); +} + +/** + * pango_fc_font_has_char: + * @font: a #PangoFcFont + * @wc: Unicode codepoint to look up + * + * Determines whether @font has a glyph for the codepoint @wc. + * + * Return value: %TRUE if @font has the requested codepoint. + * + * Since: 1.4 + **/ +gboolean +pango_fc_font_has_char (PangoFcFont *font, + gunichar wc) +{ + PangoFcFontPrivate *priv = font->priv; + FcCharSet *charset; + + g_return_val_if_fail (PANGO_IS_FC_FONT (font), FALSE); + + if (priv->decoder) + { + charset = pango_fc_decoder_get_charset (priv->decoder, font); + return FcCharSetHasChar (charset, wc); + } + + return PANGO_FC_FONT_GET_CLASS (font)->has_char (font, wc); +} + +/** + * pango_fc_font_get_glyph: + * @font: a #PangoFcFont + * @wc: Unicode character to look up + * + * Gets the glyph index for a given Unicode character + * for @font. If you only want to determine + * whether the font has the glyph, use pango_fc_font_has_char(). + * + * Return value: the glyph index, or 0, if the Unicode + * character doesn't exist in the font. + * + * Since: 1.4 + **/ +PangoGlyph +pango_fc_font_get_glyph (PangoFcFont *font, + gunichar wc) +{ + PangoFcFontPrivate *priv = font->priv; + + /* Replace NBSP with a normal space; it should be invariant that + * they shape the same other than breaking properties. + */ + if (wc == 0xA0) + wc = 0x20; + + if (priv->decoder) + return pango_fc_decoder_get_glyph (priv->decoder, font, wc); + + return PANGO_FC_FONT_GET_CLASS (font)->get_glyph (font, wc); +} + + +/** + * pango_fc_font_get_unknown_glyph: + * @font: a #PangoFcFont + * @wc: the Unicode character for which a glyph is needed. + * + * Returns the index of a glyph suitable for drawing @wc as an + * unknown character. + * + * Use PANGO_GET_UNKNOWN_GLYPH() instead. + * + * Return value: a glyph index into @font. + * + * Since: 1.4 + **/ +PangoGlyph +pango_fc_font_get_unknown_glyph (PangoFcFont *font, + gunichar wc) +{ + if (font && PANGO_FC_FONT_GET_CLASS (font)->get_unknown_glyph) + return PANGO_FC_FONT_GET_CLASS (font)->get_unknown_glyph (font, wc); + + return PANGO_GET_UNKNOWN_GLYPH (wc); +} + +void +_pango_fc_font_shutdown (PangoFcFont *font) +{ + g_return_if_fail (PANGO_IS_FC_FONT (font)); + + if (PANGO_FC_FONT_GET_CLASS (font)->shutdown) + PANGO_FC_FONT_GET_CLASS (font)->shutdown (font); +} + +/** + * pango_fc_font_kern_glyphs: + * @font: a #PangoFcFont + * @glyphs: a #PangoGlyphString + * + * Adjust each adjacent pair of glyphs in @glyphs according to + * kerning information in @font. + * + * Since: 1.4 + * Deprecated: 1.32 + **/ +void +pango_fc_font_kern_glyphs (PangoFcFont *font, + PangoGlyphString *glyphs) +{ + FT_Face face; + FT_Error error; + FT_Vector kerning; + int i; + gboolean hinting = font->is_hinted; + gboolean scale = FALSE; + double xscale = 1; + PangoFcFontKey *key; + + g_return_if_fail (PANGO_IS_FC_FONT (font)); + g_return_if_fail (glyphs != NULL); + + face = PANGO_FC_FONT_LOCK_FACE (font); + if (G_UNLIKELY (!face)) + return; + + if (!FT_HAS_KERNING (face)) + { + PANGO_FC_FONT_UNLOCK_FACE (font); + return; + } + + key = _pango_fc_font_get_font_key (font); + if (key) { + const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key); + PangoMatrix identity = PANGO_MATRIX_INIT; + if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 2 * sizeof (double)))) + { + scale = TRUE; + pango_matrix_get_font_scale_factors (matrix, &xscale, NULL); + if (xscale) xscale = 1 / xscale; + } + } + + for (i = 1; i < glyphs->num_glyphs; ++i) + { + error = FT_Get_Kerning (face, + glyphs->glyphs[i-1].glyph, + glyphs->glyphs[i].glyph, + ft_kerning_default, + &kerning); + + if (error == FT_Err_Ok) { + int adjustment = PANGO_UNITS_26_6 (kerning.x); + + if (hinting) + adjustment = PANGO_UNITS_ROUND (adjustment); + if (G_UNLIKELY (scale)) + adjustment *= xscale; + + glyphs->glyphs[i-1].geometry.width += adjustment; + } + } + + PANGO_FC_FONT_UNLOCK_FACE (font); +} + +/** + * _pango_fc_font_get_decoder: + * @font: a #PangoFcFont + * + * This will return any custom decoder set on this font. + * + * Return value: The custom decoder + * + * Since: 1.6 + **/ + +PangoFcDecoder * +_pango_fc_font_get_decoder (PangoFcFont *font) +{ + PangoFcFontPrivate *priv = font->priv; + + return priv->decoder; +} + +/** + * _pango_fc_font_set_decoder: + * @font: a #PangoFcFont + * @decoder: a #PangoFcDecoder to set for this font + * + * This sets a custom decoder for this font. Any previous decoder + * will be released before this one is set. + * + * Since: 1.6 + **/ + +void +_pango_fc_font_set_decoder (PangoFcFont *font, + PangoFcDecoder *decoder) +{ + PangoFcFontPrivate *priv = font->priv; + + if (priv->decoder) + g_object_unref (priv->decoder); + + priv->decoder = decoder; + + if (priv->decoder) + g_object_ref (priv->decoder); +} + +PangoFcFontKey * +_pango_fc_font_get_font_key (PangoFcFont *fcfont) +{ + PangoFcFontPrivate *priv = fcfont->priv; + + return priv->key; +} + +void +_pango_fc_font_set_font_key (PangoFcFont *fcfont, + PangoFcFontKey *key) +{ + PangoFcFontPrivate *priv = fcfont->priv; + + priv->key = key; +} + +static FT_Glyph_Metrics * +get_per_char (FT_Face face, + FT_Int32 load_flags, + PangoGlyph glyph) +{ + FT_Error error; + FT_Glyph_Metrics *result; + + error = FT_Load_Glyph (face, glyph, load_flags); + if (error == FT_Err_Ok) + result = &face->glyph->metrics; + else + result = NULL; + + return result; +} + +/** + * pango_fc_font_get_raw_extents: + * @fcfont: a #PangoFcFont + * @load_flags: flags to pass to FT_Load_Glyph() + * @glyph: the glyph index to load + * @ink_rect: (out) (optional): location to store ink extents of the + * glyph, or %NULL + * @logical_rect: (out) (optional): location to store logical extents + * of the glyph or %NULL + * + * Gets the extents of a single glyph from a font. The extents are in + * user space; that is, they are not transformed by any matrix in effect + * for the font. + * + * Long term, this functionality probably belongs in the default + * implementation of the get_glyph_extents() virtual function. + * The other possibility would be to to make it public in something + * like it's current form, and also expose glyph information + * caching functionality similar to pango_ft2_font_set_glyph_info(). + * + * Since: 1.6 + **/ +void +pango_fc_font_get_raw_extents (PangoFcFont *fcfont, + FT_Int32 load_flags, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + FT_Glyph_Metrics *gm; + FT_Face face; + + g_return_if_fail (PANGO_IS_FC_FONT (fcfont)); + + face = PANGO_FC_FONT_LOCK_FACE (fcfont); + if (G_UNLIKELY (!face)) + { + /* Get generic unknown-glyph extents. */ + pango_font_get_glyph_extents (NULL, glyph, ink_rect, logical_rect); + return; + } + + if (glyph == PANGO_GLYPH_EMPTY) + gm = NULL; + else + gm = get_per_char (face, load_flags, glyph); + + if (gm) + { + if (ink_rect) + { + ink_rect->x = PANGO_UNITS_26_6 (gm->horiBearingX); + ink_rect->width = PANGO_UNITS_26_6 (gm->width); + ink_rect->y = -PANGO_UNITS_26_6 (gm->horiBearingY); + ink_rect->height = PANGO_UNITS_26_6 (gm->height); + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->width = PANGO_UNITS_26_6 (gm->horiAdvance); + if (fcfont->is_hinted || + (face->face_flags & FT_FACE_FLAG_SCALABLE) == 0) + { + logical_rect->y = - PANGO_UNITS_26_6 (face->size->metrics.ascender); + logical_rect->height = PANGO_UNITS_26_6 (face->size->metrics.ascender - face->size->metrics.descender); + } + else + { + FT_Fixed ascender, descender; + + ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale); + descender = FT_MulFix (face->descender, face->size->metrics.y_scale); + + logical_rect->y = - PANGO_UNITS_26_6 (ascender); + logical_rect->height = PANGO_UNITS_26_6 (ascender - descender); + } + } + } + else + { + if (ink_rect) + { + ink_rect->x = 0; + ink_rect->width = 0; + ink_rect->y = 0; + ink_rect->height = 0; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->width = 0; + logical_rect->y = 0; + logical_rect->height = 0; + } + } + + PANGO_FC_FONT_UNLOCK_FACE (fcfont); +} + diff --git a/pango/pangofc-font.h b/pango/pangofc-font.h new file mode 100644 index 0000000..954abdc --- /dev/null +++ b/pango/pangofc-font.h @@ -0,0 +1,166 @@ +/* Pango + * pangofc-font.h: Base fontmap type for fontconfig-based backends + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FC_FONT_H__ +#define __PANGO_FC_FONT_H__ + +#include + +/* Freetype has undefined macros in its header */ +#ifdef PANGO_COMPILATION +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" +#endif + +#include +#include FT_FREETYPE_H +#include + +#ifdef PANGO_COMPILATION +#pragma GCC diagnostic pop +#endif + +G_BEGIN_DECLS + +#define PANGO_TYPE_FC_FONT (pango_fc_font_get_type ()) +#define PANGO_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT, PangoFcFont)) +#define PANGO_IS_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT)) + +typedef struct _PangoFcFont PangoFcFont; +typedef struct _PangoFcFontClass PangoFcFontClass; + +#if defined(PANGO_ENABLE_ENGINE) || defined(PANGO_ENABLE_BACKEND) + +/** + * PANGO_RENDER_TYPE_FC: + * + * A string constant used to identify shape engines that work + * with the fontconfig based backends. See the @engine_type field + * of #PangoEngineInfo. + **/ +#define PANGO_RENDER_TYPE_FC "PangoRenderFc" + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_FC_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_FONT, PangoFcFontClass)) +#define PANGO_IS_FC_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_FONT)) +#define PANGO_FC_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_FONT, PangoFcFontClass)) + +/** + * PangoFcFont: + * + * #PangoFcFont is a base class for font implementations + * using the Fontconfig and FreeType libraries and is used in + * conjunction with #PangoFcFontMap. When deriving from this + * class, you need to implement all of its virtual functions + * other than shutdown() along with the get_glyph_extents() + * virtual function from #PangoFont. + **/ +struct _PangoFcFont +{ + PangoFont parent_instance; + + FcPattern *font_pattern; /* fully resolved pattern */ + PangoFontMap *fontmap; /* associated map */ + gpointer priv; /* used internally */ + PangoMatrix matrix; /* used internally */ + PangoFontDescription *description; + + GSList *metrics_by_lang; + + guint is_hinted : 1; + guint is_transformed : 1; +}; + +/** + * PangoFcFontClass: + * @lock_face: Returns the FT_Face of the font and increases + * the reference count for the face by one. + * @unlock_face: Decreases the reference count for the + * FT_Face of the font by one. When the count is zero, + * the #PangoFcFont subclass is allowed to free the + * FT_Face. + * @has_char: Return %TRUE if the the font contains a glyph + * corresponding to the specified character. + * @get_glyph: Gets the glyph that corresponds to the given + * Unicode character. + * @get_unknown_glyph: (nullable): Gets the glyph that + * should be used to display an unknown-glyph indication + * for the specified Unicode character. May be %NULL. + * @shutdown: (nullable): Performs any font-specific + * shutdown code that needs to be done when + * pango_fc_font_map_shutdown is called. May be %NULL. + * + * Class structure for #PangoFcFont. + **/ +struct _PangoFcFontClass +{ + /*< private >*/ + PangoFontClass parent_class; + + /*< public >*/ + FT_Face (*lock_face) (PangoFcFont *font); + void (*unlock_face) (PangoFcFont *font); + gboolean (*has_char) (PangoFcFont *font, + gunichar wc); + guint (*get_glyph) (PangoFcFont *font, + gunichar wc); + PangoGlyph (*get_unknown_glyph) (PangoFcFont *font, + gunichar wc); + void (*shutdown) (PangoFcFont *font); + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +#endif /* PANGO_ENABLE_BACKEND */ + +PANGO_AVAILABLE_IN_1_4 +gboolean pango_fc_font_has_char (PangoFcFont *font, + gunichar wc); +PANGO_AVAILABLE_IN_1_4 +guint pango_fc_font_get_glyph (PangoFcFont *font, + gunichar wc); +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) +PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont *font, + gunichar wc); +PANGO_DEPRECATED_IN_1_32 +void pango_fc_font_kern_glyphs (PangoFcFont *font, + PangoGlyphString *glyphs); +#endif /* PANGO_DISABLE_DEPRECATED */ + +#endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */ + +PANGO_AVAILABLE_IN_ALL +GType pango_fc_font_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_4 +FT_Face pango_fc_font_lock_face (PangoFcFont *font); +PANGO_AVAILABLE_IN_1_4 +void pango_fc_font_unlock_face (PangoFcFont *font); + +G_END_DECLS +#endif /* __PANGO_FC_FONT_H__ */ diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c new file mode 100644 index 0000000..d491c75 --- /dev/null +++ b/pango/pangofc-fontmap.c @@ -0,0 +1,2658 @@ +/* Pango + * pangofc-fontmap.c: Base fontmap type for fontconfig-based backends + * + * Copyright (C) 2000-2003 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pangofc-fontmap + * @short_description:Base fontmap class for Fontconfig-based backends + * @title:PangoFcFontMap + * @see_also: + * + * #PangoFcFont + * The base class for fonts; creating a new + * Fontconfig-based backend involves deriving from both + * #PangoFcFontMap and #PangoFcFont. + * + * + * PangoFcFontMap is a base class for font map implementations using the + * Fontconfig and FreeType libraries. It is used in the + * Xft and + * FreeType + * backends shipped with Pango, but can also be used when creating + * new backends. Any backend deriving from this base class will + * take advantage of the wide range of shapers implemented using + * FreeType that come with Pango. + */ +#define FONTSET_CACHE_SIZE 256 + +#include "config.h" +#include + +#include "pango-context.h" +#include "pangofc-fontmap.h" +#include "pangofc-private.h" +#include "pango-impl-utils.h" +#include "pango-enum-types.h" + + +/* Overview: + * + * All programming is a practice in caching data. PangoFcFontMap is the + * major caching container of a Pango system on a Linux desktop. Here is + * a short overview of how it all works. + * + * In short, Fontconfig search patterns are constructed and a fontset loaded + * using them. Here is how we achieve that: + * + * - All FcPattern's referenced by any object in the fontmap are uniquified + * and cached in the fontmap. This both speeds lookups based on patterns + * faster, and saves memory. This is handled by fontmap->priv->pattern_hash. + * The patterns are cached indefinitely. + * + * - The results of a FcFontSort() are used to populate fontsets. However, + * FcFontSort() relies on the search pattern only, which includes the font + * size but not the full font matrix. The fontset however depends on the + * matrix. As a result, multiple fontsets may need results of the + * FcFontSort() on the same input pattern (think rotating text). As such, + * we cache FcFontSort() results in fontmap->priv->patterns_hash which + * is a refcounted structure. This level of abstraction also allows for + * optimizations like calling FcFontMatch() instead of FcFontSort(), and + * only calling FcFontSort() if any patterns other than the first match + * are needed. Another possible optimization would be to call FcFontSort() + * without trimming, and do the trimming lazily as we go. Only pattern sets + * already referenced by a fontset are cached. + * + * - A number of most-recently-used fontsets are cached and reused when + * needed. This is achieved using fontmap->priv->fontset_hash and + * fontmap->priv->fontset_cache. + * + * - All fonts created by any of our fontsets are also cached and reused. + * This is what fontmap->priv->font_hash does. + * + * - Data that only depends on the font file and face index is cached and + * reused by multiple fonts. This includes coverage and cmap cache info. + * This is done using fontmap->priv->font_face_data_hash. + * + * Upon a cache_clear() request, all caches are emptied. All objects (fonts, + * fontsets, faces, families) having a reference from outside will still live + * and may reference the fontmap still, but will not be reused by the fontmap. + * + * + * Todo: + * + * - Make PangoCoverage a GObject and subclass it as PangoFcCoverage which + * will directly use FcCharset. (#569622) + * + * - Lazy trimming of FcFontSort() results. Requires fontconfig with + * FcCharSetMerge(). + */ + + +typedef struct _PangoFcFontFaceData PangoFcFontFaceData; +typedef struct _PangoFcFace PangoFcFace; +typedef struct _PangoFcFamily PangoFcFamily; +typedef struct _PangoFcFindFuncInfo PangoFcFindFuncInfo; +typedef struct _PangoFcPatterns PangoFcPatterns; +typedef struct _PangoFcFontset PangoFcFontset; + +#define PANGO_FC_TYPE_FAMILY (pango_fc_family_get_type ()) +#define PANGO_FC_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_FAMILY, PangoFcFamily)) +#define PANGO_FC_IS_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_FAMILY)) + +#define PANGO_FC_TYPE_FACE (pango_fc_face_get_type ()) +#define PANGO_FC_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_FACE, PangoFcFace)) +#define PANGO_FC_IS_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_FACE)) + +#define PANGO_FC_TYPE_FONTSET (pango_fc_fontset_get_type ()) +#define PANGO_FC_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_FONTSET, PangoFcFontset)) +#define PANGO_FC_IS_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_FONTSET)) + +struct _PangoFcFontMapPrivate +{ + GHashTable *fontset_hash; /* Maps PangoFcFontsetKey -> PangoFcFontset */ + GQueue *fontset_cache; /* Recently used fontsets */ + + GHashTable *font_hash; /* Maps PangoFcFontKey -> PangoFcFont */ + + GHashTable *patterns_hash; /* Maps FcPattern -> PangoFcPatterns */ + + /* pattern_hash is used to make sure we only store one copy of + * each identical pattern. (Speeds up lookup). + */ + GHashTable *pattern_hash; + + GHashTable *font_face_data_hash; /* Maps font file name/id -> data */ + + /* List of all families availible */ + PangoFcFamily **families; + int n_families; /* -1 == uninitialized */ + + double dpi; + + /* Decoders */ + GSList *findfuncs; + + guint closed : 1; + + FcConfig *config; +}; + +struct _PangoFcFontFaceData +{ + /* Key */ + char *filename; + int id; /* needed to handle TTC files with multiple faces */ + + /* Data */ + FcPattern *pattern; /* Referenced pattern that owns filename */ + PangoCoverage *coverage; + PangoFcCmapCache *cmap_cache; +}; + +struct _PangoFcFace +{ + PangoFontFace parent_instance; + + PangoFcFamily *family; + char *style; + FcPattern *pattern; + + guint fake : 1; +}; + +struct _PangoFcFamily +{ + PangoFontFamily parent_instance; + + PangoFcFontMap *fontmap; + char *family_name; + + FcFontSet *patterns; + PangoFcFace **faces; + int n_faces; /* -1 == uninitialized */ + + int spacing; /* FC_SPACING */ +}; + +struct _PangoFcFindFuncInfo +{ + PangoFcDecoderFindFunc findfunc; + gpointer user_data; + GDestroyNotify dnotify; + gpointer ddata; +}; + +static GType pango_fc_family_get_type (void); +static GType pango_fc_face_get_type (void); +static GType pango_fc_fontset_get_type (void); + +static void pango_fc_font_map_finalize (GObject *object); +static PangoFont * pango_fc_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *description); +static PangoFontset *pango_fc_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); +static void pango_fc_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families); + +static double pango_fc_font_map_get_resolution (PangoFcFontMap *fcfontmap, + PangoContext *context); +static PangoFont *pango_fc_font_map_new_font (PangoFcFontMap *fontmap, + PangoFcFontsetKey *fontset_key, + FcPattern *match); + +static guint pango_fc_font_face_data_hash (PangoFcFontFaceData *key); +static gboolean pango_fc_font_face_data_equal (PangoFcFontFaceData *key1, + PangoFcFontFaceData *key2); + +static void pango_fc_fontset_key_init (PangoFcFontsetKey *key, + PangoFcFontMap *fcfontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); +static PangoFcFontsetKey *pango_fc_fontset_key_copy (const PangoFcFontsetKey *key); +static void pango_fc_fontset_key_free (PangoFcFontsetKey *key); +static guint pango_fc_fontset_key_hash (const PangoFcFontsetKey *key); +static gboolean pango_fc_fontset_key_equal (const PangoFcFontsetKey *key_a, + const PangoFcFontsetKey *key_b); + +static void pango_fc_font_key_init (PangoFcFontKey *key, + PangoFcFontMap *fcfontmap, + PangoFcFontsetKey *fontset_key, + FcPattern *pattern); +static PangoFcFontKey *pango_fc_font_key_copy (const PangoFcFontKey *key); +static void pango_fc_font_key_free (PangoFcFontKey *key); +static guint pango_fc_font_key_hash (const PangoFcFontKey *key); +static gboolean pango_fc_font_key_equal (const PangoFcFontKey *key_a, + const PangoFcFontKey *key_b); + +static PangoFcPatterns *pango_fc_patterns_new (FcPattern *pat, + PangoFcFontMap *fontmap); +static PangoFcPatterns *pango_fc_patterns_ref (PangoFcPatterns *pats); +static void pango_fc_patterns_unref (PangoFcPatterns *pats); +static FcPattern *pango_fc_patterns_get_pattern (PangoFcPatterns *pats); +static FcPattern *pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, + int i, + gboolean *prepare); + +static FcPattern *uniquify_pattern (PangoFcFontMap *fcfontmap, + FcPattern *pattern); + +static gpointer +get_gravity_class (void) +{ + static GEnumClass *class = NULL; /* MT-safe */ + + if (g_once_init_enter (&class)) + g_once_init_leave (&class, (gpointer)g_type_class_ref (PANGO_TYPE_GRAVITY)); + + return class; +} + +static guint +pango_fc_font_face_data_hash (PangoFcFontFaceData *key) +{ + return g_str_hash (key->filename) ^ key->id; +} + +static gboolean +pango_fc_font_face_data_equal (PangoFcFontFaceData *key1, + PangoFcFontFaceData *key2) +{ + return key1->id == key2->id && + (key1 == key2 || 0 == strcmp (key1->filename, key2->filename)); +} + +static void +pango_fc_font_face_data_free (PangoFcFontFaceData *data) +{ + FcPatternDestroy (data->pattern); + + if (data->coverage) + pango_coverage_unref (data->coverage); + + if (data->cmap_cache) + _pango_fc_cmap_cache_unref (data->cmap_cache); + + g_slice_free (PangoFcFontFaceData, data); +} + +/* Fowler / Noll / Vo (FNV) Hash (http://www.isthe.com/chongo/tech/comp/fnv/) + * + * Not necessarily better than a lot of other hashes, but should be OK, and + * well tested with binary data. + */ + +#define FNV_32_PRIME ((guint32)0x01000193) +#define FNV1_32_INIT ((guint32)0x811c9dc5) + +static guint32 +hash_bytes_fnv (unsigned char *buffer, + int len, + guint32 hval) +{ + while (len--) + { + hval *= FNV_32_PRIME; + hval ^= *buffer++; + } + + return hval; +} + +static void +get_context_matrix (PangoContext *context, + PangoMatrix *matrix) +{ + const PangoMatrix *set_matrix; + const PangoMatrix identity = PANGO_MATRIX_INIT; + + set_matrix = context ? pango_context_get_matrix (context) : NULL; + *matrix = set_matrix ? *set_matrix : identity; + matrix->x0 = matrix->y0 = 0.; +} + +static int +get_scaled_size (PangoFcFontMap *fcfontmap, + PangoContext *context, + const PangoFontDescription *desc) +{ + double size = pango_font_description_get_size (desc); + + if (!pango_font_description_get_size_is_absolute (desc)) + { + double dpi = pango_fc_font_map_get_resolution (fcfontmap, context); + + size = size * dpi / 72.; + } + + return .5 + pango_matrix_get_font_scale_factor (pango_context_get_matrix (context)) * size; +} + + + +struct _PangoFcFontsetKey { + PangoFcFontMap *fontmap; + PangoLanguage *language; + PangoFontDescription *desc; + PangoMatrix matrix; + int pixelsize; + double resolution; + gpointer context_key; + char *variations; +}; + +struct _PangoFcFontKey { + PangoFcFontMap *fontmap; + FcPattern *pattern; + PangoMatrix matrix; + gpointer context_key; + char *variations; +}; + +static void +pango_fc_fontset_key_init (PangoFcFontsetKey *key, + PangoFcFontMap *fcfontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + if (!language && context) + language = pango_context_get_language (context); + + key->fontmap = fcfontmap; + get_context_matrix (context, &key->matrix); + key->pixelsize = get_scaled_size (fcfontmap, context, desc); + key->resolution = pango_fc_font_map_get_resolution (fcfontmap, context); + key->language = language; + key->variations = g_strdup (pango_font_description_get_variations (desc)); + key->desc = pango_font_description_copy_static (desc); + pango_font_description_unset_fields (key->desc, PANGO_FONT_MASK_SIZE | PANGO_FONT_MASK_VARIATIONS); + + if (context && PANGO_FC_FONT_MAP_GET_CLASS (fcfontmap)->context_key_get) + key->context_key = (gpointer)PANGO_FC_FONT_MAP_GET_CLASS (fcfontmap)->context_key_get (fcfontmap, context); + else + key->context_key = NULL; +} + +static gboolean +pango_fc_fontset_key_equal (const PangoFcFontsetKey *key_a, + const PangoFcFontsetKey *key_b) +{ + if (key_a->language == key_b->language && + key_a->pixelsize == key_b->pixelsize && + key_a->resolution == key_b->resolution && + ((key_a->variations == NULL && key_b->variations == NULL) || + (key_a->variations && key_b->variations && (strcmp (key_a->variations, key_b->variations) == 0))) && + pango_font_description_equal (key_a->desc, key_b->desc) && + 0 == memcmp (&key_a->matrix, &key_b->matrix, 4 * sizeof (double))) + { + if (key_a->context_key) + return PANGO_FC_FONT_MAP_GET_CLASS (key_a->fontmap)->context_key_equal (key_a->fontmap, + key_a->context_key, + key_b->context_key); + else + return key_a->context_key == key_b->context_key; + } + else + return FALSE; +} + +static guint +pango_fc_fontset_key_hash (const PangoFcFontsetKey *key) +{ + guint32 hash = FNV1_32_INIT; + + /* We do a bytewise hash on the doubles */ + hash = hash_bytes_fnv ((unsigned char *)(&key->matrix), sizeof (double) * 4, hash); + hash = hash_bytes_fnv ((unsigned char *)(&key->resolution), sizeof (double), hash); + + hash ^= key->pixelsize; + + if (key->variations) + hash ^= g_str_hash (key->variations); + + if (key->context_key) + hash ^= PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_hash (key->fontmap, + key->context_key); + + return (hash ^ + GPOINTER_TO_UINT (key->language) ^ + pango_font_description_hash (key->desc)); +} + +static void +pango_fc_fontset_key_free (PangoFcFontsetKey *key) +{ + pango_font_description_free (key->desc); + g_free (key->variations); + + if (key->context_key) + PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap, + key->context_key); + + g_slice_free (PangoFcFontsetKey, key); +} + +static PangoFcFontsetKey * +pango_fc_fontset_key_copy (const PangoFcFontsetKey *old) +{ + PangoFcFontsetKey *key = g_slice_new (PangoFcFontsetKey); + + key->fontmap = old->fontmap; + key->language = old->language; + key->desc = pango_font_description_copy (old->desc); + key->matrix = old->matrix; + key->pixelsize = old->pixelsize; + key->resolution = old->resolution; + key->variations = g_strdup (old->variations); + + if (old->context_key) + key->context_key = PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_copy (key->fontmap, + old->context_key); + else + key->context_key = NULL; + + return key; +} + +/** + * pango_fc_fontset_key_get_language: + * @key: the fontset key + * + * Gets the language member of @key. + * + * Returns: the language + * + * Since: 1.24 + **/ +PangoLanguage * +pango_fc_fontset_key_get_language (const PangoFcFontsetKey *key) +{ + return key->language; +} + +/** + * pango_fc_fontset_key_get_description: + * @key: the fontset key + * + * Gets the font description of @key. + * + * Returns: the font description, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +const PangoFontDescription * +pango_fc_fontset_key_get_description (const PangoFcFontsetKey *key) +{ + return key->desc; +} + +/** + * pango_fc_fontset_key_get_matrix: + * @key: the fontset key + * + * Gets the matrix member of @key. + * + * Returns: the matrix, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +const PangoMatrix * +pango_fc_fontset_key_get_matrix (const PangoFcFontsetKey *key) +{ + return &key->matrix; +} + +/** + * pango_fc_fontset_key_get_absolute_size: + * @key: the fontset key + * + * Gets the absolute font size of @key in Pango units. This is adjusted + * for both resolution and transformation matrix. + * + * Returns: the pixel size of @key. + * + * Since: 1.24 + **/ +double +pango_fc_fontset_key_get_absolute_size (const PangoFcFontsetKey *key) +{ + return key->pixelsize; +} + +/** + * pango_fc_fontset_key_get_resolution: + * @key: the fontset key + * + * Gets the resolution of @key + * + * Returns: the resolution of @key + * + * Since: 1.24 + **/ +double +pango_fc_fontset_key_get_resolution (const PangoFcFontsetKey *key) +{ + return key->resolution; +} + +/** + * pango_fc_fontset_key_get_context_key: + * @key: the font key + * + * Gets the context key member of @key. + * + * Returns: the context key, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +gpointer +pango_fc_fontset_key_get_context_key (const PangoFcFontsetKey *key) +{ + return key->context_key; +} + +/* + * PangoFcFontKey + */ + +static gboolean +pango_fc_font_key_equal (const PangoFcFontKey *key_a, + const PangoFcFontKey *key_b) +{ + if (key_a->pattern == key_b->pattern && + ((key_a->variations == NULL && key_b->variations == NULL) || + (key_a->variations && key_b->variations && (strcmp (key_a->variations, key_b->variations) == 0))) && + 0 == memcmp (&key_a->matrix, &key_b->matrix, 4 * sizeof (double))) + { + if (key_a->context_key && key_b->context_key) + return PANGO_FC_FONT_MAP_GET_CLASS (key_a->fontmap)->context_key_equal (key_a->fontmap, + key_a->context_key, + key_b->context_key); + else + return key_a->context_key == key_b->context_key; + } + else + return FALSE; +} + +static guint +pango_fc_font_key_hash (const PangoFcFontKey *key) +{ + guint32 hash = FNV1_32_INIT; + + /* We do a bytewise hash on the doubles */ + hash = hash_bytes_fnv ((unsigned char *)(&key->matrix), sizeof (double) * 4, hash); + + if (key->variations) + hash ^= g_str_hash (key->variations); + + if (key->context_key) + hash ^= PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_hash (key->fontmap, + key->context_key); + + return (hash ^ GPOINTER_TO_UINT (key->pattern)); +} + +static void +pango_fc_font_key_free (PangoFcFontKey *key) +{ + if (key->pattern) + FcPatternDestroy (key->pattern); + + if (key->context_key) + PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap, + key->context_key); + + g_free (key->variations); + + g_slice_free (PangoFcFontKey, key); +} + +static PangoFcFontKey * +pango_fc_font_key_copy (const PangoFcFontKey *old) +{ + PangoFcFontKey *key = g_slice_new (PangoFcFontKey); + + key->fontmap = old->fontmap; + FcPatternReference (old->pattern); + key->pattern = old->pattern; + key->matrix = old->matrix; + key->variations = g_strdup (old->variations); + if (old->context_key) + key->context_key = PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_copy (key->fontmap, + old->context_key); + else + key->context_key = NULL; + + return key; +} + +static void +pango_fc_font_key_init (PangoFcFontKey *key, + PangoFcFontMap *fcfontmap, + PangoFcFontsetKey *fontset_key, + FcPattern *pattern) +{ + key->fontmap = fcfontmap; + key->pattern = pattern; + key->matrix = *pango_fc_fontset_key_get_matrix (fontset_key); + key->variations = fontset_key->variations; + key->context_key = pango_fc_fontset_key_get_context_key (fontset_key); +} + +/* Public API */ + +/** + * pango_fc_font_key_get_pattern: + * @key: the font key + * + * Gets the fontconfig pattern member of @key. + * + * Returns: the pattern, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +const FcPattern * +pango_fc_font_key_get_pattern (const PangoFcFontKey *key) +{ + return key->pattern; +} + +/** + * pango_fc_font_key_get_matrix: + * @key: the font key + * + * Gets the matrix member of @key. + * + * Returns: the matrix, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +const PangoMatrix * +pango_fc_font_key_get_matrix (const PangoFcFontKey *key) +{ + return &key->matrix; +} + +/** + * pango_fc_font_key_get_context_key: + * @key: the font key + * + * Gets the context key member of @key. + * + * Returns: the context key, which is owned by @key and should not be modified. + * + * Since: 1.24 + **/ +gpointer +pango_fc_font_key_get_context_key (const PangoFcFontKey *key) +{ + return key->context_key; +} + +const char * +pango_fc_font_key_get_variations (const PangoFcFontKey *key) +{ + return key->variations; +} + +/* + * PangoFcPatterns + */ + +struct _PangoFcPatterns { + guint ref_count; + + PangoFcFontMap *fontmap; + + FcPattern *pattern; + FcPattern *match; + FcFontSet *fontset; +}; + +static PangoFcPatterns * +pango_fc_patterns_new (FcPattern *pat, PangoFcFontMap *fontmap) +{ + PangoFcPatterns *pats; + + pat = uniquify_pattern (fontmap, pat); + pats = g_hash_table_lookup (fontmap->priv->patterns_hash, pat); + if (pats) + return pango_fc_patterns_ref (pats); + + pats = g_slice_new0 (PangoFcPatterns); + + pats->fontmap = fontmap; + + pats->ref_count = 1; + FcPatternReference (pat); + pats->pattern = pat; + + g_hash_table_insert (fontmap->priv->patterns_hash, + pats->pattern, pats); + + return pats; +} + +static PangoFcPatterns * +pango_fc_patterns_ref (PangoFcPatterns *pats) +{ + g_return_val_if_fail (pats->ref_count > 0, NULL); + + pats->ref_count++; + + return pats; +} + +static void +pango_fc_patterns_unref (PangoFcPatterns *pats) +{ + g_return_if_fail (pats->ref_count > 0); + + pats->ref_count--; + + if (pats->ref_count) + return; + + /* Only remove from fontmap hash if we are in it. This is not necessarily + * the case after a cache_clear() call. */ + if (pats->fontmap->priv->patterns_hash && + pats == g_hash_table_lookup (pats->fontmap->priv->patterns_hash, pats->pattern)) + g_hash_table_remove (pats->fontmap->priv->patterns_hash, + pats->pattern); + + if (pats->pattern) + FcPatternDestroy (pats->pattern); + + if (pats->match) + FcPatternDestroy (pats->match); + + if (pats->fontset) + FcFontSetDestroy (pats->fontset); + + g_slice_free (PangoFcPatterns, pats); +} + +static FcPattern * +pango_fc_patterns_get_pattern (PangoFcPatterns *pats) +{ + return pats->pattern; +} + +static FcPattern * +pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prepare) +{ + if (i == 0) + { + FcResult result; + if (!pats->match && !pats->fontset) + pats->match = FcFontMatch (pats->fontmap->priv->config, pats->pattern, &result); + + if (pats->match) + { + *prepare = FALSE; + return pats->match; + } + } + else + { + if (!pats->fontset) + { + FcResult result; + pats->fontset = FcFontSort (pats->fontmap->priv->config, pats->pattern, FcTrue, NULL, &result); + if (pats->match) + { + FcPatternDestroy (pats->match); + pats->match = NULL; + } + } + } + + *prepare = TRUE; + if (pats->fontset && i < pats->fontset->nfont) + return pats->fontset->fonts[i]; + else + return NULL; +} + + +/* + * PangoFcFontset + */ + +static void pango_fc_fontset_finalize (GObject *object); +static PangoLanguage * pango_fc_fontset_get_language (PangoFontset *fontset); +static PangoFont * pango_fc_fontset_get_font (PangoFontset *fontset, + guint wc); +static void pango_fc_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data); + +struct _PangoFcFontset +{ + PangoFontset parent_instance; + + PangoFcFontsetKey *key; + + PangoFcPatterns *patterns; + int patterns_i; + + GPtrArray *fonts; + GPtrArray *coverages; + + GList *cache_link; +}; + +typedef PangoFontsetClass PangoFcFontsetClass; +G_DEFINE_TYPE (PangoFcFontset, pango_fc_fontset, PANGO_TYPE_FONTSET); + +static PangoFcFontset * +pango_fc_fontset_new (PangoFcFontsetKey *key, + PangoFcPatterns *patterns) +{ + PangoFcFontset *fontset; + + fontset = g_object_new (PANGO_FC_TYPE_FONTSET, NULL); + + fontset->key = pango_fc_fontset_key_copy (key); + fontset->patterns = pango_fc_patterns_ref (patterns); + + return fontset; +} + +static PangoFcFontsetKey * +pango_fc_fontset_get_key (PangoFcFontset *fontset) +{ + return fontset->key; +} + +static PangoFont * +pango_fc_fontset_load_next_font (PangoFcFontset *fontset) +{ + FcPattern *pattern, *font_pattern; + PangoFont *font; + gboolean prepare; + + pattern = pango_fc_patterns_get_pattern (fontset->patterns); + font_pattern = pango_fc_patterns_get_font_pattern (fontset->patterns, + fontset->patterns_i++, + &prepare); + if (G_UNLIKELY (!font_pattern)) + return NULL; + + if (prepare) + { + font_pattern = FcFontRenderPrepare (NULL, pattern, font_pattern); + + if (G_UNLIKELY (!font_pattern)) + return NULL; + } + + font = pango_fc_font_map_new_font (fontset->key->fontmap, + fontset->key, + font_pattern); + + if (prepare) + FcPatternDestroy (font_pattern); + + return font; +} + +static PangoFont * +pango_fc_fontset_get_font_at (PangoFcFontset *fontset, + unsigned int i) +{ + while (i >= fontset->fonts->len) + { + PangoFont *font = pango_fc_fontset_load_next_font (fontset); + g_ptr_array_add (fontset->fonts, font); + g_ptr_array_add (fontset->coverages, NULL); + if (!font) + return NULL; + } + + return g_ptr_array_index (fontset->fonts, i); +} + +static void +pango_fc_fontset_class_init (PangoFcFontsetClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontsetClass *fontset_class = PANGO_FONTSET_CLASS (class); + + object_class->finalize = pango_fc_fontset_finalize; + + fontset_class->get_font = pango_fc_fontset_get_font; + fontset_class->get_language = pango_fc_fontset_get_language; + fontset_class->foreach = pango_fc_fontset_foreach; +} + +static void +pango_fc_fontset_init (PangoFcFontset *fontset) +{ + fontset->fonts = g_ptr_array_new (); + fontset->coverages = g_ptr_array_new (); +} + +static void +pango_fc_fontset_finalize (GObject *object) +{ + PangoFcFontset *fontset = PANGO_FC_FONTSET (object); + unsigned int i; + + for (i = 0; i < fontset->fonts->len; i++) + { + PangoFont *font = g_ptr_array_index(fontset->fonts, i); + if (font) + g_object_unref (font); + } + g_ptr_array_free (fontset->fonts, TRUE); + + for (i = 0; i < fontset->coverages->len; i++) + { + PangoCoverage *coverage = g_ptr_array_index (fontset->coverages, i); + if (coverage) + pango_coverage_unref (coverage); + } + g_ptr_array_free (fontset->coverages, TRUE); + + if (fontset->key) + pango_fc_fontset_key_free (fontset->key); + + if (fontset->patterns) + pango_fc_patterns_unref (fontset->patterns); + + G_OBJECT_CLASS (pango_fc_fontset_parent_class)->finalize (object); +} + +static PangoLanguage * +pango_fc_fontset_get_language (PangoFontset *fontset) +{ + PangoFcFontset *fcfontset = PANGO_FC_FONTSET (fontset); + + return pango_fc_fontset_key_get_language (pango_fc_fontset_get_key (fcfontset)); +} + +static PangoFont * +pango_fc_fontset_get_font (PangoFontset *fontset, + guint wc) +{ + PangoFcFontset *fcfontset = PANGO_FC_FONTSET (fontset); + PangoCoverageLevel best_level = PANGO_COVERAGE_NONE; + PangoCoverageLevel level; + PangoFont *font; + PangoCoverage *coverage; + int result = -1; + unsigned int i; + + for (i = 0; + pango_fc_fontset_get_font_at (fcfontset, i); + i++) + { + coverage = g_ptr_array_index (fcfontset->coverages, i); + + if (coverage == NULL) + { + font = g_ptr_array_index (fcfontset->fonts, i); + + coverage = pango_font_get_coverage (font, fcfontset->key->language); + g_ptr_array_index (fcfontset->coverages, i) = coverage; + } + + level = pango_coverage_get (coverage, wc); + + if (result == -1 || level > best_level) + { + result = i; + best_level = level; + if (level == PANGO_COVERAGE_EXACT) + break; + } + } + + if (G_UNLIKELY (result == -1)) + return NULL; + + font = g_ptr_array_index(fcfontset->fonts, result); + return g_object_ref (font); +} + +static void +pango_fc_fontset_foreach (PangoFontset *fontset, + PangoFontsetForeachFunc func, + gpointer data) +{ + PangoFcFontset *fcfontset = PANGO_FC_FONTSET (fontset); + PangoFont *font; + unsigned int i; + + for (i = 0; + (font = pango_fc_fontset_get_font_at (fcfontset, i)); + i++) + { + if ((*func) (fontset, font, data)) + return; + } +} + + +/* + * PangoFcFontMap + */ + +G_DEFINE_ABSTRACT_TYPE (PangoFcFontMap, pango_fc_font_map, PANGO_TYPE_FONT_MAP) + +static void +pango_fc_font_map_init (PangoFcFontMap *fcfontmap) +{ + PangoFcFontMapPrivate *priv; + + priv = fcfontmap->priv = G_TYPE_INSTANCE_GET_PRIVATE (fcfontmap, + PANGO_TYPE_FC_FONT_MAP, + PangoFcFontMapPrivate); + + priv->n_families = -1; + + priv->font_hash = g_hash_table_new ((GHashFunc)pango_fc_font_key_hash, + (GEqualFunc)pango_fc_font_key_equal); + + priv->fontset_hash = g_hash_table_new_full ((GHashFunc)pango_fc_fontset_key_hash, + (GEqualFunc)pango_fc_fontset_key_equal, + NULL, + (GDestroyNotify)g_object_unref); + priv->fontset_cache = g_queue_new (); + + priv->patterns_hash = g_hash_table_new (NULL, NULL); + + priv->pattern_hash = g_hash_table_new_full ((GHashFunc) FcPatternHash, + (GEqualFunc) FcPatternEqual, + (GDestroyNotify) FcPatternDestroy, + NULL); + + priv->font_face_data_hash = g_hash_table_new_full ((GHashFunc)pango_fc_font_face_data_hash, + (GEqualFunc)pango_fc_font_face_data_equal, + (GDestroyNotify)pango_fc_font_face_data_free, + NULL); + priv->dpi = -1; +} + +static void +pango_fc_font_map_fini (PangoFcFontMap *fcfontmap) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + int i; + + g_queue_free (priv->fontset_cache); + priv->fontset_cache = NULL; + + g_hash_table_destroy (priv->fontset_hash); + priv->fontset_hash = NULL; + + g_hash_table_destroy (priv->patterns_hash); + priv->patterns_hash = NULL; + + g_hash_table_destroy (priv->font_hash); + priv->font_hash = NULL; + + g_hash_table_destroy (priv->font_face_data_hash); + priv->font_face_data_hash = NULL; + + g_hash_table_destroy (priv->pattern_hash); + priv->pattern_hash = NULL; + + for (i = 0; i < priv->n_families; i++) + g_object_unref (priv->families[i]); + g_free (priv->families); + priv->n_families = -1; + priv->families = NULL; +} + +static void +pango_fc_font_map_class_init (PangoFcFontMapClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + + object_class->finalize = pango_fc_font_map_finalize; + fontmap_class->load_font = pango_fc_font_map_load_font; + fontmap_class->load_fontset = pango_fc_font_map_load_fontset; + fontmap_class->list_families = pango_fc_font_map_list_families; + fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_FC; + + g_type_class_add_private (object_class, sizeof (PangoFcFontMapPrivate)); +} + + +/** + * pango_fc_font_map_add_decoder_find_func: + * @fcfontmap: The #PangoFcFontMap to add this method to. + * @findfunc: The #PangoFcDecoderFindFunc callback function + * @user_data: User data. + * @dnotify: A #GDestroyNotify callback that will be called when the + * fontmap is finalized and the decoder is released. + * + * This function saves a callback method in the #PangoFcFontMap that + * will be called whenever new fonts are created. If the + * function returns a #PangoFcDecoder, that decoder will be used to + * determine both coverage via a #FcCharSet and a one-to-one mapping of + * characters to glyphs. This will allow applications to have + * application-specific encodings for various fonts. + * + * Since: 1.6 + **/ +void +pango_fc_font_map_add_decoder_find_func (PangoFcFontMap *fcfontmap, + PangoFcDecoderFindFunc findfunc, + gpointer user_data, + GDestroyNotify dnotify) +{ + PangoFcFontMapPrivate *priv; + PangoFcFindFuncInfo *info; + + g_return_if_fail (PANGO_IS_FC_FONT_MAP (fcfontmap)); + + priv = fcfontmap->priv; + + info = g_slice_new (PangoFcFindFuncInfo); + + info->findfunc = findfunc; + info->user_data = user_data; + info->dnotify = dnotify; + + priv->findfuncs = g_slist_append (priv->findfuncs, info); +} + +/** + * pango_fc_font_map_find_decoder: + * @fcfontmap: The #PangoFcFontMap to use. + * @pattern: The #FcPattern to find the decoder for. + * + * Finds the decoder to use for @pattern. Decoders can be added to + * a font map using pango_fc_font_map_add_decoder_find_func(). + * + * Returns: (nullable): a newly created #PangoFcDecoder object or + * %NULL if no decoder is set for @pattern. + * + * Since: 1.26 + **/ +PangoFcDecoder * +pango_fc_font_map_find_decoder (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + GSList *l; + + g_return_val_if_fail (PANGO_IS_FC_FONT_MAP (fcfontmap), NULL); + g_return_val_if_fail (pattern != NULL, NULL); + + for (l = fcfontmap->priv->findfuncs; l && l->data; l = l->next) + { + PangoFcFindFuncInfo *info = l->data; + PangoFcDecoder *decoder; + + decoder = info->findfunc (pattern, info->user_data); + if (decoder) + return decoder; + } + + return NULL; +} + +static void +pango_fc_font_map_finalize (GObject *object) +{ + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (object); + + pango_fc_font_map_shutdown (fcfontmap); + + G_OBJECT_CLASS (pango_fc_font_map_parent_class)->finalize (object); +} + +/* Add a mapping from key to fcfont */ +static void +pango_fc_font_map_add (PangoFcFontMap *fcfontmap, + PangoFcFontKey *key, + PangoFcFont *fcfont) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + PangoFcFontKey *key_copy; + + key_copy = pango_fc_font_key_copy (key); + _pango_fc_font_set_font_key (fcfont, key_copy); + g_hash_table_insert (priv->font_hash, key_copy, fcfont); +} + +/* Remove mapping from fcfont->key to fcfont */ +/* Closely related to shutdown_font() */ +void +_pango_fc_font_map_remove (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + PangoFcFontKey *key; + + key = _pango_fc_font_get_font_key (fcfont); + if (key) + { + /* Only remove from fontmap hash if we are in it. This is not necessarily + * the case after a cache_clear() call. */ + if (priv->font_hash && + fcfont == g_hash_table_lookup (priv->font_hash, key)) + { + g_hash_table_remove (priv->font_hash, key); + } + _pango_fc_font_set_font_key (fcfont, NULL); + pango_fc_font_key_free (key); + } +} + +static PangoFcFamily * +create_family (PangoFcFontMap *fcfontmap, + const char *family_name, + int spacing) +{ + PangoFcFamily *family = g_object_new (PANGO_FC_TYPE_FAMILY, NULL); + family->fontmap = fcfontmap; + family->family_name = g_strdup (family_name); + family->spacing = spacing; + family->patterns = FcFontSetCreate (); + + return family; +} + +static gboolean +is_alias_family (const char *family_name) +{ + switch (family_name[0]) + { + case 'm': + case 'M': + return (g_ascii_strcasecmp (family_name, "monospace") == 0); + case 's': + case 'S': + return (g_ascii_strcasecmp (family_name, "sans") == 0 || + g_ascii_strcasecmp (family_name, "serif") == 0); + } + + return FALSE; +} + +static void +pango_fc_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families) +{ + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (fontmap); + PangoFcFontMapPrivate *priv = fcfontmap->priv; + FcFontSet *fontset; + int i; + int count; + + if (priv->closed) + { + if (families) + *families = NULL; + if (n_families) + *n_families = 0; + + return; + } + + if (priv->n_families < 0) + { + FcObjectSet *os = FcObjectSetBuild (FC_FAMILY, FC_SPACING, FC_STYLE, FC_WEIGHT, FC_WIDTH, FC_SLANT, NULL); + FcPattern *pat = FcPatternCreate (); + GHashTable *temp_family_hash; + + fontset = FcFontList (priv->config, pat, os); + + FcPatternDestroy (pat); + FcObjectSetDestroy (os); + + priv->families = g_new (PangoFcFamily *, fontset->nfont + 3); /* 3 standard aliases */ + temp_family_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + count = 0; + for (i = 0; i < fontset->nfont; i++) + { + char *s; + FcResult res; + int spacing; + PangoFcFamily *temp_family; + + res = FcPatternGetString (fontset->fonts[i], FC_FAMILY, 0, (FcChar8 **)(void*)&s); + g_assert (res == FcResultMatch); + + temp_family = g_hash_table_lookup (temp_family_hash, s); + if (!is_alias_family (s) && !temp_family) + { + res = FcPatternGetInteger (fontset->fonts[i], FC_SPACING, 0, &spacing); + g_assert (res == FcResultMatch || res == FcResultNoMatch); + if (res == FcResultNoMatch) + spacing = FC_PROPORTIONAL; + + temp_family = create_family (fcfontmap, s, spacing); + g_hash_table_insert (temp_family_hash, g_strdup (s), temp_family); + priv->families[count++] = temp_family; + } + + if (temp_family) + { + FcPatternReference (fontset->fonts[i]); + FcFontSetAdd (temp_family->patterns, fontset->fonts[i]); + } + } + + FcFontSetDestroy (fontset); + g_hash_table_destroy (temp_family_hash); + + priv->families[count++] = create_family (fcfontmap, "Sans", FC_PROPORTIONAL); + priv->families[count++] = create_family (fcfontmap, "Serif", FC_PROPORTIONAL); + priv->families[count++] = create_family (fcfontmap, "Monospace", FC_MONO); + + priv->n_families = count; + } + + if (n_families) + *n_families = priv->n_families; + + if (families) + *families = g_memdup (priv->families, priv->n_families * sizeof (PangoFontFamily *)); +} + +static double +pango_fc_convert_weight_to_fc (PangoWeight pango_weight) +{ +#ifdef HAVE_FCWEIGHTFROMOPENTYPEDOUBLE + return FcWeightFromOpenTypeDouble (pango_weight); +#else + return FcWeightFromOpenType (pango_weight); +#endif +} + +static int +pango_fc_convert_slant_to_fc (PangoStyle pango_style) +{ + switch (pango_style) + { + case PANGO_STYLE_NORMAL: + return FC_SLANT_ROMAN; + case PANGO_STYLE_ITALIC: + return FC_SLANT_ITALIC; + case PANGO_STYLE_OBLIQUE: + return FC_SLANT_OBLIQUE; + default: + return FC_SLANT_ROMAN; + } +} + +static int +pango_fc_convert_width_to_fc (PangoStretch pango_stretch) +{ + switch (pango_stretch) + { + case PANGO_STRETCH_NORMAL: + return FC_WIDTH_NORMAL; + case PANGO_STRETCH_ULTRA_CONDENSED: + return FC_WIDTH_ULTRACONDENSED; + case PANGO_STRETCH_EXTRA_CONDENSED: + return FC_WIDTH_EXTRACONDENSED; + case PANGO_STRETCH_CONDENSED: + return FC_WIDTH_CONDENSED; + case PANGO_STRETCH_SEMI_CONDENSED: + return FC_WIDTH_SEMICONDENSED; + case PANGO_STRETCH_SEMI_EXPANDED: + return FC_WIDTH_SEMIEXPANDED; + case PANGO_STRETCH_EXPANDED: + return FC_WIDTH_EXPANDED; + case PANGO_STRETCH_EXTRA_EXPANDED: + return FC_WIDTH_EXTRAEXPANDED; + case PANGO_STRETCH_ULTRA_EXPANDED: + return FC_WIDTH_ULTRAEXPANDED; + default: + return FC_WIDTH_NORMAL; + } +} + +static FcPattern * +pango_fc_make_pattern (const PangoFontDescription *description, + PangoLanguage *language, + int pixel_size, + double dpi, + const char *variations) +{ + FcPattern *pattern; + const char *prgname; + int slant; + double weight; + PangoGravity gravity; + FcBool vertical; + char **families; + int i; + int width; + + prgname = g_get_prgname (); + slant = pango_fc_convert_slant_to_fc (pango_font_description_get_style (description)); + weight = pango_fc_convert_weight_to_fc (pango_font_description_get_weight (description)); + width = pango_fc_convert_width_to_fc (pango_font_description_get_stretch (description)); + + gravity = pango_font_description_get_gravity (description); + vertical = PANGO_GRAVITY_IS_VERTICAL (gravity) ? FcTrue : FcFalse; + + /* The reason for passing in FC_SIZE as well as FC_PIXEL_SIZE is + * to work around a bug in libgnomeprint where it doesn't look + * for FC_PIXEL_SIZE. See http://bugzilla.gnome.org/show_bug.cgi?id=169020 + * + * Putting FC_SIZE in here slightly reduces the efficiency + * of caching of patterns and fonts when working with multiple different + * dpi values. + */ + pattern = FcPatternBuild (NULL, + PANGO_FC_VERSION, FcTypeInteger, pango_version(), + FC_WEIGHT, FcTypeDouble, weight, + FC_SLANT, FcTypeInteger, slant, + FC_WIDTH, FcTypeInteger, width, + FC_VERTICAL_LAYOUT, FcTypeBool, vertical, +#ifdef FC_VARIABLE + FC_VARIABLE, FcTypeBool, FcDontCare, +#endif + FC_DPI, FcTypeDouble, dpi, + FC_SIZE, FcTypeDouble, pixel_size * (72. / 1024. / dpi), + FC_PIXEL_SIZE, FcTypeDouble, pixel_size / 1024., + NULL); + + if (variations) + FcPatternAddString (pattern, PANGO_FC_FONT_VARIATIONS, (FcChar8*) variations); + + if (pango_font_description_get_family (description)) + { + families = g_strsplit (pango_font_description_get_family (description), ",", -1); + + for (i = 0; families[i]; i++) + FcPatternAddString (pattern, FC_FAMILY, (FcChar8*) families[i]); + + g_strfreev (families); + } + + if (language) + FcPatternAddString (pattern, FC_LANG, (FcChar8 *) pango_language_to_string (language)); + + if (gravity != PANGO_GRAVITY_SOUTH) + { + GEnumValue *value = g_enum_get_value (get_gravity_class (), gravity); + FcPatternAddString (pattern, PANGO_FC_GRAVITY, (FcChar8*) value->value_nick); + } + + if (prgname) + FcPatternAddString (pattern, PANGO_FC_PRGNAME, (FcChar8*) prgname); + + return pattern; +} + +static FcPattern * +uniquify_pattern (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + FcPattern *old_pattern; + + old_pattern = g_hash_table_lookup (priv->pattern_hash, pattern); + if (old_pattern) + { + return old_pattern; + } + else + { + FcPatternReference (pattern); + g_hash_table_insert (priv->pattern_hash, pattern, pattern); + return pattern; + } +} + +static PangoFont * +pango_fc_font_map_new_font (PangoFcFontMap *fcfontmap, + PangoFcFontsetKey *fontset_key, + FcPattern *match) +{ + PangoFcFontMapClass *class; + PangoFcFontMapPrivate *priv = fcfontmap->priv; + FcPattern *pattern; + PangoFcFont *fcfont; + PangoFcFontKey key; + + if (priv->closed) + return NULL; + + match = uniquify_pattern (fcfontmap, match); + + pango_fc_font_key_init (&key, fcfontmap, fontset_key, match); + + fcfont = g_hash_table_lookup (priv->font_hash, &key); + if (fcfont) + return g_object_ref (PANGO_FONT (fcfont)); + + class = PANGO_FC_FONT_MAP_GET_CLASS (fcfontmap); + + if (class->create_font) + { + fcfont = class->create_font (fcfontmap, &key); + } + else + { + const PangoMatrix *pango_matrix = pango_fc_fontset_key_get_matrix (fontset_key); + FcMatrix fc_matrix, *fc_matrix_val; + int i; + + /* Fontconfig has the Y axis pointing up, Pango, down. + */ + fc_matrix.xx = pango_matrix->xx; + fc_matrix.xy = - pango_matrix->xy; + fc_matrix.yx = - pango_matrix->yx; + fc_matrix.yy = pango_matrix->yy; + + pattern = FcPatternDuplicate (match); + + for (i = 0; FcPatternGetMatrix (pattern, FC_MATRIX, i, &fc_matrix_val) == FcResultMatch; i++) + FcMatrixMultiply (&fc_matrix, &fc_matrix, fc_matrix_val); + + FcPatternDel (pattern, FC_MATRIX); + FcPatternAddMatrix (pattern, FC_MATRIX, &fc_matrix); + + fcfont = class->new_font (fcfontmap, uniquify_pattern (fcfontmap, pattern)); + + FcPatternDestroy (pattern); + } + + if (!fcfont) + return NULL; + + fcfont->matrix = key.matrix; + /* In case the backend didn't set the fontmap */ + if (!fcfont->fontmap) + g_object_set (fcfont, + "fontmap", fcfontmap, + NULL); + + /* cache it on fontmap */ + pango_fc_font_map_add (fcfontmap, &key, fcfont); + + return (PangoFont *)fcfont; +} + +static void +pango_fc_default_substitute (PangoFcFontMap *fontmap, + PangoFcFontsetKey *fontsetkey, + FcPattern *pattern) +{ + if (PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->fontset_key_substitute) + PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->fontset_key_substitute (fontmap, fontsetkey, pattern); + else if (PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute) + PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute (fontmap, pattern); +} + +static double +pango_fc_font_map_get_resolution (PangoFcFontMap *fcfontmap, + PangoContext *context) +{ + if (PANGO_FC_FONT_MAP_GET_CLASS (fcfontmap)->get_resolution) + return PANGO_FC_FONT_MAP_GET_CLASS (fcfontmap)->get_resolution (fcfontmap, context); + + if (fcfontmap->priv->dpi < 0) + { + FcResult result = FcResultNoMatch; + FcPattern *tmp = FcPatternBuild (NULL, + FC_FAMILY, FcTypeString, "Sans", + FC_SIZE, FcTypeDouble, 10., + NULL); + if (tmp) + { + pango_fc_default_substitute (fcfontmap, NULL, tmp); + result = FcPatternGetDouble (tmp, FC_DPI, 0, &fcfontmap->priv->dpi); + FcPatternDestroy (tmp); + } + + if (result != FcResultMatch) + { + g_warning ("Error getting DPI from fontconfig, using 72.0"); + fcfontmap->priv->dpi = 72.0; + } + } + + return fcfontmap->priv->dpi; +} + +static FcPattern * +pango_fc_fontset_key_make_pattern (PangoFcFontsetKey *key) +{ + return pango_fc_make_pattern (key->desc, + key->language, + key->pixelsize, + key->resolution, + key->variations); +} + +static PangoFcPatterns * +pango_fc_font_map_get_patterns (PangoFontMap *fontmap, + PangoFcFontsetKey *key) +{ + PangoFcFontMap *fcfontmap = (PangoFcFontMap *)fontmap; + PangoFcPatterns *patterns; + FcPattern *pattern; + + pattern = pango_fc_fontset_key_make_pattern (key); + pango_fc_default_substitute (fcfontmap, key, pattern); + + patterns = pango_fc_patterns_new (pattern, fcfontmap); + + FcPatternDestroy (pattern); + + return patterns; +} + +static gboolean +get_first_font (PangoFontset *fontset G_GNUC_UNUSED, + PangoFont *font, + gpointer data) +{ + *(PangoFont **)data = font; + + return TRUE; +} + +static PangoFont * +pango_fc_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *description) +{ + PangoLanguage *language; + PangoFontset *fontset; + PangoFont *font = NULL; + + if (context) + language = pango_context_get_language (context); + else + language = NULL; + + fontset = pango_font_map_load_fontset (fontmap, context, description, language); + + if (fontset) + { + pango_fontset_foreach (fontset, get_first_font, &font); + + if (font) + g_object_ref (font); + + g_object_unref (fontset); + } + + return font; +} + +static void +pango_fc_fontset_cache (PangoFcFontset *fontset, + PangoFcFontMap *fcfontmap) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + GQueue *cache = priv->fontset_cache; + + if (fontset->cache_link) + { + if (fontset->cache_link == cache->head) + return; + + /* Already in cache, move to head + */ + if (fontset->cache_link == cache->tail) + cache->tail = fontset->cache_link->prev; + + cache->head = g_list_remove_link (cache->head, fontset->cache_link); + cache->length--; + } + else + { + /* Add to cache initially + */ +#if 1 + if (cache->length == FONTSET_CACHE_SIZE) + { + PangoFcFontset *tmp_fontset = g_queue_pop_tail (cache); + tmp_fontset->cache_link = NULL; + g_hash_table_remove (priv->fontset_hash, tmp_fontset->key); + } +#endif + + fontset->cache_link = g_list_prepend (NULL, fontset); + } + + g_queue_push_head_link (cache, fontset->cache_link); +} + +static PangoFontset * +pango_fc_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + PangoFcFontMap *fcfontmap = (PangoFcFontMap *)fontmap; + PangoFcFontMapPrivate *priv = fcfontmap->priv; + PangoFcFontset *fontset; + PangoFcFontsetKey key; + + pango_fc_fontset_key_init (&key, fcfontmap, context, desc, language); + + fontset = g_hash_table_lookup (priv->fontset_hash, &key); + + if (G_UNLIKELY (!fontset)) + { + PangoFcPatterns *patterns = pango_fc_font_map_get_patterns (fontmap, &key); + + if (!patterns) + return NULL; + + fontset = pango_fc_fontset_new (&key, patterns); + g_hash_table_insert (priv->fontset_hash, pango_fc_fontset_get_key (fontset), fontset); + + pango_fc_patterns_unref (patterns); + } + + pango_fc_fontset_cache (fontset, fcfontmap); + + pango_font_description_free (key.desc); + g_free (key.variations); + + return g_object_ref (PANGO_FONTSET (fontset)); +} + +/** + * pango_fc_font_map_cache_clear: + * @fcfontmap: a #PangoFcFontMap + * + * Clear all cached information and fontsets for this font map; + * this should be called whenever there is a change in the + * output of the default_substitute() virtual function of the + * font map, or if fontconfig has been reinitialized to new + * configuration. + * + * Since: 1.4 + **/ +void +pango_fc_font_map_cache_clear (PangoFcFontMap *fcfontmap) +{ + if (G_UNLIKELY (fcfontmap->priv->closed)) + return; + + pango_fc_font_map_fini (fcfontmap); + pango_fc_font_map_init (fcfontmap); + + pango_font_map_changed (PANGO_FONT_MAP (fcfontmap)); +} + +/** + * pango_fc_font_map_config_changed: + * @fcfontmap: a #PangoFcFontMap + * + * Informs font map that the fontconfig configuration (ie, FcConfig object) + * used by this font map has changed. This currently calls + * pango_fc_font_map_cache_clear() which ensures that list of fonts, etc + * will be regenerated using the updated configuration. + * + * Since: 1.38 + **/ +void +pango_fc_font_map_config_changed (PangoFcFontMap *fcfontmap) +{ + pango_fc_font_map_cache_clear (fcfontmap); +} + +/** + * pango_fc_font_map_set_config: + * @fcfontmap: a #PangoFcFontMap + * @fcconfig: (nullable): a #FcConfig, or %NULL + * + * Set the FcConfig for this font map to use. The default value + * is %NULL, which causes Fontconfig to use its global "current config". + * You can create a new FcConfig object and use this API to attach it + * to a font map. + * + * This is particularly useful for example, if you want to use application + * fonts with Pango. For that, you would create a fresh FcConfig, add your + * app fonts to it, and attach it to a new Pango font map. + * + * If @fcconfig is different from the previous config attached to the font map, + * pango_fc_font_map_config_changed() is called. + * + * This function acquires a reference to the FcConfig object; the caller + * does NOT need to retain a reference. + * + * Since: 1.38 + **/ +void +pango_fc_font_map_set_config (PangoFcFontMap *fcfontmap, + FcConfig *fcconfig) +{ + FcConfig *oldconfig; + + g_return_if_fail (PANGO_IS_FC_FONT_MAP (fcfontmap)); + + oldconfig = fcfontmap->priv->config; + + if (fcconfig) + FcConfigReference (fcconfig); + + fcfontmap->priv->config = fcconfig; + + if (oldconfig != fcconfig) + pango_fc_font_map_config_changed (fcfontmap); + + if (oldconfig) + FcConfigDestroy (oldconfig); +} + +/** + * pango_fc_font_map_get_config: + * @fcfontmap: a #PangoFcFontMap + * + * Fetches FcConfig attached to a font map. See pango_fc_font_map_set_config(). + * + * Returns: (nullable): the #FcConfig object attached to @fcfontmap, which + * might be %NULL. + * + * Since: 1.38 + **/ +FcConfig * +pango_fc_font_map_get_config (PangoFcFontMap *fcfontmap) +{ + g_return_val_if_fail (PANGO_IS_FC_FONT_MAP (fcfontmap), NULL); + + return fcfontmap->priv->config; +} + +static PangoFcFontFaceData * +pango_fc_font_map_get_font_face_data (PangoFcFontMap *fcfontmap, + FcPattern *font_pattern) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + PangoFcFontFaceData key; + PangoFcFontFaceData *data; + + if (FcPatternGetString (font_pattern, FC_FILE, 0, (FcChar8 **)(void*)&key.filename) != FcResultMatch) + return NULL; + + if (FcPatternGetInteger (font_pattern, FC_INDEX, 0, &key.id) != FcResultMatch) + return NULL; + + data = g_hash_table_lookup (priv->font_face_data_hash, &key); + if (G_LIKELY (data)) + return data; + + data = g_slice_new0 (PangoFcFontFaceData); + data->filename = key.filename; + data->id = key.id; + + data->pattern = font_pattern; + FcPatternReference (data->pattern); + + g_hash_table_insert (priv->font_face_data_hash, data, data); + + return data; +} + +static PangoFcCmapCache * +_pango_fc_cmap_cache_ref (PangoFcCmapCache *cmap_cache) +{ + g_atomic_int_inc ((int *) &cmap_cache->ref_count); + + return cmap_cache; +} + +void +_pango_fc_cmap_cache_unref (PangoFcCmapCache *cmap_cache) +{ + g_return_if_fail (cmap_cache->ref_count > 0); + + if (g_atomic_int_dec_and_test ((int *) &cmap_cache->ref_count)) + { + g_free (cmap_cache); + } +} + +PangoFcCmapCache * +_pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont) +{ + PangoFcFontFaceData *data; + + if (G_UNLIKELY (fcfontmap == NULL)) + return NULL; + + if (G_UNLIKELY (!fcfont->font_pattern)) + return NULL; + + data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern); + if (G_UNLIKELY (!data)) + return NULL; + + if (G_UNLIKELY (data->cmap_cache == NULL)) + { + data->cmap_cache = g_new0 (PangoFcCmapCache, 1); + data->cmap_cache->ref_count = 1; + + /* Make sure all cache entries are invalid initially */ + data->cmap_cache->entries[0].ch = 1; /* char 1 cannot happen in bucket 0 */ + } + + return _pango_fc_cmap_cache_ref (data->cmap_cache); +} + +PangoCoverage * +_pango_fc_font_map_get_coverage (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont) +{ + PangoFcFontFaceData *data; + FcCharSet *charset; + + if (G_UNLIKELY (!fcfont->font_pattern)) + return NULL; + + data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern); + if (G_UNLIKELY (!data)) + return NULL; + + if (G_UNLIKELY (data->coverage == NULL)) + { + /* + * Pull the coverage out of the pattern, this + * doesn't require loading the font + */ + if (FcPatternGetCharSet (fcfont->font_pattern, FC_CHARSET, 0, &charset) != FcResultMatch) + return NULL; + + data->coverage = _pango_fc_font_map_fc_to_coverage (charset); + } + + return pango_coverage_ref (data->coverage); +} + +/** + * _pango_fc_font_map_fc_to_coverage: + * @charset: #FcCharSet to convert to a #PangoCoverage object. + * + * Convert the given #FcCharSet into a new #PangoCoverage object. The + * caller is responsible for freeing the newly created object. + * + * Since: 1.6 + **/ +PangoCoverage * +_pango_fc_font_map_fc_to_coverage (FcCharSet *charset) +{ + PangoCoverage *coverage; + FcChar32 ucs4, pos; + FcChar32 map[FC_CHARSET_MAP_SIZE]; + int i; + + /* + * Convert an Fc CharSet into a pango coverage structure. Sure + * would be nice to just use the Fc structure in place... + */ + coverage = pango_coverage_new (); + for (ucs4 = FcCharSetFirstPage (charset, map, &pos); + ucs4 != FC_CHARSET_DONE; + ucs4 = FcCharSetNextPage (charset, map, &pos)) + { + for (i = 0; i < FC_CHARSET_MAP_SIZE; i++) + { + FcChar32 bits = map[i]; + FcChar32 base = ucs4 + i * 32; + int b = 0; + + while (bits) + { + if (bits & 1) + pango_coverage_set (coverage, base + b, PANGO_COVERAGE_EXACT); + + bits >>= 1; + b++; + } + } + } + + /* Awful hack so Hangul Tone marks get rendered with the same + * font and in the same run as other Hangul characters. If a font + * covers the first composed Hangul glyph, then it is declared to cover + * the Hangul tone marks. This hack probably needs to be formalized + * by choosing fonts for scripts rather than individual code points. + */ + if (pango_coverage_get (coverage, 0xac00) == PANGO_COVERAGE_EXACT) + { + pango_coverage_set (coverage, 0x302e, PANGO_COVERAGE_EXACT); + pango_coverage_set (coverage, 0x302f, PANGO_COVERAGE_EXACT); + } + + return coverage; +} + +/** + * pango_fc_font_map_create_context: + * @fcfontmap: a #PangoFcFontMap + * + * Creates a new context for this fontmap. This function is intended + * only for backend implementations deriving from #PangoFcFontMap; + * it is possible that a backend will store additional information + * needed for correct operation on the #PangoContext after calling + * this function. + * + * Return value: a new #PangoContext + * + * Since: 1.4 + * + * Deprecated: 1.22: Use pango_font_map_create_context() instead. + **/ +PangoContext * +pango_fc_font_map_create_context (PangoFcFontMap *fcfontmap) +{ + g_return_val_if_fail (PANGO_IS_FC_FONT_MAP (fcfontmap), NULL); + + return pango_font_map_create_context (PANGO_FONT_MAP (fcfontmap)); +} + +static void +shutdown_font (gpointer key, + PangoFcFont *fcfont, + PangoFcFontMap *fcfontmap) +{ + _pango_fc_font_shutdown (fcfont); + + _pango_fc_font_set_font_key (fcfont, NULL); + pango_fc_font_key_free (key); +} + +/** + * pango_fc_font_map_shutdown: + * @fcfontmap: a #PangoFcFontMap + * + * Clears all cached information for the fontmap and marks + * all fonts open for the fontmap as dead. (See the shutdown() + * virtual function of #PangoFcFont.) This function might be used + * by a backend when the underlying windowing system for the font + * map exits. This function is only intended to be called + * only for backend implementations deriving from #PangoFcFontMap. + * + * Since: 1.4 + **/ +void +pango_fc_font_map_shutdown (PangoFcFontMap *fcfontmap) +{ + PangoFcFontMapPrivate *priv = fcfontmap->priv; + int i; + + if (priv->closed) + return; + + g_hash_table_foreach (priv->font_hash, (GHFunc) shutdown_font, fcfontmap); + for (i = 0; i < priv->n_families; i++) + priv->families[i]->fontmap = NULL; + + pango_fc_font_map_fini (fcfontmap); + + while (priv->findfuncs) + { + PangoFcFindFuncInfo *info; + info = priv->findfuncs->data; + if (info->dnotify) + info->dnotify (info->user_data); + + g_slice_free (PangoFcFindFuncInfo, info); + priv->findfuncs = g_slist_delete_link (priv->findfuncs, priv->findfuncs); + } + + priv->closed = TRUE; +} + +static PangoWeight +pango_fc_convert_weight_to_pango (double fc_weight) +{ +#ifdef HAVE_FCWEIGHTFROMOPENTYPEDOUBLE + return FcWeightToOpenTypeDouble (fc_weight); +#else + return FcWeightToOpenType (fc_weight); +#endif +} + +static PangoStyle +pango_fc_convert_slant_to_pango (int fc_style) +{ + switch (fc_style) + { + case FC_SLANT_ROMAN: + return PANGO_STYLE_NORMAL; + case FC_SLANT_ITALIC: + return PANGO_STYLE_ITALIC; + case FC_SLANT_OBLIQUE: + return PANGO_STYLE_OBLIQUE; + default: + return PANGO_STYLE_NORMAL; + } +} + +static PangoStretch +pango_fc_convert_width_to_pango (int fc_stretch) +{ + switch (fc_stretch) + { + case FC_WIDTH_NORMAL: + return PANGO_STRETCH_NORMAL; + case FC_WIDTH_ULTRACONDENSED: + return PANGO_STRETCH_ULTRA_CONDENSED; + case FC_WIDTH_EXTRACONDENSED: + return PANGO_STRETCH_EXTRA_CONDENSED; + case FC_WIDTH_CONDENSED: + return PANGO_STRETCH_CONDENSED; + case FC_WIDTH_SEMICONDENSED: + return PANGO_STRETCH_SEMI_CONDENSED; + case FC_WIDTH_SEMIEXPANDED: + return PANGO_STRETCH_SEMI_EXPANDED; + case FC_WIDTH_EXPANDED: + return PANGO_STRETCH_EXPANDED; + case FC_WIDTH_EXTRAEXPANDED: + return PANGO_STRETCH_EXTRA_EXPANDED; + case FC_WIDTH_ULTRAEXPANDED: + return PANGO_STRETCH_ULTRA_EXPANDED; + default: + return PANGO_STRETCH_NORMAL; + } +} + +/** + * pango_fc_font_description_from_pattern: + * @pattern: a #FcPattern + * @include_size: if %TRUE, the pattern will include the size from + * the @pattern; otherwise the resulting pattern will be unsized. + * (only %FC_SIZE is examined, not %FC_PIXEL_SIZE) + * + * Creates a #PangoFontDescription that matches the specified + * Fontconfig pattern as closely as possible. Many possible Fontconfig + * pattern values, such as %FC_RASTERIZER or %FC_DPI, don't make sense in + * the context of #PangoFontDescription, so will be ignored. + * + * Return value: a new #PangoFontDescription. Free with + * pango_font_description_free(). + * + * Since: 1.4 + **/ +PangoFontDescription * +pango_fc_font_description_from_pattern (FcPattern *pattern, gboolean include_size) +{ + PangoFontDescription *desc; + PangoStyle style; + PangoWeight weight; + PangoStretch stretch; + double size; + PangoGravity gravity; + + FcChar8 *s; + int i; + double d; + FcResult res; + + desc = pango_font_description_new (); + + res = FcPatternGetString (pattern, FC_FAMILY, 0, (FcChar8 **) &s); + g_assert (res == FcResultMatch); + + pango_font_description_set_family (desc, (gchar *)s); + + if (FcPatternGetInteger (pattern, FC_SLANT, 0, &i) == FcResultMatch) + style = pango_fc_convert_slant_to_pango (i); + else + style = PANGO_STYLE_NORMAL; + + pango_font_description_set_style (desc, style); + + if (FcPatternGetDouble (pattern, FC_WEIGHT, 0, &d) == FcResultMatch) + weight = pango_fc_convert_weight_to_pango (d); + else + weight = PANGO_WEIGHT_NORMAL; + + pango_font_description_set_weight (desc, weight); + + if (FcPatternGetInteger (pattern, FC_WIDTH, 0, &i) == FcResultMatch) + stretch = pango_fc_convert_width_to_pango (i); + else + stretch = PANGO_STRETCH_NORMAL; + + pango_font_description_set_stretch (desc, stretch); + + pango_font_description_set_variant (desc, PANGO_VARIANT_NORMAL); + + if (include_size && FcPatternGetDouble (pattern, FC_SIZE, 0, &size) == FcResultMatch) + pango_font_description_set_size (desc, size * PANGO_SCALE); + + /* gravity is a bit different. we don't want to set it if it was not set on + * the pattern */ + if (FcPatternGetString (pattern, PANGO_FC_GRAVITY, 0, (FcChar8 **)&s) == FcResultMatch) + { + GEnumValue *value = g_enum_get_value_by_nick (get_gravity_class (), (char *)s); + gravity = value->value; + + pango_font_description_set_gravity (desc, gravity); + } + + if (include_size && FcPatternGetString (pattern, PANGO_FC_FONT_VARIATIONS, 0, (FcChar8 **)&s) == FcResultMatch) + { + if (s && *s) + pango_font_description_set_variations (desc, (char *)s); + } + + return desc; +} + +/* + * PangoFcFace + */ + +typedef PangoFontFaceClass PangoFcFaceClass; +G_DEFINE_TYPE (PangoFcFace, pango_fc_face, PANGO_TYPE_FONT_FACE); + +static PangoFontDescription * +make_alias_description (PangoFcFamily *fcfamily, + gboolean bold, + gboolean italic) +{ + PangoFontDescription *desc = pango_font_description_new (); + + pango_font_description_set_family (desc, fcfamily->family_name); + pango_font_description_set_style (desc, italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL); + pango_font_description_set_weight (desc, bold ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL); + + return desc; +} + +static PangoFontDescription * +pango_fc_face_describe (PangoFontFace *face) +{ + PangoFcFace *fcface = PANGO_FC_FACE (face); + PangoFcFamily *fcfamily = fcface->family; + PangoFontDescription *desc = NULL; + + if (G_UNLIKELY (!fcfamily)) + return pango_font_description_new (); + + if (fcface->fake) + { + if (strcmp (fcface->style, "Regular") == 0) + return make_alias_description (fcfamily, FALSE, FALSE); + else if (strcmp (fcface->style, "Bold") == 0) + return make_alias_description (fcfamily, TRUE, FALSE); + else if (strcmp (fcface->style, "Italic") == 0) + return make_alias_description (fcfamily, FALSE, TRUE); + else /* Bold Italic */ + return make_alias_description (fcfamily, TRUE, TRUE); + } + + g_assert (fcface->pattern); + desc = pango_fc_font_description_from_pattern (fcface->pattern, FALSE); + + return desc; +} + +static const char * +pango_fc_face_get_face_name (PangoFontFace *face) +{ + PangoFcFace *fcface = PANGO_FC_FACE (face); + + return fcface->style; +} + +static int +compare_ints (gconstpointer ap, + gconstpointer bp) +{ + int a = *(int *)ap; + int b = *(int *)bp; + + if (a == b) + return 0; + else if (a > b) + return 1; + else + return -1; +} + +static void +pango_fc_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes) +{ + PangoFcFace *fcface = PANGO_FC_FACE (face); + FcPattern *pattern; + FcFontSet *fontset; + FcObjectSet *objectset; + + *sizes = NULL; + *n_sizes = 0; + if (G_UNLIKELY (!fcface->family || !fcface->family->fontmap)) + return; + + pattern = FcPatternCreate (); + FcPatternAddString (pattern, FC_FAMILY, (FcChar8*)(void*)fcface->family->family_name); + FcPatternAddString (pattern, FC_STYLE, (FcChar8*)(void*)fcface->style); + + objectset = FcObjectSetCreate (); + FcObjectSetAdd (objectset, FC_PIXEL_SIZE); + + fontset = FcFontList (NULL, pattern, objectset); + + if (fontset) + { + GArray *size_array; + double size, dpi = -1.0; + int i, size_i, j; + + size_array = g_array_new (FALSE, FALSE, sizeof (int)); + + for (i = 0; i < fontset->nfont; i++) + { + for (j = 0; + FcPatternGetDouble (fontset->fonts[i], FC_PIXEL_SIZE, j, &size) == FcResultMatch; + j++) + { + if (dpi < 0) + dpi = pango_fc_font_map_get_resolution (fcface->family->fontmap, NULL); + + size_i = (int) (PANGO_SCALE * size * 72.0 / dpi); + g_array_append_val (size_array, size_i); + } + } + + g_array_sort (size_array, compare_ints); + + if (size_array->len == 0) + { + *n_sizes = 0; + if (sizes) + *sizes = NULL; + g_array_free (size_array, TRUE); + } + else + { + *n_sizes = size_array->len; + if (sizes) + { + *sizes = (int *) size_array->data; + g_array_free (size_array, FALSE); + } + else + g_array_free (size_array, TRUE); + } + + FcFontSetDestroy (fontset); + } + else + { + *n_sizes = 0; + if (sizes) + *sizes = NULL; + } + + FcPatternDestroy (pattern); + FcObjectSetDestroy (objectset); +} + +static gboolean +pango_fc_face_is_synthesized (PangoFontFace *face) +{ + PangoFcFace *fcface = PANGO_FC_FACE (face); + + return fcface->fake; +} + +static void +pango_fc_face_finalize (GObject *object) +{ + PangoFcFace *fcface = PANGO_FC_FACE (object); + + g_free (fcface->style); + FcPatternDestroy (fcface->pattern); + + G_OBJECT_CLASS (pango_fc_face_parent_class)->finalize (object); +} + +static void +pango_fc_face_init (PangoFcFace *self) +{ +} + +static void +pango_fc_face_class_init (PangoFcFaceClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = pango_fc_face_finalize; + + class->describe = pango_fc_face_describe; + class->get_face_name = pango_fc_face_get_face_name; + class->list_sizes = pango_fc_face_list_sizes; + class->is_synthesized = pango_fc_face_is_synthesized; +} + + +/* + * PangoFcFamily + */ + +typedef PangoFontFamilyClass PangoFcFamilyClass; +G_DEFINE_TYPE (PangoFcFamily, pango_fc_family, PANGO_TYPE_FONT_FAMILY); + +static PangoFcFace * +create_face (PangoFcFamily *fcfamily, + const char *style, + FcPattern *pattern, + gboolean fake) +{ + PangoFcFace *face = g_object_new (PANGO_FC_TYPE_FACE, NULL); + face->style = g_strdup (style); + if (pattern) + FcPatternReference (pattern); + face->pattern = pattern; + face->family = fcfamily; + face->fake = fake; + + return face; +} + +static void +pango_fc_family_list_faces (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces) +{ + PangoFcFamily *fcfamily = PANGO_FC_FAMILY (family); + PangoFcFontMap *fcfontmap = fcfamily->fontmap; + PangoFcFontMapPrivate *priv; + + *faces = NULL; + *n_faces = 0; + if (G_UNLIKELY (!fcfontmap)) + return; + + priv = fcfontmap->priv; + + if (fcfamily->n_faces < 0) + { + FcFontSet *fontset; + int i; + + if (is_alias_family (fcfamily->family_name) || priv->closed) + { + fcfamily->n_faces = 4; + fcfamily->faces = g_new (PangoFcFace *, fcfamily->n_faces); + + i = 0; + fcfamily->faces[i++] = create_face (fcfamily, "Regular", NULL, TRUE); + fcfamily->faces[i++] = create_face (fcfamily, "Bold", NULL, TRUE); + fcfamily->faces[i++] = create_face (fcfamily, "Italic", NULL, TRUE); + fcfamily->faces[i++] = create_face (fcfamily, "Bold Italic", NULL, TRUE); + } + else + { + enum { + REGULAR, + ITALIC, + BOLD, + BOLD_ITALIC + }; + /* Regular, Italic, Bold, Bold Italic */ + gboolean has_face [4] = { FALSE, FALSE, FALSE, FALSE }; + PangoFcFace **faces; + gint num = 0; + + fontset = fcfamily->patterns; + + /* at most we have 3 additional artifical faces */ + faces = g_new (PangoFcFace *, fontset->nfont + 3); + + for (i = 0; i < fontset->nfont; i++) + { + const char *style, *font_style = NULL; + int weight, slant; + + if (FcPatternGetInteger(fontset->fonts[i], FC_WEIGHT, 0, &weight) != FcResultMatch) + weight = FC_WEIGHT_MEDIUM; + + if (FcPatternGetInteger(fontset->fonts[i], FC_SLANT, 0, &slant) != FcResultMatch) + slant = FC_SLANT_ROMAN; + + if (FcPatternGetString (fontset->fonts[i], FC_STYLE, 0, (FcChar8 **)(void*)&font_style) != FcResultMatch) + font_style = NULL; + + if (weight <= FC_WEIGHT_MEDIUM) + { + if (slant == FC_SLANT_ROMAN) + { + has_face[REGULAR] = TRUE; + style = "Regular"; + } + else + { + has_face[ITALIC] = TRUE; + style = "Italic"; + } + } + else + { + if (slant == FC_SLANT_ROMAN) + { + has_face[BOLD] = TRUE; + style = "Bold"; + } + else + { + has_face[BOLD_ITALIC] = TRUE; + style = "Bold Italic"; + } + } + + if (!font_style) + font_style = style; + faces[num++] = create_face (fcfamily, font_style, fontset->fonts[i], FALSE); + } + + if (has_face[REGULAR]) + { + if (!has_face[ITALIC]) + faces[num++] = create_face (fcfamily, "Italic", NULL, TRUE); + if (!has_face[BOLD]) + faces[num++] = create_face (fcfamily, "Bold", NULL, TRUE); + + } + if ((has_face[REGULAR] || has_face[ITALIC] || has_face[BOLD]) && !has_face[BOLD_ITALIC]) + faces[num++] = create_face (fcfamily, "Bold Italic", NULL, TRUE); + + faces = g_renew (PangoFcFace *, faces, num); + + fcfamily->n_faces = num; + fcfamily->faces = faces; + } + } + + if (n_faces) + *n_faces = fcfamily->n_faces; + + if (faces) + *faces = g_memdup (fcfamily->faces, fcfamily->n_faces * sizeof (PangoFontFace *)); +} + +static const char * +pango_fc_family_get_name (PangoFontFamily *family) +{ + PangoFcFamily *fcfamily = PANGO_FC_FAMILY (family); + + return fcfamily->family_name; +} + +static gboolean +pango_fc_family_is_monospace (PangoFontFamily *family) +{ + PangoFcFamily *fcfamily = PANGO_FC_FAMILY (family); + + return fcfamily->spacing == FC_MONO || + fcfamily->spacing == FC_DUAL || + fcfamily->spacing == FC_CHARCELL; +} + +static void +pango_fc_family_finalize (GObject *object) +{ + int i; + PangoFcFamily *fcfamily = PANGO_FC_FAMILY (object); + + g_free (fcfamily->family_name); + + for (i = 0; i < fcfamily->n_faces; i++) + { + fcfamily->faces[i]->family = NULL; + g_object_unref (fcfamily->faces[i]); + } + FcFontSetDestroy (fcfamily->patterns); + g_free (fcfamily->faces); + + G_OBJECT_CLASS (pango_fc_family_parent_class)->finalize (object); +} + +static void +pango_fc_family_class_init (PangoFcFamilyClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = pango_fc_family_finalize; + + class->list_faces = pango_fc_family_list_faces; + class->get_name = pango_fc_family_get_name; + class->is_monospace = pango_fc_family_is_monospace; +} + +static void +pango_fc_family_init (PangoFcFamily *fcfamily) +{ + fcfamily->n_faces = -1; +} diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h new file mode 100644 index 0000000..bff288b --- /dev/null +++ b/pango/pangofc-fontmap.h @@ -0,0 +1,329 @@ +/* Pango + * pangofc-fontmap.h: Base fontmap type for fontconfig-based backends + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FC_FONT_MAP_H__ +#define __PANGO_FC_FONT_MAP_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + + +#ifdef PANGO_ENABLE_BACKEND + +/** + * PangoFcFontsetKey: + * + * An opaque structure containing all the information needed for + * loading a fontset with the PangoFc fontmap. + * + * Since: 1.24 + **/ +typedef struct _PangoFcFontsetKey PangoFcFontsetKey; + +PANGO_AVAILABLE_IN_1_24 +PangoLanguage *pango_fc_fontset_key_get_language (const PangoFcFontsetKey *key); +PANGO_AVAILABLE_IN_1_24 +const PangoFontDescription *pango_fc_fontset_key_get_description (const PangoFcFontsetKey *key); +PANGO_AVAILABLE_IN_1_24 +const PangoMatrix *pango_fc_fontset_key_get_matrix (const PangoFcFontsetKey *key); +PANGO_AVAILABLE_IN_1_24 +double pango_fc_fontset_key_get_absolute_size (const PangoFcFontsetKey *key); +PANGO_AVAILABLE_IN_1_24 +double pango_fc_fontset_key_get_resolution (const PangoFcFontsetKey *key); +PANGO_AVAILABLE_IN_1_24 +gpointer pango_fc_fontset_key_get_context_key (const PangoFcFontsetKey *key); + +/** + * PangoFcFontKey: + * + * An opaque structure containing all the information needed for + * loading a font with the PangoFc fontmap. + * + * Since: 1.24 + **/ +typedef struct _PangoFcFontKey PangoFcFontKey; + +PANGO_AVAILABLE_IN_1_24 +const FcPattern *pango_fc_font_key_get_pattern (const PangoFcFontKey *key); +PANGO_AVAILABLE_IN_1_24 +const PangoMatrix *pango_fc_font_key_get_matrix (const PangoFcFontKey *key); +PANGO_AVAILABLE_IN_1_24 +gpointer pango_fc_font_key_get_context_key (const PangoFcFontKey *key); +PANGO_AVAILABLE_IN_1_40 +const char *pango_fc_font_key_get_variations (const PangoFcFontKey *key); + +#endif + + +/* + * PangoFcFontMap + */ + +#define PANGO_TYPE_FC_FONT_MAP (pango_fc_font_map_get_type ()) +#define PANGO_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT_MAP, PangoFcFontMap)) +#define PANGO_IS_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT_MAP)) + +typedef struct _PangoFcFontMap PangoFcFontMap; +typedef struct _PangoFcFontMapClass PangoFcFontMapClass; +typedef struct _PangoFcFontMapPrivate PangoFcFontMapPrivate; + +#ifdef PANGO_ENABLE_BACKEND + +#define PANGO_FC_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_FONT_MAP, PangoFcFontMapClass)) +#define PANGO_IS_FC_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_FONT_MAP)) +#define PANGO_FC_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_FONT_MAP, PangoFcFontMapClass)) + +/** + * PangoFcFontMap: + * + * #PangoFcFontMap is a base class for font map implementations + * using the Fontconfig and FreeType libraries. To create a new + * backend using Fontconfig and FreeType, you derive from this class + * and implement a new_font() virtual function that creates an + * instance deriving from #PangoFcFont. + **/ +struct _PangoFcFontMap +{ + PangoFontMap parent_instance; + + PangoFcFontMapPrivate *priv; +}; + +/** + * PangoFcFontMapClass: + * @default_substitute: (nullable): Substitutes in default + * values for unspecified fields in a #FcPattern. This will + * be called prior to creating a font for the pattern. May be + * %NULL. Deprecated in favor of @font_key_substitute(). + * @new_font: Creates a new #PangoFcFont for the specified + * pattern of the appropriate type for this font map. The + * @pattern argument must be passed to the "pattern" property + * of #PangoFcFont when you call g_object_new(). Deprecated + * in favor of @create_font(). + * @get_resolution: Gets the resolution (the scale factor + * between logical and absolute font sizes) that the backend + * will use for a particular fontmap and context. @context + * may be null. + * @context_key_get: Gets an opaque key holding backend + * specific options for the context that will affect + * fonts created by @create_font(). The result must point to + * persistant storage owned by the fontmap. This key + * is used to index hash tables used to look up fontsets + * and fonts. + * @context_key_copy: Copies a context key. Pango uses this + * to make a persistant copy of the value returned from + * @context_key_get. + * @context_key_free: Frees a context key copied with + * @context_key_copy. + * @context_key_hash: Gets a hash value for a context key + * @context_key_equal: Compares two context keys for equality. + * @fontset_key_substitute: (nullable): Substitutes in + * default values for unspecified fields in a + * #FcPattern. This will be called prior to creating a font + * for the pattern. May be %NULL. (Since: 1.24) + * @create_font: (nullable): Creates a new #PangoFcFont for + * the specified pattern of the appropriate type for this + * font map using information from the font key that is + * passed in. The @pattern member of @font_key can be + * retrieved using pango_fc_font_key_get_pattern() and must + * be passed to the "pattern" property of #PangoFcFont when + * you call g_object_new(). If %NULL, new_font() is used. + * (Since: 1.24) + * + * Class structure for #PangoFcFontMap. + **/ +struct _PangoFcFontMapClass +{ + /*< private >*/ + PangoFontMapClass parent_class; + + /*< public >*/ + /* Deprecated in favor of fontset_key_substitute */ + void (*default_substitute) (PangoFcFontMap *fontmap, + FcPattern *pattern); + /* Deprecated in favor of create_font */ + PangoFcFont *(*new_font) (PangoFcFontMap *fontmap, + FcPattern *pattern); + + double (*get_resolution) (PangoFcFontMap *fcfontmap, + PangoContext *context); + + gconstpointer (*context_key_get) (PangoFcFontMap *fcfontmap, + PangoContext *context); + gpointer (*context_key_copy) (PangoFcFontMap *fcfontmap, + gconstpointer key); + void (*context_key_free) (PangoFcFontMap *fcfontmap, + gpointer key); + guint32 (*context_key_hash) (PangoFcFontMap *fcfontmap, + gconstpointer key); + gboolean (*context_key_equal) (PangoFcFontMap *fcfontmap, + gconstpointer key_a, + gconstpointer key_b); + void (*fontset_key_substitute)(PangoFcFontMap *fontmap, + + PangoFcFontsetKey *fontsetkey, + FcPattern *pattern); + PangoFcFont *(*create_font) (PangoFcFontMap *fontmap, + PangoFcFontKey *fontkey); + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_IN_1_22_FOR(pango_font_map_create_context) +PangoContext * pango_fc_font_map_create_context (PangoFcFontMap *fcfontmap); +#endif +PANGO_AVAILABLE_IN_1_4 +void pango_fc_font_map_shutdown (PangoFcFontMap *fcfontmap); + +#endif + +PANGO_AVAILABLE_IN_ALL +GType pango_fc_font_map_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_4 +void pango_fc_font_map_cache_clear (PangoFcFontMap *fcfontmap); + +PANGO_AVAILABLE_IN_1_38 +void +pango_fc_font_map_config_changed (PangoFcFontMap *fcfontmap); + +PANGO_AVAILABLE_IN_1_38 +void +pango_fc_font_map_set_config (PangoFcFontMap *fcfontmap, + FcConfig *fcconfig); +PANGO_AVAILABLE_IN_1_38 +FcConfig * +pango_fc_font_map_get_config (PangoFcFontMap *fcfontmap); + +/** + * PangoFcDecoderFindFunc: + * @pattern: a fully resolved #FcPattern specifying the font on the system + * @user_data: user data passed to pango_fc_font_map_add_decoder_find_func() + * + * Callback function passed to pango_fc_font_map_add_decoder_find_func(). + * + * Return value: a new reference to a custom decoder for this pattern, + * or %NULL if the default decoder handling should be used. + **/ +typedef PangoFcDecoder * (*PangoFcDecoderFindFunc) (FcPattern *pattern, + gpointer user_data); + +PANGO_AVAILABLE_IN_1_6 +void pango_fc_font_map_add_decoder_find_func (PangoFcFontMap *fcfontmap, + PangoFcDecoderFindFunc findfunc, + gpointer user_data, + GDestroyNotify dnotify); +PANGO_AVAILABLE_IN_1_26 +PangoFcDecoder *pango_fc_font_map_find_decoder (PangoFcFontMap *fcfontmap, + FcPattern *pattern); + +PANGO_AVAILABLE_IN_1_4 +PangoFontDescription *pango_fc_font_description_from_pattern (FcPattern *pattern, + gboolean include_size); + +/** + * PANGO_FC_GRAVITY: + * + * String representing a fontconfig property name that Pango sets on any + * fontconfig pattern it passes to fontconfig if a #PangoGravity other + * than %PANGO_GRAVITY_SOUTH is desired. + * + * The property will have a #PangoGravity value as a string, like "east". + * This can be used to write fontconfig configuration rules to choose + * different fonts for horizontal and vertical writing directions. + * + * Since: 1.20 + */ +#define PANGO_FC_GRAVITY "pangogravity" + +/** + * PANGO_FC_VERSION: + * + * String representing a fontconfig property name that Pango sets on any + * fontconfig pattern it passes to fontconfig. + * + * The property will have an integer value equal to what + * pango_version() returns. + * This can be used to write fontconfig configuration rules that only affect + * certain pango versions (or only pango-using applications, or only + * non-pango-using applications). + * + * Since: 1.20 + */ +#define PANGO_FC_VERSION "pangoversion" + +/** + * PANGO_FC_PRGNAME: + * + * String representing a fontconfig property name that Pango sets on any + * fontconfig pattern it passes to fontconfig. + * + * The property will have a string equal to what + * g_get_prgname() returns. + * This can be used to write fontconfig configuration rules that only affect + * certain applications. + * + * This is equivalent to FC_PRGNAME in versions of fontconfig that have that. + * + * Since: 1.24 + */ +#define PANGO_FC_PRGNAME "prgname" + +/** + * PANGO_FC_FONT_FEATURES: + * + * String representing a fontconfig property name that Pango reads from font + * patterns to populate list of OpenType features to be enabled for the font + * by default. + * + * The property will have a number of string elements, each of which is the + * OpenType feature tag of one feature to enable. + * + * This is equivalent to FC_FONT_FEATURES in versions of fontconfig that have that. + * + * Since: 1.34 + */ +#define PANGO_FC_FONT_FEATURES "fontfeatures" + +/** + * PANGO_FC_FONT_VARIATIONS: + * + * String representing a fontconfig property name that Pango reads from font + * patterns to populate list of OpenType font variations to be used for a font. + * + * The property will have a string elements, each of which a comma-separated + * list of OpenType axis setting of the form AXIS=VALUE. + */ +#define PANGO_FC_FONT_VARIATIONS "fontvariations" + +G_END_DECLS + +#endif /* __PANGO_FC_FONT_MAP_H__ */ diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h new file mode 100644 index 0000000..ee04871 --- /dev/null +++ b/pango/pangofc-private.h @@ -0,0 +1,116 @@ +/* Pango + * pangofc-private.h: Private routines and declarations for generic + * fontconfig operation + * + * Copyright (C) 2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOFC_PRIVATE_H__ +#define __PANGOFC_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + + +#ifndef FC_WEIGHT_DEMILIGHT +#define FC_WEIGHT_DEMILIGHT 55 +#define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT +#endif + + +typedef struct _PangoFcMetricsInfo PangoFcMetricsInfo; + +struct _PangoFcMetricsInfo +{ + const char *sample_str; + PangoFontMetrics *metrics; +}; + + +typedef struct _PangoFcCmapCacheEntry PangoFcCmapCacheEntry; +typedef struct _PangoFcCmapCache PangoFcCmapCache; + +#define CMAP_CACHE_NUM_ENTRIES 256 /* should be power of two */ +#define CMAP_CACHE_MASK (CMAP_CACHE_NUM_ENTRIES - 1) + +struct _PangoFcCmapCacheEntry +{ + gunichar ch; + PangoGlyph glyph; +}; + +struct _PangoFcCmapCache +{ + guint ref_count; + PangoFcCmapCacheEntry entries[CMAP_CACHE_NUM_ENTRIES]; +}; + + +#define PANGO_SCALE_26_6 (PANGO_SCALE / (1<<6)) +#define PANGO_PIXELS_26_6(d) \ + (((d) >= 0) ? \ + ((d) + PANGO_SCALE_26_6 / 2) / PANGO_SCALE_26_6 : \ + ((d) - PANGO_SCALE_26_6 / 2) / PANGO_SCALE_26_6) +#define PANGO_UNITS_26_6(d) ((d) * PANGO_SCALE_26_6) +#define PANGO_UNITS_TO_26_6(d) ((d) / PANGO_SCALE_26_6) + +void _pango_fc_font_shutdown (PangoFcFont *fcfont); + +void _pango_fc_font_map_remove (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont); + +PangoCoverage *_pango_fc_font_map_get_coverage (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont); +PangoCoverage *_pango_fc_font_map_fc_to_coverage (FcCharSet *charset); + +PangoFcCmapCache *_pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont); +void _pango_fc_cmap_cache_unref (PangoFcCmapCache *cmap_cache); + +PangoFcDecoder *_pango_fc_font_get_decoder (PangoFcFont *font); +void _pango_fc_font_set_decoder (PangoFcFont *font, + PangoFcDecoder *decoder); + +PangoFcFontKey *_pango_fc_font_get_font_key (PangoFcFont *fcfont); +void _pango_fc_font_set_font_key (PangoFcFont *fcfont, + PangoFcFontKey *key); + +_PANGO_EXTERN +void pango_fc_font_get_raw_extents (PangoFcFont *font, + FT_Int32 load_flags, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +_PANGO_EXTERN +PangoFontMetrics *pango_fc_font_create_base_metrics_for_context (PangoFcFont *font, + PangoContext *context); + +void +_pango_fc_shape (PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length); + +G_END_DECLS + +#endif /* __PANGOFC_PRIVATE_H__ */ diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c new file mode 100644 index 0000000..a59ca67 --- /dev/null +++ b/pango/pangofc-shape.c @@ -0,0 +1,544 @@ +/* Pango + * pangofc-shape.c: Basic shaper for FreeType-based backends + * + * Copyright (C) 2000, 2007, 2009 Red Hat Software + * Authors: + * Owen Taylor + * Behdad Esfahbod + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include + +#include "pangofc-private.h" +#include +#include + +/* cache a single hb_buffer_t */ +static hb_buffer_t *cached_buffer = NULL; /* MT-safe */ +G_LOCK_DEFINE_STATIC (cached_buffer); + +static hb_buffer_t * +acquire_buffer (gboolean *free_buffer) +{ + hb_buffer_t *buffer; + + if (G_LIKELY (G_TRYLOCK (cached_buffer))) + { + if (G_UNLIKELY (!cached_buffer)) + cached_buffer = hb_buffer_create (); + + buffer = cached_buffer; + *free_buffer = FALSE; + } + else + { + buffer = hb_buffer_create (); + *free_buffer = TRUE; + } + + return buffer; +} + +static void +release_buffer (hb_buffer_t *buffer, gboolean free_buffer) +{ + if (G_LIKELY (!free_buffer)) + { + hb_buffer_reset (buffer); + G_UNLOCK (cached_buffer); + } + else + hb_buffer_destroy (buffer); +} + +typedef struct _PangoFcHbContext { + FT_Face ft_face; + PangoFcFont *fc_font; + gboolean vertical; + double x_scale, y_scale; /* CTM scales. */ +} PangoFcHbContext; + +static hb_bool_t +pango_fc_hb_font_get_nominal_glyph (hb_font_t *font, void *font_data, + hb_codepoint_t unicode, + hb_codepoint_t *glyph, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + PangoFcFont *fc_font = context->fc_font; + + *glyph = pango_fc_font_get_glyph (fc_font, unicode); + if (G_LIKELY (*glyph)) + return TRUE; + + *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); + + /* We draw our own invalid-Unicode shape, so prevent HarfBuzz + * from using REPLACEMENT CHARACTER. */ + if (unicode > 0x10FFFF) + return TRUE; + + return FALSE; +} + +static hb_bool_t +pango_fc_hb_font_get_variation_glyph (hb_font_t *font, + void *font_data, + hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + FT_Face ft_face = context->ft_face; + unsigned int g; + + g = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector); + + if (G_UNLIKELY (!g)) + return FALSE; + + *glyph = g; + return TRUE; +} + +static hb_bool_t +pango_fc_hb_font_get_glyph_contour_point (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, unsigned int point_index, + hb_position_t *x, hb_position_t *y, + void *user_data G_GNUC_UNUSED) +{ + return FALSE; +#if 0 + FT_Face ft_face = (FT_Face) font_data; + int load_flags = FT_LOAD_DEFAULT; + + /* TODO: load_flags, embolden, etc */ + + if (HB_UNLIKELY (FT_Load_Glyph (ft_face, glyph, load_flags))) + return FALSE; + + if (HB_UNLIKELY (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)) + return FALSE; + + if (HB_UNLIKELY (point_index >= (unsigned int) ft_face->glyph->outline.n_points)) + return FALSE; + + *x = ft_face->glyph->outline.points[point_index].x; + *y = ft_face->glyph->outline.points[point_index].y; + + return TRUE; +#endif +} + +static hb_position_t +pango_fc_hb_font_get_glyph_advance (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + PangoFcFont *fc_font = context->fc_font; + PangoRectangle logical; + + pango_font_get_glyph_extents ((PangoFont *) fc_font, glyph, NULL, &logical); + + return logical.width; +} + +static hb_bool_t +pango_fc_hb_font_get_glyph_extents (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + PangoFcFont *fc_font = context->fc_font; + PangoRectangle ink; + + pango_font_get_glyph_extents ((PangoFont *) fc_font, glyph, &ink, NULL); + + if (G_LIKELY (!context->vertical)) { + extents->x_bearing = ink.x; + extents->y_bearing = ink.y; + extents->width = ink.width; + extents->height = ink.height; + } else { + /* XXX */ + extents->x_bearing = ink.x; + extents->y_bearing = ink.y; + extents->width = ink.height; + extents->height = ink.width; + } + + return TRUE; +} + +static hb_bool_t +pango_fc_hb_font_get_glyph_h_origin (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + FT_Face ft_face = context->ft_face; + int load_flags = FT_LOAD_DEFAULT; + + if (!context->vertical) return TRUE; + + if (FT_Load_Glyph (ft_face, glyph, load_flags)) + return FALSE; + + /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates + * have a Y growing upward. Hence the extra negations. */ + *x = -PANGO_UNITS_26_6 (ft_face->glyph->metrics.horiBearingX - ft_face->glyph->metrics.vertBearingX); + *y = +PANGO_UNITS_26_6 (ft_face->glyph->metrics.horiBearingY - (-ft_face->glyph->metrics.vertBearingY)); + + return TRUE; +} + +static hb_bool_t +pango_fc_hb_font_get_glyph_v_origin (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + FT_Face ft_face = context->ft_face; + int load_flags = FT_LOAD_DEFAULT; + + /* pangocairo-fc configures font in vertical origin for vertical writing. */ + if (context->vertical) return TRUE; + + if (FT_Load_Glyph (ft_face, glyph, load_flags)) + return FALSE; + + /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates + * have a Y growing upward. Hence the extra negation. */ + *x = PANGO_UNITS_26_6 (ft_face->glyph->metrics.horiBearingX - ft_face->glyph->metrics.vertBearingX); + *y = PANGO_UNITS_26_6 (ft_face->glyph->metrics.horiBearingY - (-ft_face->glyph->metrics.vertBearingY)); + + /* XXX */ + + return TRUE; +} + + +static hb_position_t +pango_fc_hb_font_get_h_kerning (hb_font_t *font, void *font_data, + hb_codepoint_t left_glyph, hb_codepoint_t right_glyph, + void *user_data G_GNUC_UNUSED) +{ + PangoFcHbContext *context = (PangoFcHbContext *) font_data; + FT_Face ft_face = context->ft_face; + FT_Vector kerning; + + if (FT_Get_Kerning (ft_face, left_glyph, right_glyph, FT_KERNING_DEFAULT, &kerning)) + return 0; + + return PANGO_UNITS_26_6 (kerning.x * context->x_scale); +} + +static hb_font_funcs_t * +pango_fc_get_hb_font_funcs (void) +{ + static hb_font_funcs_t *funcs; + + if (G_UNLIKELY (!funcs)) { + funcs = hb_font_funcs_create (); + hb_font_funcs_set_nominal_glyph_func (funcs, pango_fc_hb_font_get_nominal_glyph, NULL, NULL); + hb_font_funcs_set_variation_glyph_func (funcs, pango_fc_hb_font_get_variation_glyph, NULL, NULL); + hb_font_funcs_set_glyph_h_advance_func (funcs, pango_fc_hb_font_get_glyph_advance, NULL, NULL); + hb_font_funcs_set_glyph_v_advance_func (funcs, pango_fc_hb_font_get_glyph_advance, NULL, NULL); + hb_font_funcs_set_glyph_h_origin_func (funcs, pango_fc_hb_font_get_glyph_h_origin, NULL, NULL); + hb_font_funcs_set_glyph_v_origin_func (funcs, pango_fc_hb_font_get_glyph_v_origin, NULL, NULL); + hb_font_funcs_set_glyph_h_kerning_func (funcs, pango_fc_hb_font_get_h_kerning, NULL, NULL); + /* Don't need v_kerning. */ + hb_font_funcs_set_glyph_extents_func (funcs, pango_fc_hb_font_get_glyph_extents, NULL, NULL); + hb_font_funcs_set_glyph_contour_point_func (funcs, pango_fc_hb_font_get_glyph_contour_point, NULL, NULL); + /* Don't need glyph_name / glyph_from_name */ + } + + return funcs; +} + +static void +parse_variations (const char *variations, + hb_variation_t **hb_variations, + guint *n_variations) +{ + guint n; + hb_variation_t *var; + int i; + const char *p; + + n = 1; + for (i = 0; variations[i]; i++) + { + if (variations[i] == ',') + n++; + } + + var = g_new (hb_variation_t, n); + + p = variations; + n = 0; + while (p && *p) + { + char *end = strchr (p, ','); + if (hb_variation_from_string (p, end ? end - p: -1, &var[n])) + n++; + p = end ? end + 1 : NULL; + } + + *hb_variations = var; + *n_variations = n; +} + +void +_pango_fc_shape (PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length) +{ + PangoFcHbContext context; + PangoFcFont *fc_font; + PangoFcFontKey *key; + FT_Face ft_face; + hb_face_t *hb_face; + hb_font_t *hb_font; + hb_buffer_t *hb_buffer; + hb_direction_t hb_direction; + gboolean free_buffer; + hb_glyph_info_t *hb_glyph; + hb_glyph_position_t *hb_position; + int last_cluster; + guint i, num_glyphs; + unsigned int item_offset = item_text - paragraph_text; + hb_feature_t features[32]; + unsigned int num_features = 0; + double x_scale_inv, y_scale_inv; + PangoGlyphInfo *infos; + const char *variations; + + g_return_if_fail (font != NULL); + g_return_if_fail (analysis != NULL); + + fc_font = PANGO_FC_FONT (font); + ft_face = pango_fc_font_lock_face (fc_font); + if (!ft_face) + return; + + /* TODO: Cache hb_font? */ + + x_scale_inv = y_scale_inv = 1.0; + key = _pango_fc_font_get_font_key (fc_font); + if (key) + { + const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key); + pango_matrix_get_font_scale_factors (matrix, &x_scale_inv, &y_scale_inv); + } + if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity)) + { + x_scale_inv = -x_scale_inv; + y_scale_inv = -y_scale_inv; + } + context.x_scale = 1. / x_scale_inv; + context.y_scale = 1. / y_scale_inv; + context.ft_face = ft_face; + context.fc_font = fc_font; + context.vertical = PANGO_GRAVITY_IS_VERTICAL (analysis->gravity); + hb_face = hb_ft_face_create_cached (ft_face); + hb_font = hb_font_create (hb_face); + hb_font_set_funcs (hb_font, + pango_fc_get_hb_font_funcs (), + &context, + NULL); + hb_font_set_scale (hb_font, + +(((gint64) ft_face->size->metrics.x_scale * ft_face->units_per_EM) >> 12) * context.x_scale, + -(((gint64) ft_face->size->metrics.y_scale * ft_face->units_per_EM) >> 12) * context.y_scale); + hb_font_set_ppem (hb_font, + fc_font->is_hinted ? ft_face->size->metrics.x_ppem : 0, + fc_font->is_hinted ? ft_face->size->metrics.y_ppem : 0); + + variations = pango_fc_font_key_get_variations (key); + if (variations) + { + guint n_variations; + hb_variation_t *hb_variations; + + parse_variations (variations, &hb_variations, &n_variations); + hb_font_set_variations (hb_font, hb_variations, n_variations); + + g_free (hb_variations); + } + + hb_buffer = acquire_buffer (&free_buffer); + + hb_direction = PANGO_GRAVITY_IS_VERTICAL (analysis->gravity) ? HB_DIRECTION_TTB : HB_DIRECTION_LTR; + if (analysis->level % 2) + hb_direction = HB_DIRECTION_REVERSE (hb_direction); + if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity)) + hb_direction = HB_DIRECTION_REVERSE (hb_direction); + + /* setup buffer */ + + hb_buffer_set_direction (hb_buffer, hb_direction); + hb_buffer_set_script (hb_buffer, hb_glib_script_to_script (analysis->script)); + hb_buffer_set_language (hb_buffer, hb_language_from_string (pango_language_to_string (analysis->language), -1)); +#if HB_VERSION_ATLEAST(1,0,3) + hb_buffer_set_cluster_level (hb_buffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS); +#endif + hb_buffer_set_flags (hb_buffer, HB_BUFFER_FLAG_BOT | HB_BUFFER_FLAG_EOT); + + hb_buffer_add_utf8 (hb_buffer, paragraph_text, paragraph_length, item_offset, item_length); + + /* Setup features from fontconfig pattern. */ + if (fc_font->font_pattern) + { + char *s; + while (num_features < G_N_ELEMENTS (features) && + FcResultMatch == FcPatternGetString (fc_font->font_pattern, + PANGO_FC_FONT_FEATURES, + num_features, + (FcChar8 **) &s)) + { + gboolean ret = hb_feature_from_string (s, -1, &features[num_features]); + features[num_features].start = 0; + features[num_features].end = (unsigned int) -1; + if (ret) + num_features++; + } + } + + if (analysis->extra_attrs) + { + GSList *tmp_attrs; + + for (tmp_attrs = analysis->extra_attrs; tmp_attrs && num_features < G_N_ELEMENTS (features); tmp_attrs = tmp_attrs->next) + { + if (((PangoAttribute *) tmp_attrs->data)->klass->type == PANGO_ATTR_FONT_FEATURES) + { + const PangoAttrFontFeatures *fattr = (const PangoAttrFontFeatures *) tmp_attrs->data; + const gchar *feat; + const gchar *end; + int len; + + feat = fattr->features; + + while (feat != NULL && num_features < G_N_ELEMENTS (features)) + { + end = strchr (feat, ','); + if (end) + len = end - feat; + else + len = -1; + + if (hb_feature_from_string (feat, len, &features[num_features])) + num_features++; + + if (end == NULL) + break; + + feat = end + 1; + } + } + } + } + + hb_shape (hb_font, hb_buffer, features, num_features); + + if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity)) + hb_buffer_reverse (hb_buffer); + + /* buffer output */ + num_glyphs = hb_buffer_get_length (hb_buffer); + hb_glyph = hb_buffer_get_glyph_infos (hb_buffer, NULL); + pango_glyph_string_set_size (glyphs, num_glyphs); + infos = glyphs->glyphs; + last_cluster = -1; + for (i = 0; i < num_glyphs; i++) + { + infos[i].glyph = hb_glyph->codepoint; + glyphs->log_clusters[i] = hb_glyph->cluster - item_offset; + infos[i].attr.is_cluster_start = glyphs->log_clusters[i] != last_cluster; + hb_glyph++; + last_cluster = glyphs->log_clusters[i]; + } + + hb_position = hb_buffer_get_glyph_positions (hb_buffer, NULL); + if (context.vertical) + for (i = 0; i < num_glyphs; i++) + { + /* 90 degrees rotation counter-clockwise. */ + infos[i].geometry.width = hb_position->y_advance; + infos[i].geometry.x_offset = hb_position->y_offset; + infos[i].geometry.y_offset = -hb_position->x_offset; + hb_position++; + } + else /* horizontal */ + for (i = 0; i < num_glyphs; i++) + { + infos[i].geometry.width = hb_position->x_advance; + infos[i].geometry.x_offset = hb_position->x_offset; + infos[i].geometry.y_offset = hb_position->y_offset; + hb_position++; + } + + if (fc_font->is_hinted) + { + if (context.x_scale == 1.0 && context.y_scale == 1.0) + { + for (i = 0; i < num_glyphs; i++) + infos[i].geometry.width = PANGO_UNITS_ROUND (infos[i].geometry.width); + } + else + { +#if 0 + if (context.vertical) + { + /* XXX */ + double tmp = x_scale; + x_scale = y_scale; + y_scale = -tmp; + } +#endif +#define HINT(value, scale_inv, scale) (PANGO_UNITS_ROUND ((int) ((value) * scale)) * scale_inv) +#define HINT_X(value) HINT ((value), context.x_scale, x_scale_inv) +#define HINT_Y(value) HINT ((value), context.y_scale, y_scale_inv) + for (i = 0; i < num_glyphs; i++) + { + infos[i].geometry.width = HINT_X (infos[i].geometry.width); + infos[i].geometry.x_offset = HINT_X (infos[i].geometry.x_offset); + infos[i].geometry.y_offset = HINT_Y (infos[i].geometry.y_offset); + } +#undef HINT_Y +#undef HINT_X +#undef HINT + } + } + + release_buffer (hb_buffer, free_buffer); + hb_font_destroy (hb_font); + hb_face_destroy (hb_face); + pango_fc_font_unlock_face (fc_font); +} diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c new file mode 100644 index 0000000..617def0 --- /dev/null +++ b/pango/pangoft2-fontmap.c @@ -0,0 +1,391 @@ +/* Pango + * pangoft2-fontmap.c: + * + * Copyright (C) 2000 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include + +#include "pango-impl-utils.h" +#include "pangoft2-private.h" +#include "pangofc-fontmap.h" + +typedef struct _PangoFT2Family PangoFT2Family; +typedef struct _PangoFT2FontMapClass PangoFT2FontMapClass; + +/** + * PangoFT2FontMap: + * + * The #PangoFT2FontMap is the #PangoFontMap implementation for FreeType fonts. + */ +struct _PangoFT2FontMap +{ + PangoFcFontMap parent_instance; + + FT_Library library; + + guint serial; + double dpi_x; + double dpi_y; + + /* Function to call on prepared patterns to do final + * config tweaking. + */ + PangoFT2SubstituteFunc substitute_func; + gpointer substitute_data; + GDestroyNotify substitute_destroy; + + PangoRenderer *renderer; +}; + +struct _PangoFT2FontMapClass +{ + PangoFcFontMapClass parent_class; +}; + +static void pango_ft2_font_map_finalize (GObject *object); +static PangoFcFont * pango_ft2_font_map_new_font (PangoFcFontMap *fcfontmap, + FcPattern *pattern); +static double pango_ft2_font_map_get_resolution (PangoFcFontMap *fcfontmap, + PangoContext *context); +static guint pango_ft2_font_map_get_serial (PangoFontMap *fontmap); +static void pango_ft2_font_map_changed (PangoFontMap *fontmap); + +static PangoFT2FontMap *pango_ft2_global_fontmap = NULL; /* MT-safe */ + +G_DEFINE_TYPE (PangoFT2FontMap, pango_ft2_font_map, PANGO_TYPE_FC_FONT_MAP) + +static void +pango_ft2_font_map_class_init (PangoFT2FontMapClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + PangoFcFontMapClass *fcfontmap_class = PANGO_FC_FONT_MAP_CLASS (class); + + gobject_class->finalize = pango_ft2_font_map_finalize; + fontmap_class->get_serial = pango_ft2_font_map_get_serial; + fontmap_class->changed = pango_ft2_font_map_changed; + fcfontmap_class->default_substitute = _pango_ft2_font_map_default_substitute; + fcfontmap_class->new_font = pango_ft2_font_map_new_font; + fcfontmap_class->get_resolution = pango_ft2_font_map_get_resolution; +} + +static void +pango_ft2_font_map_init (PangoFT2FontMap *fontmap) +{ + FT_Error error; + + fontmap->serial = 1; + fontmap->library = NULL; + fontmap->dpi_x = 72.0; + fontmap->dpi_y = 72.0; + + error = FT_Init_FreeType (&fontmap->library); + if (error != FT_Err_Ok) + g_critical ("pango_ft2_font_map_init: Could not initialize freetype"); +} + +static void +pango_ft2_font_map_finalize (GObject *object) +{ + PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (object); + + if (ft2fontmap->renderer) + g_object_unref (ft2fontmap->renderer); + + if (ft2fontmap->substitute_destroy) + ft2fontmap->substitute_destroy (ft2fontmap->substitute_data); + + G_OBJECT_CLASS (pango_ft2_font_map_parent_class)->finalize (object); + + FT_Done_FreeType (ft2fontmap->library); +} + +/** + * pango_ft2_font_map_new: + * + * Create a new #PangoFT2FontMap object; a fontmap is used + * to cache information about available fonts, and holds + * certain global parameters such as the resolution and + * the default substitute function (see + * pango_ft2_font_map_set_default_substitute()). + * + * Return value: the newly created fontmap object. Unref + * with g_object_unref() when you are finished with it. + * + * Since: 1.2 + **/ +PangoFontMap * +pango_ft2_font_map_new (void) +{ +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* Make sure that the type system is initialized */ + g_type_init (); +#endif + + return (PangoFontMap *) g_object_new (PANGO_TYPE_FT2_FONT_MAP, NULL); +} + +static guint +pango_ft2_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (fontmap); + + return ft2fontmap->serial; +} + +static void +pango_ft2_font_map_changed (PangoFontMap *fontmap) +{ + PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (fontmap); + + ft2fontmap->serial++; + if (ft2fontmap->serial == 0) + ft2fontmap->serial++; +} + +/** + * pango_ft2_font_map_set_default_substitute: + * @fontmap: a #PangoFT2FontMap + * @func: function to call to to do final config tweaking + * on #FcPattern objects. + * @data: data to pass to @func + * @notify: function to call when @data is no longer used. + * + * Sets a function that will be called to do final configuration + * substitution on a #FcPattern before it is used to load + * the font. This function can be used to do things like set + * hinting and antialiasing options. + * + * Since: 1.2 + **/ +void +pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap, + PangoFT2SubstituteFunc func, + gpointer data, + GDestroyNotify notify) +{ + fontmap->serial++; + if (fontmap->serial == 0) + fontmap->serial++; + + if (fontmap->substitute_destroy) + fontmap->substitute_destroy (fontmap->substitute_data); + + fontmap->substitute_func = func; + fontmap->substitute_data = data; + fontmap->substitute_destroy = notify; + + pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); +} + +/** + * pango_ft2_font_map_substitute_changed: + * @fontmap: a #PangoFT2FontMap + * + * Call this function any time the results of the + * default substitution function set with + * pango_ft2_font_map_set_default_substitute() change. + * That is, if your substitution function will return different + * results for the same input pattern, you must call this function. + * + * Since: 1.2 + **/ +void +pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap) +{ + fontmap->serial++; + if (fontmap->serial == 0) + fontmap->serial++; + pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); +} + +/** + * pango_ft2_font_map_set_resolution: + * @fontmap: a #PangoFT2FontMap + * @dpi_x: dots per inch in the X direction + * @dpi_y: dots per inch in the Y direction + * + * Sets the horizontal and vertical resolutions for the fontmap. + * + * Since: 1.2 + **/ +void +pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap, + double dpi_x, + double dpi_y) +{ + g_return_if_fail (PANGO_FT2_IS_FONT_MAP (fontmap)); + + fontmap->dpi_x = dpi_x; + fontmap->dpi_y = dpi_y; + + pango_ft2_font_map_substitute_changed (fontmap); +} + +/** + * pango_ft2_font_map_create_context: (skip) + * @fontmap: a #PangoFT2FontMap + * + * Create a #PangoContext for the given fontmap. + * + * Return value: (transfer full): the newly created context; free with + * g_object_unref(). + * + * Since: 1.2 + * + * Deprecated: 1.22: Use pango_font_map_create_context() instead. + **/ +PangoContext * +pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap) +{ + g_return_val_if_fail (PANGO_FT2_IS_FONT_MAP (fontmap), NULL); + + return pango_font_map_create_context (PANGO_FONT_MAP (fontmap)); +} + +/** + * pango_ft2_get_context: (skip) + * @dpi_x: the horizontal DPI of the target device + * @dpi_y: the vertical DPI of the target device + * + * Retrieves a #PangoContext for the default PangoFT2 fontmap + * (see pango_ft2_font_map_for_display()) and sets the resolution + * for the default fontmap to @dpi_x by @dpi_y. + * + * Return value: (transfer full): the new #PangoContext + * + * Deprecated: 1.22: Use pango_font_map_create_context() instead. + **/ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +PangoContext * +pango_ft2_get_context (double dpi_x, double dpi_y) +{ + PangoFontMap *fontmap; + + fontmap = pango_ft2_font_map_for_display (); + pango_ft2_font_map_set_resolution (PANGO_FT2_FONT_MAP (fontmap), dpi_x, dpi_y); + + return pango_font_map_create_context (fontmap); +} +G_GNUC_END_IGNORE_DEPRECATIONS + +/** + * pango_ft2_font_map_for_display: (skip) + * + * Returns a #PangoFT2FontMap. This font map is cached and should + * not be freed. If the font map is no longer needed, it can + * be released with pango_ft2_shutdown_display(). Use of the + * global PangoFT2 fontmap is deprecated; use pango_ft2_font_map_new() + * instead. + * + * Return value: (transfer none): a #PangoFT2FontMap. + **/ +PangoFontMap * +pango_ft2_font_map_for_display (void) +{ + if (g_once_init_enter (&pango_ft2_global_fontmap)) + g_once_init_leave (&pango_ft2_global_fontmap, PANGO_FT2_FONT_MAP (pango_ft2_font_map_new ())); + + return PANGO_FONT_MAP (pango_ft2_global_fontmap); +} + +/** + * pango_ft2_shutdown_display: + * + * Free the global fontmap. (See pango_ft2_font_map_for_display()) + * Use of the global PangoFT2 fontmap is deprecated. + **/ +void +pango_ft2_shutdown_display (void) +{ + if (pango_ft2_global_fontmap) + { + pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (pango_ft2_global_fontmap)); + + g_object_unref (pango_ft2_global_fontmap); + + pango_ft2_global_fontmap = NULL; + } +} + +FT_Library +_pango_ft2_font_map_get_library (PangoFontMap *fontmap) +{ + PangoFT2FontMap *ft2fontmap = (PangoFT2FontMap *)fontmap; + + return ft2fontmap->library; +} + + +/** + * _pango_ft2_font_map_get_renderer: + * @fontmap: a #PangoFT2FontMap + * + * Gets the singleton PangoFT2Renderer for this fontmap. + * + * Return value: the renderer. + **/ +PangoRenderer * +_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap) +{ + if (!ft2fontmap->renderer) + ft2fontmap->renderer = g_object_new (PANGO_TYPE_FT2_RENDERER, NULL); + + return ft2fontmap->renderer; +} + +void +_pango_ft2_font_map_default_substitute (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (fcfontmap); + FcValue v; + + FcConfigSubstitute (NULL, pattern, FcMatchPattern); + + if (ft2fontmap->substitute_func) + ft2fontmap->substitute_func (pattern, ft2fontmap->substitute_data); + + if (FcPatternGet (pattern, FC_DPI, 0, &v) == FcResultNoMatch) + FcPatternAddDouble (pattern, FC_DPI, ft2fontmap->dpi_y); + FcDefaultSubstitute (pattern); +} + +static double +pango_ft2_font_map_get_resolution (PangoFcFontMap *fcfontmap, + PangoContext *context G_GNUC_UNUSED) +{ + return ((PangoFT2FontMap *)fcfontmap)->dpi_y; +} + +static PangoFcFont * +pango_ft2_font_map_new_font (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + return (PangoFcFont *)_pango_ft2_font_new (PANGO_FT2_FONT_MAP (fcfontmap), pattern); +} diff --git a/pango/pangoft2-private.h b/pango/pangoft2-private.h new file mode 100644 index 0000000..c9b25d1 --- /dev/null +++ b/pango/pangoft2-private.h @@ -0,0 +1,106 @@ +/* Pango + * pangoft2-private.h: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOFT2_PRIVATE_H__ +#define __PANGOFT2_PRIVATE_H__ + +#include +#include +#include +#include + +/* Debugging... */ +/*#define DEBUGGING 1*/ + +#if defined(DEBUGGING) && DEBUGGING +#ifdef __GNUC__ +#define PING(printlist) \ +(g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__), \ + g_print printlist, \ + g_print ("\n")) +#else +#define PING(printlist) \ +(g_print ("%s:%d ", __FILE__, __LINE__), \ + g_print printlist, \ + g_print ("\n")) +#endif +#else /* !DEBUGGING */ +#define PING(printlist) +#endif + +typedef struct _PangoFT2Font PangoFT2Font; +typedef struct _PangoFT2GlyphInfo PangoFT2GlyphInfo; +typedef struct _PangoFT2Renderer PangoFT2Renderer; + +struct _PangoFT2Font +{ + PangoFcFont font; + + FT_Face face; + int load_flags; + + int size; + + GSList *metrics_by_lang; + + GHashTable *glyph_info; + GDestroyNotify glyph_cache_destroy; +}; + +struct _PangoFT2GlyphInfo +{ + PangoRectangle logical_rect; + PangoRectangle ink_rect; + void *cached_glyph; +}; + +#define PANGO_TYPE_FT2_FONT (pango_ft2_font_get_type ()) +#define PANGO_FT2_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT, PangoFT2Font)) +#define PANGO_FT2_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_FONT)) + +_PANGO_EXTERN +GType pango_ft2_font_get_type (void) G_GNUC_CONST; + +PangoFT2Font * _pango_ft2_font_new (PangoFT2FontMap *ft2fontmap, + FcPattern *pattern); +FT_Library _pango_ft2_font_map_get_library (PangoFontMap *fontmap); +void _pango_ft2_font_map_default_substitute (PangoFcFontMap *fcfontmap, + FcPattern *pattern); + +void *_pango_ft2_font_get_cache_glyph_data (PangoFont *font, + int glyph_index); +void _pango_ft2_font_set_cache_glyph_data (PangoFont *font, + int glyph_index, + void *cached_glyph); +void _pango_ft2_font_set_glyph_cache_destroy (PangoFont *font, + GDestroyNotify destroy_notify); + +#define PANGO_TYPE_FT2_RENDERER (pango_ft2_renderer_get_type()) +#define PANGO_FT2_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_RENDERER, PangoFT2Renderer)) +#define PANGO_IS_FT2_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_RENDERER)) + +_PANGO_EXTERN +GType pango_ft2_renderer_get_type (void) G_GNUC_CONST; + +PangoRenderer *_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap); + +#endif /* __PANGOFT2_PRIVATE_H__ */ diff --git a/pango/pangoft2-render.c b/pango/pangoft2-render.c new file mode 100644 index 0000000..efb950d --- /dev/null +++ b/pango/pangoft2-render.c @@ -0,0 +1,762 @@ +/* Pango + * pangoft2-render.c: Rendering routines to FT_Bitmap objects + * + * Copyright (C) 2004 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:pango-renderer + * @short_description:Rendering driver base class + * @title:PangoRenderer + * + * #PangoRenderer is a base class that contains the necessary logic for + * rendering a #PangoLayout or #PangoLayoutLine. By subclassing + * #PangoRenderer and overriding operations such as @draw_glyphs and + * @draw_rectangle, renderers for particular font backends and + * destinations can be created. + */ +#include "config.h" +#include + +#include "pangoft2-private.h" + +/* for compatibility with older freetype versions */ +#ifndef FT_LOAD_TARGET_MONO +#define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME +#endif + +typedef struct _PangoFT2RendererClass PangoFT2RendererClass; + +#define PANGO_FT2_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FT2_RENDERER, PangoFT2RendererClass)) +#define PANGO_IS_FT2_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FT2_RENDERER)) +#define PANGO_FT2_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FT2_RENDERER, PangoFT2RendererClass)) + +struct _PangoFT2Renderer +{ + PangoRenderer parent_instance; + + FT_Bitmap *bitmap; +}; + +struct _PangoFT2RendererClass +{ + PangoRendererClass parent_class; +}; + +static void pango_ft2_renderer_draw_glyph (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph, + double x, + double y); +static void pango_ft2_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22); + +G_DEFINE_TYPE (PangoFT2Renderer, pango_ft2_renderer, PANGO_TYPE_RENDERER) + +static void +pango_ft2_renderer_init (PangoFT2Renderer *renderer G_GNUC_UNUSED) +{ +} + +static void +pango_ft2_renderer_class_init (PangoFT2RendererClass *klass) +{ + PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); + + renderer_class->draw_glyph = pango_ft2_renderer_draw_glyph; + renderer_class->draw_trapezoid = pango_ft2_renderer_draw_trapezoid; +} + +static void +pango_ft2_renderer_set_bitmap (PangoFT2Renderer *renderer, + FT_Bitmap *bitmap) +{ + renderer->bitmap = bitmap; +} + +typedef struct +{ + FT_Bitmap bitmap; + int bitmap_left; + int bitmap_top; +} PangoFT2RenderedGlyph; + +static void +pango_ft2_free_rendered_glyph (PangoFT2RenderedGlyph *rendered) +{ + g_free (rendered->bitmap.buffer); + g_slice_free (PangoFT2RenderedGlyph, rendered); +} + +static PangoFT2RenderedGlyph * +pango_ft2_font_render_box_glyph (int width, + int height, + int top, + gboolean invalid) +{ + PangoFT2RenderedGlyph *box; + int i, j, offset1, offset2, line_width; + + line_width = MAX ((height + 43) / 44, 1); + if (width < 1 || height < 1) + line_width = 0; + + box = g_slice_new (PangoFT2RenderedGlyph); + + box->bitmap_left = 0; + box->bitmap_top = top; + + box->bitmap.pixel_mode = ft_pixel_mode_grays; + + box->bitmap.width = width; + box->bitmap.rows = height; + box->bitmap.pitch = width; + + box->bitmap.buffer = g_malloc0_n (box->bitmap.rows, box->bitmap.pitch); + + if (G_UNLIKELY (!box->bitmap.buffer)) { + g_slice_free (PangoFT2RenderedGlyph, box); + return NULL; + } + + /* draw the box */ + for (j = 0; j < line_width; j++) + { + offset1 = box->bitmap.pitch * (MIN (1 + j, height - 1)); + offset2 = box->bitmap.pitch * (MAX (box->bitmap.rows - 2 - j, 0)); + for (i = 1; + i < (int) box->bitmap.width - 1; + i++) + { + box->bitmap.buffer[offset1 + i] = 0xff; + box->bitmap.buffer[offset2 + i] = 0xff; + } + } + for (j = 0; j < line_width; j++) + { + offset1 = MIN (1 + j, width - 1); + offset2 = MAX ((int) box->bitmap.width - 2 - j, 0); + for (i = box->bitmap.pitch; + i < (int) (box->bitmap.rows - 1) * box->bitmap.pitch; + i += box->bitmap.pitch) + { + box->bitmap.buffer[offset1 + i] = 0xff; + box->bitmap.buffer[offset2 + i] = 0xff; + } + } + + if (invalid) + { + /* XXX This may scrabble memory. Didn't check close enough */ + int inc = PANGO_SCALE * MAX (width - line_width, 0) / (height + 1); + offset1 = PANGO_SCALE; + offset2 = PANGO_SCALE * MAX (width - line_width - 1, 0) ; + for (i = box->bitmap.pitch; + i < (int) (box->bitmap.rows - 1) * box->bitmap.pitch; + i += box->bitmap.pitch) + { + for (j = 0; j < line_width; j++) + { + box->bitmap.buffer[PANGO_PIXELS (offset1) + i + j] = 0xff; + box->bitmap.buffer[PANGO_PIXELS (offset2) + i + j] = 0xff; + } + offset1 += inc; + offset2 -= inc; + } + + } + + return box; +} + +static PangoFT2RenderedGlyph * +pango_ft2_font_render_glyph (PangoFont *font, + PangoGlyph glyph_index) +{ + FT_Face face; + gboolean invalid_input; + + invalid_input = glyph_index == PANGO_GLYPH_INVALID_INPUT || (glyph_index & ~PANGO_GLYPH_UNKNOWN_FLAG) > 0x10FFFF; + + if (glyph_index & PANGO_GLYPH_UNKNOWN_FLAG) + { + PangoFT2RenderedGlyph *box; + PangoFontMetrics *metrics; + + if (!font) + goto generic_box; + + metrics = pango_font_get_metrics (font, NULL); + if (!metrics) + goto generic_box; + + box = pango_ft2_font_render_box_glyph (PANGO_PIXELS (metrics->approximate_char_width), + PANGO_PIXELS (metrics->ascent + metrics->descent), + PANGO_PIXELS (metrics->ascent), + invalid_input); + pango_font_metrics_unref (metrics); + + return box; + } + + face = pango_ft2_font_get_face (font); + + if (face) + { + PangoFT2RenderedGlyph *rendered; + PangoFT2Font *ft2font = (PangoFT2Font *) font; + + rendered = g_slice_new (PangoFT2RenderedGlyph); + + /* Draw glyph */ + FT_Load_Glyph (face, glyph_index, ft2font->load_flags); + FT_Render_Glyph (face->glyph, + (ft2font->load_flags & FT_LOAD_TARGET_MONO ? + ft_render_mode_mono : ft_render_mode_normal)); + + rendered->bitmap = face->glyph->bitmap; + rendered->bitmap.buffer = g_memdup (face->glyph->bitmap.buffer, + face->glyph->bitmap.rows * face->glyph->bitmap.pitch); + rendered->bitmap_left = face->glyph->bitmap_left; + rendered->bitmap_top = face->glyph->bitmap_top; + + if (G_UNLIKELY (!rendered->bitmap.buffer)) { + g_slice_free (PangoFT2RenderedGlyph, rendered); + return NULL; + } + + return rendered; + } + else + { +generic_box: + return pango_ft2_font_render_box_glyph (PANGO_UNKNOWN_GLYPH_WIDTH, + PANGO_UNKNOWN_GLYPH_HEIGHT, + PANGO_UNKNOWN_GLYPH_HEIGHT, + invalid_input); + } +} + +static void +pango_ft2_renderer_draw_glyph (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph, + double x, + double y) +{ + FT_Bitmap *bitmap = PANGO_FT2_RENDERER (renderer)->bitmap; + PangoFT2RenderedGlyph *rendered_glyph; + gboolean add_glyph_to_cache; + guchar *src, *dest; + + int x_start, x_limit; + int y_start, y_limit; + int ixoff = floor (x + 0.5); + int iyoff = floor (y + 0.5); + int ix, iy; + + if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + /* Since we don't draw hexbox for FT2 renderer, + * unifiy the rendered bitmap in the cache by converting + * all missing glyphs to either INVALID_INPUT or UNKNOWN_FLAG. + */ + + gunichar wc = glyph & (~PANGO_GLYPH_UNKNOWN_FLAG); + + if (G_UNLIKELY (glyph == PANGO_GLYPH_INVALID_INPUT || wc > 0x10FFFF)) + glyph = PANGO_GLYPH_INVALID_INPUT; + else + glyph = PANGO_GLYPH_UNKNOWN_FLAG; + } + + rendered_glyph = _pango_ft2_font_get_cache_glyph_data (font, glyph); + add_glyph_to_cache = FALSE; + if (rendered_glyph == NULL) + { + rendered_glyph = pango_ft2_font_render_glyph (font, glyph); + if (rendered_glyph == NULL) + return; + add_glyph_to_cache = TRUE; + } + + x_start = MAX (0, - (ixoff + rendered_glyph->bitmap_left)); + x_limit = MIN ((int) rendered_glyph->bitmap.width, + (int) (bitmap->width - (ixoff + rendered_glyph->bitmap_left))); + + y_start = MAX (0, - (iyoff - rendered_glyph->bitmap_top)); + y_limit = MIN ((int) rendered_glyph->bitmap.rows, + (int) (bitmap->rows - (iyoff - rendered_glyph->bitmap_top))); + + src = rendered_glyph->bitmap.buffer + + y_start * rendered_glyph->bitmap.pitch; + + dest = bitmap->buffer + + (y_start + iyoff - rendered_glyph->bitmap_top) * bitmap->pitch + + x_start + ixoff + rendered_glyph->bitmap_left; + + switch (rendered_glyph->bitmap.pixel_mode) + { + case ft_pixel_mode_grays: + src += x_start; + for (iy = y_start; iy < y_limit; iy++) + { + guchar *s = src; + guchar *d = dest; + + for (ix = x_start; ix < x_limit; ix++) + { + switch (*s) + { + case 0: + break; + case 0xff: + *d = 0xff; + default: + *d = MIN ((gushort) *d + (gushort) *s, 0xff); + break; + } + + s++; + d++; + } + + dest += bitmap->pitch; + src += rendered_glyph->bitmap.pitch; + } + break; + + case ft_pixel_mode_mono: + src += x_start / 8; + for (iy = y_start; iy < y_limit; iy++) + { + guchar *s = src; + guchar *d = dest; + + for (ix = x_start; ix < x_limit; ix++) + { + if ((*s) & (1 << (7 - (ix % 8)))) + *d |= 0xff; + + if ((ix % 8) == 7) + s++; + d++; + } + + dest += bitmap->pitch; + src += rendered_glyph->bitmap.pitch; + } + break; + + default: + g_warning ("pango_ft2_render: " + "Unrecognized glyph bitmap pixel mode %d\n", + rendered_glyph->bitmap.pixel_mode); + break; + } + + if (add_glyph_to_cache) + { + _pango_ft2_font_set_glyph_cache_destroy (font, + (GDestroyNotify) pango_ft2_free_rendered_glyph); + _pango_ft2_font_set_cache_glyph_data (font, + glyph, rendered_glyph); + } +} + +typedef struct { + double y; + double x1; + double x2; +} Position; + +static void +draw_simple_trap (PangoRenderer *renderer, + Position *t, + Position *b) +{ + FT_Bitmap *bitmap = PANGO_FT2_RENDERER (renderer)->bitmap; + int iy = floor (t->y); + int x1, x2, x; + double dy = b->y - t->y; + guchar *dest; + + if (iy < 0 || iy >= (int) bitmap->rows) + return; + dest = bitmap->buffer + iy * bitmap->pitch; + + if (t->x1 < b->x1) + x1 = floor (t->x1); + else + x1 = floor (b->x1); + + if (t->x2 > b->x2) + x2 = ceil (t->x2); + else + x2 = ceil (b->x2); + + x1 = CLAMP (x1, 0, (int) bitmap->width); + x2 = CLAMP (x2, 0, (int) bitmap->width); + + for (x = x1; x < x2; x++) + { + double top_left = MAX (t->x1, x); + double top_right = MIN (t->x2, x + 1); + double bottom_left = MAX (b->x1, x); + double bottom_right = MIN (b->x2, x + 1); + double c = 0.5 * dy * ((top_right - top_left) + (bottom_right - bottom_left)); + + /* When converting to [0,255], we round up. This is intended + * to prevent the problem of pixels that get divided into + * multiple slices not being fully black. + */ + int ic = c * 256; + + dest[x] = MIN (dest[x] + ic, 255); + } +} + +static void +interpolate_position (Position *result, + Position *top, + Position *bottom, + double val, + double val1, + double val2) +{ + result->y = (top->y * (val2 - val) + bottom->y * (val - val1)) / (val2 - val1); + result->x1 = (top->x1 * (val2 - val) + bottom->x1 * (val - val1)) / (val2 - val1); + result->x2 = (top->x2 * (val2 - val) + bottom->x2 * (val - val1)) / (val2 - val1); +} + +/* This draws a trapezoid with the parallel sides aligned with + * the X axis. We do this by subdividing the trapezoid vertically + * into thin slices (themselves trapezoids) where two edge sides are each + * contained within a single pixel and then rasterizing each + * slice. There are frequently multiple slices within a single + * line so we have to accumulate to get the final result. + */ +static void +pango_ft2_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part G_GNUC_UNUSED, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22) +{ + Position pos; + Position t; + Position b; + gboolean done = FALSE; + + if (y1 == y2) + return; + + pos.y = t.y = y1; + pos.x1 = t.x1 = x11; + pos.x2 = t.x2 = x21; + b.y = y2; + b.x1 = x12; + b.x2 = x22; + + while (!done) + { + Position pos_next; + double y_next, x1_next, x2_next; + double ix1, ix2; + + /* The algorithm here is written to emphasize simplicity and + * numerical stability as opposed to speed. + * + * While the end result is slicing up the polygon vertically, + * conceptually we aren't walking in the X direction, rather we + * are walking along the edges. When we compute crossing of + * horizontal pixel boundaries, we use the X coordinate as the + * interpolating variable, when we compute crossing for vertical + * pixel boundaries, we use the Y coordinate. + * + * This allows us to handle almost exactly horizontal edges without + * running into difficulties. (Almost exactly horizontal edges + * come up frequently due to inexactness in computing, say, + * a 90 degree rotation transformation) + */ + + pos_next = b; + done = TRUE; + + /* Check for crossing vertical pixel boundaries */ + y_next = floor (pos.y) + 1; + if (y_next < pos_next.y) + { + interpolate_position (&pos_next, &t, &b, + y_next, t.y, b.y); + pos_next.y = y_next; + done = FALSE; + } + + /* Check left side for crossing horizontal pixel boundaries */ + ix1 = floor (pos.x1); + + if (b.x1 < t.x1) + { + if (ix1 == pos.x1) + x1_next = ix1 - 1; + else + x1_next = ix1; + + if (x1_next > pos_next.x1) + { + interpolate_position (&pos_next, &t, &b, + x1_next, t.x1, b.x1); + pos_next.x1 = x1_next; + done = FALSE; + } + } + else if (b.x1 > t.x1) + { + x1_next = ix1 + 1; + + if (x1_next < pos_next.x1) + { + interpolate_position (&pos_next, &t, &b, + x1_next, t.x1, b.x1); + pos_next.x1 = x1_next; + done = FALSE; + } + } + + /* Check right side for crossing horizontal pixel boundaries */ + ix2 = floor (pos.x2); + + if (b.x2 < t.x2) + { + if (ix2 == pos.x2) + x2_next = ix2 - 1; + else + x2_next = ix2; + + if (x2_next > pos_next.x2) + { + interpolate_position (&pos_next, &t, &b, + x2_next, t.x2, b.x2); + pos_next.x2 = x2_next; + done = FALSE; + } + } + else if (x22 > x21) + { + x2_next = ix2 + 1; + + if (x2_next < pos_next.x2) + { + interpolate_position (&pos_next, &t, &b, + x2_next, t.x2, b.x2); + pos_next.x2 = x2_next; + done = FALSE; + } + } + + draw_simple_trap (renderer, &pos, &pos_next); + pos = pos_next; + } +} + +/** + * pango_ft2_render_layout_subpixel: + * @bitmap: a FT_Bitmap to render the layout onto + * @layout: a #PangoLayout + * @x: the X position of the left of the layout (in Pango units) + * @y: the Y position of the top of the layout (in Pango units) + * + * Render a #PangoLayout onto a FreeType2 bitmap, with he + * location specified in fixed-point Pango units rather than + * pixels. (Using this will avoid extra inaccuracies from + * rounding to integer pixels multiple times, even if the + * final glyph positions are integers.) + * + * Since: 1.6 + */ +void +pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap, + PangoLayout *layout, + int x, + int y) +{ + PangoContext *context; + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (bitmap != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + context = pango_layout_get_context (layout); + fontmap = pango_context_get_font_map (context); + renderer = _pango_ft2_font_map_get_renderer (PANGO_FT2_FONT_MAP (fontmap)); + + pango_ft2_renderer_set_bitmap (PANGO_FT2_RENDERER (renderer), bitmap); + + pango_renderer_draw_layout (renderer, layout, x, y); +} + +/** + * pango_ft2_render_layout: + * @bitmap: a FT_Bitmap to render the layout onto + * @layout: a #PangoLayout + * @x: the X position of the left of the layout (in pixels) + * @y: the Y position of the top of the layout (in pixels) + * + * Render a #PangoLayout onto a FreeType2 bitmap + */ +void +pango_ft2_render_layout (FT_Bitmap *bitmap, + PangoLayout *layout, + int x, + int y) +{ + pango_ft2_render_layout_subpixel (bitmap, layout, x * PANGO_SCALE, y * PANGO_SCALE); +} + +/** + * pango_ft2_render_layout_line_subpixel: + * @bitmap: a FT_Bitmap to render the line onto + * @line: a #PangoLayoutLine + * @x: the x position of start of string (in Pango units) + * @y: the y position of baseline (in Pango units) + * + * Render a #PangoLayoutLine onto a FreeType2 bitmap, with he + * location specified in fixed-point Pango units rather than + * pixels. (Using this will avoid extra inaccuracies from + * rounding to integer pixels multiple times, even if the + * final glyph positions are integers.) + * + * Since: 1.6 + */ +void +pango_ft2_render_layout_line_subpixel (FT_Bitmap *bitmap, + PangoLayoutLine *line, + int x, + int y) +{ + PangoContext *context; + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (bitmap != NULL); + g_return_if_fail (line != NULL); + + context = pango_layout_get_context (line->layout); + fontmap = pango_context_get_font_map (context); + renderer = _pango_ft2_font_map_get_renderer (PANGO_FT2_FONT_MAP (fontmap)); + + pango_ft2_renderer_set_bitmap (PANGO_FT2_RENDERER (renderer), bitmap); + + pango_renderer_draw_layout_line (renderer, line, x, y); +} + +/** + * pango_ft2_render_layout_line: + * @bitmap: a FT_Bitmap to render the line onto + * @line: a #PangoLayoutLine + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * + * Render a #PangoLayoutLine onto a FreeType2 bitmap + */ +void +pango_ft2_render_layout_line (FT_Bitmap *bitmap, + PangoLayoutLine *line, + int x, + int y) +{ + pango_ft2_render_layout_line_subpixel (bitmap, line, x * PANGO_SCALE, y * PANGO_SCALE); +} + +/** + * pango_ft2_render_transformed: + * @bitmap: the FreeType2 bitmap onto which to draw the string + * @font: the font in which to draw the string + * @matrix: (nullable): a #PangoMatrix, or %NULL to use an identity + * transformation + * @glyphs: the glyph string to draw + * @x: the x position of the start of the string (in Pango + * units in user space coordinates) + * @y: the y position of the baseline (in Pango units + * in user space coordinates) + * + * Renders a #PangoGlyphString onto a FreeType2 bitmap, possibly + * transforming the layed-out coordinates through a transformation + * matrix. Note that the transformation matrix for @font is not + * changed, so to produce correct rendering results, the @font + * must have been loaded using a #PangoContext with an identical + * transformation matrix to that passed in to this function. + * + * Since: 1.6 + **/ +void +pango_ft2_render_transformed (FT_Bitmap *bitmap, + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (bitmap != NULL); + g_return_if_fail (glyphs != NULL); + g_return_if_fail (PANGO_FT2_IS_FONT (font)); + + fontmap = PANGO_FC_FONT (font)->fontmap; + renderer = _pango_ft2_font_map_get_renderer (PANGO_FT2_FONT_MAP (fontmap)); + + pango_ft2_renderer_set_bitmap (PANGO_FT2_RENDERER (renderer), bitmap); + pango_renderer_set_matrix (renderer, matrix); + + pango_renderer_draw_glyphs (renderer, font, glyphs, x, y); +} + +/** + * pango_ft2_render: + * @bitmap: the FreeType2 bitmap onto which to draw the string + * @font: the font in which to draw the string + * @glyphs: the glyph string to draw + * @x: the x position of the start of the string (in pixels) + * @y: the y position of the baseline (in pixels) + * + * Renders a #PangoGlyphString onto a FreeType2 bitmap. + **/ +void +pango_ft2_render (FT_Bitmap *bitmap, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + pango_ft2_render_transformed (bitmap, NULL, font, glyphs, x * PANGO_SCALE, y * PANGO_SCALE); +} + diff --git a/pango/pangoft2.c b/pango/pangoft2.c new file mode 100644 index 0000000..0671a11 --- /dev/null +++ b/pango/pangoft2.c @@ -0,0 +1,562 @@ +/* Pango + * pangoft2.c: Routines for handling FreeType2 fonts + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:freetype-fonts + * @short_description:Functions for shape engines to manipulate FreeType fonts + * @title:FreeType Fonts and Rendering + * + * The macros and functions in this section are used to access fonts and render + * text to bitmaps using the FreeType 2 library. + */ +#include "config.h" + +#include +#include +#include +#include +#include + +#include "pangoft2.h" +#include "pangoft2-private.h" +#include "pangofc-fontmap.h" +#include "pangofc-private.h" + +/* for compatibility with older freetype versions */ +#ifndef FT_LOAD_TARGET_MONO +#define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME +#endif + +#define PANGO_FT2_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FT2_FONT, PangoFT2FontClass)) +#define PANGO_FT2_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FT2_FONT)) +#define PANGO_FT2_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FT2_FONT, PangoFT2FontClass)) + +typedef struct _PangoFT2FontClass PangoFT2FontClass; + +struct _PangoFT2FontClass +{ + PangoFcFontClass parent_class; +}; + +static void pango_ft2_font_finalize (GObject *object); + +static void pango_ft2_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +static FT_Face pango_ft2_font_real_lock_face (PangoFcFont *font); +static void pango_ft2_font_real_unlock_face (PangoFcFont *font); + + +PangoFT2Font * +_pango_ft2_font_new (PangoFT2FontMap *ft2fontmap, + FcPattern *pattern) +{ + PangoFontMap *fontmap = PANGO_FONT_MAP (ft2fontmap); + PangoFT2Font *ft2font; + double d; + + g_return_val_if_fail (fontmap != NULL, NULL); + g_return_val_if_fail (pattern != NULL, NULL); + + ft2font = (PangoFT2Font *)g_object_new (PANGO_TYPE_FT2_FONT, + "pattern", pattern, + "fontmap", fontmap, + NULL); + + if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &d) == FcResultMatch) + ft2font->size = d*PANGO_SCALE; + + return ft2font; +} + +static void +load_fallback_face (PangoFT2Font *ft2font, + const char *original_file) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (ft2font); + FcPattern *sans; + FcPattern *matched; + FcResult result; + FT_Error error; + FcChar8 *filename2 = NULL; + gchar *name; + int id; + + sans = FcPatternBuild (NULL, + FC_FAMILY, FcTypeString, "sans", + FC_PIXEL_SIZE, FcTypeDouble, (double)ft2font->size / PANGO_SCALE, + NULL); + + _pango_ft2_font_map_default_substitute ((PangoFcFontMap *)fcfont->fontmap, sans); + + matched = FcFontMatch (pango_fc_font_map_get_config ((PangoFcFontMap *)fcfont->fontmap), sans, &result); + + if (FcPatternGetString (matched, FC_FILE, 0, &filename2) != FcResultMatch) + goto bail1; + + if (FcPatternGetInteger (matched, FC_INDEX, 0, &id) != FcResultMatch) + goto bail1; + + error = FT_New_Face (_pango_ft2_font_map_get_library (fcfont->fontmap), + (char *) filename2, id, &ft2font->face); + + + if (error) + { + bail1: + name = pango_font_description_to_string (fcfont->description); + g_error ("Unable to open font file %s for font %s, exiting\n", filename2, name); + } + else + { + name = pango_font_description_to_string (fcfont->description); + g_warning ("Unable to open font file %s for font %s, falling back to %s\n", original_file, name, filename2); + g_free (name); + } + + FcPatternDestroy (sans); + FcPatternDestroy (matched); +} + +static void +set_transform (PangoFT2Font *ft2font) +{ + PangoFcFont *fcfont = (PangoFcFont *)ft2font; + FcMatrix *fc_matrix; + + if (FcPatternGetMatrix (fcfont->font_pattern, FC_MATRIX, 0, &fc_matrix) == FcResultMatch) + { + FT_Matrix ft_matrix; + + ft_matrix.xx = 0x10000L * fc_matrix->xx; + ft_matrix.yy = 0x10000L * fc_matrix->yy; + ft_matrix.xy = 0x10000L * fc_matrix->xy; + ft_matrix.yx = 0x10000L * fc_matrix->yx; + + FT_Set_Transform (ft2font->face, &ft_matrix, NULL); + } +} + +/** + * pango_ft2_font_get_face: + * @font: a #PangoFont + * + * Returns the native FreeType2 FT_Face structure used for this #PangoFont. + * This may be useful if you want to use FreeType2 functions directly. + * + * Use pango_fc_font_lock_face() instead; when you are done with a + * face from pango_fc_font_lock_face() you must call + * pango_fc_font_unlock_face(). + * + * Return value: (nullable): a pointer to a FT_Face + * structure, with the size set correctly, or %NULL if + * @font is %NULL. + **/ +FT_Face +pango_ft2_font_get_face (PangoFont *font) +{ + PangoFT2Font *ft2font = (PangoFT2Font *)font; + PangoFcFont *fcfont = (PangoFcFont *)font; + FT_Error error; + FcPattern *pattern; + FcChar8 *filename; + FcBool antialias, hinting, autohint; + int hintstyle; + int id; + + if (G_UNLIKELY (!font)) + return NULL; + + pattern = fcfont->font_pattern; + + if (!ft2font->face) + { + ft2font->load_flags = 0; + + /* disable antialiasing if requested */ + if (FcPatternGetBool (pattern, + FC_ANTIALIAS, 0, &antialias) != FcResultMatch) + antialias = FcTrue; + + if (antialias) + ft2font->load_flags |= FT_LOAD_NO_BITMAP; + else + ft2font->load_flags |= FT_LOAD_TARGET_MONO; + + /* disable hinting if requested */ + if (FcPatternGetBool (pattern, + FC_HINTING, 0, &hinting) != FcResultMatch) + hinting = FcTrue; + +#ifdef FC_HINT_STYLE + if (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hintstyle) != FcResultMatch) + hintstyle = FC_HINT_FULL; + + if (!hinting || hintstyle == FC_HINT_NONE) + ft2font->load_flags |= FT_LOAD_NO_HINTING; + + switch (hintstyle) { + case FC_HINT_SLIGHT: + case FC_HINT_MEDIUM: + ft2font->load_flags |= FT_LOAD_TARGET_LIGHT; + break; + default: + ft2font->load_flags |= FT_LOAD_TARGET_NORMAL; + break; + } +#else + if (!hinting) + ft2font->load_flags |= FT_LOAD_NO_HINTING; +#endif + + /* force autohinting if requested */ + if (FcPatternGetBool (pattern, + FC_AUTOHINT, 0, &autohint) != FcResultMatch) + autohint = FcFalse; + + if (autohint) + ft2font->load_flags |= FT_LOAD_FORCE_AUTOHINT; + + if (FcPatternGetString (pattern, FC_FILE, 0, &filename) != FcResultMatch) + goto bail0; + + if (FcPatternGetInteger (pattern, FC_INDEX, 0, &id) != FcResultMatch) + goto bail0; + + error = FT_New_Face (_pango_ft2_font_map_get_library (fcfont->fontmap), + (char *) filename, id, &ft2font->face); + if (error != FT_Err_Ok) + { + bail0: + load_fallback_face (ft2font, (char *) filename); + } + + g_assert (ft2font->face); + + set_transform (ft2font); + + error = FT_Set_Char_Size (ft2font->face, + PANGO_PIXELS_26_6 (ft2font->size), + PANGO_PIXELS_26_6 (ft2font->size), + 0, 0); + if (error) + g_warning ("Error in FT_Set_Char_Size: %d", error); + } + + return ft2font->face; +} + +G_DEFINE_TYPE (PangoFT2Font, pango_ft2_font, PANGO_TYPE_FC_FONT) + +static void +pango_ft2_font_init (PangoFT2Font *ft2font) +{ + ft2font->face = NULL; + + ft2font->size = 0; + + ft2font->glyph_info = g_hash_table_new (NULL, NULL); +} + +static void +pango_ft2_font_class_init (PangoFT2FontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + PangoFcFontClass *fc_font_class = PANGO_FC_FONT_CLASS (class); + + object_class->finalize = pango_ft2_font_finalize; + + font_class->get_glyph_extents = pango_ft2_font_get_glyph_extents; + + fc_font_class->lock_face = pango_ft2_font_real_lock_face; + fc_font_class->unlock_face = pango_ft2_font_real_unlock_face; +} + +static PangoFT2GlyphInfo * +pango_ft2_font_get_glyph_info (PangoFont *font, + PangoGlyph glyph, + gboolean create) +{ + PangoFT2Font *ft2font = (PangoFT2Font *)font; + PangoFcFont *fcfont = (PangoFcFont *)font; + PangoFT2GlyphInfo *info; + + info = g_hash_table_lookup (ft2font->glyph_info, GUINT_TO_POINTER (glyph)); + + if ((info == NULL) && create) + { + info = g_slice_new0 (PangoFT2GlyphInfo); + + pango_fc_font_get_raw_extents (fcfont, ft2font->load_flags, + glyph, + &info->ink_rect, + &info->logical_rect); + + g_hash_table_insert (ft2font->glyph_info, GUINT_TO_POINTER(glyph), info); + } + + return info; +} + +static void +pango_ft2_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoFT2GlyphInfo *info; + gboolean empty = FALSE; + + if (glyph == PANGO_GLYPH_EMPTY) + { + glyph = pango_fc_font_get_glyph ((PangoFcFont *) font, ' '); + empty = TRUE; + } + + if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + PangoFontMetrics *metrics = pango_font_get_metrics (font, NULL); + + if (metrics) + { + if (ink_rect) + { + ink_rect->x = PANGO_SCALE; + ink_rect->width = metrics->approximate_char_width - 2 * PANGO_SCALE; + ink_rect->y = - (metrics->ascent - PANGO_SCALE); + ink_rect->height = metrics->ascent + metrics->descent - 2 * PANGO_SCALE; + } + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->width = metrics->approximate_char_width; + logical_rect->y = -metrics->ascent; + logical_rect->height = metrics->ascent + metrics->descent; + } + + pango_font_metrics_unref (metrics); + } + else + { + if (ink_rect) + ink_rect->x = ink_rect->y = ink_rect->height = ink_rect->width = 0; + if (logical_rect) + logical_rect->x = logical_rect->y = logical_rect->height = logical_rect->width = 0; + } + return; + } + + info = pango_ft2_font_get_glyph_info (font, glyph, TRUE); + + if (ink_rect) + *ink_rect = info->ink_rect; + if (logical_rect) + *logical_rect = info->logical_rect; + + if (empty) + { + if (ink_rect) + ink_rect->x = ink_rect->y = ink_rect->height = ink_rect->width = 0; + if (logical_rect) + logical_rect->x = logical_rect->width = 0; + return; + } +} + +/** + * pango_ft2_font_get_kerning: + * @font: a #PangoFont + * @left: the left #PangoGlyph + * @right: the right #PangoGlyph + * + * Retrieves kerning information for a combination of two glyphs. + * + * Use pango_fc_font_kern_glyphs() instead. + * + * Return value: The amount of kerning (in Pango units) to apply for + * the given combination of glyphs. + **/ +int +pango_ft2_font_get_kerning (PangoFont *font, + PangoGlyph left, + PangoGlyph right) +{ + PangoFcFont *fc_font = PANGO_FC_FONT (font); + + FT_Face face; + FT_Error error; + FT_Vector kerning; + + face = pango_fc_font_lock_face (fc_font); + if (!face) + return 0; + + if (!FT_HAS_KERNING (face)) + { + pango_fc_font_unlock_face (fc_font); + return 0; + } + + error = FT_Get_Kerning (face, left, right, ft_kerning_default, &kerning); + if (error != FT_Err_Ok) + { + pango_fc_font_unlock_face (fc_font); + return 0; + } + + pango_fc_font_unlock_face (fc_font); + return PANGO_UNITS_26_6 (kerning.x); +} + +static FT_Face +pango_ft2_font_real_lock_face (PangoFcFont *font) +{ + return pango_ft2_font_get_face ((PangoFont *)font); +} + +static void +pango_ft2_font_real_unlock_face (PangoFcFont *font G_GNUC_UNUSED) +{ +} + +static gboolean +pango_ft2_free_glyph_info_callback (gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer data) +{ + PangoFT2Font *font = PANGO_FT2_FONT (data); + PangoFT2GlyphInfo *info = value; + + if (font->glyph_cache_destroy && info->cached_glyph) + (*font->glyph_cache_destroy) (info->cached_glyph); + + g_slice_free (PangoFT2GlyphInfo, info); + return TRUE; +} + +static void +pango_ft2_font_finalize (GObject *object) +{ + PangoFT2Font *ft2font = (PangoFT2Font *)object; + + if (ft2font->face) + { + FT_Done_Face (ft2font->face); + ft2font->face = NULL; + } + + g_hash_table_foreach_remove (ft2font->glyph_info, + pango_ft2_free_glyph_info_callback, object); + g_hash_table_destroy (ft2font->glyph_info); + + G_OBJECT_CLASS (pango_ft2_font_parent_class)->finalize (object); +} + +/** + * pango_ft2_font_get_coverage: + * @font: a PangoFT2Font. + * @language: a language tag. + * + * Gets the #PangoCoverage for a PangoFT2Font. Use + * pango_font_get_coverage() instead. + * + * Return value: a #PangoCoverage. + **/ +PangoCoverage * +pango_ft2_font_get_coverage (PangoFont *font, + PangoLanguage *language) +{ + return pango_font_get_coverage (font, language); +} + +/* Utility functions */ + +/** + * pango_ft2_get_unknown_glyph: + * @font: a #PangoFont + * + * Return the index of a glyph suitable for drawing unknown characters with + * @font, or %PANGO_GLYPH_EMPTY if no suitable glyph found. + * + * If you want to draw an unknown-box for a character that is not covered + * by the font, + * use PANGO_GET_UNKNOWN_GLYPH() instead. + * + * Return value: a glyph index into @font, or %PANGO_GLYPH_EMPTY + **/ +PangoGlyph +pango_ft2_get_unknown_glyph (PangoFont *font) +{ + FT_Face face = pango_ft2_font_get_face (font); + if (face && FT_IS_SFNT (face)) + /* TrueType fonts have an 'unknown glyph' box on glyph index 0 */ + return 0; + else + return PANGO_GLYPH_EMPTY; +} + +void * +_pango_ft2_font_get_cache_glyph_data (PangoFont *font, + int glyph_index) +{ + PangoFT2GlyphInfo *info; + + if (!PANGO_FT2_IS_FONT (font)) + return NULL; + + info = pango_ft2_font_get_glyph_info (font, glyph_index, FALSE); + + if (info == NULL) + return NULL; + + return info->cached_glyph; +} + +void +_pango_ft2_font_set_cache_glyph_data (PangoFont *font, + int glyph_index, + void *cached_glyph) +{ + PangoFT2GlyphInfo *info; + + if (!PANGO_FT2_IS_FONT (font)) + return; + + info = pango_ft2_font_get_glyph_info (font, glyph_index, TRUE); + + info->cached_glyph = cached_glyph; + + /* TODO: Implement limiting of the number of cached glyphs */ +} + +void +_pango_ft2_font_set_glyph_cache_destroy (PangoFont *font, + GDestroyNotify destroy_notify) +{ + if (!PANGO_FT2_IS_FONT (font)) + return; + + PANGO_FT2_FONT (font)->glyph_cache_destroy = destroy_notify; +} diff --git a/pango/pangoft2.h b/pango/pangoft2.h new file mode 100644 index 0000000..c083032 --- /dev/null +++ b/pango/pangoft2.h @@ -0,0 +1,144 @@ +/* Pango + * pangoft2.h: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOFT2_H__ +#define __PANGOFT2_H__ + +#include + +#include +#include + +G_BEGIN_DECLS + +#ifndef PANGO_DISABLE_DEPRECATED +/** + * PANGO_RENDER_TYPE_FT2: + * + * A string constant that was used to identify shape engines that work + * with the FreeType backend. See %PANGO_RENDER_TYPE_FC for the replacement. + */ +#define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2" +#endif + +#define PANGO_TYPE_FT2_FONT_MAP (pango_ft2_font_map_get_type ()) +#define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT_MAP, PangoFT2FontMap)) +#define PANGO_FT2_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_FONT_MAP)) + +typedef struct _PangoFT2FontMap PangoFT2FontMap; + +/** + * PangoFT2SubstituteFunc: + * @pattern: the FcPattern to tweak. + * @data: user data. + * + * Function type for doing final config tweaking on prepared FcPatterns. + */ +typedef void (*PangoFT2SubstituteFunc) (FcPattern *pattern, + gpointer data); + +/* Calls for applications */ + +PANGO_AVAILABLE_IN_ALL +void pango_ft2_render (FT_Bitmap *bitmap, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y); +PANGO_AVAILABLE_IN_1_6 +void pango_ft2_render_transformed (FT_Bitmap *bitmap, + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); + +PANGO_AVAILABLE_IN_ALL +void pango_ft2_render_layout_line (FT_Bitmap *bitmap, + PangoLayoutLine *line, + int x, + int y); +PANGO_AVAILABLE_IN_1_6 +void pango_ft2_render_layout_line_subpixel (FT_Bitmap *bitmap, + PangoLayoutLine *line, + int x, + int y); +PANGO_AVAILABLE_IN_ALL +void pango_ft2_render_layout (FT_Bitmap *bitmap, + PangoLayout *layout, + int x, + int y); +PANGO_AVAILABLE_IN_1_6 +void pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap, + PangoLayout *layout, + int x, + int y); + +PANGO_AVAILABLE_IN_ALL +GType pango_ft2_font_map_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_2 +PangoFontMap *pango_ft2_font_map_new (void); +PANGO_AVAILABLE_IN_1_2 +void pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap, + double dpi_x, + double dpi_y); +PANGO_AVAILABLE_IN_1_2 +void pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap, + PangoFT2SubstituteFunc func, + gpointer data, + GDestroyNotify notify); +PANGO_AVAILABLE_IN_1_2 +void pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap); +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_IN_1_22_FOR(pango_font_map_create_context) +PangoContext *pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap); +#endif + + +/* API for rendering modules + */ +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(pango_font_map_create_context) +PangoContext *pango_ft2_get_context (double dpi_x, + double dpi_y); +PANGO_DEPRECATED_FOR(pango_ft2_font_map_new) +PangoFontMap *pango_ft2_font_map_for_display (void); +PANGO_DEPRECATED +void pango_ft2_shutdown_display (void); + +PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) +PangoGlyph pango_ft2_get_unknown_glyph (PangoFont *font); +PANGO_DEPRECATED_FOR(pango_fc_font_kern_glyphs) +int pango_ft2_font_get_kerning (PangoFont *font, + PangoGlyph left, + PangoGlyph right); +PANGO_DEPRECATED_FOR(pango_fc_font_lock_face) +FT_Face pango_ft2_font_get_face (PangoFont *font); +PANGO_DEPRECATED_FOR(pango_font_get_coverage) +PangoCoverage *pango_ft2_font_get_coverage (PangoFont *font, + PangoLanguage *language); +#endif /* PANGO_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* __PANGOFT2_H__ */ diff --git a/pango/pangoft2.rc b/pango/pangoft2.rc new file mode 100644 index 0000000..a18a4da --- /dev/null +++ b/pango/pangoft2.rc @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,42,4,0 + PRODUCTVERSION 1,42,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoFT2" + VALUE "FileVersion", "1.42.4.0" + VALUE "InternalName", "pangoft2-1.0-0" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software. Copyright 2000 Tor Lillqvist" + VALUE "OriginalFilename", "pangoft2-1.0-0.dll" + VALUE "ProductName", "PangoFT2" + VALUE "ProductVersion", "1.42.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangoft2.rc.in b/pango/pangoft2.rc.in new file mode 100644 index 0000000..d9367ae --- /dev/null +++ b/pango/pangoft2.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoFT2" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pangoft2-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software. Copyright 2000 Tor Lillqvist" + VALUE "OriginalFilename", "pangoft2-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "PangoFT2" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangowin32-fontcache.c b/pango/pangowin32-fontcache.c new file mode 100644 index 0000000..b8bc92d --- /dev/null +++ b/pango/pangowin32-fontcache.c @@ -0,0 +1,438 @@ +/* Pango + * pangowin32-fontcache.c: Cache of HFONTs by LOGFONTW + * + * Copyright (C) 2000 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * Copyright (C) 2007 Novell, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include + +#include "pangowin32-private.h" + +/* Font cache + */ + +/* Number of fonts to retain after they are not otherwise referenced. + */ +#define CACHE_SIZE 16 + +typedef struct _CacheEntry CacheEntry; + +/** + * PangoWin32FontCache: + * + * A #PangoWin32FontCache caches HFONTs by their LOGFONT descriptions. + */ +struct _PangoWin32FontCache +{ + GHashTable *forward; + GHashTable *back; + + GList *mru; + GList *mru_tail; + int mru_count; +}; + +struct _CacheEntry +{ + LOGFONTW logfontw; + HFONT hfont; + + gint ref_count; + GList *mru; +}; + +static void +free_cache_entry (LOGFONTW *logfont, + CacheEntry *entry, + PangoWin32FontCache *cache) +{ + if (!DeleteObject (entry->hfont)) + PING (("DeleteObject for hfont %p failed", entry->hfont)); + + g_slice_free (CacheEntry, entry); +} + +/** + * pango_win32_font_cache_free: + * @cache: a #PangoWin32FontCache + * + * Frees a #PangoWin32FontCache and all associated memory. All fonts loaded + * through this font cache will be freed along with the cache. + **/ +void +pango_win32_font_cache_free (PangoWin32FontCache *cache) +{ + g_return_if_fail (cache != NULL); + + g_hash_table_foreach (cache->forward, (GHFunc)free_cache_entry, cache); + + g_hash_table_destroy (cache->forward); + g_hash_table_destroy (cache->back); + + g_list_free (cache->mru); + + g_slice_free (PangoWin32FontCache, cache); +} + +static guint +wcs_hash (gconstpointer v) +{ + /* 31 bit hash function */ + const wchar_t *p = v; + guint32 h = *p; + + if (h) + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + *p; + + return h; +} + +static guint +logfontw_hash (gconstpointer v) +{ + const LOGFONTW *lfp = v; + + return wcs_hash (lfp->lfFaceName) + + (lfp->lfItalic != 0) + + lfp->lfWeight/10 + + lfp->lfOrientation + + abs (lfp->lfHeight) * 10; +} + +static gint +logfontw_equal (gconstpointer v1, + gconstpointer v2) +{ + const LOGFONTW *lfp1 = v1, *lfp2 = v2; + + return (wcscmp (lfp1->lfFaceName, lfp2->lfFaceName) == 0 + && lfp1->lfPitchAndFamily == lfp2->lfPitchAndFamily + && lfp1->lfStrikeOut == lfp2->lfStrikeOut + && lfp1->lfUnderline == lfp2->lfUnderline + && (lfp1->lfItalic != 0) == (lfp2->lfItalic != 0) + && lfp1->lfWeight == lfp2->lfWeight + && lfp1->lfOrientation == lfp2->lfOrientation + && lfp1->lfEscapement == lfp2->lfEscapement + && lfp1->lfWidth == lfp2->lfWidth + && lfp1->lfHeight == lfp2->lfHeight); +} + +/** + * pango_win32_font_cache_new: + * + * Creates a font cache. + * + * Return value: The new font cache. This must be freed with + * pango_win32_font_cache_free(). + **/ +PangoWin32FontCache * +pango_win32_font_cache_new (void) +{ + PangoWin32FontCache *cache; + + cache = g_slice_new (PangoWin32FontCache); + + cache->forward = g_hash_table_new (logfontw_hash, logfontw_equal); + cache->back = g_hash_table_new (g_direct_hash, g_direct_equal); + + cache->mru = NULL; + cache->mru_tail = NULL; + cache->mru_count = 0; + + return cache; +} + +static void +cache_entry_unref (PangoWin32FontCache *cache, + CacheEntry *entry) +{ + if (g_atomic_int_dec_and_test (&entry->ref_count)) + { + PING (("removing cache entry %p", entry->hfont)); + + g_hash_table_remove (cache->forward, &entry->logfontw); + g_hash_table_remove (cache->back, entry->hfont); + + free_cache_entry (NULL, entry, cache); + } +} + +/** + * pango_win32_font_cache_load: + * @cache: a #PangoWin32FontCache + * @logfont: a pointer to a LOGFONTA structure describing the font to load. + * + * Creates a HFONT from a LOGFONTA. The + * result may be newly loaded, or it may have been previously + * stored + * + * Return value: (nullable): The font structure, or %NULL if the font + * could not be loaded. In order to free this structure, you must call + * pango_win32_font_cache_unload(). + **/ +HFONT +pango_win32_font_cache_load (PangoWin32FontCache *cache, + const LOGFONTA *lfp) +{ + LOGFONTW lf; + + /* We know that the lfFaceName is the last member in the structs */ + *(LOGFONTA *)&lf = *lfp; + + if (!MultiByteToWideChar (CP_ACP, MB_ERR_INVALID_CHARS, + lfp->lfFaceName, -1, + lf.lfFaceName, G_N_ELEMENTS (lf.lfFaceName))) + return NULL; + + return pango_win32_font_cache_loadw (cache, &lf); +} + +/** + * pango_win32_font_cache_loadw: + * @cache: a #PangoWin32FontCache + * @logfont: a pointer to a LOGFONTW structure describing the font to load. + * + * Creates a HFONT from a LOGFONTW. The + * result may be newly loaded, or it may have been previously + * stored + * + * Return value: (nullable): The font structure, or %NULL if the font + * could not be loaded. In order to free this structure, you must call + * pango_win32_font_cache_unload(). + * + * Since: 1.16 + **/ +HFONT +pango_win32_font_cache_loadw (PangoWin32FontCache *cache, + const LOGFONTW *lfp) +{ + CacheEntry *entry; + LOGFONTW lf; + HFONT hfont; + int tries; + + g_return_val_if_fail (cache != NULL, NULL); + g_return_val_if_fail (lfp != NULL, NULL); + + entry = g_hash_table_lookup (cache->forward, lfp); + + if (entry) + { + g_atomic_int_inc (&entry->ref_count); + PING (("increased refcount for cache entry %p: %d", entry->hfont, entry->ref_count)); + } + else + { + BOOL font_smoothing; + lf = *lfp; + SystemParametersInfo (SPI_GETFONTSMOOTHING, 0, &font_smoothing, 0); + /* If on XP or better, try to use ClearType if the global system + * settings ask for it. + */ + if (font_smoothing && + (_pango_win32_os_version_info.dwMajorVersion > 5 || + (_pango_win32_os_version_info.dwMajorVersion == 5 && + _pango_win32_os_version_info.dwMinorVersion >= 1))) + { + UINT smoothing_type; + +#ifndef SPI_GETFONTSMOOTHINGTYPE +#define SPI_GETFONTSMOOTHINGTYPE 0x200a +#endif +#ifndef FE_FONTSMOOTHINGCLEARTYPE +#define FE_FONTSMOOTHINGCLEARTYPE 2 +#endif +#ifndef CLEARTYPE_QUALITY +#define CLEARTYPE_QUALITY 5 +#endif + SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE, 0, &smoothing_type, 0); + lf.lfQuality = + (font_smoothing ? + (smoothing_type == FE_FONTSMOOTHINGCLEARTYPE ? + CLEARTYPE_QUALITY : ANTIALIASED_QUALITY) : + DEFAULT_QUALITY); + } + else + lf.lfQuality = (font_smoothing ? ANTIALIASED_QUALITY : DEFAULT_QUALITY); + lf.lfCharSet = DEFAULT_CHARSET; + for (tries = 0; ; tries++) + { + PING (("... trying CreateFontIndirect " + "height=%ld,width=%ld,escapement=%ld,orientation=%ld," + "weight=%ld,%s%s%s" + "charset=%d,outprecision=%d,clipprecision=%d," + "quality=%d,pitchandfamily=%#.02x,facename=\"%S\")", + lf.lfHeight, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, + lf.lfWeight, (lf.lfItalic ? "italic," : ""), + (lf.lfUnderline ? "underline," : ""), + (lf.lfStrikeOut ? "strikeout," : ""), + lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision, + lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName)); + hfont = CreateFontIndirectW (&lf); + + if (hfont != NULL) + { + PING (("Success! hfont=%p", hfont)); + break; + } + + /* If we fail, try some similar fonts often found on Windows. */ + if (tries == 0) + { + gchar *p = g_utf16_to_utf8 (lf.lfFaceName, -1, NULL, NULL, NULL); + if (!p) + ; /* Nothing */ + else if (g_ascii_strcasecmp (p, "helvetica") == 0) + wcscpy (lf.lfFaceName, L"arial"); + else if (g_ascii_strcasecmp (p, "new century schoolbook") == 0) + wcscpy (lf.lfFaceName, L"century schoolbook"); + else if (g_ascii_strcasecmp (p, "courier") == 0) + wcscpy (lf.lfFaceName, L"courier new"); + else if (g_ascii_strcasecmp (p, "lucida") == 0) + wcscpy (lf.lfFaceName, L"lucida sans unicode"); + else if (g_ascii_strcasecmp (p, "lucidatypewriter") == 0) + wcscpy (lf.lfFaceName, L"lucida console"); + else if (g_ascii_strcasecmp (p, "times") == 0) + wcscpy (lf.lfFaceName, L"times new roman"); + g_free (p); + } + else if (tries == 1) + { + gchar *p = g_utf16_to_utf8 (lf.lfFaceName, -1, NULL, NULL, NULL); + if (!p) + ; /* Nothing */ + else if (g_ascii_strcasecmp (p, "courier") == 0) + { + wcscpy (lf.lfFaceName, L""); + lf.lfPitchAndFamily |= FF_MODERN; + } + else if (g_ascii_strcasecmp (p, "times new roman") == 0) + { + wcscpy (lf.lfFaceName, L""); + lf.lfPitchAndFamily |= FF_ROMAN; + } + else if (g_ascii_strcasecmp (p, "helvetica") == 0 + || g_ascii_strcasecmp (p, "lucida") == 0) + { + wcscpy (lf.lfFaceName, L""); + lf.lfPitchAndFamily |= FF_SWISS; + } + else + { + wcscpy (lf.lfFaceName, L""); + lf.lfPitchAndFamily = (lf.lfPitchAndFamily & 0x0F) | FF_DONTCARE; + } + g_free (p); + } + else + break; + tries++; + } + + if (!hfont) + return NULL; + + entry = g_slice_new (CacheEntry); + + entry->logfontw = lf; + entry->hfont = hfont; + + entry->ref_count = 1; + entry->mru = NULL; + + g_hash_table_insert (cache->forward, &entry->logfontw, entry); + g_hash_table_insert (cache->back, entry->hfont, entry); + } + + if (entry->mru) + { + if (cache->mru_count > 1 && entry->mru->prev) + { + /* Move to the head of the mru list */ + + if (entry->mru == cache->mru_tail) + { + cache->mru_tail = cache->mru_tail->prev; + cache->mru_tail->next = NULL; + } + else + { + entry->mru->prev->next = entry->mru->next; + entry->mru->next->prev = entry->mru->prev; + } + + entry->mru->next = cache->mru; + entry->mru->prev = NULL; + cache->mru->prev = entry->mru; + cache->mru = entry->mru; + } + } + else + { + g_atomic_int_inc (&entry->ref_count); + + /* Insert into the mru list */ + + if (cache->mru_count == CACHE_SIZE) + { + CacheEntry *old_entry = cache->mru_tail->data; + + cache->mru_tail = cache->mru_tail->prev; + cache->mru_tail->next = NULL; + + g_list_free_1 (old_entry->mru); + old_entry->mru = NULL; + cache_entry_unref (cache, old_entry); + } + else + cache->mru_count++; + + cache->mru = g_list_prepend (cache->mru, entry); + if (!cache->mru_tail) + cache->mru_tail = cache->mru; + entry->mru = cache->mru; + } + + return entry->hfont; +} + +/** + * pango_win32_font_cache_unload: + * @cache: a #PangoWin32FontCache + * @hfont: the HFONT to unload + * + * Frees a font structure previously loaded with pango_win32_font_cache_load(). + **/ +void +pango_win32_font_cache_unload (PangoWin32FontCache *cache, + HFONT hfont) +{ + CacheEntry *entry; + + g_return_if_fail (cache != NULL); + g_return_if_fail (hfont != NULL); + + entry = g_hash_table_lookup (cache->back, hfont); + g_return_if_fail (entry != NULL); + + cache_entry_unref (cache, entry); +} diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c new file mode 100644 index 0000000..12fa4f2 --- /dev/null +++ b/pango/pangowin32-fontmap.c @@ -0,0 +1,1779 @@ +/* Pango + * pangowin32-fontmap.c: Win32 font handling + * + * Copyright (C) 2000 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * Copyright (C) 2001 Alexander Larsson + * Copyright (C) 2007 Novell, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "pango-fontmap.h" +#include "pango-impl-utils.h" +#include "pangowin32-private.h" + +typedef struct _PangoWin32Family PangoWin32Family; +typedef PangoFontFamilyClass PangoWin32FamilyClass; + +struct _PangoWin32Family +{ + PangoFontFamily parent_instance; + + char *family_name; + GSList *faces; + + gboolean is_monospace; +}; + + +#if !defined(NTM_PS_OPENTYPE) +# define NTM_PS_OPENTYPE 0x20000 +#endif + +#if !defined(NTM_TYPE1) +# define NTM_TYPE1 0x100000 +#endif + +#define PANGO_WIN32_TYPE_FAMILY (pango_win32_family_get_type ()) +#define PANGO_WIN32_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_WIN32_TYPE_FAMILY, PangoWin32Family)) +#define PANGO_WIN32_IS_FAMILY (object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_WIN32_TYPE_FAMILY)) +#define PANGO_WIN32_FAMILY_CLASS (klass) (G_TYPE_CHECK_CLASS_CAST (klass), PANGO_WIN32_TYPE_FAMILY, PangoWin32Family)) +#define PANGO_WIN32_IS_FAMILY_CLASS (klass) (G_TYPE_CHECK_CLASS_CAST (klass), PANGO_WIN32_TYPE_FAMILY)) +#define PANGO_WIN32_FAMILY_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), PANGO_WIN32_FAMILY, PangoWin32FamilyClass)) + +#define PANGO_WIN32_TYPE_FACE (pango_win32_face_get_type ()) +#define PANGO_WIN32_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_WIN32_TYPE_FACE, PangoWin32Face)) +#define PANGO_WIN32_IS_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_WIN32_TYPE_FACE)) +#define PANGO_WIN32_FACE_CLASS (klass) (G_TYPE_CHECK_CLASS_CAST (klass), PANGO_WIN32_TYPE_FACE, PangoWin32Face)) +#define PANGO_WIN32_IS_FACE_CLASS (klass) (G_TYPE_CHECK_CLASS_CAST (klass), PANGO_WIN32_TYPE_FACE)) +#define PANGO_WIN32_FACE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), PANGO_WIN32_FACE, PangoWin32FaceClass)) + +static GType pango_win32_face_get_type (void); + +static GType pango_win32_family_get_type (void); + +static void pango_win32_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes); + +static void pango_win32_font_map_finalize (GObject *object); +static PangoFont *pango_win32_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *description); +static PangoFontset *pango_win32_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language); +static void pango_win32_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families); + +static PangoFont *pango_win32_font_map_real_find_font (PangoWin32FontMap *win32fontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *description); + +static void pango_win32_fontmap_cache_clear (PangoWin32FontMap *win32fontmap); + +static void pango_win32_insert_font (PangoWin32FontMap *fontmap, + LOGFONTW *lfp, + gboolean is_synthetic); + +static PangoWin32Family *pango_win32_get_font_family (PangoWin32FontMap *win32fontmap, + const char *family_name); + +static const char *pango_win32_face_get_face_name (PangoFontFace *face); + +static PangoWin32FontMap *default_fontmap = NULL; /* MT-safe */ + +G_DEFINE_TYPE (PangoWin32FontMap, _pango_win32_font_map, PANGO_TYPE_FONT_MAP) + +#define TOLOWER(c) \ + (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c)) + +static guint +case_insensitive_str_hash (const char *key) +{ + const char *p = key; + guint h = TOLOWER (*p); + + if (h) + { + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + TOLOWER (*p); + } + + return h; +} + +static gboolean +case_insensitive_str_equal (const char *key1, + const char *key2) +{ + while (*key1 && *key2 && TOLOWER (*key1) == TOLOWER (*key2)) + key1++, key2++; + return (!*key1 && !*key2); +} + +static guint +case_insensitive_wcs_hash (const wchar_t *key) +{ + const wchar_t *p = key; + guint h = TOLOWER (*p); + + if (h) + { + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + TOLOWER (*p); + } + + return h; +} + +static gboolean +case_insensitive_wcs_equal (const wchar_t *key1, + const wchar_t *key2) +{ + while (*key1 && *key2 && TOLOWER (*key1) == TOLOWER (*key2)) + key1++, key2++; + return (!*key1 && !*key2); +} + +/* A hash function for LOGFONTWs that takes into consideration only + * those fields that indicate a specific .ttf file is in use: + * lfFaceName, lfItalic and lfWeight. Dunno how correct this is. + */ +static guint +logfontw_nosize_hash (const LOGFONTW *lfp) +{ + return case_insensitive_wcs_hash (lfp->lfFaceName) + (lfp->lfItalic != 0) + lfp->lfWeight; +} + +/* Ditto comparison function */ +static gboolean +logfontw_nosize_equal (const LOGFONTW *lfp1, + const LOGFONTW *lfp2) +{ + return (case_insensitive_wcs_equal (lfp1->lfFaceName, lfp2->lfFaceName) + && (lfp1->lfItalic != 0) == (lfp2->lfItalic != 0) + && lfp1->lfWeight == lfp2->lfWeight); +} + +static int CALLBACK +pango_win32_inner_enum_proc (LOGFONTW *lfp, + TEXTMETRICW *metrics, + DWORD fontType, + LPARAM lParam) +{ + PangoWin32FontMap *win32fontmap = (PangoWin32FontMap *)lParam; + + /* Windows generates synthetic vertical writing versions of East + * Asian fonts with @ prepended to their name, ignore them. + */ + if (lfp->lfFaceName[0] != '@') + pango_win32_insert_font (win32fontmap, lfp, FALSE); + + return 1; +} + +static int CALLBACK +pango_win32_enum_proc (LOGFONTW *lfp, + NEWTEXTMETRICW *metrics, + DWORD fontType, + LPARAM lParam) +{ + LOGFONTW lf; + + PING (("%S: %lu %lx", lfp->lfFaceName, fontType, metrics->ntmFlags)); + + if (fontType == TRUETYPE_FONTTYPE || + (_pango_win32_os_version_info.dwMajorVersion >= 5 && + ((metrics->ntmFlags & NTM_PS_OPENTYPE) || (metrics->ntmFlags & NTM_TYPE1)))) + { + lf = *lfp; + + EnumFontFamiliesExW (_pango_win32_hdc, &lf, + (FONTENUMPROCW) pango_win32_inner_enum_proc, + lParam, 0); + } + + return 1; +} + +static void +synthesize_foreach (gpointer key, + gpointer value, + gpointer user_data) +{ + PangoWin32Family *win32family = value; + PangoWin32FontMap *win32fontmap = user_data; + + enum { NORMAL, BOLDER, SLANTED }; + PangoWin32Face *variant[4] = { NULL, NULL, NULL, NULL }; + + GSList *p; + + LOGFONTW lf; + + p = win32family->faces; + while (p) + { + PangoWin32Face *win32face = p->data; + + /* Don't synthesize anything unless it's a monospace, serif, or sans font */ + if (!((win32face->logfontw.lfPitchAndFamily & 0xF0) == FF_MODERN || + (win32face->logfontw.lfPitchAndFamily & 0xF0) == FF_ROMAN || + (win32face->logfontw.lfPitchAndFamily & 0xF0) == FF_SWISS)) + return; + + if (pango_font_description_get_weight (win32face->description) == PANGO_WEIGHT_NORMAL && + pango_font_description_get_style (win32face->description) == PANGO_STYLE_NORMAL) + variant[NORMAL] = win32face; + + if (pango_font_description_get_weight (win32face->description) > PANGO_WEIGHT_NORMAL && + pango_font_description_get_style (win32face->description) == PANGO_STYLE_NORMAL) + variant[BOLDER] = win32face; + + if (pango_font_description_get_weight (win32face->description) == PANGO_WEIGHT_NORMAL && + pango_font_description_get_style (win32face->description) >= PANGO_STYLE_OBLIQUE) + variant[SLANTED] = win32face; + + if (pango_font_description_get_weight (win32face->description) > PANGO_WEIGHT_NORMAL && + pango_font_description_get_style (win32face->description) >= PANGO_STYLE_OBLIQUE) + variant[BOLDER+SLANTED] = win32face; + + p = p->next; + } + + if (variant[NORMAL] != NULL && variant[BOLDER] == NULL) + { + lf = variant[NORMAL]->logfontw; + lf.lfWeight = FW_BOLD; + + pango_win32_insert_font (win32fontmap, &lf, TRUE); + } + + if (variant[NORMAL] != NULL && variant[SLANTED] == NULL) + { + lf = variant[NORMAL]->logfontw; + lf.lfItalic = 255; + + pango_win32_insert_font (win32fontmap, &lf, TRUE); + } + + if (variant[NORMAL] != NULL && + variant[BOLDER+SLANTED] == NULL) + { + lf = variant[NORMAL]->logfontw; + lf.lfWeight = FW_BOLD; + lf.lfItalic = 255; + + pango_win32_insert_font (win32fontmap, &lf, TRUE); + } + else if (variant[BOLDER] != NULL && + variant[BOLDER+SLANTED] == NULL) + { + lf = variant[BOLDER]->logfontw; + lf.lfItalic = 255; + + pango_win32_insert_font (win32fontmap, &lf, TRUE); + } + else if (variant[SLANTED] != NULL && + variant[BOLDER+SLANTED] == NULL) + { + lf = variant[SLANTED]->logfontw; + lf.lfWeight = FW_BOLD; + + pango_win32_insert_font (win32fontmap, &lf, TRUE); + } +} + +struct PangoAlias +{ + char *alias; + int n_families; + char **families; + gboolean visible; /* Do we want/need this? */ +}; + +static guint +alias_hash (struct PangoAlias *alias) +{ + return g_str_hash (alias->alias); +} + +static gboolean +alias_equal (struct PangoAlias *alias1, + struct PangoAlias *alias2) +{ + return g_str_equal (alias1->alias, + alias2->alias); +} + +static void +alias_free (struct PangoAlias *alias) +{ + int i; + g_free (alias->alias); + + for (i = 0; i < alias->n_families; i++) + g_free (alias->families[i]); + + g_free (alias->families); + + g_slice_free (struct PangoAlias, alias); +} + +static void +handle_alias_line (GString *line_buffer, + char **errstring, + GHashTable *ht_aliases) +{ + GString *tmp_buffer1; + GString *tmp_buffer2; + const char *pos; + struct PangoAlias alias_key; + struct PangoAlias *alias; + gboolean append = FALSE; + char **new_families; + int n_new; + int i; + + tmp_buffer1 = g_string_new (NULL); + tmp_buffer2 = g_string_new (NULL); + + pos = line_buffer->str; + if (!pango_skip_space (&pos)) + return; + + if (!pango_scan_string (&pos, tmp_buffer1) || + !pango_skip_space (&pos)) + { + *errstring = g_strdup ("Line is not of the form KEY=VALUE or KEY+=VALUE"); + goto error; + } + + if (*pos == '+') + { + append = TRUE; + pos++; + } + + if (*(pos++) != '=') + { + *errstring = g_strdup ("Line is not of the form KEY=VALUE or KEY+=VALUE"); + goto error; + } + + if (!pango_scan_string (&pos, tmp_buffer2)) + { + *errstring = g_strdup ("Error parsing value string"); + goto error; + } + if (pango_skip_space (&pos)) + { + *errstring = g_strdup ("Junk after value string"); + goto error; + } + + alias_key.alias = g_ascii_strdown (tmp_buffer1->str, -1); + + /* Remove any existing values */ + alias = g_hash_table_lookup (ht_aliases, &alias_key); + + if (!alias) + { + alias = g_slice_new0 (struct PangoAlias); + alias->alias = alias_key.alias; + + g_hash_table_insert (ht_aliases, alias, alias); + } + else + g_free (alias_key.alias); + + new_families = g_strsplit (tmp_buffer2->str, ",", -1); + + n_new = 0; + while (new_families[n_new]) + n_new++; + + if (alias->families && append) + { + alias->families = g_realloc (alias->families, + sizeof (char *) *(n_new + alias->n_families)); + for (i = 0; i < n_new; i++) + alias->families[alias->n_families + i] = new_families[i]; + g_free (new_families); + alias->n_families += n_new; + } + else + { + for (i = 0; i < alias->n_families; i++) + g_free (alias->families[i]); + g_free (alias->families); + + alias->families = new_families; + alias->n_families = n_new; + } + + error: + + g_string_free (tmp_buffer1, TRUE); + g_string_free (tmp_buffer2, TRUE); +} + +#ifdef HAVE_CAIRO_WIN32 + +static const char * const builtin_aliases[] = { + "courier = \"courier new\"", + "\"segoe ui\" = \"segoe ui,meiryo,malgun gothic,microsoft jhenghei,microsoft yahei,gisha,leelawadee,arial unicode ms,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "tahoma = \"tahoma,arial unicode ms,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + /* It sucks to use the same GulimChe, MS Gothic, Sylfaen, Kartika, + * Latha, Mangal and Raavi fonts for all three of sans, serif and + * mono, but it isn't like there would be much choice. For most + * non-Latin scripts that Windows includes any font at all for, it + * has ony one. One solution is to install the free DejaVu fonts + * that are popular on Linux. They are listed here first. + */ + "sans = \"dejavu sans,tahoma,arial unicode ms,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "sans-serif = \"dejavu sans,tahoma,arial unicode ms,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "serif = \"dejavu serif,georgia,angsana new,mingliu,simsun,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "mono = \"dejavu sans mono,courier new,lucida console,courier monothai,mingliu,simsun,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "monospace = \"dejavu sans mono,courier new,lucida console,courier monothai,mingliu,simsun,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"", + "emoji = \"segoe ui emoji,segoe ui symbol,segoe ui\"", +}; + +static void +read_builtin_aliases (GHashTable *ht_aliases) +{ + + GString *line_buffer; + char *errstring = NULL; + int line; + + line_buffer = g_string_new (NULL); + + for (line = 0; line < G_N_ELEMENTS (builtin_aliases) && errstring == NULL; line++) + { + g_string_assign (line_buffer, builtin_aliases[line]); + handle_alias_line (line_buffer, &errstring, ht_aliases); + } + + if (errstring) + { + g_error ("error in built-in aliases:%d: %s\n", line, errstring); + g_free (errstring); + } + + g_string_free (line_buffer, TRUE); +} +#endif + + +static GHashTable * +load_aliases (void) +{ + GHashTable *ht_aliases = g_hash_table_new_full ((GHashFunc)alias_hash, + (GEqualFunc)alias_equal, + (GDestroyNotify)alias_free, + NULL); + +#ifdef HAVE_CAIRO_WIN32 + read_builtin_aliases (ht_aliases); +#endif + + return ht_aliases; +} + +static void +lookup_aliases (const char *fontname, + char ***families, + int *n_families) +{ + static GHashTable *aliases_ht = NULL; /* MT-safe */ + + struct PangoAlias alias_key; + struct PangoAlias *alias; + + if (g_once_init_enter (&aliases_ht)) + { + g_once_init_leave (&aliases_ht, load_aliases ()); + } + + alias_key.alias = g_ascii_strdown (fontname, -1); + alias = g_hash_table_lookup (aliases_ht, &alias_key); + g_free (alias_key.alias); + + if (alias) + { + *families = alias->families; + *n_families = alias->n_families; + } + else + { + *families = NULL; + *n_families = 0; + } +} + +static void +create_standard_family (PangoWin32FontMap *win32fontmap, + const char *standard_family_name) +{ + int i; + int n_aliases; + char **aliases; + + lookup_aliases (standard_family_name, &aliases, &n_aliases); + for (i = 0; i < n_aliases; i++) + { + PangoWin32Family *existing_family = g_hash_table_lookup (win32fontmap->families, aliases[i]); + + if (existing_family) + { + PangoWin32Family *new_family = pango_win32_get_font_family (win32fontmap, standard_family_name); + GSList *p = existing_family->faces; + + new_family->is_monospace = existing_family->is_monospace; + + while (p) + { + const PangoWin32Face *old_face = p->data; + PangoWin32Face *new_face = g_object_new (PANGO_WIN32_TYPE_FACE, NULL); + int j; + + new_face->logfontw = old_face->logfontw; + new_face->description = pango_font_description_copy_static (old_face->description); + pango_font_description_set_family_static (new_face->description, standard_family_name); + + for (j = 0; j < PANGO_WIN32_N_COVERAGES; j++) + { + if (old_face->coverages[j] != NULL) + new_face->coverages[j] = pango_coverage_ref (old_face->coverages[j]); + else + new_face->coverages[j] = NULL; + } + + new_face->face_name = NULL; + + new_face->is_synthetic = TRUE; + + new_face->has_cmap = old_face->has_cmap; + new_face->cmap_format = old_face->cmap_format; + new_face->cmap = old_face->cmap; + + new_face->cached_fonts = NULL; + + new_family->faces = g_slist_append (new_family->faces, new_face); + + p = p->next; + } + return; + } + } + /* XXX What to do if none of the members of aliases for standard_family_name + * exists on this machine? + */ +} + +static void +_pango_win32_font_map_init (PangoWin32FontMap *win32fontmap) +{ + LOGFONTW logfont; + + win32fontmap->families = + g_hash_table_new_full ((GHashFunc) case_insensitive_str_hash, + (GEqualFunc) case_insensitive_str_equal, NULL, g_object_unref); + win32fontmap->fonts = + g_hash_table_new_full ((GHashFunc) logfontw_nosize_hash, + (GEqualFunc) logfontw_nosize_equal, NULL, g_free); + + win32fontmap->font_cache = pango_win32_font_cache_new (); + win32fontmap->freed_fonts = g_queue_new (); + + memset (&logfont, 0, sizeof (logfont)); + logfont.lfCharSet = DEFAULT_CHARSET; + EnumFontFamiliesExW (_pango_win32_hdc, &logfont, + (FONTENUMPROCW) pango_win32_enum_proc, + (LPARAM) win32fontmap, 0); + + g_hash_table_foreach (win32fontmap->families, synthesize_foreach, win32fontmap); + + /* Create synthetic "Sans", "Serif" and "Monospace" families */ + create_standard_family (win32fontmap, "Sans"); + create_standard_family (win32fontmap, "Serif"); + create_standard_family (win32fontmap, "Monospace"); + + win32fontmap->resolution = (PANGO_SCALE / (double) GetDeviceCaps (_pango_win32_hdc, LOGPIXELSY)) * 72.0; +} + +static void +pango_win32_font_map_fontset_add_fonts (PangoFontMap *fontmap, + PangoContext *context, + PangoFontsetSimple *fonts, + PangoFontDescription *desc, + const char *family) +{ + /* Mostly use the "old" pango_font_map_fontset_add_fonts() */ + /* on Windows so that we can go through the .aliases file */ + /* to load the appropriate fontset for various texts */ + PangoFont *font; + char **aliases; + int n_aliases; + int j; + + lookup_aliases (family, &aliases, &n_aliases); + + if (n_aliases) + { + for (j = 0; j < n_aliases; j++) + { + pango_font_description_set_family_static (desc, aliases[j]); + font = pango_win32_font_map_load_font (fontmap, context, desc); + if (font) + pango_fontset_simple_append (fonts, font); + } + } + else + { + pango_font_description_set_family_static (desc, family); + font = pango_win32_font_map_load_font (fontmap, context, desc); + if (font) + pango_fontset_simple_append (fonts, font); + } +} + +static void +_pango_win32_font_map_class_init (PangoWin32FontMapClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + + class->find_font = pango_win32_font_map_real_find_font; + object_class->finalize = pango_win32_font_map_finalize; + fontmap_class->load_font = pango_win32_font_map_load_font; + /* we now need a load_fontset implementation for the Win32 backend */ + fontmap_class->load_fontset = pango_win32_font_map_load_fontset; + fontmap_class->list_families = pango_win32_font_map_list_families; + fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_WIN32; + + pango_win32_get_dc (); +} + +/** + * pango_win32_font_map_for_display: + * + * Returns a PangoWin32FontMap. Font maps are cached and should + * not be freed. If the font map is no longer needed, it can + * be released with pango_win32_shutdown_display(). + * + * Return value: a #PangoFontMap. + **/ +PangoFontMap * +pango_win32_font_map_for_display (void) +{ +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* Make sure that the type system is initialized */ + g_type_init (); +#endif + + if (g_once_init_enter ((gsize*)&default_fontmap)) + g_once_init_leave((gsize*)&default_fontmap, (gsize)g_object_new (PANGO_TYPE_WIN32_FONT_MAP, NULL)); + + return PANGO_FONT_MAP (default_fontmap); +} + +/** + * pango_win32_shutdown_display: + * + * Free cached resources. + **/ +void +pango_win32_shutdown_display (void) +{ + if (default_fontmap) + { + pango_win32_fontmap_cache_clear (default_fontmap); + g_object_unref (default_fontmap); + + default_fontmap = NULL; + } +} + +static void +pango_win32_font_map_finalize (GObject *object) +{ + PangoWin32FontMap *win32fontmap = PANGO_WIN32_FONT_MAP (object); + + g_list_foreach (win32fontmap->freed_fonts->head, (GFunc)g_object_unref, NULL); + g_queue_free (win32fontmap->freed_fonts); + + pango_win32_font_cache_free (win32fontmap->font_cache); + + g_hash_table_destroy (win32fontmap->fonts); + + g_hash_table_destroy (win32fontmap->families); + + G_OBJECT_CLASS (_pango_win32_font_map_parent_class)->finalize (object); +} + +/* + * PangoWin32Family + */ +static void +pango_win32_family_list_faces (PangoFontFamily *family, + PangoFontFace ***faces, + int *n_faces) +{ + PangoWin32Family *win32family = PANGO_WIN32_FAMILY (family); + GSList *p; + int n; + + p = win32family->faces; + n = 0; + while (p) + { + n++; + p = p->next; + } + + if (faces) + { + int i; + + *faces = g_new (PangoFontFace *, n); + + p = win32family->faces; + i = 0; + while (p) + { + (*faces)[i++] = p->data; + p = p->next; + } + } + if (n_faces) + *n_faces = n; +} + +static const char * +pango_win32_family_get_name (PangoFontFamily *family) +{ + PangoWin32Family *win32family = PANGO_WIN32_FAMILY (family); + + return win32family->family_name; +} + +static gboolean +pango_win32_family_is_monospace (PangoFontFamily *family) +{ + PangoWin32Family *win32family = PANGO_WIN32_FAMILY (family); + + return win32family->is_monospace; +} + +G_DEFINE_TYPE (PangoWin32Family, pango_win32_family, PANGO_TYPE_FONT_FAMILY) + +static void +pango_win32_family_finalize (GObject *object) +{ + PangoWin32Family *win32family = PANGO_WIN32_FAMILY (object); + + g_free (win32family->family_name); + + g_slist_free_full (win32family->faces, g_object_unref); + + G_OBJECT_CLASS (pango_win32_family_parent_class)->finalize (object); +} + +static void +pango_win32_family_class_init (PangoFontFamilyClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = pango_win32_family_finalize; + class->list_faces = pango_win32_family_list_faces; + class->get_name = pango_win32_family_get_name; + class->is_monospace = pango_win32_family_is_monospace; +} + +static void +pango_win32_family_init (PangoWin32Family *family) +{ +} + +static void +list_families_foreach (gpointer key, + gpointer value, + gpointer user_data) +{ + GSList **list = user_data; + + *list = g_slist_prepend (*list, value); +} + +static void +pango_win32_font_map_list_families (PangoFontMap *fontmap, + PangoFontFamily ***families, + int *n_families) +{ + GSList *family_list = NULL; + GSList *tmp_list; + PangoWin32FontMap *win32fontmap = (PangoWin32FontMap *)fontmap; + + if (!n_families) + return; + + g_hash_table_foreach (win32fontmap->families, list_families_foreach, &family_list); + + *n_families = g_slist_length (family_list); + + if (families) + { + int i = 0; + + *families = g_new (PangoFontFamily *, *n_families); + + tmp_list = family_list; + while (tmp_list) + { + (*families)[i] = tmp_list->data; + i++; + tmp_list = tmp_list->next; + } + } + + g_slist_free (family_list); +} + +static PangoWin32Family * +pango_win32_get_font_family (PangoWin32FontMap *win32fontmap, + const char *family_name) +{ + PangoWin32Family *win32family = g_hash_table_lookup (win32fontmap->families, family_name); + if (!win32family) + { + win32family = g_object_new (PANGO_WIN32_TYPE_FAMILY, NULL); + win32family->family_name = g_strdup (family_name); + win32family->faces = NULL; + + g_hash_table_insert (win32fontmap->families, win32family->family_name, win32family); + } + + return win32family; +} + +static PangoFont * +pango_win32_font_map_load_font (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *description) +{ + PangoWin32FontMap *win32fontmap = (PangoWin32FontMap *)fontmap; + PangoWin32Family *win32family; + PangoFont *result = NULL; + GSList *tmp_list; + const char *family; + + g_return_val_if_fail (description != NULL, NULL); + + family = pango_font_description_get_family (description); + family = family ? family : ""; + PING (("name=%s", family)); + + win32family = g_hash_table_lookup (win32fontmap->families, family); + if (win32family) + { + PangoWin32Face *best_match = NULL; + + PING (("got win32family")); + tmp_list = win32family->faces; + while (tmp_list) + { + PangoWin32Face *face = tmp_list->data; + + if (pango_font_description_better_match (description, + best_match ? best_match->description : NULL, + face->description)) + best_match = face; + + tmp_list = tmp_list->next; + } + + if (best_match) + result = PANGO_WIN32_FONT_MAP_GET_CLASS (win32fontmap)->find_font (win32fontmap, context, + best_match, + description); + /* TODO: Handle the case that result == NULL. */ + else + PING (("no best match!")); + } + + return result; +} + +static PangoWin32Font * +pango_win32_font_neww (PangoFontMap *fontmap, + const LOGFONTW *lfp, + int size) +{ + PangoWin32Font *result; + + g_return_val_if_fail (fontmap != NULL, NULL); + g_return_val_if_fail (lfp != NULL, NULL); + + result = (PangoWin32Font *)g_object_new (PANGO_TYPE_WIN32_FONT, NULL); + + if (G_UNLIKELY(result->fontmap)) + return result; + g_weak_ref_set ((GWeakRef *)&result->fontmap, fontmap); + + result->size = size; + _pango_win32_make_matching_logfontw (fontmap, lfp, size, &result->logfontw); + + return result; +} + +static PangoFont * +pango_win32_font_map_real_find_font (PangoWin32FontMap *win32fontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *description) +{ + PangoFontMap *fontmap = PANGO_FONT_MAP (win32fontmap); + PangoWin32Font *win32font; + GSList *tmp_list = face->cached_fonts; + int size = pango_font_description_get_size (description); + + if (pango_font_description_get_size_is_absolute (description)) + size = (int) 0.5 + (size * win32fontmap->resolution) / PANGO_SCALE; + + PING (("got best match:%S size=%d",face->logfontw.lfFaceName,size)); + + while (tmp_list) + { + win32font = tmp_list->data; + if (win32font->size == size) + { + PING (("size matches")); + + g_object_ref (win32font); + if (win32font->in_cache) + _pango_win32_fontmap_cache_remove (fontmap, win32font); + + return (PangoFont *)win32font; + } + tmp_list = tmp_list->next; + } + + win32font = pango_win32_font_neww (fontmap, &face->logfontw, size); + + if (!win32font) + return NULL; + + win32font->win32face = face; + face->cached_fonts = g_slist_prepend (face->cached_fonts, win32font); + + return (PangoFont *)win32font; +} + +static gchar * +get_family_nameA (const LOGFONTA *lfp) +{ + HFONT hfont; + HFONT oldhfont; + + struct name_header header; + struct name_record record; + + gint unicode_ix = -1, mac_ix = -1, microsoft_ix = -1; + gint name_ix; + gchar *codeset; + + gchar *string = NULL; + gchar *name; + + gint i, l; + gsize nbytes; + + /* If lfFaceName is ASCII, assume it is the common (English) name + * for the font. Is this valid? Do some TrueType fonts have + * different names in French, German, etc, and does the system + * return these if the locale is set to use French, German, etc? + */ + l = strlen (lfp->lfFaceName); + for (i = 0; i < l; i++) + if (lfp->lfFaceName[i] < ' ' || lfp->lfFaceName[i] > '~') + break; + + if (i == l) + return g_strdup (lfp->lfFaceName); + + if ((hfont = CreateFontIndirect (lfp)) == NULL) + goto fail0; + + if ((oldhfont = SelectObject (_pango_win32_hdc, hfont)) == NULL) + goto fail1; + + if (!_pango_win32_get_name_header (_pango_win32_hdc, &header)) + goto fail2; + + PING (("%d name records", header.num_records)); + + for (i = 0; i < header.num_records; i++) + { + if (!_pango_win32_get_name_record (_pango_win32_hdc, i, &record)) + goto fail2; + + if ((record.name_id != 1 && record.name_id != 16) || record.string_length <= 0) + continue; + + PING (("platform:%d encoding:%d language:%04x name_id:%d", + record.platform_id, record.encoding_id, record.language_id, record.name_id)); + + if (record.platform_id == APPLE_UNICODE_PLATFORM_ID || + record.platform_id == ISO_PLATFORM_ID) + unicode_ix = i; + else if (record.platform_id == MACINTOSH_PLATFORM_ID && + record.encoding_id == 0 && /* Roman */ + record.language_id == 0) /* English */ + mac_ix = i; + else if (record.platform_id == MICROSOFT_PLATFORM_ID) + if ((microsoft_ix == -1 || + PRIMARYLANGID (record.language_id) == LANG_ENGLISH) && + (record.encoding_id == SYMBOL_ENCODING_ID || + record.encoding_id == UNICODE_ENCODING_ID || + record.encoding_id == UCS4_ENCODING_ID)) + microsoft_ix = i; + } + + if (microsoft_ix >= 0) + name_ix = microsoft_ix; + else if (mac_ix >= 0) + name_ix = mac_ix; + else if (unicode_ix >= 0) + name_ix = unicode_ix; + else + goto fail2; + + if (!_pango_win32_get_name_record (_pango_win32_hdc, name_ix, &record)) + goto fail2; + + string = g_malloc (record.string_length + 1); + if (GetFontData (_pango_win32_hdc, NAME, + header.string_storage_offset + record.string_offset, + string, record.string_length) != record.string_length) + goto fail2; + + string[record.string_length] = '\0'; + + if (name_ix == microsoft_ix) + if (record.encoding_id == SYMBOL_ENCODING_ID || + record.encoding_id == UNICODE_ENCODING_ID || + record.encoding_id == UCS4_ENCODING_ID) + codeset = "UTF-16BE"; + else + codeset = "UCS-4BE"; + else if (name_ix == mac_ix) + codeset = "MacRoman"; + else /* name_ix == unicode_ix */ + codeset = "UCS-4BE"; + + name = g_convert (string, record.string_length, "UTF-8", codeset, NULL, &nbytes, NULL); + if (name == NULL) + goto fail2; + g_free (string); + + PING (("%s", name)); + + SelectObject (_pango_win32_hdc, oldhfont); + DeleteObject (hfont); + + return name; + + fail2: + g_free (string); + SelectObject (_pango_win32_hdc, oldhfont); + + fail1: + DeleteObject (hfont); + + fail0: + return g_locale_to_utf8 (lfp->lfFaceName, -1, NULL, NULL, NULL); +} + +/** + * pango_win32_font_description_from_logfont: + * @lfp: a LOGFONTA + * + * Creates a #PangoFontDescription that matches the specified LOGFONTA. + * + * The face name, italicness and weight fields in the LOGFONTA are used + * to set up the resulting #PangoFontDescription. If the face name in + * the LOGFONTA contains non-ASCII characters the font is temporarily + * loaded (using CreateFontIndirect()) and an ASCII (usually English) + * name for it is looked up from the font name tables in the font + * data. If that doesn't work, the face name is converted from the + * system codepage to UTF-8 and that is used. + * + * Return value: the newly allocated #PangoFontDescription, which + * should be freed using pango_font_description_free() + * + * Since: 1.12 + */ +PangoFontDescription * +pango_win32_font_description_from_logfont (const LOGFONT *lfp) +{ + PangoFontDescription *description; + gchar *family; + PangoStyle style; + PangoVariant variant; + PangoWeight weight; + PangoStretch stretch; + + family = get_family_nameA (lfp); + + if (!lfp->lfItalic) + style = PANGO_STYLE_NORMAL; + else + style = PANGO_STYLE_ITALIC; + + variant = PANGO_VARIANT_NORMAL; + + if (lfp->lfWeight == FW_DONTCARE) + weight = PANGO_WEIGHT_NORMAL; + else + /* The PangoWeight values PANGO_WEIGHT_* map exactly to Windows FW_*. */ + weight = (PangoWeight) lfp->lfWeight; + + /* XXX No idea how to figure out the stretch */ + stretch = PANGO_STRETCH_NORMAL; + + description = pango_font_description_new (); + pango_font_description_set_family (description, family); + g_free(family); + pango_font_description_set_style (description, style); + pango_font_description_set_weight (description, weight); + pango_font_description_set_stretch (description, stretch); + pango_font_description_set_variant (description, variant); + + return description; +} + +static gchar * +get_family_nameW (const LOGFONTW *lfp) +{ + HFONT hfont; + HFONT oldhfont; + + struct name_header header; + struct name_record record; + + gint unicode_ix = -1, mac_ix = -1, microsoft_ix = -1; + gint name_ix; + gchar *codeset; + + gchar *string = NULL; + gchar *name; + + gint i, l; + gsize nbytes; + + /* If lfFaceName is ASCII, assume it is the common (English) name + * for the font. Is this valid? Do some TrueType fonts have + * different names in French, German, etc, and does the system + * return these if the locale is set to use French, German, etc? + */ + l = wcslen (lfp->lfFaceName); + for (i = 0; i < l; i++) + if (lfp->lfFaceName[i] < ' ' || lfp->lfFaceName[i] > '~') + break; + + if (i == l) + return g_utf16_to_utf8 (lfp->lfFaceName, -1, NULL, NULL, NULL); + + if ((hfont = CreateFontIndirectW (lfp)) == NULL) + goto fail0; + + if ((oldhfont = SelectObject (_pango_win32_hdc, hfont)) == NULL) + goto fail1; + + if (!_pango_win32_get_name_header (_pango_win32_hdc, &header)) + goto fail2; + + PING (("%d name records", header.num_records)); + + for (i = 0; i < header.num_records; i++) + { + if (!_pango_win32_get_name_record (_pango_win32_hdc, i, &record)) + goto fail2; + + if ((record.name_id != 1 && record.name_id != 16) || record.string_length <= 0) + continue; + + PING (("platform:%d encoding:%d language:%04x name_id:%d", + record.platform_id, record.encoding_id, record.language_id, record.name_id)); + + if (record.platform_id == APPLE_UNICODE_PLATFORM_ID || + record.platform_id == ISO_PLATFORM_ID) + unicode_ix = i; + else if (record.platform_id == MACINTOSH_PLATFORM_ID && + record.encoding_id == 0 && /* Roman */ + record.language_id == 0) /* English */ + mac_ix = i; + else if (record.platform_id == MICROSOFT_PLATFORM_ID) + if ((microsoft_ix == -1 || + PRIMARYLANGID (record.language_id) == LANG_ENGLISH) && + (record.encoding_id == SYMBOL_ENCODING_ID || + record.encoding_id == UNICODE_ENCODING_ID || + record.encoding_id == UCS4_ENCODING_ID)) + microsoft_ix = i; + } + + if (microsoft_ix >= 0) + name_ix = microsoft_ix; + else if (mac_ix >= 0) + name_ix = mac_ix; + else if (unicode_ix >= 0) + name_ix = unicode_ix; + else + goto fail2; + + if (!_pango_win32_get_name_record (_pango_win32_hdc, name_ix, &record)) + goto fail2; + + string = g_malloc (record.string_length + 1); + if (GetFontData (_pango_win32_hdc, NAME, + header.string_storage_offset + record.string_offset, + string, record.string_length) != record.string_length) + goto fail2; + + string[record.string_length] = '\0'; + + if (name_ix == microsoft_ix) + if (record.encoding_id == SYMBOL_ENCODING_ID || + record.encoding_id == UNICODE_ENCODING_ID || + record.encoding_id == UCS4_ENCODING_ID) + codeset = "UTF-16BE"; + else + codeset = "UCS-4BE"; + else if (name_ix == mac_ix) + codeset = "MacRoman"; + else /* name_ix == unicode_ix */ + codeset = "UCS-4BE"; + + name = g_convert (string, record.string_length, "UTF-8", codeset, NULL, &nbytes, NULL); + if (name == NULL) + goto fail2; + g_free (string); + + PING (("%s", name)); + + SelectObject (_pango_win32_hdc, oldhfont); + DeleteObject (hfont); + + return name; + + fail2: + g_free (string); + SelectObject (_pango_win32_hdc, oldhfont); + + fail1: + DeleteObject (hfont); + + fail0: + return g_utf16_to_utf8 (lfp->lfFaceName, -1, NULL, NULL, NULL); +} + +/** + * pango_win32_font_description_from_logfontw: + * @lfp: a LOGFONTW + * + * Creates a #PangoFontDescription that matches the specified LOGFONTW. + * + * The face name, italicness and weight fields in the LOGFONTW are used + * to set up the resulting #PangoFontDescription. If the face name in + * the LOGFONTW contains non-ASCII characters the font is temporarily + * loaded (using CreateFontIndirect()) and an ASCII (usually English) + * name for it is looked up from the font name tables in the font + * data. If that doesn't work, the face name is converted from UTF-16 + * to UTF-8 and that is used. + * + * Return value: the newly allocated #PangoFontDescription, which + * should be freed using pango_font_description_free() + * + * Since: 1.16 + */ +PangoFontDescription * +pango_win32_font_description_from_logfontw (const LOGFONTW *lfp) +{ + PangoFontDescription *description; + gchar *family; + PangoStyle style; + PangoVariant variant; + PangoWeight weight; + PangoStretch stretch; + + family = get_family_nameW (lfp); + + if ((lfp->lfPitchAndFamily & 0xF0) == FF_ROMAN && lfp->lfItalic) + style = PANGO_STYLE_ITALIC; + else if (lfp->lfItalic) + style = PANGO_STYLE_OBLIQUE; + else + style = PANGO_STYLE_NORMAL; + + variant = PANGO_VARIANT_NORMAL; + + if (lfp->lfWeight == FW_DONTCARE) + weight = PANGO_WEIGHT_NORMAL; + else + /* The PangoWeight values PANGO_WEIGHT_* map exactly to Windows FW_*. */ + weight = (PangoWeight) lfp->lfWeight; + + /* XXX No idea how to figure out the stretch */ + stretch = PANGO_STRETCH_NORMAL; + + description = pango_font_description_new (); + pango_font_description_set_family (description, family); + g_free(family); + pango_font_description_set_style (description, style); + pango_font_description_set_weight (description, weight); + pango_font_description_set_stretch (description, stretch); + pango_font_description_set_variant (description, variant); + + return description; +} + +static char * +charset_name (int charset, char* num) +{ + switch (charset) + { +#define CASE(x) case x##_CHARSET: return #x + CASE (ANSI); + CASE (DEFAULT); + CASE (SYMBOL); + CASE (SHIFTJIS); + CASE (HANGUL); + CASE (GB2312); + CASE (CHINESEBIG5); + CASE (GREEK); + CASE (TURKISH); + CASE (HEBREW); + CASE (ARABIC); + CASE (BALTIC); + CASE (RUSSIAN); + CASE (THAI); + CASE (EASTEUROPE); + CASE (OEM); + CASE (JOHAB); + CASE (VIETNAMESE); + CASE (MAC); +#undef CASE + default: + sprintf (num, "%d", charset); + return num; + } +} + +static char * +ff_name (int ff, char* num) +{ + switch (ff) + { +#define CASE(x) case FF_##x: return #x + CASE (DECORATIVE); + CASE (DONTCARE); + CASE (MODERN); + CASE (ROMAN); + CASE (SCRIPT); + CASE (SWISS); +#undef CASE + default: + sprintf (num, "%d", ff); + return num; + } +} + +static void +pango_win32_insert_font (PangoWin32FontMap *win32fontmap, + LOGFONTW *lfp, + gboolean is_synthetic) +{ + LOGFONTW *lfp2 = NULL; + PangoFontDescription *description; + PangoWin32Family *win32family; + PangoWin32Face *win32face; + gint i; + + char tmp_for_charset_name[10]; + char tmp_for_ff_name[10]; + + PING (("face=%S,charset=%s,it=%s,wt=%ld,ht=%ld,ff=%s%s", + lfp->lfFaceName, + charset_name (lfp->lfCharSet, tmp_for_charset_name), + lfp->lfItalic ? "yes" : "no", + lfp->lfWeight, + lfp->lfHeight, + ff_name (lfp->lfPitchAndFamily & 0xF0, tmp_for_ff_name), + is_synthetic ? " synthetic" : "")); + + /* Ignore Symbol fonts (which don't have any Unicode mapping + * table). We could also be fancy and use the PostScript glyph name + * table for such if present, and build a Unicode map by mapping + * each PostScript glyph name to Unicode character. Oh well. + */ + if (lfp->lfCharSet == SYMBOL_CHARSET) + return; + + if (g_hash_table_lookup (win32fontmap->fonts, lfp)) + { + PING (("already have it")); + return; + } + + PING (("not found")); + lfp2 = g_new (LOGFONTW, 1); + *lfp2 = *lfp; + g_hash_table_insert (win32fontmap->fonts, lfp2, lfp2); + + description = pango_win32_font_description_from_logfontw (lfp2); + + /* In some cases, extracting a name for a font can fail; such fonts + * aren't usable for us + */ + if (!pango_font_description_get_family (description)) + { + pango_font_description_free (description); + return; + } + + win32face = g_object_new (PANGO_WIN32_TYPE_FACE, NULL); + + PING (("win32face created: %p for %S", win32face, lfp->lfFaceName)); + + win32face->logfontw = *lfp; + win32face->description = description; + + for (i = 0; i < PANGO_WIN32_N_COVERAGES; i++) + win32face->coverages[i] = NULL; + + win32face->face_name = NULL; + + win32face->is_synthetic = is_synthetic; + + win32face->has_cmap = TRUE; + win32face->cmap_format = 0; + win32face->cmap = NULL; + + win32face->cached_fonts = NULL; + + win32family = + pango_win32_get_font_family (win32fontmap, + pango_font_description_get_family (win32face->description)); + if ((lfp->lfPitchAndFamily & 0xF0) == FF_MODERN) + win32family->is_monospace = TRUE; + + win32family->faces = g_slist_append (win32family->faces, win32face); + + PING (("name=%s, length(faces)=%d", + win32family->family_name, g_slist_length (win32family->faces))); +} + +/* Given a LOGFONTW and size, make a matching LOGFONTW corresponding to + * an installed font. + */ +void +_pango_win32_make_matching_logfontw (PangoFontMap *fontmap, + const LOGFONTW *lfp, + int size, + LOGFONTW *out) +{ + PangoWin32FontMap *win32fontmap; + LOGFONTW *match; + + PING (("lfp.face=%S,wt=%ld,ht=%ld,size:%d", + lfp->lfFaceName, lfp->lfWeight, lfp->lfHeight, size)); + win32fontmap = PANGO_WIN32_FONT_MAP (fontmap); + + match = g_hash_table_lookup (win32fontmap->fonts, lfp); + + if (!match) + { + PING (("not found")); + return; + } + + /* OK, we have a match; let's modify it to fit this size */ + + *out = *match; + out->lfHeight = -(int)((double)size / win32fontmap->resolution + 0.5); + out->lfWidth = 0; +} + +static PangoFontDescription * +pango_win32_face_describe (PangoFontFace *face) +{ + PangoWin32Face *win32face = PANGO_WIN32_FACE (face); + + return pango_font_description_copy (win32face->description); +} + +static const char * +pango_win32_face_get_face_name (PangoFontFace *face) +{ + PangoWin32Face *win32face = PANGO_WIN32_FACE (face); + + if (!win32face->face_name) + { + PangoFontDescription *desc = pango_font_face_describe (face); + + pango_font_description_unset_fields (desc, + PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_SIZE); + + win32face->face_name = pango_font_description_to_string (desc); + pango_font_description_free (desc); + } + + return win32face->face_name; +} + +static gboolean +pango_win32_face_is_synthesized (PangoFontFace *face) +{ + PangoWin32Face *win32face = PANGO_WIN32_FACE (face); + + return win32face->is_synthetic; +} + +G_DEFINE_TYPE (PangoWin32Face, pango_win32_face, PANGO_TYPE_FONT_FACE) + +static void +pango_win32_face_finalize (GObject *object) +{ + int j; + PangoWin32Face *win32face = PANGO_WIN32_FACE (object); + + pango_font_description_free (win32face->description); + + for (j = 0; j < PANGO_WIN32_N_COVERAGES; j++) + if (win32face->coverages[j] != NULL) + pango_coverage_unref (win32face->coverages[j]); + + g_free (win32face->face_name); + + //g_free (win32face->cmap); // Err, cmap does not have lifecycle management currently :( + + g_slist_free (win32face->cached_fonts); +// g_slist_free_full (win32face->cached_fonts, g_object_unref); // This doesn't work. + + G_OBJECT_CLASS (pango_win32_family_parent_class)->finalize (object); +} + +static void +pango_win32_face_class_init (PangoFontFaceClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = pango_win32_face_finalize; + class->describe = pango_win32_face_describe; + class->get_face_name = pango_win32_face_get_face_name; + class->list_sizes = pango_win32_face_list_sizes; + class->is_synthesized = pango_win32_face_is_synthesized; +} + +static void +pango_win32_face_init (PangoWin32Face *face) +{ +} + +static void +pango_win32_face_list_sizes (PangoFontFace *face, + int **sizes, + int *n_sizes) +{ + /* + * for scalable fonts it's simple, and currently we only have such + * see : pango_win32_enum_proc(), TRUETYPE_FONTTYPE + */ + *sizes = NULL; + *n_sizes = 0; +} + +/** + * pango_win32_font_map_get_font_cache: + * @font_map: a PangoWin32FontMap. + * + * Obtains the font cache associated with the given font map. + * + * Return value: the #PangoWin32FontCache of @font_map. + **/ +PangoWin32FontCache * +pango_win32_font_map_get_font_cache (PangoFontMap *font_map) +{ + if (G_UNLIKELY (!font_map)) + return NULL; + + g_return_val_if_fail (PANGO_WIN32_IS_FONT_MAP (font_map), NULL); + + return PANGO_WIN32_FONT_MAP (font_map)->font_cache; +} + +void +_pango_win32_fontmap_cache_remove (PangoFontMap *fontmap, + PangoWin32Font *win32font) +{ + PangoWin32FontMap *win32fontmap = PANGO_WIN32_FONT_MAP (fontmap); + GList *link = g_queue_find (win32fontmap->freed_fonts, win32font); + + if (link) + g_queue_delete_link (win32fontmap->freed_fonts, link); + win32font->in_cache = FALSE; + + g_object_unref (win32font); +} + +static void +pango_win32_fontmap_cache_clear (PangoWin32FontMap *win32fontmap) +{ + g_list_foreach (win32fontmap->freed_fonts->head, (GFunc)g_object_unref, NULL); + g_queue_free (win32fontmap->freed_fonts); + win32fontmap->freed_fonts = g_queue_new (); +} + +static PangoFontset * +pango_win32_font_map_load_fontset (PangoFontMap *fontmap, + PangoContext *context, + const PangoFontDescription *desc, + PangoLanguage *language) +{ + /* This "adds" a load_fontset() for the Win32 backend */ + /* which is needed to make sure we use an appropriate */ + /* font for various texts when we are on Windows */ + /* (Copied directly from pango-fontmap.c) */ + PangoFontDescription *tmp_desc = pango_font_description_copy_static (desc); + const char *family; + char **families; + int i; + PangoFontsetSimple *fonts; + static GHashTable *warned_fonts = NULL; /* MT-safe */ + G_LOCK_DEFINE_STATIC (warned_fonts); + + g_return_val_if_fail (fontmap != NULL, NULL); + + family = pango_font_description_get_family (desc); + families = g_strsplit (family ? family : "", ",", -1); + + fonts = pango_fontset_simple_new (language); + + for (i = 0; families[i]; i++) + pango_win32_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + families[i]); + + g_strfreev (families); + + /* The font description was completely unloadable, try with + * family == "Sans" + */ + if (pango_fontset_simple_size (fonts) == 0) + { + char *ctmp1, *ctmp2; + + pango_font_description_set_family_static (tmp_desc, + pango_font_description_get_family (desc)); + + ctmp1 = pango_font_description_to_string (desc); + pango_font_description_set_family_static (tmp_desc, "Sans"); + + G_LOCK (warned_fonts); + if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) + { + if (!warned_fonts) + warned_fonts = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_insert (warned_fonts, g_strdup (ctmp1), GINT_TO_POINTER (1)); + + ctmp2 = pango_font_description_to_string (tmp_desc); + g_warning ("couldn't load font \"%s\", falling back to \"%s\", " + "expect ugly output.", ctmp1, ctmp2); + g_free (ctmp2); + } + G_UNLOCK (warned_fonts); + g_free (ctmp1); + + pango_win32_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + "Sans"); + } + + /* We couldn't try with Sans and the specified style. Try Sans Normal + */ + if (pango_fontset_simple_size (fonts) == 0) + { + char *ctmp1, *ctmp2; + + pango_font_description_set_family_static (tmp_desc, "Sans"); + ctmp1 = pango_font_description_to_string (tmp_desc); + pango_font_description_set_style (tmp_desc, PANGO_STYLE_NORMAL); + pango_font_description_set_weight (tmp_desc, PANGO_WEIGHT_NORMAL); + pango_font_description_set_variant (tmp_desc, PANGO_VARIANT_NORMAL); + pango_font_description_set_stretch (tmp_desc, PANGO_STRETCH_NORMAL); + + G_LOCK (warned_fonts); + if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) + { + g_hash_table_insert (warned_fonts, g_strdup (ctmp1), GINT_TO_POINTER (1)); + + ctmp2 = pango_font_description_to_string (tmp_desc); + + g_warning ("couldn't load font \"%s\", falling back to \"%s\", " + "expect ugly output.", ctmp1, ctmp2); + g_free (ctmp2); + } + G_UNLOCK (warned_fonts); + g_free (ctmp1); + + pango_win32_font_map_fontset_add_fonts (fontmap, + context, + fonts, + tmp_desc, + "Sans"); + } + + pango_font_description_free (tmp_desc); + + /* Everything failed, we are screwed, there is no way to continue, + * but lets just not crash here. + */ + if (pango_fontset_simple_size (fonts) == 0) + g_warning ("All font fallbacks failed!!!!"); + + return PANGO_FONTSET (fonts); +} diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h new file mode 100644 index 0000000..88e5655 --- /dev/null +++ b/pango/pangowin32-private.h @@ -0,0 +1,298 @@ +/* Pango + * pangowin32-private.h: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000-2002 Tor Lillqvist + * Copyright (C) 2001 Alexander Larsson + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOWIN32_PRIVATE_H__ +#define __PANGOWIN32_PRIVATE_H__ + +/* Define if you want the possibility to get copious debugging output. + * (You still need to set the PANGO_WIN32_DEBUG environment variable + * to get it.) + */ +#define PANGO_WIN32_DEBUGGING 1 + +#ifdef PANGO_WIN32_DEBUGGING +#ifdef __GNUC__ +#define PING(printlist) \ +(_pango_win32_debug ? \ + (g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__), \ + g_print printlist, \ + g_print ("\n"), \ + 0) : \ + 0) +#else +#define PING(printlist) \ +(_pango_win32_debug ? \ + (g_print ("%s:%d ", __FILE__, __LINE__), \ + g_print printlist, \ + g_print ("\n"), \ + 0) : \ + 0) +#endif +#else /* !PANGO_WIN32_DEBUGGING */ +#define PING(printlist) +#endif + +#include "pangowin32.h" + +typedef enum + { + PANGO_WIN32_COVERAGE_UNSPEC, + PANGO_WIN32_COVERAGE_ZH_TW, + PANGO_WIN32_COVERAGE_ZH_CN, + PANGO_WIN32_COVERAGE_JA, + PANGO_WIN32_COVERAGE_KO, + PANGO_WIN32_COVERAGE_VI, + PANGO_WIN32_N_COVERAGES + } PangoWin32CoverageLanguageClass; + +#define PANGO_TYPE_WIN32_FONT_MAP (_pango_win32_font_map_get_type ()) +#define PANGO_WIN32_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_WIN32_FONT_MAP, PangoWin32FontMap)) +#define PANGO_WIN32_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_WIN32_FONT_MAP)) +#define PANGO_WIN32_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_WIN32_FONT_MAP, PangoWin32FontMapClass)) +#define PANGO_IS_WIN32_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_WIN32_FONT_MAP)) +#define PANGO_WIN32_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_WIN32_FONT_MAP, PangoWin32FontMapClass)) + +#define PANGO_TYPE_WIN32_FONT (_pango_win32_font_get_type ()) +#define PANGO_WIN32_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_WIN32_FONT, PangoWin32Font)) +#define PANGO_WIN32_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_WIN32_FONT, PangoWin32FontClass)) +#define PANGO_WIN32_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_WIN32_FONT)) +#define PANGO_WIN32_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_WIN32_FONT)) +#define PANGO_WIN32_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_WIN32_FONT, PangoWin32FontClass)) + +typedef struct _PangoWin32FontMap PangoWin32FontMap; +typedef struct _PangoWin32FontMapClass PangoWin32FontMapClass; +typedef struct _PangoWin32Font PangoWin32Font; +typedef struct _PangoWin32FontClass PangoWin32FontClass; +typedef struct _PangoWin32Face PangoWin32Face; +typedef PangoFontFaceClass PangoWin32FaceClass; +typedef struct _PangoWin32GlyphInfo PangoWin32GlyphInfo; +typedef struct _PangoWin32MetricsInfo PangoWin32MetricsInfo; + +struct _PangoWin32FontMap +{ + PangoFontMap parent_instance; + + PangoWin32FontCache *font_cache; + GQueue *freed_fonts; + + /* Map Pango family names to PangoWin32Family structs */ + GHashTable *families; + + /* Map LOGFONTWs (taking into account only the lfFaceName, lfItalic + * and lfWeight fields) to LOGFONTWs corresponding to actual fonts + * installed. + */ + GHashTable *fonts; + + double resolution; /* (points / pixel) * PANGO_SCALE */ +}; + +struct _PangoWin32FontMapClass +{ + PangoFontMapClass parent_class; + + PangoFont *(*find_font) (PangoWin32FontMap *fontmap, + PangoContext *context, + PangoWin32Face *face, + const PangoFontDescription *desc); + +}; + +struct _PangoWin32Font +{ + PangoFont font; + + LOGFONTW logfontw; + int size; + + GSList *metrics_by_lang; + + PangoFontMap *fontmap; + + /* Written by _pango_win32_font_get_hfont: */ + HFONT hfont; + + PangoWin32Face *win32face; + + /* If TRUE, font is in cache of recently unused fonts and not otherwise + * in use. + */ + gboolean in_cache; + GHashTable *glyph_info; +}; + +struct _PangoWin32FontClass +{ + PangoFontClass parent_class; + + gboolean (*select_font) (PangoFont *font, + HDC hdc); + void (*done_font) (PangoFont *font); + double (*get_metrics_factor) (PangoFont *font); +}; + +struct _PangoWin32Face +{ + PangoFontFace parent_instance; + + LOGFONTW logfontw; + PangoFontDescription *description; + PangoCoverage *coverages[PANGO_WIN32_N_COVERAGES]; + char *face_name; + gboolean is_synthetic; + + gboolean has_cmap; + guint16 cmap_format; + gpointer cmap; + + GSList *cached_fonts; +}; + +struct _PangoWin32GlyphInfo +{ + PangoRectangle logical_rect; + PangoRectangle ink_rect; +}; + +struct _PangoWin32MetricsInfo +{ + const char *sample_str; + PangoFontMetrics *metrics; +}; + +/* TrueType defines: */ + +#define MAKE_TT_TABLE_NAME(c1, c2, c3, c4) \ + (((guint32)c4) << 24 | ((guint32)c3) << 16 | ((guint32)c2) << 8 | ((guint32)c1)) + +#define CMAP (MAKE_TT_TABLE_NAME('c','m','a','p')) +#define CMAP_HEADER_SIZE 4 + +#define NAME (MAKE_TT_TABLE_NAME('n','a','m','e')) +#define NAME_HEADER_SIZE 6 + +#define ENCODING_TABLE_SIZE 8 + +#define APPLE_UNICODE_PLATFORM_ID 0 +#define MACINTOSH_PLATFORM_ID 1 +#define ISO_PLATFORM_ID 2 +#define MICROSOFT_PLATFORM_ID 3 + +#define SYMBOL_ENCODING_ID 0 +#define UNICODE_ENCODING_ID 1 +#define UCS4_ENCODING_ID 10 + +/* All the below structs must be packed! */ + +struct cmap_encoding_subtable +{ + guint16 platform_id; + guint16 encoding_id; + guint32 offset; +}; + +struct format_4_cmap +{ + guint16 format; + guint16 length; + guint16 language; + guint16 seg_count_x_2; + guint16 search_range; + guint16 entry_selector; + guint16 range_shift; + + guint16 reserved; + + guint16 arrays[1]; +}; + +struct format_12_cmap +{ + guint16 format; + guint16 reserved; + guint32 length; + guint32 language; + guint32 count; + + guint32 groups[1]; +}; + +struct name_header +{ + guint16 format_selector; + guint16 num_records; + guint16 string_storage_offset; +}; + +struct name_record +{ + guint16 platform_id; + guint16 encoding_id; + guint16 language_id; + guint16 name_id; + guint16 string_length; + guint16 string_offset; +}; + +_PANGO_EXTERN +GType _pango_win32_font_get_type (void) G_GNUC_CONST; + +_PANGO_EXTERN +void _pango_win32_make_matching_logfontw (PangoFontMap *fontmap, + const LOGFONTW *lfp, + int size, + LOGFONTW *out); + +_PANGO_EXTERN +GType _pango_win32_font_map_get_type (void) G_GNUC_CONST; + +_PANGO_EXTERN +void _pango_win32_fontmap_cache_remove (PangoFontMap *fontmap, + PangoWin32Font *xfont); + +_PANGO_EXTERN +gboolean _pango_win32_get_name_header (HDC hdc, + struct name_header *header); +_PANGO_EXTERN +gboolean _pango_win32_get_name_record (HDC hdc, + gint i, + struct name_record *record); + +_PANGO_EXTERN +HFONT _pango_win32_font_get_hfont (PangoFont *font); + +_PANGO_EXTERN +void +_pango_win32_shape (PangoFont *font, + const char *text, + unsigned int length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED); + +extern HDC _pango_win32_hdc; +extern OSVERSIONINFO _pango_win32_os_version_info; +extern gboolean _pango_win32_debug; + +#endif /* __PANGOWIN32_PRIVATE_H__ */ diff --git a/pango/pangowin32-shape.c b/pango/pangowin32-shape.c new file mode 100644 index 0000000..aad0243 --- /dev/null +++ b/pango/pangowin32-shape.c @@ -0,0 +1,775 @@ +/* Pango + * pangowin32-shape.c: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2001 Alexander Larsson + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +/*#define BASIC_WIN32_DEBUGGING */ + +#include +#include + +#include + +#include "pangowin32-private.h" + +#include "pango-utils.h" +#include "pango-impl-utils.h" + +static gboolean pango_win32_debug = FALSE; + +#include + +static PangoGlyph +find_char (PangoFont *font, + gunichar wc) +{ + return pango_win32_font_get_glyph_index (font, wc); +} + +static void +set_glyph (PangoFont *font, + PangoGlyphString *glyphs, + int i, + int offset, + PangoGlyph glyph) +{ + PangoRectangle logical_rect; + + glyphs->glyphs[i].glyph = glyph; + + glyphs->glyphs[i].geometry.x_offset = 0; + glyphs->glyphs[i].geometry.y_offset = 0; + + glyphs->log_clusters[i] = offset; + + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect); + glyphs->glyphs[i].geometry.width = logical_rect.width; +} + +static void +swap_range (PangoGlyphString *glyphs, + int start, + int end) +{ + int i, j; + + for (i = start, j = end - 1; i < j; i++, j--) + { + PangoGlyphInfo glyph_info; + gint log_cluster; + + glyph_info = glyphs->glyphs[i]; + glyphs->glyphs[i] = glyphs->glyphs[j]; + glyphs->glyphs[j] = glyph_info; + + log_cluster = glyphs->log_clusters[i]; + glyphs->log_clusters[i] = glyphs->log_clusters[j]; + glyphs->log_clusters[j] = log_cluster; + } +} + +#ifdef BASIC_WIN32_DEBUGGING + +static char * +lang_name (int lang) +{ + LCID lcid = MAKELCID (lang, SORT_DEFAULT); + static char retval[10]; + + if (!GetLocaleInfo (lcid, LOCALE_SISO639LANGNAME, retval, G_N_ELEMENTS (retval))) + sprintf (retval, "%#02x", lang); + + return retval; +} + +#endif /* BASIC_WIN32_DEBUGGING */ + +static WORD +make_langid (PangoLanguage *lang) +{ +#define CASE(t,p,s) if (pango_language_matches (lang, t)) return MAKELANGID (LANG_##p, SUBLANG_##p##_##s) +#define CASEN(t,p) if (pango_language_matches (lang, t)) return MAKELANGID (LANG_##p, SUBLANG_NEUTRAL) + + /* Languages that most probably don't affect Uniscribe have been + * left out. Uniscribe is documented to use + * SCRIPT_CONTROL::uDefaultLanguage only to select digit shapes, so + * just leave languages with own digits. + */ + + CASEN ("ar", ARABIC); + CASEN ("hy", ARMENIAN); + CASEN ("as", ASSAMESE); + CASEN ("az", AZERI); + CASEN ("bn", BENGALI); + CASE ("zh-tw", CHINESE, TRADITIONAL); + CASE ("zh-cn", CHINESE, SIMPLIFIED); + CASE ("zh-hk", CHINESE, HONGKONG); + CASE ("zh-sg", CHINESE, SINGAPORE); + CASE ("zh-mo", CHINESE, MACAU); + CASEN ("dib", DIVEHI); + CASEN ("fa", FARSI); + CASEN ("ka", GEORGIAN); + CASEN ("gu", GUJARATI); + CASEN ("he", HEBREW); + CASEN ("hi", HINDI); + CASEN ("ja", JAPANESE); + CASEN ("kn", KANNADA); + CASE ("ks-in", KASHMIRI, INDIA); + CASEN ("ks", KASHMIRI); + CASEN ("kk", KAZAK); + CASEN ("kok", KONKANI); + CASEN ("ko", KOREAN); + CASEN ("ky", KYRGYZ); + CASEN ("ml", MALAYALAM); + CASEN ("mni", MANIPURI); + CASEN ("mr", MARATHI); + CASEN ("mn", MONGOLIAN); + CASE ("ne-in", NEPALI, INDIA); + CASEN ("ne", NEPALI); + CASEN ("or", ORIYA); + CASEN ("pa", PUNJABI); + CASEN ("sa", SANSKRIT); + CASEN ("sd", SINDHI); + CASEN ("syr", SYRIAC); + CASEN ("ta", TAMIL); + CASEN ("tt", TATAR); + CASEN ("te", TELUGU); + CASEN ("th", THAI); + CASE ("ur-pk", URDU, PAKISTAN); + CASE ("ur-in", URDU, INDIA); + CASEN ("ur", URDU); + CASEN ("uz", UZBEK); + +#undef CASE +#undef CASEN + + return MAKELANGID (LANG_NEUTRAL, SUBLANG_NEUTRAL); +} + +#ifdef BASIC_WIN32_DEBUGGING + +static void +dump_glyphs_and_log_clusters (gboolean rtl, + int itemlen, + int charix0, + WORD *log_clusters, + WORD *iglyphs, + int nglyphs) +{ + if (pango_win32_debug) + { + int j, k, nclusters, clusterix, charix, ng; + + g_print (" ScriptShape: nglyphs=%d: ", nglyphs); + + for (j = 0; j < nglyphs; j++) + g_print ("%d%s", iglyphs[j], (j < nglyphs-1) ? "," : ""); + g_print ("\n"); + + g_print (" log_clusters: "); + for (j = 0; j < itemlen; j++) + g_print ("%d ", log_clusters[j]); + g_print ("\n"); + nclusters = 0; + for (j = 0; j < itemlen; j++) + { + if (j == 0 || log_clusters[j-1] != log_clusters[j]) + nclusters++; + } + g_print (" %d clusters:\n", nclusters); + + /* If RTL, first char is the last in the run, otherwise the + * first. + */ + clusterix = 0; + if (rtl) + { + int firstglyphix = 0; + for (j = itemlen - 1, charix = charix0 + j; j >= 0; j--, charix--) + { + if (j == itemlen - 1 || log_clusters[j] != log_clusters[j+1]) + g_print (" Cluster %d: chars %d--", + clusterix, charix); + if (j == 0 || log_clusters[j-1] != log_clusters[j]) + { + ng = log_clusters[j] - firstglyphix + 1; + g_print ("%d: %d glyphs: ", + charix, ng); + for (k = firstglyphix; k <= log_clusters[j]; k++) + { + g_print ("%d", iglyphs[k]); + if (k < log_clusters[j]) + g_print (","); + } + firstglyphix = log_clusters[j] + 1; + clusterix++; + g_print ("\n"); + } + } + } + else + { + for (j = 0, charix = charix0; j < itemlen; j++, charix++) + { + if (j == 0 || log_clusters[j-1] != log_clusters[j]) + g_print (" Cluster %d: wchar_t %d--", + clusterix, charix); + if (j == itemlen - 1 || log_clusters[j] != log_clusters[j+1]) + { + int klim = ((j == itemlen-1) ? nglyphs : log_clusters[j+1]); + ng = klim - log_clusters[j]; + g_print ("%d: %d glyphs: ", + charix, ng); + for (k = log_clusters[j]; k < klim; k++) + { + g_print ("%d", iglyphs[k]); + if (k != klim - 1) + g_print (","); + } + clusterix++; + g_print ("\n"); + } + } + } + } +} + +#endif /* BASIC_WIN32_DEBUGGING */ + +static void +set_up_pango_log_clusters (wchar_t *wtext, + gboolean rtl, + int itemlen, + WORD *usp_log_clusters, + int nglyphs, + gint *pango_log_clusters, + int char_offset) +{ + int j, k; + int first_char_in_cluster; + + if (rtl) + { + /* RTL. Walk Uniscribe log_clusters array backwards, build Pango + * log_clusters array forwards. + */ + int glyph0 = 0; + first_char_in_cluster = itemlen - 1; + for (j = itemlen - 1; j >= 0; j--) + { + if (j < itemlen - 1 && usp_log_clusters[j+1] != usp_log_clusters[j]) + { + /* Cluster starts */ + first_char_in_cluster = j; + } + if (j == 0) + { + /* First char, cluster ends */ + for (k = glyph0; k < nglyphs; k++) + pango_log_clusters[k] = first_char_in_cluster + char_offset; + } + else if (usp_log_clusters[j-1] == usp_log_clusters[j]) + { + /* Cluster continues */ + first_char_in_cluster = j-1; + } + else + { + /* Cluster ends */ + for (k = glyph0; k <= usp_log_clusters[j]; k++) + pango_log_clusters[k] = first_char_in_cluster + char_offset; + glyph0 = usp_log_clusters[j] + 1; + } + } + } + else + { + /* LTR. Walk Uniscribe log_clusters array forwards, build Pango + * log_clusters array also forwards. + */ + first_char_in_cluster = 0; + for (j = 0; j < itemlen; j++) + { + if (j > 0 && usp_log_clusters[j-1] != usp_log_clusters[j]) + { + /* Cluster starts */ + first_char_in_cluster = j; + } + if (j == itemlen - 1) + { + /* Last char, cluster ends */ + for (k = usp_log_clusters[j]; k < nglyphs; k++) + pango_log_clusters[k] = first_char_in_cluster + char_offset; + } + else if (usp_log_clusters[j] == usp_log_clusters[j+1]) + { + /* Cluster continues */ + } + else + { + /* Cluster ends */ + for (k = usp_log_clusters[j]; k < usp_log_clusters[j+1]; k++) + pango_log_clusters[k] = first_char_in_cluster + char_offset; + } + } + } +} + +static void +convert_log_clusters_to_byte_offsets (const char *text, + gint length, + PangoGlyphString *glyphs, + gint utf16_len) +{ + const char *p; + int charix, glyphix; + int *byte_offset = g_new (int, utf16_len); + + p = text; + charix = 0; + while (p < text + length) + { + byte_offset[charix] = p - text; + charix++; + if (g_utf8_get_char (p) > 0xFFFF) + { + byte_offset[charix] = p - text; + charix++; + } + p = g_utf8_next_char (p); + } + g_assert (charix <= utf16_len); + + /* Convert utf16 indexes in the log_clusters array to byte offsets. + */ + for (glyphix = 0; glyphix < glyphs->num_glyphs; glyphix++) + { + g_assert (glyphs->log_clusters[glyphix] < utf16_len); + glyphs->log_clusters[glyphix] = byte_offset[glyphs->log_clusters[glyphix]]; + } + + g_free (byte_offset); +} + +typedef struct { + HFONT hfont; + gint32 script; +} script_cache_key; + +static guint +script_cache_key_hash_func (script_cache_key *key) +{ + return g_direct_hash (key->hfont) ^ g_int_hash (&(key->script)); +} + +static gboolean +script_cache_key_equal_func (script_cache_key *a, + script_cache_key *b) +{ + return (a->hfont == b->hfont) && (a->script == b->script); +} + +static gboolean +itemize_shape_and_place (PangoFont *font, + HDC hdc, + wchar_t *wtext, + int wlen, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) +{ + int i; + int item, nitems, item_step; + int itemlen, glyphix, nglyphs; + SCRIPT_CONTROL control; + SCRIPT_STATE state; + SCRIPT_ITEM items[100]; + double scale = pango_win32_font_get_metrics_factor (font); + HFONT hfont = _pango_win32_font_get_hfont (font); + static GHashTable *script_cache_hash = NULL; + + if (!script_cache_hash) + script_cache_hash = g_hash_table_new ((GHashFunc)script_cache_key_hash_func, + (GEqualFunc)script_cache_key_equal_func); + + memset (&control, 0, sizeof (control)); + memset (&state, 0, sizeof (state)); + + control.uDefaultLanguage = make_langid (analysis->language); + state.uBidiLevel = analysis->level; + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print (G_STRLOC ": ScriptItemize: uDefaultLanguage:%04x uBidiLevel:%d\n", + control.uDefaultLanguage, state.uBidiLevel); +#endif + if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items), &control, NULL, + items, &nitems)) + { +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print ("ScriptItemize failed\n"); +#endif + return FALSE; + } + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print ("%d items:\n", nitems); +#endif + + if (analysis->level % 2) + { + item = nitems - 1; + item_step = -1; + } + else + { + item = 0; + item_step = 1; + } + + for (i = 0; i < nitems; i++, item += item_step) + { + WORD iglyphs[1000]; + WORD log_clusters[1000]; + SCRIPT_VISATTR visattrs[1000]; + int advances[1000]; + GOFFSET offsets[1000]; + ABC abc; + gint32 script = items[item].a.eScript; + int ng; + int char_offset; + SCRIPT_CACHE *script_cache; + script_cache_key font_and_script_key; + + memset (advances, 0, sizeof (advances)); + memset (offsets, 0, sizeof (offsets)); + memset (&abc, 0, sizeof (abc)); + + /* Note that itemlen is number of wchar_t's i.e. surrogate pairs + * count as two! + */ + itemlen = items[item+1].iCharPos - items[item].iCharPos; + char_offset = items[item].iCharPos; + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + { + static const SCRIPT_PROPERTIES **scripts; + static int nscripts; + if (!nscripts) + ScriptGetProperties (&scripts, &nscripts); + g_print (" Item %d: iCharPos=%d eScript=%d (%s) %s%s%s%s%s%s%s wchar_t %d--%d (%d)\n", + item, items[item].iCharPos, script, + lang_name (scripts[script]->langid), + scripts[script]->fComplex ? "complex" : "simple", + items[item].a.fRTL ? " fRTL" : "", + items[item].a.fLayoutRTL ? " fLayoutRTL" : "", + items[item].a.fLinkBefore ? " fLinkBefore" : "", + items[item].a.fLinkAfter ? " fLinkAfter" : "", + items[item].a.fLogicalOrder ? " fLogicalOrder" : "", + items[item].a.fNoGlyphIndex ? " fNoGlyphIndex" : "", + items[item].iCharPos, items[item+1].iCharPos-1, itemlen); +#endif + /* Create a hash key based on hfont and script engine */ + font_and_script_key.hfont = hfont; + font_and_script_key.script = script; + + /* Get the script cache for this hfont and script */ + script_cache = g_hash_table_lookup (script_cache_hash, &font_and_script_key); + if (!script_cache) + { + script_cache_key *key_n; + SCRIPT_CACHE *new_script_cache; + + key_n = g_new (script_cache_key, 1); + *key_n = font_and_script_key; + + new_script_cache = g_new0 (SCRIPT_CACHE, 1); + script_cache = new_script_cache; + + /* Insert the new value */ + g_hash_table_insert (script_cache_hash, key_n, new_script_cache); + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print (" New SCRIPT_CACHE for font %p and script %d\n", hfont, script); +#endif + } + + items[item].a.fRTL = analysis->level % 2; + if (ScriptShape (hdc, script_cache, + wtext + items[item].iCharPos, itemlen, + G_N_ELEMENTS (iglyphs), + &items[item].a, + iglyphs, + log_clusters, + visattrs, + &nglyphs)) + { +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print ("pangowin32-shape: ScriptShape failed\n"); +#endif + return FALSE; + } + +#ifdef BASIC_WIN32_DEBUGGING + dump_glyphs_and_log_clusters (items[item].a.fRTL, itemlen, + items[item].iCharPos, log_clusters, + iglyphs, nglyphs); +#endif + + ng = glyphs->num_glyphs; + pango_glyph_string_set_size (glyphs, ng + nglyphs); + + set_up_pango_log_clusters (wtext + items[item].iCharPos, + items[item].a.fRTL, itemlen, log_clusters, + nglyphs, glyphs->log_clusters + ng, + char_offset); + + if (ScriptPlace (hdc, script_cache, iglyphs, nglyphs, + visattrs, &items[item].a, + advances, offsets, &abc)) + { +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print ("pangowin32-shape: ScriptPlace failed\n"); +#endif + return FALSE; + } + + for (glyphix = 0; glyphix < nglyphs; glyphix++) + { + if (iglyphs[glyphix] != 0) + { + glyphs->glyphs[ng+glyphix].glyph = iglyphs[glyphix]; + glyphs->glyphs[ng+glyphix].geometry.width = floor (0.5 + scale * advances[glyphix]); + glyphs->glyphs[ng+glyphix].geometry.x_offset = floor (0.5 + scale * offsets[glyphix].du); + glyphs->glyphs[ng+glyphix].geometry.y_offset = -floor (0.5 + scale * offsets[glyphix].dv); + } + else + { + PangoRectangle logical_rect; + /* Should pass actual char that was not found to + * PANGO_GET_UNKNOWN_GLYPH(), but a bit hard to + * find out that at this point, so cheat and use 0. + */ + PangoGlyph unk = PANGO_GET_UNKNOWN_GLYPH (0); + + glyphs->glyphs[ng+glyphix].glyph = unk; + pango_font_get_glyph_extents (font, unk, NULL, &logical_rect); + glyphs->glyphs[ng+glyphix].geometry.width = logical_rect.width; + glyphs->glyphs[ng+glyphix].geometry.x_offset = 0; + glyphs->glyphs[ng+glyphix].geometry.y_offset = 0; + } + } + } + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + { + g_print (" Pango log_clusters (level:%d), char index:", analysis->level); + for (glyphix = 0; glyphix < glyphs->num_glyphs; glyphix++) + g_print ("%d ", glyphs->log_clusters[glyphix]); + g_print ("\n"); + } +#endif + + return TRUE; +} + +static gboolean +uniscribe_shape (PangoFont *font, + const char *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) +{ + wchar_t *wtext; + long wlen; + HDC hdc = _pango_win32_hdc; + gboolean retval = TRUE; + + if (!pango_win32_font_select_font (font, hdc)) + return FALSE; + + wtext = g_utf8_to_utf16 (text, length, NULL, &wlen, NULL); + if (wtext == NULL) + retval = FALSE; + + if (retval) + { + retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs); + } + + if (retval) + { + convert_log_clusters_to_byte_offsets (text, length, glyphs, wlen); +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + { + int glyphix; + + g_print (" Pango log_clusters, byte offsets:"); + for (glyphix = 0; glyphix < glyphs->num_glyphs; glyphix++) + g_print ("%d ", glyphs->log_clusters[glyphix]); + g_print ("\n"); + } +#endif + } + + pango_win32_font_done_font (font); + + g_free (wtext); + + return retval && glyphs->num_glyphs > 0; +} + +static gboolean +text_is_simple (const char *text, + gint length) +{ + gboolean retval; + wchar_t *wtext; + long wlen; + + wtext = (wchar_t *) g_utf8_to_utf16 (text, length, NULL, &wlen, NULL); + if (wtext == NULL) + return TRUE; + + retval = (ScriptIsComplex (wtext, wlen, SIC_COMPLEX) == S_FALSE); + + g_free (wtext); + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print ("text_is_simple: %.*s (%ld wchar_t): %s\n", + MIN (length, 10), text, wlen, retval ? "YES" : "NO"); +#endif + + return retval; +} + +void +_pango_win32_shape (PangoFont *font, + const char *text, + unsigned int length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED) +{ + int n_chars; + int i; + const char *p; + + g_return_if_fail (font != NULL); + g_return_if_fail (text != NULL); + g_return_if_fail (length >= 0); + g_return_if_fail (analysis != NULL); + + if (!text_is_simple (text, length) && + uniscribe_shape (font, text, length, analysis, glyphs)) + return; + + n_chars = pango_utf8_strlen (text, length); + + pango_glyph_string_set_size (glyphs, n_chars); + + p = text; + for (i = 0; i < n_chars; i++) + { + gunichar wc; + gunichar mirrored_ch; + PangoGlyph index; + + wc = g_utf8_get_char (p); + + if (analysis->level % 2) + if (g_unichar_get_mirror_char (wc, &mirrored_ch)) + wc = mirrored_ch; + + if (wc == 0xa0) /* non-break-space */ + wc = 0x20; + + if (pango_is_zero_width (wc)) + { + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY); + } + else + { + index = find_char (font, wc); + if (index) + { + set_glyph (font, glyphs, i, p - text, index); + + if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK) + { + if (i > 0) + { + PangoRectangle logical_rect, ink_rect; + + glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width, + glyphs->glyphs[i].geometry.width); + glyphs->glyphs[i-1].geometry.width = 0; + glyphs->log_clusters[i] = glyphs->log_clusters[i-1]; + + /* Some heuristics to try to guess how overstrike glyphs are + * done and compensate + */ + /* FIXME: (alex) Is this double call to get_glyph_extents really necessary? */ + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect); + if (logical_rect.width == 0 && ink_rect.x == 0) + glyphs->glyphs[i].geometry.x_offset = (glyphs->glyphs[i].geometry.width - ink_rect.width) / 2; + } + } + } + else + set_glyph (font, glyphs, i, p - text, PANGO_GET_UNKNOWN_GLYPH (wc)); + } + + p = g_utf8_next_char (p); + } + + /* Simple bidi support... may have separate modules later */ + + if (analysis->level % 2) + { + int start, end; + + /* Swap all glyphs */ + swap_range (glyphs, 0, n_chars); + + /* Now reorder glyphs within each cluster back to LTR */ + for (start = 0; start < n_chars;) + { + end = start; + while (end < n_chars && + glyphs->log_clusters[end] == glyphs->log_clusters[start]) + end++; + + swap_range (glyphs, start, end); + start = end; + } + } +} diff --git a/pango/pangowin32.c b/pango/pangowin32.c new file mode 100644 index 0000000..630898e --- /dev/null +++ b/pango/pangowin32.c @@ -0,0 +1,1910 @@ +/* Pango + * pangowin32.c: Routines for handling Windows fonts + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * Copyright (C) 2001 Alexander Larsson + * Copyright (C) 2007 Novell, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:win32-fonts + * @short_description:Functions for shape engines to manipulate Win32 fonts + * @title:Win32 Fonts and Rendering + * + * The macros and functions in this section are used to access fonts natively on + * Win32 systems and to render text in conjunction with Win32 APIs. + */ +#include "config.h" + +#include +#include +#include + +#include "pango-impl-utils.h" +#include "pangowin32.h" +#include "pangowin32-private.h" + +#define MAX_FREED_FONTS 256 + +#define CH_IS_UNIHAN_BMP(ch) ((ch) >= 0x3400 && (ch) <= 0x9FFF) +#define CH_IS_UNIHAN(ch) (CH_IS_UNIHAN_BMP (ch) || \ + ((ch) >= 0x20000 && (ch) <= 0x2A6DF) || \ + ((ch) >= 0x2F800 && (ch) <= 0x2FA1F)) + +HDC _pango_win32_hdc; +OSVERSIONINFO _pango_win32_os_version_info; +gboolean _pango_win32_debug = FALSE; + +static void pango_win32_font_dispose (GObject *object); +static void pango_win32_font_finalize (GObject *object); + +static PangoFontDescription *pango_win32_font_describe (PangoFont *font); +static PangoFontDescription *pango_win32_font_describe_absolute (PangoFont *font); +static PangoCoverage *pango_win32_font_get_coverage (PangoFont *font, + PangoLanguage *lang); +static void pango_win32_font_calc_coverage (PangoFont *font, + PangoCoverage *coverage, + PangoLanguage *lang); +static PangoEngineShape *pango_win32_font_find_shaper (PangoFont *font, + PangoLanguage *lang, + guint32 ch); +static void pango_win32_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); +static PangoFontMetrics * pango_win32_font_get_metrics (PangoFont *font, + PangoLanguage *lang); +static PangoFontMap * pango_win32_font_get_font_map (PangoFont *font); + +static gboolean pango_win32_font_real_select_font (PangoFont *font, + HDC hdc); +static void pango_win32_font_real_done_font (PangoFont *font); +static double pango_win32_font_real_get_metrics_factor (PangoFont *font); + +static void pango_win32_get_item_properties (PangoItem *item, + PangoUnderline *uline, + PangoAttrColor *uline_color, + gboolean *uline_set, + PangoAttrColor *fg_color, + gboolean *fg_set, + PangoAttrColor *bg_color, + gboolean *bg_set); + +HFONT +_pango_win32_font_get_hfont (PangoFont *font) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + PangoWin32FontCache *cache; + + if (!win32font) + return NULL; + + if (!win32font->hfont) + { + cache = pango_win32_font_map_get_font_cache (win32font->fontmap); + if (G_UNLIKELY (!cache)) + return NULL; + + win32font->hfont = pango_win32_font_cache_loadw (cache, &win32font->logfontw); + if (!win32font->hfont) + { + gchar *face_utf8 = g_utf16_to_utf8 (win32font->logfontw.lfFaceName, + -1, NULL, NULL, NULL); + g_warning ("Cannot load font '%s\n", face_utf8); + g_free (face_utf8); + return NULL; + } + } + + return win32font->hfont; +} + +/** + * pango_win32_get_context: + * + * Retrieves a #PangoContext appropriate for rendering with Windows fonts. + * + * Return value: the new #PangoContext + * + * Deprecated: 1.22: Use pango_win32_font_map_for_display() followed by + * pango_font_map_create_context() instead. + **/ +PangoContext * +pango_win32_get_context (void) +{ + return pango_font_map_create_context (pango_win32_font_map_for_display ()); +} + +G_DEFINE_TYPE (PangoWin32Font, _pango_win32_font, PANGO_TYPE_FONT) + +static void +_pango_win32_font_init (PangoWin32Font *win32font) +{ + win32font->size = -1; + + win32font->metrics_by_lang = NULL; + + win32font->glyph_info = g_hash_table_new_full (NULL, NULL, NULL, g_free); +} + +/** + * pango_win32_get_dc: + * + * Obtains a handle to the Windows device context that is used by Pango. + * + * Return value: A handle to the Windows device context that is used by Pango. + **/ +HDC +pango_win32_get_dc (void) +{ + if (g_once_init_enter (&_pango_win32_hdc)) + { + HDC hdc = CreateDC ("DISPLAY", NULL, NULL, NULL); + memset (&_pango_win32_os_version_info, 0, + sizeof (_pango_win32_os_version_info)); + _pango_win32_os_version_info.dwOSVersionInfoSize = + sizeof (OSVERSIONINFO); + GetVersionEx (&_pango_win32_os_version_info); + + /* Also do some generic pangowin32 initialisations... this function + * is a suitable place for those as it is called from a couple + * of class_init functions. + */ +#ifdef PANGO_WIN32_DEBUGGING + if (getenv ("PANGO_WIN32_DEBUG") != NULL) + _pango_win32_debug = TRUE; +#endif + g_once_init_leave (&_pango_win32_hdc, hdc); + } + + return _pango_win32_hdc; +} + +/** + * pango_win32_get_debug_flag: + * + * Returns whether debugging is turned on. + * + * Return value: %TRUE if debugging is turned on. + * + * Since: 1.2 + */ +gboolean +pango_win32_get_debug_flag (void) +{ + return _pango_win32_debug; +} + +static void +_pango_win32_font_class_init (PangoWin32FontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + + object_class->finalize = pango_win32_font_finalize; + object_class->dispose = pango_win32_font_dispose; + + font_class->describe = pango_win32_font_describe; + font_class->describe_absolute = pango_win32_font_describe_absolute; + font_class->get_coverage = pango_win32_font_get_coverage; + font_class->find_shaper = pango_win32_font_find_shaper; + font_class->get_glyph_extents = pango_win32_font_get_glyph_extents; + font_class->get_metrics = pango_win32_font_get_metrics; + font_class->get_font_map = pango_win32_font_get_font_map; + + class->select_font = pango_win32_font_real_select_font; + class->done_font = pango_win32_font_real_done_font; + class->get_metrics_factor = pango_win32_font_real_get_metrics_factor; + + pango_win32_get_dc (); +} + +/** + * pango_win32_render: + * @hdc: the device context + * @font: the font in which to draw the string + * @glyphs: the glyph string to draw + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * + * Render a #PangoGlyphString onto a Windows DC + */ +void +pango_win32_render (HDC hdc, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + HFONT hfont, old_hfont = NULL; + int i, j, num_valid_glyphs; + guint16 *glyph_indexes; + gint *dX; + gint this_x; + gint start_x_offset, x_offset, next_x_offset, cur_y_offset; /* in Pango units */ + + g_return_if_fail (glyphs != NULL); + +#ifdef PANGO_WIN32_DEBUGGING + if (_pango_win32_debug) + { + PING (("num_glyphs:%d", glyphs->num_glyphs)); + for (i = 0; i < glyphs->num_glyphs; i++) + { + g_print (" %d:%d", glyphs->glyphs[i].glyph, glyphs->glyphs[i].geometry.width); + if (glyphs->glyphs[i].geometry.x_offset != 0 || + glyphs->glyphs[i].geometry.y_offset != 0) + g_print (":%d,%d", glyphs->glyphs[i].geometry.x_offset, + glyphs->glyphs[i].geometry.y_offset); + } + g_print ("\n"); + } +#endif + + if (glyphs->num_glyphs == 0) + return; + + hfont = _pango_win32_font_get_hfont (font); + if (!hfont) + return; + + old_hfont = SelectObject (hdc, hfont); + + glyph_indexes = g_new (guint16, glyphs->num_glyphs); + dX = g_new (INT, glyphs->num_glyphs); + + /* Render glyphs using one ExtTextOutW() call for each run of glyphs + * that have the same y offset. The big majoroty of glyphs will have + * y offset of zero, so in general, the whole glyph string will be + * rendered by one call to ExtTextOutW(). + * + * In order to minimize buildup of rounding errors, we keep track of + * where the glyphs should be rendered in Pango units, and round + * to pixels separately for each glyph, + */ + + i = 0; + + /* Outer loop through all glyphs in string */ + while (i < glyphs->num_glyphs) + { + cur_y_offset = glyphs->glyphs[i].geometry.y_offset; + num_valid_glyphs = 0; + x_offset = 0; + start_x_offset = glyphs->glyphs[i].geometry.x_offset; + this_x = PANGO_PIXELS (start_x_offset); + + /* Inner loop through glyphs with the same y offset, or code + * point zero (just spacing). + */ + while (i < glyphs->num_glyphs && + (glyphs->glyphs[i].glyph == PANGO_GLYPH_EMPTY || + cur_y_offset == glyphs->glyphs[i].geometry.y_offset)) + { + if (glyphs->glyphs[i].glyph == PANGO_GLYPH_EMPTY) + { + /* PANGO_GLYPH_EMPTY glyphs should not be rendered, but their + * indicated width (set up by PangoLayout) should be taken + * into account. + */ + + /* If the string starts with spacing, must shift the + * starting point for the glyphs actually rendered. For + * spacing in the middle of the glyph string, add to the dX + * of the previous glyph to be rendered. + */ + if (num_valid_glyphs == 0) + start_x_offset += glyphs->glyphs[i].geometry.width; + else + { + x_offset += glyphs->glyphs[i].geometry.width; + dX[num_valid_glyphs-1] = PANGO_PIXELS (x_offset) - this_x; + } + } + else + { + if (glyphs->glyphs[i].glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + /* Glyph index is actually the char value that doesn't + * have any glyph (ORed with the flag). We should really + * do the same that pango_xft_real_render() does: render + * a box with the char value in hex inside it in a tiny + * font. Later. For now, use the TrueType invalid glyph + * at 0. + */ + glyph_indexes[num_valid_glyphs] = 0; + } + else + glyph_indexes[num_valid_glyphs] = glyphs->glyphs[i].glyph; + + x_offset += glyphs->glyphs[i].geometry.width; + + /* If the next glyph has an X offset, take that into consideration now */ + if (i < glyphs->num_glyphs - 1) + next_x_offset = glyphs->glyphs[i+1].geometry.x_offset; + else + next_x_offset = 0; + + dX[num_valid_glyphs] = PANGO_PIXELS (x_offset + next_x_offset) - this_x; + + /* Prepare for next glyph */ + this_x += dX[num_valid_glyphs]; + num_valid_glyphs++; + } + i++; + } +#ifdef PANGO_WIN32_DEBUGGING + if (_pango_win32_debug) + { + g_print ("ExtTextOutW at %d,%d deltas:", + x + PANGO_PIXELS (start_x_offset), + y + PANGO_PIXELS (cur_y_offset)); + for (j = 0; j < num_valid_glyphs; j++) + g_print (" %d", dX[j]); + g_print ("\n"); + } +#endif + + ExtTextOutW (hdc, + x + PANGO_PIXELS (start_x_offset), + y + PANGO_PIXELS (cur_y_offset), + ETO_GLYPH_INDEX, + NULL, + glyph_indexes, num_valid_glyphs, + dX); + x += this_x; + } + + + SelectObject (hdc, old_hfont); /* restore */ + g_free (glyph_indexes); + g_free (dX); +} + +/** + * pango_win32_render_transformed: + * @hdc: a windows device context + * @matrix: (nullable): a #PangoMatrix, or %NULL to use an identity + * transformation + * @font: the font in which to draw the string + * @glyphs: the glyph string to draw + * @x: the x position of the start of the string (in Pango + * units in user space coordinates) + * @y: the y position of the baseline (in Pango units + * in user space coordinates) + * + * Renders a #PangoGlyphString onto a windows DC, possibly + * transforming the layed-out coordinates through a transformation + * matrix. Note that the transformation matrix for @font is not + * changed, so to produce correct rendering results, the @font + * must have been loaded using a #PangoContext with an identical + * transformation matrix to that passed in to this function. + **/ +void +pango_win32_render_transformed (HDC hdc, + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + XFORM xForm; + XFORM xFormPrev = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; + int mode = GetGraphicsMode (hdc); + + if (!SetGraphicsMode (hdc, GM_ADVANCED)) + g_warning ("SetGraphicsMode() failed"); + else if (!GetWorldTransform (hdc, &xFormPrev)) + g_warning ("GetWorldTransform() failed"); + else if (matrix) + { + xForm.eM11 = matrix->xx; + xForm.eM12 = matrix->yx; + xForm.eM21 = matrix->xy; + xForm.eM22 = matrix->yy; + xForm.eDx = matrix->x0; + xForm.eDy = matrix->y0; + if (!SetWorldTransform (hdc, &xForm)) + g_warning ("GetWorldTransform() failed"); + } + + pango_win32_render (hdc, font, glyphs, x/PANGO_SCALE, y/PANGO_SCALE); + + /* restore */ + SetWorldTransform (hdc, &xFormPrev); + SetGraphicsMode (hdc, mode); +} + +static void +pango_win32_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + guint16 glyph_index = glyph; + GLYPHMETRICS gm; + TEXTMETRIC tm; + guint32 res; + HFONT hfont; + MAT2 m = {{0,1}, {0,0}, {0,0}, {0,1}}; + PangoWin32GlyphInfo *info; + + if (glyph == PANGO_GLYPH_EMPTY) + { + if (ink_rect) + ink_rect->x = ink_rect->width = ink_rect->y = ink_rect->height = 0; + if (logical_rect) + logical_rect->x = logical_rect->width = logical_rect->y = logical_rect->height = 0; + return; + } + + if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + glyph_index = glyph = 0; + + info = g_hash_table_lookup (win32font->glyph_info, GUINT_TO_POINTER (glyph)); + + if (!info) + { + info = g_new0 (PangoWin32GlyphInfo, 1); + + memset (&gm, 0, sizeof (gm)); + + hfont = _pango_win32_font_get_hfont (font); + SelectObject (_pango_win32_hdc, hfont); + /* FIXME: (Alex) This constant reuse of _pango_win32_hdc is + not thread-safe */ + res = GetGlyphOutlineA (_pango_win32_hdc, + glyph_index, + GGO_METRICS | GGO_GLYPH_INDEX, + &gm, + 0, NULL, + &m); + + if (res == GDI_ERROR) + { + gchar *error = g_win32_error_message (GetLastError ()); + g_warning ("GetGlyphOutline(%04X) failed: %s\n", + glyph_index, error); + g_free (error); + + /* Don't just return now, use the still zeroed out gm */ + } + + info->ink_rect.x = PANGO_SCALE * gm.gmptGlyphOrigin.x; + info->ink_rect.width = PANGO_SCALE * gm.gmBlackBoxX; + info->ink_rect.y = - PANGO_SCALE * gm.gmptGlyphOrigin.y; + info->ink_rect.height = PANGO_SCALE * gm.gmBlackBoxY; + + GetTextMetrics (_pango_win32_hdc, &tm); + info->logical_rect.x = 0; + info->logical_rect.width = PANGO_SCALE * gm.gmCellIncX; + info->logical_rect.y = - PANGO_SCALE * tm.tmAscent; + info->logical_rect.height = PANGO_SCALE * (tm.tmAscent + tm.tmDescent); + + g_hash_table_insert (win32font->glyph_info, GUINT_TO_POINTER(glyph), info); + } + + if (ink_rect) + *ink_rect = info->ink_rect; + + if (logical_rect) + *logical_rect = info->logical_rect; +} + +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + +static PangoFontMetrics * +pango_win32_font_get_metrics (PangoFont *font, + PangoLanguage *language) +{ + PangoWin32MetricsInfo *info = NULL; /* Quiet gcc */ + PangoWin32Font *win32font = (PangoWin32Font *)font; + GSList *tmp_list; + + const char *sample_str = pango_language_get_sample_string (language); + + tmp_list = win32font->metrics_by_lang; + while (tmp_list) + { + info = tmp_list->data; + + if (info->sample_str == sample_str) /* We _don't_ need strcmp */ + break; + + tmp_list = tmp_list->next; + } + + if (!tmp_list) + { + HFONT hfont; + PangoFontMetrics *metrics; + + info = g_new (PangoWin32MetricsInfo, 1); + win32font->metrics_by_lang = g_slist_prepend (win32font->metrics_by_lang, info); + + info->sample_str = sample_str; + info->metrics = metrics = pango_font_metrics_new (); + + hfont = _pango_win32_font_get_hfont (font); + if (hfont != NULL) + { + PangoCoverage *coverage; + TEXTMETRIC tm; + + SelectObject (_pango_win32_hdc, hfont); + GetTextMetrics (_pango_win32_hdc, &tm); + + metrics->ascent = tm.tmAscent * PANGO_SCALE; + metrics->descent = tm.tmDescent * PANGO_SCALE; + metrics->approximate_char_width = tm.tmAveCharWidth * PANGO_SCALE; + + coverage = pango_win32_font_get_coverage (font, language); + if (pango_coverage_get (coverage, '0') != PANGO_COVERAGE_NONE && + pango_coverage_get (coverage, '9') != PANGO_COVERAGE_NONE) + { + PangoContext *context; + PangoFontDescription *font_desc; + PangoLayout *layout; + + /* Get the average width of the chars in "0123456789" */ + context = pango_font_map_create_context (pango_win32_font_map_for_display ()); + pango_context_set_language (context, language); + font_desc = pango_font_describe_with_absolute_size (font); + pango_context_set_font_description (context, font_desc); + layout = pango_layout_new (context); + pango_layout_set_text (layout, "0123456789", -1); + + metrics->approximate_digit_width = max_glyph_width (layout); + + pango_font_description_free (font_desc); + g_object_unref (layout); + g_object_unref (context); + } + else + metrics->approximate_digit_width = metrics->approximate_char_width; + + pango_coverage_unref (coverage); + + /* FIXME: Should get the real values from the TrueType font file */ + metrics->underline_position = -2 * PANGO_SCALE; + metrics->underline_thickness = 1 * PANGO_SCALE; + metrics->strikethrough_thickness = metrics->underline_thickness; + /* Really really wild guess */ + metrics->strikethrough_position = metrics->ascent / 3; + } + } + + return pango_font_metrics_ref (info->metrics); +} + +static PangoFontMap * +pango_win32_font_get_font_map (PangoFont *font) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + + return win32font->fontmap; +} + +static gboolean +pango_win32_font_real_select_font (PangoFont *font, + HDC hdc) +{ + HFONT hfont = _pango_win32_font_get_hfont (font); + + if (!hfont) + return FALSE; + + if (!SelectObject (hdc, hfont)) + { + g_warning ("pango_win32_font_real_select_font: Cannot select font\n"); + return FALSE; + } + + return TRUE; +} + +static void +pango_win32_font_real_done_font (PangoFont *font) +{ +} + +static double +pango_win32_font_real_get_metrics_factor (PangoFont *font) +{ + return PANGO_SCALE; +} + +/** + * pango_win32_font_logfont: + * @font: a #PangoFont which must be from the Win32 backend + * + * Determine the LOGFONTA struct for the specified font. Note that + * Pango internally uses LOGFONTW structs, so if converting the UTF-16 + * face name in the LOGFONTW struct to system codepage fails, the + * returned LOGFONTA will have an emppty face name. To get the + * LOGFONTW of a PangoFont, use pango_win32_font_logfontw(). It + * is recommended to do that always even if you don't expect + * to come across fonts with odd names. + * + * Return value: A newly allocated LOGFONTA struct. It must be + * freed with g_free(). + **/ +LOGFONTA * +pango_win32_font_logfont (PangoFont *font) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + LOGFONTA *lfp; + + g_return_val_if_fail (font != NULL, NULL); + g_return_val_if_fail (PANGO_WIN32_IS_FONT (font), NULL); + + lfp = g_new (LOGFONTA, 1); + + *lfp = *(LOGFONTA*) &win32font->logfontw; + if (!WideCharToMultiByte (CP_ACP, 0, + win32font->logfontw.lfFaceName, -1, + lfp->lfFaceName, G_N_ELEMENTS (lfp->lfFaceName), + NULL, NULL)) + lfp->lfFaceName[0] = '\0'; + + return lfp; +} + +/** + * pango_win32_font_logfontw: + * @font: a #PangoFont which must be from the Win32 backend + * + * Determine the LOGFONTW struct for the specified font. + * + * Return value: A newly allocated LOGFONTW struct. It must be + * freed with g_free(). + * + * Since: 1.16 + **/ +LOGFONTW * +pango_win32_font_logfontw (PangoFont *font) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + LOGFONTW *lfp; + + g_return_val_if_fail (font != NULL, NULL); + g_return_val_if_fail (PANGO_WIN32_IS_FONT (font), NULL); + + lfp = g_new (LOGFONTW, 1); + *lfp = win32font->logfontw; + + return lfp; +} + +/** + * pango_win32_font_select_font: + * @font: a #PangoFont from the Win32 backend + * @hdc: a windows device context + * + * Selects the font into the specified DC and changes the mapping mode + * and world transformation of the DC appropriately for the font. + * You may want to surround the use of this function with calls + * to SaveDC() and RestoreDC(). Call pango_win32_font_done_font() when + * you are done using the DC to release allocated resources. + * + * See pango_win32_font_get_metrics_factor() for information about + * converting from the coordinate space used by this function + * into Pango units. + * + * Return value: %TRUE if the operation succeeded. + **/ +gboolean +pango_win32_font_select_font (PangoFont *font, + HDC hdc) +{ + g_return_val_if_fail (PANGO_WIN32_IS_FONT (font), FALSE); + + return PANGO_WIN32_FONT_GET_CLASS (font)->select_font (font, hdc); +} + +/** + * pango_win32_font_done_font: + * @font: a #PangoFont from the win32 backend + * + * Releases any resources allocated by pango_win32_font_done_font() + **/ +void +pango_win32_font_done_font (PangoFont *font) +{ + g_return_if_fail (PANGO_WIN32_IS_FONT (font)); + + PANGO_WIN32_FONT_GET_CLASS (font)->done_font (font); +} + +/** + * pango_win32_font_get_metrics_factor: + * @font: a #PangoFont from the win32 backend + * + * Returns the scale factor from logical units in the coordinate + * space used by pango_win32_font_select_font() to Pango units + * in user space. + * + * Return value: factor to multiply logical units by to get Pango + * units. + **/ +double +pango_win32_font_get_metrics_factor (PangoFont *font) +{ + g_return_val_if_fail (PANGO_WIN32_IS_FONT (font), 1.); + + return PANGO_WIN32_FONT_GET_CLASS (font)->get_metrics_factor (font); +} + +static void +pango_win32_fontmap_cache_add (PangoFontMap *fontmap, + PangoWin32Font *win32font) +{ + PangoWin32FontMap *win32fontmap = PANGO_WIN32_FONT_MAP (fontmap); + + if (win32fontmap->freed_fonts->length == MAX_FREED_FONTS) + { + PangoWin32Font *old_font = g_queue_pop_tail (win32fontmap->freed_fonts); + g_object_unref (old_font); + } + + g_object_ref (win32font); + g_queue_push_head (win32fontmap->freed_fonts, win32font); + win32font->in_cache = TRUE; +} + +static void +pango_win32_font_dispose (GObject *object) +{ + PangoWin32Font *win32font = PANGO_WIN32_FONT (object); + + /* If the font is not already in the freed-fonts cache, add it, + * if it is already there, do nothing and the font will be + * freed. + */ + if (!win32font->in_cache && win32font->fontmap) + pango_win32_fontmap_cache_add (win32font->fontmap, win32font); + + G_OBJECT_CLASS (_pango_win32_font_parent_class)->dispose (object); +} + +static void +free_metrics_info (PangoWin32MetricsInfo *info) +{ + pango_font_metrics_unref (info->metrics); + g_free (info); +} + +static void +pango_win32_font_entry_remove (PangoWin32Face *face, + PangoFont *font) +{ + face->cached_fonts = g_slist_remove (face->cached_fonts, font); +} + +static void +pango_win32_font_finalize (GObject *object) +{ + PangoWin32Font *win32font = (PangoWin32Font *)object; + PangoWin32FontCache *cache = pango_win32_font_map_get_font_cache (win32font->fontmap); + PangoWin32Font *fontmap; + + if (G_UNLIKELY (!cache)) + return; + + if (win32font->hfont != NULL) + pango_win32_font_cache_unload (cache, win32font->hfont); + + g_slist_foreach (win32font->metrics_by_lang, (GFunc)free_metrics_info, NULL); + g_slist_free (win32font->metrics_by_lang); + + if (win32font->win32face) + pango_win32_font_entry_remove (win32font->win32face, PANGO_FONT (win32font)); + + g_hash_table_destroy (win32font->glyph_info); + + fontmap = g_weak_ref_get ((GWeakRef *) &win32font->fontmap); + if (fontmap) + { + g_object_remove_weak_pointer (G_OBJECT (win32font->fontmap), (gpointer *) (gpointer) &win32font->fontmap); + g_object_unref (fontmap); + } + + G_OBJECT_CLASS (_pango_win32_font_parent_class)->finalize (object); +} + +static PangoFontDescription * +pango_win32_font_describe (PangoFont *font) +{ + PangoFontDescription *desc; + PangoWin32Font *win32font = PANGO_WIN32_FONT (font); + + desc = pango_font_description_copy (win32font->win32face->description); + pango_font_description_set_size (desc, win32font->size / (PANGO_SCALE / PANGO_WIN32_FONT_MAP (win32font->fontmap)->resolution)); + + return desc; +} + +static PangoFontDescription * +pango_win32_font_describe_absolute (PangoFont *font) +{ + PangoFontDescription *desc; + PangoWin32Font *win32font = PANGO_WIN32_FONT (font); + + desc = pango_font_description_copy (win32font->win32face->description); + pango_font_description_set_absolute_size (desc, win32font->size); + + return desc; +} + +static gint +pango_win32_coverage_language_classify (PangoLanguage *lang) +{ + if (pango_language_matches (lang, "zh-tw")) + return PANGO_WIN32_COVERAGE_ZH_TW; + else if (pango_language_matches (lang, "zh-cn")) + return PANGO_WIN32_COVERAGE_ZH_CN; + else if (pango_language_matches (lang, "ja")) + return PANGO_WIN32_COVERAGE_JA; + else if (pango_language_matches (lang, "ko")) + return PANGO_WIN32_COVERAGE_KO; + else if (pango_language_matches (lang, "vi")) + return PANGO_WIN32_COVERAGE_VI; + else + return PANGO_WIN32_COVERAGE_UNSPEC; +} + +static PangoCoverage * +pango_win32_font_entry_get_coverage (PangoWin32Face *face, + PangoLanguage *lang) +{ + gint i = pango_win32_coverage_language_classify (lang); + if (face->coverages[i]) + { + pango_coverage_ref (face->coverages[i]); + return face->coverages[i]; + } + + return NULL; +} + +static void +pango_win32_font_entry_set_coverage (PangoWin32Face *face, + PangoCoverage *coverage, + PangoLanguage *lang) +{ + face->coverages[pango_win32_coverage_language_classify (lang)] = pango_coverage_ref (coverage); +} + +static PangoCoverage * +pango_win32_font_get_coverage (PangoFont *font, + PangoLanguage *lang) +{ + PangoCoverage *coverage; + PangoWin32Font *win32font = (PangoWin32Font *)font; + + coverage = pango_win32_font_entry_get_coverage (win32font->win32face, lang); + if (!coverage) + { + coverage = pango_coverage_new (); + pango_win32_font_calc_coverage (font, coverage, lang); + + pango_win32_font_entry_set_coverage (win32font->win32face, coverage, lang); + } + + return coverage; +} + +/* Wrap shaper in PangoEngineShape to pass it through old API, + * from times when there were modules and engines. */ +typedef PangoEngineShape PangoWin32ShapeEngine; +typedef PangoEngineShapeClass PangoWin32ShapeEngineClass; +static GType pango_win32_shape_engine_get_type (void) G_GNUC_CONST; +G_DEFINE_TYPE (PangoWin32ShapeEngine, pango_win32_shape_engine, PANGO_TYPE_ENGINE_SHAPE); +static void +_pango_win32_shape_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, + PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length) +{ + _pango_win32_shape (font, item_text, item_length, analysis, glyphs, + paragraph_text, paragraph_length); +} +static void +pango_win32_shape_engine_class_init (PangoEngineShapeClass *class) +{ + class->script_shape = _pango_win32_shape_engine_shape; +} +static void +pango_win32_shape_engine_init (PangoEngineShape *object) +{ +} + +static PangoEngineShape * +pango_win32_font_find_shaper (PangoFont *font, + PangoLanguage *lang, + guint32 ch) +{ + static PangoEngineShape *shaper; + if (g_once_init_enter (&shaper)) + g_once_init_leave (&shaper, g_object_new (pango_win32_shape_engine_get_type(), NULL)); + return shaper; +} + +/* Utility functions */ + +/** + * pango_win32_get_unknown_glyph: + * @font: a #PangoFont + * @wc: the Unicode character for which a glyph is needed. + * + * Returns the index of a glyph suitable for drawing @wc as an + * unknown character. + * + * Use PANGO_GET_UNKNOWN_GLYPH() instead. + * + * Return value: a glyph index into @font + **/ +PangoGlyph +pango_win32_get_unknown_glyph (PangoFont *font, + gunichar wc) +{ + return PANGO_GET_UNKNOWN_GLYPH (wc); +} + +/** + * pango_win32_render_layout_line: + * @hdc: DC to use for drawing + * @line: a #PangoLayoutLine + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * + * Render a #PangoLayoutLine onto a device context. For underlining to + * work property the text alignment of the DC should have TA_BASELINE + * and TA_LEFT. + */ +void +pango_win32_render_layout_line (HDC hdc, + PangoLayoutLine *line, + int x, + int y) +{ + GSList *tmp_list = line->runs; + PangoRectangle overall_rect; + PangoRectangle logical_rect; + PangoRectangle ink_rect; + int oldbkmode = SetBkMode (hdc, TRANSPARENT); + + int x_off = 0; + + pango_layout_line_get_extents (line,NULL, &overall_rect); + + while (tmp_list) + { + COLORREF oldfg = 0; + HPEN uline_pen, old_pen; + POINT points[2]; + PangoUnderline uline = PANGO_UNDERLINE_NONE; + PangoLayoutRun *run = tmp_list->data; + PangoAttrColor fg_color, bg_color, uline_color; + gboolean fg_set, bg_set, uline_set; + + tmp_list = tmp_list->next; + + pango_win32_get_item_properties (run->item, &uline, &uline_color, &uline_set, &fg_color, &fg_set, &bg_color, &bg_set); + if (!uline_set) + uline_color = fg_color; + + if (uline == PANGO_UNDERLINE_NONE) + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, + NULL, &logical_rect); + else + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, + &ink_rect, &logical_rect); + + if (bg_set) + { + COLORREF bg_col = RGB ((bg_color.color.red) >> 8, + (bg_color.color.green) >> 8, + (bg_color.color.blue) >> 8); + HBRUSH bg_brush = CreateSolidBrush (bg_col); + HBRUSH old_brush = SelectObject (hdc, bg_brush); + old_pen = SelectObject (hdc, GetStockObject (NULL_PEN)); + Rectangle (hdc, x + PANGO_PIXELS (x_off + logical_rect.x), + y + PANGO_PIXELS (overall_rect.y), + 1 + x + PANGO_PIXELS (x_off + logical_rect.x + logical_rect.width), + 1 + y + PANGO_PIXELS (overall_rect.y + overall_rect.height)); + SelectObject (hdc, old_brush); + DeleteObject (bg_brush); + SelectObject (hdc, old_pen); + } + + if (fg_set) + { + COLORREF fg_col = RGB ((fg_color.color.red) >> 8, + (fg_color.color.green) >> 8, + (fg_color.color.blue) >> 8); + oldfg = SetTextColor (hdc, fg_col); + } + + pango_win32_render (hdc, run->item->analysis.font, run->glyphs, + x + PANGO_PIXELS (x_off), y); + + if (fg_set) + SetTextColor (hdc, oldfg); + + if (uline != PANGO_UNDERLINE_NONE) + { + COLORREF uline_col = RGB ((uline_color.color.red) >> 8, + (uline_color.color.green) >> 8, + (uline_color.color.blue) >> 8); + uline_pen = CreatePen (PS_SOLID, 1, uline_col); + old_pen = SelectObject (hdc, uline_pen); + } + + switch (uline) + { + case PANGO_UNDERLINE_NONE: + break; + case PANGO_UNDERLINE_DOUBLE: + points[0].x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + points[0].y = points[1].y = y + 4; + points[1].x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); + Polyline (hdc, points, 2); + points[0].y = points[1].y = y + 2; + Polyline (hdc, points, 2); + break; + case PANGO_UNDERLINE_SINGLE: + points[0].x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + points[0].y = points[1].y = y + 2; + points[1].x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); + Polyline (hdc, points, 2); + break; + case PANGO_UNDERLINE_ERROR: + { + int point_x; + int counter = 0; + int end_x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); + + for (point_x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + point_x <= end_x; + point_x += 2) + { + points[0].x = point_x; + points[1].x = MAX (point_x + 1, end_x); + + if (counter) + points[0].y = points[1].y = y + 2; + else + points[0].y = points[1].y = y + 3; + + Polyline (hdc, points, 2); + counter = (counter + 1) % 2; + } + } + break; + case PANGO_UNDERLINE_LOW: + points[0].x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + points[0].y = points[1].y = y + PANGO_PIXELS (ink_rect.y + ink_rect.height) + 2; + points[1].x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); + Polyline (hdc, points, 2); + break; + } + + if (uline != PANGO_UNDERLINE_NONE) + { + SelectObject (hdc, old_pen); + DeleteObject (uline_pen); + } + + x_off += logical_rect.width; + } + + SetBkMode (hdc, oldbkmode); +} + +/** + * pango_win32_render_layout: + * @hdc: HDC to use for drawing + * @layout: a #PangoLayout + * @x: the X position of the left of the layout (in pixels) + * @y: the Y position of the top of the layout (in pixels) + * + * Render a #PangoLayoutLine onto an X drawable + */ +void +pango_win32_render_layout (HDC hdc, + PangoLayout *layout, + int x, + int y) +{ + PangoLayoutIter *iter; + + g_return_if_fail (hdc != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + iter = pango_layout_get_iter (layout); + + do + { + PangoRectangle logical_rect; + PangoLayoutLine *line; + int baseline; + + line = pango_layout_iter_get_line_readonly (iter); + + pango_layout_iter_get_line_extents (iter, NULL, &logical_rect); + baseline = pango_layout_iter_get_baseline (iter); + + pango_win32_render_layout_line (hdc, + line, + x + PANGO_PIXELS (logical_rect.x), + y + PANGO_PIXELS (baseline)); + } + while (pango_layout_iter_next_line (iter)); + + pango_layout_iter_free (iter); +} + +/* This utility function is duplicated here and in pango-layout.c; should it be + * public? Trouble is - what is the appropriate set of properties? + */ +static void +pango_win32_get_item_properties (PangoItem *item, + PangoUnderline *uline, + PangoAttrColor *uline_color, + gboolean *uline_set, + PangoAttrColor *fg_color, + gboolean *fg_set, + PangoAttrColor *bg_color, + gboolean *bg_set) +{ + GSList *tmp_list = item->analysis.extra_attrs; + + if (fg_set) + *fg_set = FALSE; + + if (bg_set) + *bg_set = FALSE; + + while (tmp_list) + { + PangoAttribute *attr = tmp_list->data; + + switch (attr->klass->type) + { + case PANGO_ATTR_UNDERLINE: + if (uline) + *uline = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_UNDERLINE_COLOR: + if (uline_color) + *uline_color = *((PangoAttrColor *)attr); + if (uline_set) + *uline_set = TRUE; + + break; + + case PANGO_ATTR_FOREGROUND: + if (fg_color) + *fg_color = *((PangoAttrColor *)attr); + if (fg_set) + *fg_set = TRUE; + + break; + + case PANGO_ATTR_BACKGROUND: + if (bg_color) + *bg_color = *((PangoAttrColor *)attr); + if (bg_set) + *bg_set = TRUE; + + break; + + default: + break; + } + tmp_list = tmp_list->next; + } +} + +static guint +get_cmap_offset (HDC hdc, + guint16 encoding_id) +{ + guint16 n_tables; + struct cmap_encoding_subtable *table; + gint32 res; + int i; + guint32 offset; + + /* Get The number of encoding tables, at offset 2 */ + res = GetFontData (hdc, CMAP, 2, &n_tables, 2); + if (res != 2) + return 0; + + n_tables = GUINT16_FROM_BE (n_tables); + + table = g_malloc (ENCODING_TABLE_SIZE*n_tables); + + res = GetFontData (hdc, CMAP, CMAP_HEADER_SIZE, table, ENCODING_TABLE_SIZE*n_tables); + if (res != ENCODING_TABLE_SIZE*n_tables) + return 0; + + for (i = 0; i < n_tables; i++) + { + if (table[i].platform_id == GUINT16_TO_BE (MICROSOFT_PLATFORM_ID) && + table[i].encoding_id == GUINT16_TO_BE (encoding_id)) + { + offset = GUINT32_FROM_BE (table[i].offset); + g_free (table); + return offset; + } + } + g_free (table); + return 0; +} + +static gpointer +get_format_4_cmap (HDC hdc) +{ + guint32 offset; + guint32 res; + guint16 length; + guint16 *tbl, *tbl_end; + struct format_4_cmap *table; + + /* FIXME: Could look here at the CRC for the font in the DC + and return a cached copy if the same */ + + offset = get_cmap_offset (hdc, UNICODE_ENCODING_ID); + if (offset == 0) + return NULL; + + res = GetFontData (hdc, CMAP, offset + 2, &length, 2); + if (res != 2) + return NULL; + length = GUINT16_FROM_BE (length); + + table = g_malloc (length); + + res = GetFontData (hdc, CMAP, offset, table, length); + if (res != length || + GUINT16_FROM_BE (table->format) != 4 || + (GUINT16_FROM_BE (table->length) % 2) != 0) + { + g_free (table); + return NULL; + } + + table->format = GUINT16_FROM_BE (table->format); + table->length = GUINT16_FROM_BE (table->length); + table->language = GUINT16_FROM_BE (table->language); + table->seg_count_x_2 = GUINT16_FROM_BE (table->seg_count_x_2); + table->search_range = GUINT16_FROM_BE (table->search_range); + table->entry_selector = GUINT16_FROM_BE (table->entry_selector); + table->range_shift = GUINT16_FROM_BE (table->range_shift); + + tbl_end = (guint16 *)((char *)table + length); + tbl = &table->reserved; + + while (tbl < tbl_end) + { + *tbl = GUINT16_FROM_BE (*tbl); + tbl++; + } + + return table; +} + +static guint16 * +get_id_range_offset (struct format_4_cmap *table) +{ + gint32 seg_count = table->seg_count_x_2/2; + return &table->arrays[seg_count*3]; +} + +static guint16 * +get_id_delta (struct format_4_cmap *table) +{ + gint32 seg_count = table->seg_count_x_2/2; + return &table->arrays[seg_count*2]; +} + +static guint16 * +get_start_count (struct format_4_cmap *table) +{ + gint32 seg_count = table->seg_count_x_2/2; + return &table->arrays[seg_count*1]; +} + +static guint16 * +get_end_count (struct format_4_cmap *table) +{ + gint32 seg_count = table->seg_count_x_2/2; + /* Apparently the reseved spot is not reserved for + the end_count array!? */ + return (&table->arrays[seg_count*0])-1; +} + +static gboolean +find_segment (struct format_4_cmap *table, + guint16 wc, + guint16 *segment) +{ + guint16 start, end, i; + guint16 seg_count = table->seg_count_x_2/2; + guint16 *end_count = get_end_count (table); + guint16 *start_count = get_start_count (table); + static guint last = 0; /* Cache of one */ /* MT-safe */ + + if (last < seg_count && + wc >= start_count[last] && + wc <= end_count[last]) + { + *segment = last; + return TRUE; + } + + + /* Binary search for the segment */ + start = 0; /* inclusive */ + end = seg_count; /* not inclusive */ + while (start < end) + { + /* Look at middle pos */ + i = (start + end)/2; + + if (i == start) + { + /* We made no progress. Look if this is the one. */ + + if (wc >= start_count[i] && + wc <= end_count[i]) + { + *segment = i; + last = i; + return TRUE; + } + else + return FALSE; + } + else if (wc < start_count[i]) + { + end = i; + } + else if (wc > end_count[i]) + { + start = i; + } + else + { + /* Found it! */ + *segment = i; + last = i; + return TRUE; + } + } + return FALSE; +} + +static gpointer +get_format_12_cmap (HDC hdc) +{ + guint32 offset; + guint32 res; + guint32 length; + guint32 *tbl, *tbl_end; + struct format_12_cmap *table; + + offset = get_cmap_offset (hdc, UCS4_ENCODING_ID); + if (offset == 0) + return NULL; + + res = GetFontData (hdc, CMAP, offset + 4, &length, 4); + if (res != 4) + return NULL; + length = GUINT32_FROM_BE (length); + + table = g_malloc (length); + + res = GetFontData (hdc, CMAP, offset, table, length); + if (res != length) + { + g_free (table); + return NULL; + } + + table->format = GUINT16_FROM_BE (table->format); + table->length = GUINT32_FROM_BE (table->length); + table->language = GUINT32_FROM_BE (table->language); + table->count = GUINT32_FROM_BE (table->count); + + if (table->format != 12 || + (table->length % 4) != 0 || + table->length > length || + table->length < 16 + table->count * 12) + { + g_free (table); + return NULL; + } + + tbl_end = (guint32 *) ((char *) table + length); + tbl = table->groups; + + while (tbl < tbl_end) + { + *tbl = GUINT32_FROM_BE (*tbl); + tbl++; + } + + return table; +} + +static gpointer +font_get_cmap (PangoFont *font) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + gpointer cmap; + + if (win32font->win32face->cmap) + return win32font->win32face->cmap; + + pango_win32_font_select_font (font, _pango_win32_hdc); + + /* Prefer the format 12 cmap */ + if ((cmap = get_format_12_cmap (_pango_win32_hdc)) != NULL) + { + win32font->win32face->cmap_format = 12; + win32font->win32face->cmap = cmap; + } + else if ((cmap = get_format_4_cmap (_pango_win32_hdc)) != NULL) + { + win32font->win32face->cmap_format = 4; + win32font->win32face->cmap = cmap; + } + + pango_win32_font_done_font (font); + + return cmap; +} + +static gint +pango_win32_font_get_type1_glyph_index (PangoFont *font, + gunichar wc) +{ + wchar_t unicode[2]; + WORD glyph_index; + gint32 res; + + unicode[0] = wc; + unicode[1] = 0; + pango_win32_font_select_font (font, _pango_win32_hdc); + res = GetGlyphIndicesW (_pango_win32_hdc, unicode, 1, &glyph_index, 0); + pango_win32_font_done_font (font); + + if (res == 1) + return glyph_index; + else + return 0; +} + +/** + * pango_win32_font_get_glyph_index: + * @font: a #PangoFont. + * @wc: a Unicode character. + * + * Obtains the index of the glyph for @wc in @font, or 0, if not + * covered. + * + * Return value: the glyph index for @wc. + **/ +gint +pango_win32_font_get_glyph_index (PangoFont *font, + gunichar wc) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + gpointer cmap; + guint16 glyph; + + if (win32font->win32face->has_cmap) + { + /* Do GetFontData magic on font->hfont here. */ + cmap = font_get_cmap (font); + if (cmap == NULL) + win32font->win32face->has_cmap = FALSE; + } + + if (!win32font->win32face->has_cmap) + return pango_win32_font_get_type1_glyph_index (font, wc); + + if (win32font->win32face->cmap_format == 4) + { + struct format_4_cmap *cmap4 = cmap; + guint16 *id_range_offset; + guint16 *id_delta; + guint16 *start_count; + guint16 segment; + guint16 id; + guint16 ch = wc; + + if (wc > 0xFFFF) + return 0; + + if (!find_segment (cmap4, ch, &segment)) + return 0; + + id_range_offset = get_id_range_offset (cmap4); + id_delta = get_id_delta (cmap4); + start_count = get_start_count (cmap4); + + if (id_range_offset[segment] == 0) + glyph = (id_delta[segment] + ch) % 65536; + else + { + id = *(id_range_offset[segment]/2 + + (ch - start_count[segment]) + + &id_range_offset[segment]); + if (id) + glyph = (id_delta[segment] + id) %65536; + else + glyph = 0; + } + } + else if (win32font->win32face->cmap_format == 12) + { + struct format_12_cmap *cmap12 = cmap; + guint32 i; + + glyph = 0; + for (i = 0; i < cmap12->count; i++) + { + if (cmap12->groups[i*3+0] <= wc && wc <= cmap12->groups[i*3+1]) + { + glyph = cmap12->groups[i*3+2] + (wc - cmap12->groups[i*3+0]); + break; + } + } + } + else + g_assert_not_reached (); + + return glyph; +} + +gboolean +_pango_win32_get_name_header (HDC hdc, + struct name_header *header) +{ + if (GetFontData (hdc, NAME, 0, header, sizeof (*header)) != sizeof (*header)) + return FALSE; + + header->num_records = GUINT16_FROM_BE (header->num_records); + header->string_storage_offset = GUINT16_FROM_BE (header->string_storage_offset); + + return TRUE; +} + +gboolean +_pango_win32_get_name_record (HDC hdc, + gint i, + struct name_record *record) +{ + if (GetFontData (hdc, NAME, 6 + i * sizeof (*record), + record, sizeof (*record)) != sizeof (*record)) + return FALSE; + + record->platform_id = GUINT16_FROM_BE (record->platform_id); + record->encoding_id = GUINT16_FROM_BE (record->encoding_id); + record->language_id = GUINT16_FROM_BE (record->language_id); + record->name_id = GUINT16_FROM_BE (record->name_id); + record->string_length = GUINT16_FROM_BE (record->string_length); + record->string_offset = GUINT16_FROM_BE (record->string_offset); + + return TRUE; +} + +static gboolean +font_has_name_in (PangoFont *font, + PangoWin32CoverageLanguageClass cjkv) +{ + HFONT hfont, oldhfont; + struct name_header header; + struct name_record record; + gint i; + gboolean retval = FALSE; + + if (cjkv == PANGO_WIN32_COVERAGE_UNSPEC) + return TRUE; + + hfont = _pango_win32_font_get_hfont (font); + oldhfont = SelectObject (_pango_win32_hdc, hfont); + + if (!_pango_win32_get_name_header (_pango_win32_hdc, &header)) + { + SelectObject (_pango_win32_hdc, oldhfont); + return FALSE; + } + + for (i = 0; i < header.num_records; i++) + { + if (!_pango_win32_get_name_record (_pango_win32_hdc, i, &record)) + { + SelectObject (_pango_win32_hdc, oldhfont); + return FALSE; + } + + if ((record.name_id != 1 && record.name_id != 16) || record.string_length <= 0) + continue; + + PING (("platform:%d encoding:%d language:%04x name_id:%d", + record.platform_id, record.encoding_id, record.language_id, record.name_id)); + + if (record.platform_id == MICROSOFT_PLATFORM_ID) + if ((cjkv == PANGO_WIN32_COVERAGE_ZH_TW && + record.language_id == MAKELANGID (LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)) + || + (cjkv == PANGO_WIN32_COVERAGE_ZH_CN && + record.language_id == MAKELANGID (LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)) + || + (cjkv == PANGO_WIN32_COVERAGE_JA && + PRIMARYLANGID (record.language_id) == LANG_JAPANESE) + || + (cjkv == PANGO_WIN32_COVERAGE_KO && + PRIMARYLANGID (record.language_id) == LANG_KOREAN) + || + (cjkv == PANGO_WIN32_COVERAGE_VI && + PRIMARYLANGID (record.language_id) == LANG_VIETNAMESE)) + { + PING (("yep:%d:%04x", cjkv, record.language_id)); + retval = TRUE; + break; + } + } + + SelectObject (_pango_win32_hdc, oldhfont); + return retval; +} + +static void +pango_win32_font_calc_type1_coverage (PangoFont *font, + PangoCoverage *coverage, + PangoLanguage *lang) +{ + GLYPHSET *glyph_set; + gint32 res; + guint32 ch; + guint32 i; + + pango_win32_font_select_font (font, _pango_win32_hdc); + res = GetFontUnicodeRanges(_pango_win32_hdc, NULL); + if (res == 0) + goto fail1; + + glyph_set = g_malloc (res); + res = GetFontUnicodeRanges(_pango_win32_hdc, glyph_set); + if (res == 0) + goto fail2; + + for (i = 0; i < glyph_set->cRanges; i++) + { + guint32 end = glyph_set->ranges[i].wcLow + glyph_set->ranges[i].cGlyphs; + + for (ch = glyph_set->ranges[i].wcLow; ch < end; ch++) + if (CH_IS_UNIHAN_BMP (ch)) + pango_coverage_set (coverage, ch, PANGO_COVERAGE_APPROXIMATE); + else + pango_coverage_set (coverage, ch, PANGO_COVERAGE_EXACT); + } + + fail2: + g_free (glyph_set); + + fail1: + pango_win32_font_done_font (font); +} + +static void +pango_win32_font_calc_coverage (PangoFont *font, + PangoCoverage *coverage, + PangoLanguage *lang) +{ + PangoWin32Font *win32font = (PangoWin32Font *)font; + gpointer cmap; + guint32 ch; + guint32 i; + PangoWin32CoverageLanguageClass cjkv; + gboolean hide_unihan = FALSE; + PangoFontDescription *desc; + gchar *name; + + desc = pango_font_describe (font); + name = pango_font_description_to_string (desc); + PING (("font:%s lang:%s", name, + pango_language_to_string (lang))); + g_free (name); + pango_font_description_free (desc); + + if (win32font->win32face->has_cmap) + { + /* Do GetFontData magic on font->hfont here. */ + cmap = font_get_cmap (font); + if (cmap == NULL) + win32font->win32face->has_cmap = FALSE; + } + + if (!win32font->win32face->has_cmap) + { + pango_win32_font_calc_type1_coverage (font, coverage, lang); + return; + } + + cjkv = pango_win32_coverage_language_classify (lang); + + if (cjkv != PANGO_WIN32_COVERAGE_UNSPEC && !font_has_name_in (font, cjkv)) + { + PING (("hiding UniHan chars")); + hide_unihan = TRUE; + } + + PING (("coverage:")); + if (win32font->win32face->cmap_format == 4) + { + struct format_4_cmap *cmap4 = cmap; + guint16 *id_range_offset; + guint16 *start_count; + guint16 *end_count; + guint16 seg_count; + guint16 id; + + seg_count = cmap4->seg_count_x_2/2; + end_count = get_end_count (cmap4); + start_count = get_start_count (cmap4); + id_range_offset = get_id_range_offset (cmap4); + + for (i = 0; i < seg_count; i++) + { + if (id_range_offset[i] == 0) + { +#ifdef PANGO_WIN32_DEBUGGING + if (_pango_win32_debug) + { + if (end_count[i] == start_count[i]) + g_print ("%04x ", start_count[i]); + else + g_print ("%04x:%04x ", start_count[i], end_count[i]); + } +#endif + for (ch = start_count[i]; ch <= end_count[i]; ch++) + if (hide_unihan && CH_IS_UNIHAN_BMP (ch)) + pango_coverage_set (coverage, ch, PANGO_COVERAGE_APPROXIMATE); + else + pango_coverage_set (coverage, ch, PANGO_COVERAGE_EXACT); + } + else + { +#ifdef PANGO_WIN32_DEBUGGING + guint32 ch0 = G_MAXUINT; +#endif + for (ch = start_count[i]; ch <= end_count[i]; ch++) + { + if (ch == 0xFFFF) + break; + + id = *(id_range_offset[i]/2 + + (ch - start_count[i]) + + &id_range_offset[i]); + if (id) + { +#ifdef PANGO_WIN32_DEBUGGING + if (ch0 == G_MAXUINT) + ch0 = ch; +#endif + if (hide_unihan && CH_IS_UNIHAN_BMP (ch)) + pango_coverage_set (coverage, ch, PANGO_COVERAGE_APPROXIMATE); + else + pango_coverage_set (coverage, ch, PANGO_COVERAGE_EXACT); + } +#ifdef PANGO_WIN32_DEBUGGING + else if (ch0 < G_MAXUINT) + { + if (_pango_win32_debug) + { + if (ch > ch0 + 2) + g_print ("%04x:%04x ", ch0, ch - 1); + else + g_print ("%04x ", ch0); + } + ch0 = G_MAXUINT; + } +#endif + } +#ifdef PANGO_WIN32_DEBUGGING + if (ch0 < G_MAXUINT) + { + if (_pango_win32_debug) + { + if (ch > ch0 + 2) + g_print ("%04x:%04x ", ch0, ch - 1); + else + g_print ("%04x ", ch0); + } + } +#endif + } + } + } + else if (win32font->win32face->cmap_format == 12) + { + struct format_12_cmap *cmap12 = cmap; + + for (i = 0; i < cmap12->count; i++) + { +#ifdef PANGO_WIN32_DEBUGGING + if (_pango_win32_debug) + { + if (cmap12->groups[i*3+0] == cmap12->groups[i*3+1]) + g_print ("%04x ", cmap12->groups[i*3+0]); + else + g_print ("%04x:%04x ", cmap12->groups[i*3+0], cmap12->groups[i*3+1]); + } +#endif + for (ch = cmap12->groups[i*3+0]; ch <= cmap12->groups[i*3+1]; ch++) + { + if (hide_unihan && CH_IS_UNIHAN (ch)) + pango_coverage_set (coverage, ch, PANGO_COVERAGE_APPROXIMATE); + else + pango_coverage_set (coverage, ch, PANGO_COVERAGE_EXACT); + } + } + } + else + g_assert_not_reached (); +#ifdef PANGO_WIN32_DEBUGGING + if (_pango_win32_debug) + g_print ("\n"); +#endif +} diff --git a/pango/pangowin32.h b/pango/pangowin32.h new file mode 100644 index 0000000..c9b440c --- /dev/null +++ b/pango/pangowin32.h @@ -0,0 +1,150 @@ +/* Pango + * pangowin32.h: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 Tor Lillqvist + * Copyright (C) 2001 Alexander Larsson + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOWIN32_H__ +#define __PANGOWIN32_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define STRICT +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 /* To get ClearType-related macros */ +#endif +#include +#undef STRICT + +/** + * PANGO_RENDER_TYPE_WIN32: + * + * A string constant identifying the Win32 renderer. The associated quark (see + * g_quark_from_string()) is used to identify the renderer in pango_find_map(). + */ +#define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32" + +/* Calls for applications + */ +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(pango_font_map_create_context) +PangoContext * pango_win32_get_context (void); +#endif + +PANGO_AVAILABLE_IN_ALL +void pango_win32_render (HDC hdc, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y); +PANGO_AVAILABLE_IN_ALL +void pango_win32_render_layout_line (HDC hdc, + PangoLayoutLine *line, + int x, + int y); +PANGO_AVAILABLE_IN_ALL +void pango_win32_render_layout (HDC hdc, + PangoLayout *layout, + int x, + int y); + +PANGO_AVAILABLE_IN_ALL +void pango_win32_render_transformed (HDC hdc, + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); + +#ifdef PANGO_ENABLE_ENGINE + +/* For shape engines + */ + +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) +PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font, + gunichar wc); +#endif /* PANGO_DISABLE_DEPRECATED */ +PANGO_AVAILABLE_IN_ALL +gint pango_win32_font_get_glyph_index(PangoFont *font, + gunichar wc); + +PANGO_AVAILABLE_IN_ALL +HDC pango_win32_get_dc (void); + +PANGO_AVAILABLE_IN_1_2 +gboolean pango_win32_get_debug_flag (void); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_win32_font_select_font (PangoFont *font, + HDC hdc); +PANGO_AVAILABLE_IN_ALL +void pango_win32_font_done_font (PangoFont *font); +PANGO_AVAILABLE_IN_ALL +double pango_win32_font_get_metrics_factor (PangoFont *font); + +#endif + +/* API for libraries that want to use PangoWin32 mixed with classic + * Win32 fonts. + */ +typedef struct _PangoWin32FontCache PangoWin32FontCache; + +PANGO_AVAILABLE_IN_ALL +PangoWin32FontCache *pango_win32_font_cache_new (void); +PANGO_AVAILABLE_IN_ALL +void pango_win32_font_cache_free (PangoWin32FontCache *cache); + +PANGO_AVAILABLE_IN_ALL +HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache, + const LOGFONTA *logfont); +PANGO_AVAILABLE_IN_1_16 +HFONT pango_win32_font_cache_loadw (PangoWin32FontCache *cache, + const LOGFONTW *logfont); +PANGO_AVAILABLE_IN_ALL +void pango_win32_font_cache_unload (PangoWin32FontCache *cache, + HFONT hfont); + +PANGO_AVAILABLE_IN_ALL +PangoFontMap *pango_win32_font_map_for_display (void); +PANGO_AVAILABLE_IN_ALL +void pango_win32_shutdown_display (void); +PANGO_AVAILABLE_IN_ALL +PangoWin32FontCache *pango_win32_font_map_get_font_cache (PangoFontMap *font_map); + +PANGO_AVAILABLE_IN_ALL +LOGFONTA *pango_win32_font_logfont (PangoFont *font); +PANGO_AVAILABLE_IN_1_16 +LOGFONTW *pango_win32_font_logfontw (PangoFont *font); + +PANGO_AVAILABLE_IN_1_12 +PangoFontDescription *pango_win32_font_description_from_logfont (const LOGFONTA *lfp); + +PANGO_AVAILABLE_IN_1_16 +PangoFontDescription *pango_win32_font_description_from_logfontw (const LOGFONTW *lfp); + +G_END_DECLS + +#endif /* __PANGOWIN32_H__ */ diff --git a/pango/pangowin32.rc b/pango/pangowin32.rc new file mode 100644 index 0000000..35711e6 --- /dev/null +++ b/pango/pangowin32.rc @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,42,4,0 + PRODUCTVERSION 1,42,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoWin32" + VALUE "FileVersion", "1.42.4.0" + VALUE "InternalName", "pangowin32-1.0-0" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software. Copyright 2000 Tor Lillqvist" + VALUE "OriginalFilename", "pangowin32-1.0-0.dll" + VALUE "ProductName", "PangoWin32" + VALUE "ProductVersion", "1.42.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangowin32.rc.in b/pango/pangowin32.rc.in new file mode 100644 index 0000000..fb020a0 --- /dev/null +++ b/pango/pangowin32.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoWin32" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pangowin32-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright 1999 Red Hat Software. Copyright 2000 Tor Lillqvist" + VALUE "OriginalFilename", "pangowin32-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "PangoWin32" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c new file mode 100644 index 0000000..9185630 --- /dev/null +++ b/pango/pangoxft-font.c @@ -0,0 +1,649 @@ +/* Pango + * pangoxft-font.c: Routines for handling X fonts + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:xft-fonts + * @short_description:Font handling and rendering with the Xft backend + * @title:Xft Fonts and Rendering + * + * The Xft library is a library for displaying fonts on the X window + * system; internally it uses the fontconfig library to locate font + * files, and the FreeType library to load and render fonts. The + * Xft backend is the recommended Pango font backend for screen + * display with X. (The Cairo back end is another possibility.) + * + * Using the Xft backend is generally straightforward; + * pango_xft_get_context() creates a context for a specified display + * and screen. You can then create a #PangoLayout with that context + * and render it with pango_xft_render_layout(). At a more advanced + * level, the low-level fontconfig options used for rendering fonts + * can be affected using pango_xft_set_default_substitute(), and + * pango_xft_substitute_changed(). + * + * A range of functions for drawing pieces of a layout, such as + * individual layout lines and glyphs strings are provided. You can also + * directly create a #PangoXftRenderer. Finally, in some advanced cases, it + * is useful to derive from #PangoXftRenderer. Deriving from + * #PangoXftRenderer is useful for two reasons. One reason is be to + * support custom attributes by overriding #PangoRendererClass virtual + * functions like 'prepare_run' or 'draw_shape'. The reason is to + * customize exactly how the final bits are drawn to the destination by + * overriding the #PangoXftRendererClass virtual functions + * 'composite_glyphs' and 'composite_trapezoids'. + */ +#include "config.h" + +#include + +#include "pangofc-fontmap.h" +#include "pangoxft-private.h" +#include "pangofc-private.h" + +#define PANGO_XFT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_FONT, PangoXftFontClass)) +#define PANGO_XFT_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_XFT_FONT)) +#define PANGO_XFT_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_XFT_FONT, PangoXftFontClass)) + +typedef struct _PangoXftFontClass PangoXftFontClass; + +struct _PangoXftFontClass +{ + PangoFcFontClass parent_class; +}; + +static void pango_xft_font_finalize (GObject *object); + +static void pango_xft_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +static FT_Face pango_xft_font_real_lock_face (PangoFcFont *font); +static void pango_xft_font_real_unlock_face (PangoFcFont *font); +static gboolean pango_xft_font_real_has_char (PangoFcFont *font, + gunichar wc); +static guint pango_xft_font_real_get_glyph (PangoFcFont *font, + gunichar wc); +static void pango_xft_font_real_shutdown (PangoFcFont *font); + +static XftFont *xft_font_get_font (PangoFont *font); + +G_DEFINE_TYPE (PangoXftFont, pango_xft_font, PANGO_TYPE_FC_FONT) + +static void +pango_xft_font_class_init (PangoXftFontClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + PangoFontClass *font_class = PANGO_FONT_CLASS (class); + PangoFcFontClass *fc_font_class = PANGO_FC_FONT_CLASS (class); + + object_class->finalize = pango_xft_font_finalize; + + font_class->get_glyph_extents = pango_xft_font_get_glyph_extents; + + fc_font_class->lock_face = pango_xft_font_real_lock_face; + fc_font_class->unlock_face = pango_xft_font_real_unlock_face; + fc_font_class->has_char = pango_xft_font_real_has_char; + fc_font_class->get_glyph = pango_xft_font_real_get_glyph; + fc_font_class->shutdown = pango_xft_font_real_shutdown; +} + +static void +pango_xft_font_init (PangoXftFont *xftfont G_GNUC_UNUSED) +{ +} + +PangoXftFont * +_pango_xft_font_new (PangoXftFontMap *xftfontmap, + FcPattern *pattern) +{ + PangoFontMap *fontmap = PANGO_FONT_MAP (xftfontmap); + PangoXftFont *xfont; + + g_return_val_if_fail (fontmap != NULL, NULL); + g_return_val_if_fail (pattern != NULL, NULL); + + xfont = (PangoXftFont *)g_object_new (PANGO_TYPE_XFT_FONT, + "pattern", pattern, + "fontmap", fontmap, + NULL); + + /* Hack to force hinting of vertical metrics; hinting off for + * a Xft font just means to not hint outlines, but we still + * want integer line spacing, underline positions, etc + */ + PANGO_FC_FONT (xfont)->is_hinted = TRUE; + + xfont->xft_font = NULL; + + return xfont; +} + +/** + * _pango_xft_font_get_mini_font: + * @xfont: a #PangoXftFont + * + * Gets the font used for drawing the digits in the + * missing-character hex squares + * + * Return value: the #PangoFont used for the digits; this + * value is associated with the main font and will be freed + * along with the main font. + **/ +PangoFont * +_pango_xft_font_get_mini_font (PangoXftFont *xfont) +{ + PangoFcFont *fcfont = (PangoFcFont *)xfont; + + if (!fcfont || !fcfont->fontmap) + return NULL; + + if (!xfont->mini_font) + { + Display *display; + int screen; + PangoFontDescription *desc = pango_font_description_new (); + PangoContext *context; + int i; + int width = 0, height = 0; + XGlyphInfo extents; + XftFont *mini_xft; + int new_size; + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, &screen); + + context = pango_font_map_create_context (pango_xft_get_font_map (display, screen)); + pango_context_set_language (context, pango_language_from_string ("en")); + + pango_font_description_set_family_static (desc, "monospace"); + + new_size = pango_font_description_get_size (fcfont->description) / 2; + + if (pango_font_description_get_size_is_absolute (fcfont->description)) + pango_font_description_set_absolute_size (desc, new_size); + else + pango_font_description_set_size (desc, new_size); + + xfont->mini_font = pango_font_map_load_font (fcfont->fontmap, context, desc); + pango_font_description_free (desc); + g_object_unref (context); + + if (!xfont->mini_font) + return NULL; + + mini_xft = xft_font_get_font (xfont->mini_font); + + for (i = 0 ; i < 16 ; i++) + { + char c = i < 10 ? '0' + i : 'A' + i - 10; + XftTextExtents8 (display, mini_xft, (FcChar8 *) &c, 1, &extents); + width = MAX (width, extents.width); + height = MAX (height, extents.height); + } + + xfont->mini_width = PANGO_SCALE * width; + xfont->mini_height = PANGO_SCALE * height; + xfont->mini_pad = PANGO_SCALE * MIN (height / 2, MAX ((int)(2.2 * height + 27) / 28, 1)); + } + + return xfont->mini_font; +} + +static void +pango_xft_font_finalize (GObject *object) +{ + PangoXftFont *xfont = (PangoXftFont *)object; + PangoFcFont *fcfont = (PangoFcFont *)object; + + if (xfont->mini_font) + g_object_unref (xfont->mini_font); + + if (xfont->xft_font) + { + Display *display; + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, NULL); + XftFontClose (display, xfont->xft_font); + } + + if (xfont->glyph_info) + g_hash_table_destroy (xfont->glyph_info); + + G_OBJECT_CLASS (pango_xft_font_parent_class)->finalize (object); +} + +static void +get_glyph_extents_missing (PangoXftFont *xfont, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) + +{ + PangoFont *font = PANGO_FONT (xfont); + XftFont *xft_font = xft_font_get_font (font); + gunichar ch; + gint cols; + + ch = glyph & ~PANGO_GLYPH_UNKNOWN_FLAG; + + if (G_UNLIKELY (glyph == PANGO_GLYPH_INVALID_INPUT || ch > 0x10FFFF)) + cols = 1; + else + cols = ch > 0xffff ? 3 : 2; + + _pango_xft_font_get_mini_font (xfont); + + if (ink_rect) + { + ink_rect->x = 0; + ink_rect->y = - PANGO_SCALE * xft_font->ascent + PANGO_SCALE * (((xft_font->ascent + xft_font->descent) - (xfont->mini_height * 2 + xfont->mini_pad * 5 + PANGO_SCALE / 2) / PANGO_SCALE) / 2); + ink_rect->width = xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 1); + ink_rect->height = xfont->mini_height * 2 + xfont->mini_pad * 5; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = - PANGO_SCALE * xft_font->ascent; + logical_rect->width = xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 2); + logical_rect->height = (xft_font->ascent + xft_font->descent) * PANGO_SCALE; + } +} + +static void +get_glyph_extents_xft (PangoFcFont *fcfont, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + XftFont *xft_font = xft_font_get_font ((PangoFont *)fcfont); + XGlyphInfo extents; + Display *display; + FT_UInt ft_glyph = glyph; + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, NULL); + + XftGlyphExtents (display, xft_font, &ft_glyph, 1, &extents); + + if (ink_rect) + { + ink_rect->x = - extents.x * PANGO_SCALE; /* Xft crack-rock sign choice */ + ink_rect->y = - extents.y * PANGO_SCALE; /* " */ + ink_rect->width = extents.width * PANGO_SCALE; + ink_rect->height = extents.height * PANGO_SCALE; + } + + if (logical_rect) + { + logical_rect->x = 0; + logical_rect->y = - xft_font->ascent * PANGO_SCALE; + logical_rect->width = extents.xOff * PANGO_SCALE; + logical_rect->height = (xft_font->ascent + xft_font->descent) * PANGO_SCALE; + } +} + +typedef struct +{ + PangoRectangle ink_rect; + PangoRectangle logical_rect; +} Extents; + +static void +extents_free (Extents *ext) +{ + g_slice_free (Extents, ext); +} + +static void +get_glyph_extents_raw (PangoXftFont *xfont, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + Extents *extents; + + if (!xfont->glyph_info) + xfont->glyph_info = g_hash_table_new_full (NULL, NULL, + NULL, (GDestroyNotify)extents_free); + + extents = g_hash_table_lookup (xfont->glyph_info, + GUINT_TO_POINTER (glyph)); + + if (!extents) + { + extents = g_slice_new (Extents); + + pango_fc_font_get_raw_extents (PANGO_FC_FONT (xfont), + FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING, + glyph, + &extents->ink_rect, + &extents->logical_rect); + + g_hash_table_insert (xfont->glyph_info, + GUINT_TO_POINTER (glyph), + extents); + } + + if (ink_rect) + *ink_rect = extents->ink_rect; + + if (logical_rect) + *logical_rect = extents->logical_rect; +} + +static void +pango_xft_font_get_glyph_extents (PangoFont *font, + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) +{ + PangoXftFont *xfont = (PangoXftFont *)font; + PangoFcFont *fcfont = PANGO_FC_FONT (font); + gboolean empty = FALSE; + + if (G_UNLIKELY (!fcfont->fontmap)) /* Display closed */ + { + if (ink_rect) + ink_rect->x = ink_rect->width = ink_rect->y = ink_rect->height = 0; + if (logical_rect) + logical_rect->x = logical_rect->width = logical_rect->y = logical_rect->height = 0; + return; + } + + if (glyph == PANGO_GLYPH_EMPTY) + { + glyph = pango_fc_font_get_glyph (fcfont, ' '); + empty = TRUE; + } + + if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + get_glyph_extents_missing (xfont, glyph, ink_rect, logical_rect); + } + else + { + if (!fcfont->is_transformed) + get_glyph_extents_xft (fcfont, glyph, ink_rect, logical_rect); + else + get_glyph_extents_raw (xfont, glyph, ink_rect, logical_rect); + } + + if (empty) + { + if (ink_rect) + ink_rect->x = ink_rect->y = ink_rect->height = ink_rect->width = 0; + if (logical_rect) + logical_rect->x = logical_rect->width = 0; + return; + } +} + +static void +load_fallback_font (PangoXftFont *xfont) +{ + PangoFcFont *fcfont = PANGO_FC_FONT (xfont); + Display *display; + int screen; + XftFont *xft_font; + gboolean size_is_absolute; + double size; + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, &screen); + + size_is_absolute = pango_font_description_get_size_is_absolute (fcfont->description); + size = pango_font_description_get_size (fcfont->description) / PANGO_SCALE; + + xft_font = XftFontOpen (display, screen, + FC_FAMILY, FcTypeString, "sans", + size_is_absolute ? FC_PIXEL_SIZE : FC_SIZE, FcTypeDouble, size, + NULL); + + xfont->xft_font = xft_font; +} + +static XftFont * +xft_font_get_font (PangoFont *font) +{ + PangoXftFont *xfont; + PangoFcFont *fcfont; + Display *display; + int screen; + + xfont = (PangoXftFont *)font; + fcfont = (PangoFcFont *)font; + + if (G_UNLIKELY (xfont->xft_font == NULL)) + { + FcPattern *pattern = FcPatternDuplicate (fcfont->font_pattern); + FcPatternDel (pattern, FC_SPACING); + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, &screen); + + xfont->xft_font = XftFontOpenPattern (display, pattern); + if (!xfont->xft_font) + { + gchar *name = pango_font_description_to_string (fcfont->description); + g_warning ("Cannot open font file for font %s", name); + g_free (name); + + load_fallback_font (xfont); + } + } + + return xfont->xft_font; +} + +static FT_Face +pango_xft_font_real_lock_face (PangoFcFont *font) +{ + XftFont *xft_font = xft_font_get_font ((PangoFont *)font); + + return XftLockFace (xft_font); +} + +static void +pango_xft_font_real_unlock_face (PangoFcFont *font) +{ + XftFont *xft_font = xft_font_get_font ((PangoFont *)font); + + XftUnlockFace (xft_font); +} + +static gboolean +pango_xft_font_real_has_char (PangoFcFont *font, + gunichar wc) +{ + XftFont *xft_font = xft_font_get_font ((PangoFont *)font); + + return XftCharExists (NULL, xft_font, wc); +} + +static guint +pango_xft_font_real_get_glyph (PangoFcFont *font, + gunichar wc) +{ + XftFont *xft_font = xft_font_get_font ((PangoFont *)font); + + return XftCharIndex (NULL, xft_font, wc); +} + +static void +pango_xft_font_real_shutdown (PangoFcFont *fcfont) +{ + PangoXftFont *xfont = PANGO_XFT_FONT (fcfont); + + if (xfont->xft_font) + { + Display *display; + + _pango_xft_font_map_get_info (fcfont->fontmap, &display, NULL); + XftFontClose (display, xfont->xft_font); + xfont->xft_font = NULL; + } +} + +/** + * pango_xft_font_get_font: + * @font: (nullable): a #PangoFont. + * + * Returns the XftFont of a font. + * + * Return value: (nullable): the XftFont associated to @font, or %NULL + * if @font is %NULL. + **/ +XftFont * +pango_xft_font_get_font (PangoFont *font) +{ + if (G_UNLIKELY (!font)) + return NULL; + + return xft_font_get_font (font); +} + +/** + * pango_xft_font_get_display: + * @font: a #PangoFont. + * + * Returns the X display of the XftFont of a font. + * + * Return value: the X display of the XftFont associated to @font. + **/ +Display * +pango_xft_font_get_display (PangoFont *font) +{ + PangoFcFont *fcfont; + Display *display; + + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), NULL); + + fcfont = PANGO_FC_FONT (font); + _pango_xft_font_map_get_info (fcfont->fontmap, &display, NULL); + + return display; +} + +/** + * pango_xft_font_get_unknown_glyph: + * @font: a #PangoFont. + * @wc: the Unicode character for which a glyph is needed. + * + * Returns the index of a glyph suitable for drawing @wc as an + * unknown character. + * + * Use PANGO_GET_UNKNOWN_GLYPH() instead. + * + * Return value: a glyph index into @font. + **/ +PangoGlyph +pango_xft_font_get_unknown_glyph (PangoFont *font, + gunichar wc) +{ + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), PANGO_GLYPH_EMPTY); + + return PANGO_GET_UNKNOWN_GLYPH (wc); +} + +/** + * pango_xft_font_lock_face: + * @font: a #PangoFont. + * + * Gets the FreeType FT_Face associated with a font, + * This face will be kept around until you call + * pango_xft_font_unlock_face(). + * + * Use pango_fc_font_lock_face() instead. + * + * Return value: the FreeType FT_Face associated with @font. + * + * Since: 1.2 + **/ +FT_Face +pango_xft_font_lock_face (PangoFont *font) +{ + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), NULL); + + return pango_fc_font_lock_face (PANGO_FC_FONT (font)); +} + +/** + * pango_xft_font_unlock_face: + * @font: a #PangoFont. + * + * Releases a font previously obtained with + * pango_xft_font_lock_face(). + * + * Use pango_fc_font_unlock_face() instead. + * + * Since: 1.2 + **/ +void +pango_xft_font_unlock_face (PangoFont *font) +{ + g_return_if_fail (PANGO_XFT_IS_FONT (font)); + + pango_fc_font_unlock_face (PANGO_FC_FONT (font)); +} + +/** + * pango_xft_font_get_glyph: + * @font: a #PangoFont for the Xft backend + * @wc: Unicode codepoint to look up + * + * Gets the glyph index for a given Unicode character + * for @font. If you only want to determine + * whether the font has the glyph, use pango_xft_font_has_char(). + * + * Use pango_fc_font_get_glyph() instead. + * + * Return value: the glyph index, or 0, if the Unicode + * character does not exist in the font. + * + * Since: 1.2 + **/ +guint +pango_xft_font_get_glyph (PangoFont *font, + gunichar wc) +{ + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), 0); + + return pango_fc_font_get_glyph (PANGO_FC_FONT (font), wc); +} + +/** + * pango_xft_font_has_char: + * @font: a #PangoFont for the Xft backend + * @wc: Unicode codepoint to look up + * + * Determines whether @font has a glyph for the codepoint @wc. + * + * Use pango_fc_font_has_char() instead. + * + * Return value: %TRUE if @font has the requested codepoint. + * + * Since: 1.2 + **/ +gboolean +pango_xft_font_has_char (PangoFont *font, + gunichar wc) +{ + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), 0); + + return pango_fc_font_has_char (PANGO_FC_FONT (font), wc); +} diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c new file mode 100644 index 0000000..fd96816 --- /dev/null +++ b/pango/pangoxft-fontmap.c @@ -0,0 +1,433 @@ +/* Pango + * pangoxft-fontmap.c: Xft font handling + * + * Copyright (C) 2000-2003 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include + +#include "pangofc-fontmap.h" +#include "pangoxft.h" +#include "pangoxft-private.h" + +/* For XExtSetCloseDisplay */ +#include + +typedef struct _PangoXftFamily PangoXftFamily; +typedef struct _PangoXftFontMapClass PangoXftFontMapClass; + +#define PANGO_TYPE_XFT_FONT_MAP (pango_xft_font_map_get_type ()) +#define PANGO_XFT_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT_MAP, PangoXftFontMap)) +#define PANGO_XFT_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_FONT_MAP)) + +struct _PangoXftFontMap +{ + PangoFcFontMap parent_instance; + + guint serial; + + Display *display; + int screen; + + /* Function to call on prepared patterns to do final + * config tweaking. + */ + PangoXftSubstituteFunc substitute_func; + gpointer substitute_data; + GDestroyNotify substitute_destroy; + + PangoRenderer *renderer; +}; + +struct _PangoXftFontMapClass +{ + PangoFcFontMapClass parent_class; +}; + +static guint pango_xft_font_map_get_serial (PangoFontMap *fontmap); +static void pango_xft_font_map_changed (PangoFontMap *fontmap); +static void pango_xft_font_map_default_substitute (PangoFcFontMap *fcfontmap, + FcPattern *pattern); +static PangoFcFont * pango_xft_font_map_new_font (PangoFcFontMap *fcfontmap, + FcPattern *pattern); +static void pango_xft_font_map_finalize (GObject *object); + +G_LOCK_DEFINE_STATIC (fontmaps); +static GSList *fontmaps = NULL; /* MT-safe */ + +G_DEFINE_TYPE (PangoXftFontMap, pango_xft_font_map, PANGO_TYPE_FC_FONT_MAP) + +static void +pango_xft_font_map_class_init (PangoXftFontMapClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class); + PangoFcFontMapClass *fcfontmap_class = PANGO_FC_FONT_MAP_CLASS (class); + + gobject_class->finalize = pango_xft_font_map_finalize; + + fontmap_class->get_serial = pango_xft_font_map_get_serial; + fontmap_class->changed = pango_xft_font_map_changed; + + fcfontmap_class->default_substitute = pango_xft_font_map_default_substitute; + fcfontmap_class->new_font = pango_xft_font_map_new_font; +} + +static void +pango_xft_font_map_init (PangoXftFontMap *xftfontmap) +{ + xftfontmap->serial = 1; +} + +static void +pango_xft_font_map_finalize (GObject *object) +{ + PangoXftFontMap *xftfontmap = PANGO_XFT_FONT_MAP (object); + + if (xftfontmap->renderer) + g_object_unref (xftfontmap->renderer); + + G_LOCK (fontmaps); + fontmaps = g_slist_remove (fontmaps, object); + G_UNLOCK (fontmaps); + + if (xftfontmap->substitute_destroy) + xftfontmap->substitute_destroy (xftfontmap->substitute_data); + + G_OBJECT_CLASS (pango_xft_font_map_parent_class)->finalize (object); +} + + +static guint +pango_xft_font_map_get_serial (PangoFontMap *fontmap) +{ + PangoXftFontMap *xftfontmap = PANGO_XFT_FONT_MAP (fontmap); + + return xftfontmap->serial; +} + +static void +pango_xft_font_map_changed (PangoFontMap *fontmap) +{ + PangoXftFontMap *xftfontmap = PANGO_XFT_FONT_MAP (fontmap); + + xftfontmap->serial++; + if (xftfontmap->serial == 0) + xftfontmap->serial++; +} + +static PangoFontMap * +pango_xft_find_font_map (Display *display, + int screen) +{ + GSList *tmp_list; + + G_LOCK (fontmaps); + tmp_list = fontmaps; + while (tmp_list) + { + PangoXftFontMap *xftfontmap = tmp_list->data; + + if (xftfontmap->display == display && + xftfontmap->screen == screen) + { + G_UNLOCK (fontmaps); + return PANGO_FONT_MAP (xftfontmap); + } + + tmp_list = tmp_list->next; + } + G_UNLOCK (fontmaps); + + return NULL; +} + +/* + * Hackery to set up notification when a Display is closed + */ +static GSList *registered_displays; /* MT-safe, protected by fontmaps lock */ + +static int +close_display_cb (Display *display, + XExtCodes *extcodes G_GNUC_UNUSED) +{ + GSList *tmp_list; + + G_LOCK (fontmaps); + tmp_list = g_slist_copy (fontmaps); + G_UNLOCK (fontmaps); + + while (tmp_list) + { + PangoXftFontMap *xftfontmap = tmp_list->data; + tmp_list = tmp_list->next; + + if (xftfontmap->display == display) + pango_xft_shutdown_display (display, xftfontmap->screen); + } + + g_slist_free (tmp_list); + + registered_displays = g_slist_remove (registered_displays, display); + + return 0; +} + +static void +register_display (Display *display) +{ + XExtCodes *extcodes; + GSList *tmp_list; + + for (tmp_list = registered_displays; tmp_list; tmp_list = tmp_list->next) + { + if (tmp_list->data == display) + return; + } + + registered_displays = g_slist_prepend (registered_displays, display); + + extcodes = XAddExtension (display); + XESetCloseDisplay (display, extcodes->extension, close_display_cb); +} + +/** + * pango_xft_get_font_map: + * @display: an X display + * @screen: the screen number of a screen within @display + * + * Returns the #PangoXftFontMap for the given display and screen. + * The fontmap is owned by Pango and will be valid until + * the display is closed. + * + * Return value: (transfer none): a #PangoFontMap object, owned by Pango. + * + * Since: 1.2 + **/ +PangoFontMap * +pango_xft_get_font_map (Display *display, + int screen) +{ + PangoFontMap *fontmap; + PangoXftFontMap *xftfontmap; + + g_return_val_if_fail (display != NULL, NULL); + + fontmap = pango_xft_find_font_map (display, screen); + if (fontmap) + return fontmap; + +#if !GLIB_CHECK_VERSION (2, 35, 3) + /* Make sure that the type system is initialized */ + g_type_init (); +#endif + + xftfontmap = (PangoXftFontMap *)g_object_new (PANGO_TYPE_XFT_FONT_MAP, NULL); + + xftfontmap->display = display; + xftfontmap->screen = screen; + + G_LOCK (fontmaps); + + register_display (display); + + fontmaps = g_slist_prepend (fontmaps, xftfontmap); + + G_UNLOCK (fontmaps); + + return PANGO_FONT_MAP (xftfontmap); +} + +/** + * pango_xft_shutdown_display: + * @display: an X display + * @screen: the screen number of a screen within @display + * + * Release any resources that have been cached for the + * combination of @display and @screen. Note that when the + * X display is closed, resources are released automatically, + * without needing to call this function. + * + * Since: 1.2 + **/ +void +pango_xft_shutdown_display (Display *display, + int screen) +{ + PangoFontMap *fontmap; + + fontmap = pango_xft_find_font_map (display, screen); + if (fontmap) + { + PangoXftFontMap *xftfontmap = PANGO_XFT_FONT_MAP (fontmap); + + G_LOCK (fontmaps); + fontmaps = g_slist_remove (fontmaps, fontmap); + G_UNLOCK (fontmaps); + pango_fc_font_map_shutdown (PANGO_FC_FONT_MAP (fontmap)); + + xftfontmap->display = NULL; + g_object_unref (fontmap); + } +} + +/** + * pango_xft_set_default_substitute: + * @display: an X Display + * @screen: the screen number of a screen within @display + * @func: function to call to to do final config tweaking + * on #FcPattern objects. + * @data: data to pass to @func + * @notify: function to call when @data is no longer used. + * + * Sets a function that will be called to do final configuration + * substitution on a #FcPattern before it is used to load + * the font. This function can be used to do things like set + * hinting and antialiasing options. + * + * Since: 1.2 + **/ +void +pango_xft_set_default_substitute (Display *display, + int screen, + PangoXftSubstituteFunc func, + gpointer data, + GDestroyNotify notify) +{ + PangoXftFontMap *xftfontmap = (PangoXftFontMap *)pango_xft_get_font_map (display, screen); + + xftfontmap->serial++; + if (xftfontmap->serial == 0) + xftfontmap->serial++; + + if (xftfontmap->substitute_destroy) + xftfontmap->substitute_destroy (xftfontmap->substitute_data); + + xftfontmap->substitute_func = func; + xftfontmap->substitute_data = data; + xftfontmap->substitute_destroy = notify; + + pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (xftfontmap)); +} + +/** + * pango_xft_substitute_changed: + * @display: an X Display + * @screen: the screen number of a screen within @display + * + * Call this function any time the results of the + * default substitution function set with + * pango_xft_set_default_substitute() change. + * That is, if your substitution function will return different + * results for the same input pattern, you must call this function. + * + * Since: 1.2 + **/ +void +pango_xft_substitute_changed (Display *display, + int screen) +{ + PangoXftFontMap *xftfontmap = (PangoXftFontMap *)pango_xft_get_font_map (display, screen); + + xftfontmap->serial++; + if (xftfontmap->serial == 0) + xftfontmap->serial++; + pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (xftfontmap)); +} + +void +_pango_xft_font_map_get_info (PangoFontMap *fontmap, + Display **display, + int *screen) +{ + PangoXftFontMap *xftfontmap = (PangoXftFontMap *)fontmap; + + if (display) + *display = xftfontmap->display; + if (screen) + *screen = xftfontmap->screen; +} + +/** + * pango_xft_get_context: (skip) + * @display: an X display. + * @screen: an X screen. + * + * Retrieves a #PangoContext appropriate for rendering with + * Xft fonts on the given screen of the given display. + * + * Return value: the new #PangoContext. + * + * Deprecated: 1.22: Use pango_xft_get_font_map() followed by + * pango_font_map_create_context() instead. + **/ +PangoContext * +pango_xft_get_context (Display *display, + int screen) +{ + g_return_val_if_fail (display != NULL, NULL); + + return pango_font_map_create_context (pango_xft_get_font_map (display, screen)); +} + +/** + * _pango_xft_font_map_get_renderer: + * @fontmap: a #PangoXftFontMap + * + * Gets the singleton #PangoXFTRenderer for this fontmap. + * + * Return value: the renderer. + **/ +PangoRenderer * +_pango_xft_font_map_get_renderer (PangoXftFontMap *xftfontmap) +{ + if (!xftfontmap->renderer) + xftfontmap->renderer = pango_xft_renderer_new (xftfontmap->display, + xftfontmap->screen); + + return xftfontmap->renderer; +} + +static void +pango_xft_font_map_default_substitute (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + PangoXftFontMap *xftfontmap = PANGO_XFT_FONT_MAP (fcfontmap); + double d; + + FcConfigSubstitute (NULL, pattern, FcMatchPattern); + if (xftfontmap->substitute_func) + xftfontmap->substitute_func (pattern, xftfontmap->substitute_data); + XftDefaultSubstitute (xftfontmap->display, xftfontmap->screen, pattern); + if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &d) == FcResultMatch && d == 0.0) + { + FcValue v; + v.type = FcTypeDouble; + v.u.d = 1.0; + FcPatternAdd (pattern, FC_PIXEL_SIZE, v, FcFalse); + } +} + +static PangoFcFont * +pango_xft_font_map_new_font (PangoFcFontMap *fcfontmap, + FcPattern *pattern) +{ + return (PangoFcFont *)_pango_xft_font_new (PANGO_XFT_FONT_MAP (fcfontmap), pattern); +} diff --git a/pango/pangoxft-private.h b/pango/pangoxft-private.h new file mode 100644 index 0000000..fb1c244 --- /dev/null +++ b/pango/pangoxft-private.h @@ -0,0 +1,60 @@ +/* Pango + * pangox-private.h: + * + * Copyright (C) 2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOXFT_PRIVATE_H__ +#define __PANGOXFT_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + +struct _PangoXftFont +{ + PangoFcFont parent_instance; + + XftFont *xft_font; /* created on demand */ + PangoFont *mini_font; /* font used to display missing glyphs */ + + guint mini_width; /* metrics for missing glyph drawing */ + guint mini_height; + guint mini_pad; + + GHashTable *glyph_info; /* Used only when we can't get + * glyph extents out of Xft because + * we have a transformation in effect + */ +}; + +PangoXftFont *_pango_xft_font_new (PangoXftFontMap *xftfontmap, + FcPattern *pattern); + +void _pango_xft_font_map_get_info (PangoFontMap *fontmap, + Display **display, + int *screen); + +PangoRenderer *_pango_xft_font_map_get_renderer (PangoXftFontMap *xftfontmap); + +PangoFont *_pango_xft_font_get_mini_font (PangoXftFont *xfont); + +G_END_DECLS + +#endif /* __PANGOXFT_PRIVATE_H__ */ diff --git a/pango/pangoxft-render.c b/pango/pangoxft-render.c new file mode 100644 index 0000000..9b3c936 --- /dev/null +++ b/pango/pangoxft-render.c @@ -0,0 +1,967 @@ +/* Pango + * pangoxft-render.c: Rendering routines for the Xft library + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include + +#include "pangoxft-render.h" +#include "pangoxft-private.h" + +enum { + PROP_0, + PROP_DISPLAY, + PROP_SCREEN +}; + +struct _PangoXftRendererPrivate +{ + PangoColor default_color; + guint16 alpha; + + Picture src_picture; + Picture dest_picture; + + XRenderPictFormat *mask_format; + + GArray *trapezoids; + PangoRenderPart trapezoid_part; + + GArray *glyphs; + PangoFont *glyph_font; +}; + +static void pango_xft_renderer_finalize (GObject *object); +static void pango_xft_renderer_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); + +static void pango_xft_renderer_real_composite_trapezoids (PangoXftRenderer *xftrenderer, + PangoRenderPart part, + XTrapezoid *trapezoids, + int n_trapezoids); +static void pango_xft_renderer_real_composite_glyphs (PangoXftRenderer *xftrenderer, + XftFont *xft_font, + XftGlyphSpec *glyphs, + int n_glyphs); + +static void pango_xft_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); +static void pango_xft_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22); +static void pango_xft_renderer_part_changed (PangoRenderer *renderer, + PangoRenderPart part); +static void pango_xft_renderer_end (PangoRenderer *renderer); + +static void flush_trapezoids (PangoXftRenderer *xftrenderer); +static void flush_glyphs (PangoXftRenderer *xftrenderer); + +G_DEFINE_TYPE (PangoXftRenderer, pango_xft_renderer, PANGO_TYPE_RENDERER) + +static void +pango_xft_renderer_init (PangoXftRenderer *xftrenderer) +{ + xftrenderer->priv = G_TYPE_INSTANCE_GET_PRIVATE (xftrenderer, + PANGO_TYPE_XFT_RENDERER, + PangoXftRendererPrivate); + xftrenderer->priv->alpha = 0xffff; +} + +static void +pango_xft_renderer_class_init (PangoXftRendererClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); + + klass->composite_glyphs = pango_xft_renderer_real_composite_glyphs; + klass->composite_trapezoids = pango_xft_renderer_real_composite_trapezoids; + + renderer_class->draw_glyphs = pango_xft_renderer_draw_glyphs; + renderer_class->draw_trapezoid = pango_xft_renderer_draw_trapezoid; + renderer_class->part_changed = pango_xft_renderer_part_changed; + renderer_class->end = pango_xft_renderer_end; + + object_class->finalize = pango_xft_renderer_finalize; + object_class->set_property = pango_xft_renderer_set_property; + + g_object_class_install_property (object_class, PROP_DISPLAY, + g_param_spec_pointer ("display", + "Display", + "The display being rendered to", + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (object_class, PROP_SCREEN, + g_param_spec_int ("screen", + "Screen", + "The screen being rendered to", + 0, G_MAXINT, 0, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof (PangoXftRendererPrivate)); +} + +static void +pango_xft_renderer_finalize (GObject *object) +{ + PangoXftRenderer *renderer = PANGO_XFT_RENDERER (object); + + if (renderer->priv->glyphs) + g_array_free (renderer->priv->glyphs, TRUE); + if (renderer->priv->trapezoids) + g_array_free (renderer->priv->trapezoids, TRUE); + + G_OBJECT_CLASS (pango_xft_renderer_parent_class)->finalize (object); +} + +static void +pango_xft_renderer_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (object); + + switch (prop_id) + { + case PROP_DISPLAY: + xftrenderer->display = g_value_get_pointer (value); + /* We possibly should use ARGB format when subpixel-AA is turned + * on for the fontmap; we could discover that using the technique + * for FC_DPI in pango_fc_face_list_sizes. + */ + xftrenderer->priv->mask_format = XRenderFindStandardFormat (xftrenderer->display, + PictStandardA8); + break; + case PROP_SCREEN: + xftrenderer->screen = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +pango_xft_renderer_set_pictures (PangoXftRenderer *renderer, + Picture src_picture, + Picture dest_picture) +{ + renderer->priv->src_picture = src_picture; + renderer->priv->dest_picture = dest_picture; +} + +static void +flush_glyphs (PangoXftRenderer *xftrenderer) +{ + XftFont *xft_font; + + if (!xftrenderer->priv->glyphs || + xftrenderer->priv->glyphs->len == 0) + return; + + xft_font = pango_xft_font_get_font (xftrenderer->priv->glyph_font); + + PANGO_XFT_RENDERER_GET_CLASS (xftrenderer)->composite_glyphs (xftrenderer, + xft_font, + (XftGlyphSpec *)xftrenderer->priv->glyphs->data, + xftrenderer->priv->glyphs->len); + + g_array_set_size (xftrenderer->priv->glyphs, 0); + g_object_unref (xftrenderer->priv->glyph_font); + xftrenderer->priv->glyph_font = NULL; +} + +#define MAX_GLYPHS 1024 + +static void +draw_glyph (PangoRenderer *renderer, + PangoFont *font, + FT_UInt glyph, + int x, + int y) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (renderer); + XftGlyphSpec gs; + int pixel_x, pixel_y; + + if (renderer->matrix) + { + pixel_x = floor (0.5 + (x * renderer->matrix->xx + y * renderer->matrix->xy) / PANGO_SCALE + renderer->matrix->x0); + pixel_y = floor (0.5 + (x * renderer->matrix->yx + y * renderer->matrix->yy) / PANGO_SCALE + renderer->matrix->y0); + } + else + { + pixel_x = PANGO_PIXELS (x); + pixel_y = PANGO_PIXELS (y); + } + + /* Clip glyphs into the X coordinate range; we really + * want to clip glyphs with an ink rect outside the + * [0,32767] x [0,32767] rectangle but looking up + * the ink rect here would be a noticeable speed hit. + * This is close enough. + */ + if (pixel_x < -32768 || pixel_x > 32767 || + pixel_y < -32768 || pixel_y > 32767) + return; + + flush_trapezoids (xftrenderer); + + if (!xftrenderer->priv->glyphs) + xftrenderer->priv->glyphs = g_array_new (FALSE, FALSE, + sizeof (XftGlyphSpec)); + + if (xftrenderer->priv->glyph_font != font || + xftrenderer->priv->glyphs->len == MAX_GLYPHS) + { + flush_glyphs (xftrenderer); + + xftrenderer->priv->glyph_font = g_object_ref (font); + } + + gs.x = pixel_x; + gs.y = pixel_y; + gs.glyph = glyph; + + g_array_append_val (xftrenderer->priv->glyphs, gs); +} + +static gboolean +point_in_bounds (PangoRenderer *renderer, + gint x, + gint y) +{ + gdouble pixel_x = (x * renderer->matrix->xx + y * renderer->matrix->xy) / PANGO_SCALE + renderer->matrix->x0; + gdouble pixel_y = (x * renderer->matrix->yx + y * renderer->matrix->yy) / PANGO_SCALE + renderer->matrix->y0; + + return (pixel_x >= -32768. && pixel_x < 32768. && + pixel_y >= -32768. && pixel_y < 32768.); +} + +static gboolean +box_in_bounds (PangoRenderer *renderer, + gint x, + gint y, + gint width, + gint height) +{ + if (!renderer->matrix) + { +#define COORD_MIN (PANGO_SCALE * -16384 - PANGO_SCALE / 2) +#define COORD_MAX (PANGO_SCALE * 32767 + PANGO_SCALE / 2 - 1) + return (x >= COORD_MIN && x + width <= COORD_MAX && + y >= COORD_MIN && y + width <= COORD_MAX); +#undef COORD_MIN +#undef COORD_MAX + } + else + { + return (point_in_bounds (renderer, x, y) && + point_in_bounds (renderer, x + width, y) && + point_in_bounds (renderer, x + width, y + height) && + point_in_bounds (renderer, x, y + height)); + } +} + +static void +get_total_matrix (PangoMatrix *total, + const PangoMatrix *global, + double x, + double y, + double width, + double height) +{ + PangoMatrix local = PANGO_MATRIX_INIT; + gdouble angle = atan2 (height, width); + + pango_matrix_translate (&local, x, y); + pango_matrix_rotate (&local, -angle * (180. / G_PI)); + + *total = *global; + pango_matrix_concat (total, &local); +} + +static void +draw_box (PangoRenderer *renderer, + gint line_width, + gint x, + gint y, + gint width, + gint height, + gboolean invalid) +{ + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + x, y, width, line_width); + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + x, y + line_width, line_width, height - line_width * 2); + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + x + width - line_width, y + line_width, line_width, height - line_width * 2); + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + x, y + height - line_width, width, line_width); + + if (invalid) + { + int length; + double in_width, in_height; + PangoMatrix orig_matrix = PANGO_MATRIX_INIT, new_matrix; + const PangoMatrix *porig_matrix; + + in_width = pango_units_to_double (width - 2 * line_width); + in_height = pango_units_to_double (height - 2 * line_width); + length = PANGO_SCALE * sqrt (in_width*in_width + in_height*in_height); + + porig_matrix = pango_renderer_get_matrix (renderer); + if (porig_matrix) + { + orig_matrix = *porig_matrix; + porig_matrix = &orig_matrix; + } + + get_total_matrix (&new_matrix, &orig_matrix, + pango_units_to_double (x + line_width), pango_units_to_double (y + line_width), + in_width, in_height); + pango_renderer_set_matrix (renderer, &new_matrix); + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + 0, -line_width / 2, length, line_width); + + get_total_matrix (&new_matrix, &orig_matrix, + pango_units_to_double (x + line_width), pango_units_to_double (y + height - line_width), + in_width, -in_height); + pango_renderer_set_matrix (renderer, &new_matrix); + pango_renderer_draw_rectangle (renderer, PANGO_RENDER_PART_FOREGROUND, + 0, -line_width / 2, length, line_width); + + pango_renderer_set_matrix (renderer, porig_matrix); + } +} + +static void +_pango_xft_renderer_draw_box_glyph (PangoRenderer *renderer, + PangoGlyphInfo *gi, + int glyph_x, + int glyph_y, + gboolean invalid) +{ + int x = glyph_x + PANGO_SCALE; + int y = glyph_y - PANGO_SCALE * (PANGO_UNKNOWN_GLYPH_HEIGHT - 1); + int width = gi->geometry.width - PANGO_SCALE * 2; + int height = PANGO_SCALE * (PANGO_UNKNOWN_GLYPH_HEIGHT - 2); + + if (box_in_bounds (renderer, x, y, width, height)) + draw_box (renderer, PANGO_SCALE, x, y, width, height, invalid); +} + +static void +_pango_xft_renderer_draw_unknown_glyph (PangoRenderer *renderer, + PangoXftFont *xfont, + XftFont *xft_font, + PangoGlyphInfo *gi, + int glyph_x, + int glyph_y) +{ + char buf[7]; + int ys[3]; + int xs[4]; + int row, col; + int cols; + gunichar ch; + gboolean invalid_input; + + PangoFont *mini_font; + XftFont *mini_xft_font; + + ch = gi->glyph & ~PANGO_GLYPH_UNKNOWN_FLAG; + if (G_UNLIKELY (gi->glyph == PANGO_GLYPH_INVALID_INPUT || ch > 0x10FFFF)) + { + invalid_input = TRUE; + cols = 1; + } + else + { + invalid_input = FALSE; + cols = ch > 0xffff ? 3 : 2; + g_snprintf (buf, sizeof(buf), (ch > 0xffff) ? "%06X" : "%04X", ch); + } + + mini_font = _pango_xft_font_get_mini_font (xfont); + mini_xft_font = pango_xft_font_get_font (mini_font); + if (!mini_xft_font) + { + _pango_xft_renderer_draw_box_glyph (renderer, gi, glyph_x, glyph_y, invalid_input); + return; + } + + + ys[0] = glyph_y - PANGO_SCALE * xft_font->ascent + PANGO_SCALE * (((xft_font->ascent + xft_font->descent) - (xfont->mini_height * 2 + xfont->mini_pad * 5 + PANGO_SCALE / 2) / PANGO_SCALE) / 2); + ys[1] = ys[0] + 2 * xfont->mini_pad + xfont->mini_height; + ys[2] = ys[1] + xfont->mini_height + xfont->mini_pad; + + xs[0] = glyph_x; + xs[1] = xs[0] + 2 * xfont->mini_pad; + xs[2] = xs[1] + xfont->mini_width + xfont->mini_pad; + xs[3] = xs[2] + xfont->mini_width + xfont->mini_pad; + + if (box_in_bounds (renderer, + xs[0], ys[0], + xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 1), + xfont->mini_height * 2 + xfont->mini_pad * 5)) + { + if (xfont->mini_pad) + draw_box (renderer, xfont->mini_pad, + xs[0], ys[0], + xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 1), + xfont->mini_height * 2 + xfont->mini_pad * 5, + invalid_input); + + if (invalid_input) + return; + + for (row = 0; row < 2; row++) + for (col = 0; col < cols; col++) + { + draw_glyph (renderer, mini_font, + XftCharIndex (NULL, mini_xft_font, + buf[row * cols + col] & 0xff), + xs[col+1], + ys[row+1]); + } + } +} + +static void +pango_xft_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + PangoXftFont *xfont = PANGO_XFT_FONT (font); + PangoFcFont *fcfont = PANGO_FC_FONT (font); + XftFont *xft_font = pango_xft_font_get_font (font); + int i; + int x_off = 0; + + if (!fcfont) + { + for (i=0; inum_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + if (gi->glyph != PANGO_GLYPH_EMPTY) + { + int glyph_x = x + x_off + gi->geometry.x_offset; + int glyph_y = y + gi->geometry.y_offset; + + _pango_xft_renderer_draw_unknown_glyph (renderer, + xfont, + xft_font, + gi, + glyph_x, + glyph_y); + } + + x_off += gi->geometry.width; + } + return; + } + + if (!fcfont->fontmap) /* Display closed */ + return; + + for (i=0; inum_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + if (gi->glyph != PANGO_GLYPH_EMPTY) + { + int glyph_x = x + x_off + gi->geometry.x_offset; + int glyph_y = y + gi->geometry.y_offset; + + if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + _pango_xft_renderer_draw_unknown_glyph (renderer, + xfont, + xft_font, + gi, + glyph_x, + glyph_y); + } + else + { + draw_glyph (renderer, font, gi->glyph, glyph_x, glyph_y); + } + } + + x_off += gi->geometry.width; + } +} + +static void +flush_trapezoids (PangoXftRenderer *xftrenderer) +{ + if (!xftrenderer->priv->trapezoids || + xftrenderer->priv->trapezoids->len == 0) + return; + + PANGO_XFT_RENDERER_GET_CLASS (xftrenderer)->composite_trapezoids (xftrenderer, + xftrenderer->priv->trapezoid_part, + (XTrapezoid *)xftrenderer->priv->trapezoids->data, + xftrenderer->priv->trapezoids->len); + + g_array_set_size (xftrenderer->priv->trapezoids, 0); +} + +static void +pango_xft_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (renderer); + XTrapezoid trap; + + flush_glyphs (xftrenderer); + + if (!xftrenderer->priv->trapezoids) + xftrenderer->priv->trapezoids = g_array_new (FALSE, FALSE, + sizeof (XTrapezoid)); + + if (xftrenderer->draw) + { + if (xftrenderer->priv->trapezoids->len > 0 && + xftrenderer->priv->trapezoid_part != part) + flush_trapezoids (xftrenderer); + + xftrenderer->priv->trapezoid_part = part; + } + + trap.top = XDoubleToFixed (y1); + trap.bottom = XDoubleToFixed (y2); + trap.left.p1.x = XDoubleToFixed (x11); + trap.left.p1.y = XDoubleToFixed (y1); + trap.left.p2.x = XDoubleToFixed (x12); + trap.left.p2.y = XDoubleToFixed (y2); + trap.right.p1.x = XDoubleToFixed (x21); + trap.right.p1.y = XDoubleToFixed (y1); + trap.right.p2.x = XDoubleToFixed (x22); + trap.right.p2.y = XDoubleToFixed (y2); + + g_array_append_val (xftrenderer->priv->trapezoids, trap); +} + +static void +pango_xft_renderer_part_changed (PangoRenderer *renderer, + PangoRenderPart part) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (renderer); + + if (part == PANGO_RENDER_PART_FOREGROUND) + flush_glyphs (xftrenderer); + + if (part == xftrenderer->priv->trapezoid_part) + flush_trapezoids (xftrenderer); +} + +static void +pango_xft_renderer_end (PangoRenderer *renderer) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (renderer); + + flush_glyphs (xftrenderer); + flush_trapezoids (xftrenderer); +} + +static void +pango_xft_renderer_real_composite_trapezoids (PangoXftRenderer *xftrenderer, + PangoRenderPart part, + XTrapezoid *trapezoids, + int n_trapezoids) +{ + Picture src_picture; + Picture dest_picture; + + if (!XftDefaultHasRender (xftrenderer->display)) + return; + + if (xftrenderer->priv->src_picture != None) + { + src_picture = xftrenderer->priv->src_picture; + dest_picture = xftrenderer->priv->dest_picture; + } + else + { + XftColor xft_color; + PangoColor *color = pango_renderer_get_color (PANGO_RENDERER (xftrenderer), + part); + if (!color) + color = &xftrenderer->priv->default_color; + + xft_color.color.red = color->red; + xft_color.color.green = color->green; + xft_color.color.blue = color->blue; + xft_color.color.alpha = xftrenderer->priv->alpha; + + src_picture = XftDrawSrcPicture (xftrenderer->draw, &xft_color); + dest_picture = XftDrawPicture (xftrenderer->draw); + } + + XRenderCompositeTrapezoids (xftrenderer->display, + PictOpOver, + src_picture, dest_picture, + xftrenderer->priv->mask_format, + 0, 0, + trapezoids, n_trapezoids); +} + +static void +pango_xft_renderer_real_composite_glyphs (PangoXftRenderer *xftrenderer, + XftFont *xft_font, + XftGlyphSpec *glyphs, + int n_glyphs) +{ + if (xftrenderer->priv->src_picture != None) + { + XftGlyphSpecRender (xftrenderer->display, PictOpOver, + xftrenderer->priv->src_picture, + xft_font, + xftrenderer->priv->dest_picture, 0, 0, + glyphs, n_glyphs); + } + else + { + XftColor xft_color; + PangoColor *color = pango_renderer_get_color (PANGO_RENDERER (xftrenderer), + PANGO_RENDER_PART_FOREGROUND); + if (!color) + color = &xftrenderer->priv->default_color; + + xft_color.color.red = color->red; + xft_color.color.green = color->green; + xft_color.color.blue = color->blue; + xft_color.color.alpha = xftrenderer->priv->alpha; + + XftDrawGlyphSpec (xftrenderer->draw, &xft_color, + xft_font, + glyphs, n_glyphs); + } +} + +static PangoRenderer * +get_renderer (PangoFontMap *fontmap, + XftDraw *draw, + XftColor *color) +{ + PangoRenderer *renderer; + PangoXftRenderer *xftrenderer; + PangoColor pango_color; + + renderer = _pango_xft_font_map_get_renderer (PANGO_XFT_FONT_MAP (fontmap)); + xftrenderer = PANGO_XFT_RENDERER (renderer); + + pango_xft_renderer_set_draw (xftrenderer, draw); + + pango_color.red = color->color.red; + pango_color.green = color->color.green; + pango_color.blue = color->color.blue; + pango_xft_renderer_set_default_color (xftrenderer, &pango_color); + xftrenderer->priv->alpha = color->color.alpha; + + return renderer; +} + +static void +release_renderer (PangoRenderer *renderer) +{ + PangoXftRenderer *xftrenderer = PANGO_XFT_RENDERER (renderer); + + xftrenderer->priv->alpha = 0xffff; +} + +/** + * pango_xft_render_layout: + * @draw: an #XftDraw + * @color: the foreground color in which to draw the layout + * (may be overridden by color attributes) + * @layout: a #PangoLayout + * @x: the X position of the left of the layout (in Pango units) + * @y: the Y position of the top of the layout (in Pango units) + * + * Render a #PangoLayout onto a #XftDraw + * + * Since: 1.8 + */ +void +pango_xft_render_layout (XftDraw *draw, + XftColor *color, + PangoLayout *layout, + int x, + int y) +{ + PangoContext *context; + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (draw != NULL); + g_return_if_fail (color != NULL); + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + context = pango_layout_get_context (layout); + fontmap = pango_context_get_font_map (context); + renderer = get_renderer (fontmap, draw, color); + + pango_renderer_draw_layout (renderer, layout, x, y); + + release_renderer (renderer); +} + +/** + * pango_xft_render_layout_line: + * @draw: an #XftDraw + * @color: the foreground color in which to draw the layout line + * (may be overridden by color attributes) + * @line: a #PangoLayoutLine + * @x: the x position of start of string (in Pango units) + * @y: the y position of baseline (in Pango units) + * + * Render a #PangoLayoutLine onto a #XftDraw + * + * Since: 1.8 + */ +void +pango_xft_render_layout_line (XftDraw *draw, + XftColor *color, + PangoLayoutLine *line, + int x, + int y) +{ + PangoContext *context; + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (draw != NULL); + g_return_if_fail (color != NULL); + g_return_if_fail (line != NULL); + + context = pango_layout_get_context (line->layout); + fontmap = pango_context_get_font_map (context); + renderer = get_renderer (fontmap, draw, color); + + pango_renderer_draw_layout_line (renderer, line, x, y); + + release_renderer (renderer); +} + +/** + * pango_xft_render_transformed: + * @draw: an #XftDraw + * @color: the color in which to draw the glyphs + * @font: the font in which to draw the string + * @matrix: (nullable): a #PangoMatrix, or %NULL to use an identity + * transformation + * @glyphs: the glyph string to draw + * @x: the x position of the start of the string (in Pango + * units in user space coordinates) + * @y: the y position of the baseline (in Pango units + * in user space coordinates) + * + * Renders a #PangoGlyphString onto a #XftDraw, possibly + * transforming the layed-out coordinates through a transformation + * matrix. Note that the transformation matrix for @font is not + * changed, so to produce correct rendering results, the @font + * must have been loaded using a #PangoContext with an identical + * transformation matrix to that passed in to this function. + * + * Since: 1.8 + **/ +void +pango_xft_render_transformed (XftDraw *draw, + XftColor *color, + PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) +{ + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (draw != NULL); + g_return_if_fail (color != NULL); + g_return_if_fail (PANGO_XFT_IS_FONT (font)); + g_return_if_fail (glyphs != NULL); + + fontmap = PANGO_FC_FONT (font)->fontmap; + renderer = get_renderer (fontmap, draw, color); + + pango_renderer_set_matrix (renderer, matrix); + + pango_renderer_draw_glyphs (renderer, font, glyphs, x, y); + + release_renderer (renderer); +} + +/** + * pango_xft_render: + * @draw: the XftDraw object. + * @color: the color in which to draw the string + * @font: the font in which to draw the string + * @glyphs: the glyph string to draw + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * + * Renders a #PangoGlyphString onto an XftDraw object wrapping an X drawable. + */ +void +pango_xft_render (XftDraw *draw, + XftColor *color, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y) +{ + g_return_if_fail (draw != NULL); + g_return_if_fail (color != NULL); + g_return_if_fail (PANGO_XFT_IS_FONT (font)); + g_return_if_fail (glyphs != NULL); + + pango_xft_render_transformed (draw, color, NULL, font, glyphs, + x * PANGO_SCALE, y * PANGO_SCALE); +} + +/** + * pango_xft_picture_render: + * @display: an X display + * @src_picture: the source picture to draw the string with + * @dest_picture: the destination picture to draw the string onto + * @font: the font in which to draw the string + * @glyphs: the glyph string to draw + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * + * Renders a #PangoGlyphString onto an Xrender Picture object. + */ +void +pango_xft_picture_render (Display *display, + Picture src_picture, + Picture dest_picture, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y) +{ + PangoFontMap *fontmap; + PangoRenderer *renderer; + + g_return_if_fail (display != NULL); + g_return_if_fail (src_picture != None); + g_return_if_fail (dest_picture != None); + g_return_if_fail (PANGO_XFT_IS_FONT (font)); + g_return_if_fail (glyphs != NULL); + + fontmap = PANGO_FC_FONT (font)->fontmap; + renderer = _pango_xft_font_map_get_renderer (PANGO_XFT_FONT_MAP (fontmap)); + + pango_xft_renderer_set_pictures (PANGO_XFT_RENDERER (renderer), + src_picture, dest_picture); + pango_renderer_set_matrix (renderer, NULL); + + pango_renderer_draw_glyphs (renderer, font, glyphs, x * PANGO_SCALE, y * PANGO_SCALE); + + pango_xft_renderer_set_pictures (PANGO_XFT_RENDERER (renderer), + None, None); +} + +/** + * pango_xft_renderer_new: + * @display: an X display + * @screen: the index of the screen for @display to which rendering will be done + * + * Create a new #PangoXftRenderer to allow rendering Pango objects + * with the Xft library. You must call pango_xft_renderer_set_draw() before + * using the renderer. + * + * Return value: the newly created #PangoXftRenderer, which should + * be freed with g_object_unref(). + * + * Since: 1.8 + **/ +PangoRenderer * +pango_xft_renderer_new (Display *display, + int screen) +{ + PangoXftRenderer *xftrenderer; + + xftrenderer = g_object_new (PANGO_TYPE_XFT_RENDERER, + "display", display, + "screen", screen, + NULL); + + return PANGO_RENDERER (xftrenderer); +} + +/** + * pango_xft_renderer_set_draw: + * @xftrenderer: a #PangoXftRenderer + * @draw: a #XftDraw + * + * Sets the #XftDraw object that the renderer is drawing to. + * The renderer must not be currently active. + * + * Since: 1.8 + **/ +void +pango_xft_renderer_set_draw (PangoXftRenderer *xftrenderer, + XftDraw *draw) +{ + g_return_if_fail (PANGO_IS_XFT_RENDERER (xftrenderer)); + + xftrenderer->draw = draw; +} + +/** + * pango_xft_renderer_set_default_color: + * @xftrenderer: a #XftRenderer + * @default_color: the default foreground color + * + * Sets the default foreground color for a #XftRenderer. + * + * Since: 1.8 + **/ +void +pango_xft_renderer_set_default_color (PangoXftRenderer *xftrenderer, + PangoColor *default_color) +{ + g_return_if_fail (PANGO_IS_XFT_RENDERER (xftrenderer)); + + xftrenderer->priv->default_color = *default_color; +} diff --git a/pango/pangoxft-render.h b/pango/pangoxft-render.h new file mode 100644 index 0000000..5893574 --- /dev/null +++ b/pango/pangoxft-render.h @@ -0,0 +1,150 @@ +/* Pango + * pangoxft-render.h: Rendering routines for the Xft library + * + * Copyright (C) 2004 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOXFT_RENDER_H__ +#define __PANGOXFT_RENDER_H__ + +#include + +G_BEGIN_DECLS + +#define _XFT_NO_COMPAT_ +#include +#include +#if defined(XftVersion) && XftVersion >= 20000 +#else +#error "must have Xft version 2 or newer" +#endif + +typedef struct _PangoXftRenderer PangoXftRenderer; +typedef struct _PangoXftRendererClass PangoXftRendererClass; +typedef struct _PangoXftRendererPrivate PangoXftRendererPrivate; + +#define PANGO_TYPE_XFT_RENDERER (pango_xft_renderer_get_type()) +#define PANGO_XFT_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_RENDERER, PangoXftRenderer)) +#define PANGO_IS_XFT_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_RENDERER)) +#define PANGO_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass)) +#define PANGO_IS_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_XFT_RENDERER)) +#define PANGO_XFT_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass)) + +/** + * PangoXftRenderer: + * + * #PangoXftRenderer is a subclass of #PangoRenderer used for rendering + * with Pango's Xft backend. It can be used directly, or it can be + * further subclassed to modify exactly how drawing of individual + * elements occurs. + * + * Since: 1.8 + */ +struct _PangoXftRenderer +{ + /*< private >*/ + PangoRenderer parent_instance; + + Display *display; + int screen; + XftDraw *draw; + + PangoXftRendererPrivate *priv; +}; + +/** + * PangoXftRendererClass: + * @composite_trapezoids: draw the specified trapezoids using + * the current color and other attributes for @part + * @composite_glyphs: draw the specified glyphs using + * the current foreground color and other foreground + * attributes + * + * The class structure for #PangoXftRenderer + * + * Since: 1.8 + */ +struct _PangoXftRendererClass +{ + /*< private >*/ + PangoRendererClass parent_class; + + /*< public >*/ + void (*composite_trapezoids) (PangoXftRenderer *xftrenderer, + PangoRenderPart part, + XTrapezoid *trapezoids, + int n_trapezoids); + void (*composite_glyphs) (PangoXftRenderer *xftrenderer, + XftFont *xft_font, + XftGlyphSpec *glyphs, + int n_glyphs); +}; + +PANGO_AVAILABLE_IN_1_8 +GType pango_xft_renderer_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_1_8 +PangoRenderer *pango_xft_renderer_new (Display *display, + int screen); +PANGO_AVAILABLE_IN_1_8 +void pango_xft_renderer_set_draw (PangoXftRenderer *xftrenderer, + XftDraw *draw); +PANGO_AVAILABLE_IN_1_8 +void pango_xft_renderer_set_default_color (PangoXftRenderer *xftrenderer, + PangoColor *default_color); + +PANGO_AVAILABLE_IN_ALL +void pango_xft_render (XftDraw *draw, + XftColor *color, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y); +PANGO_AVAILABLE_IN_ALL +void pango_xft_picture_render (Display *display, + Picture src_picture, + Picture dest_picture, + PangoFont *font, + PangoGlyphString *glyphs, + gint x, + gint y); +PANGO_AVAILABLE_IN_1_8 +void pango_xft_render_transformed (XftDraw *draw, + XftColor *color, + PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); +PANGO_AVAILABLE_IN_1_8 +void pango_xft_render_layout_line (XftDraw *draw, + XftColor *color, + PangoLayoutLine *line, + int x, + int y); +PANGO_AVAILABLE_IN_1_8 +void pango_xft_render_layout (XftDraw *draw, + XftColor *color, + PangoLayout *layout, + int x, + int y); + +G_END_DECLS + +#endif /* __PANGOXFT_RENDER_H__ */ + diff --git a/pango/pangoxft.h b/pango/pangoxft.h new file mode 100644 index 0000000..744fce0 --- /dev/null +++ b/pango/pangoxft.h @@ -0,0 +1,136 @@ +/* Pango + * pangoxft.h: + * + * Copyright (C) 1999 Red Hat Software + * Copyright (C) 2000 SuSE Linux Ltd + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGOXFT_H__ +#define __PANGOXFT_H__ + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/** + * PANGO_RENDER_TYPE_XFT: + * + * A string constant that was used to identify shape engines that work + * with the Xft backend. See %PANGO_RENDER_TYPE_FC for the replacement. + */ +#ifndef PANGO_DISABLE_DEPRECATED +#define PANGO_RENDER_TYPE_XFT "PangoRenderXft" +#endif + +/** + * PangoXftFontMap: + * + * #PangoXftFontMap is an implementation of #PangoFcFontMap suitable for + * the Xft library as the renderer. It is used in to create fonts of + * type #PangoXftFont. + */ +#define PANGO_TYPE_XFT_FONT_MAP (pango_xft_font_map_get_type ()) +#define PANGO_XFT_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT_MAP, PangoXftFontMap)) +#define PANGO_XFT_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_FONT_MAP)) + +typedef struct _PangoXftFontMap PangoXftFontMap; + +/** + * PangoXftFont: + * + * #PangoXftFont is an implementation of #PangoFcFont using the Xft + * library for rendering. It is used in conjunction with #PangoXftFontMap. + */ +typedef struct _PangoXftFont PangoXftFont; + +/** + * PangoXftSubstituteFunc: + * @pattern: the FcPattern to tweak. + * @data: user data. + * + * Function type for doing final config tweaking on prepared FcPatterns. + */ +typedef void (*PangoXftSubstituteFunc) (FcPattern *pattern, + gpointer data); + +/* Calls for applications + */ +PANGO_AVAILABLE_IN_1_2 +PangoFontMap *pango_xft_get_font_map (Display *display, + int screen); +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED +PangoContext *pango_xft_get_context (Display *display, + int screen); +#endif +PANGO_AVAILABLE_IN_1_2 +void pango_xft_shutdown_display (Display *display, + int screen); + +PANGO_AVAILABLE_IN_1_2 +void pango_xft_set_default_substitute (Display *display, + int screen, + PangoXftSubstituteFunc func, + gpointer data, + GDestroyNotify notify); +PANGO_AVAILABLE_IN_1_2 +void pango_xft_substitute_changed (Display *display, + int screen); + +PANGO_AVAILABLE_IN_ALL +GType pango_xft_font_map_get_type (void) G_GNUC_CONST; + +#define PANGO_XFT_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT, PangoXftFont)) +#define PANGO_TYPE_XFT_FONT (pango_xft_font_get_type ()) +#define PANGO_XFT_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_FONT)) + +PANGO_AVAILABLE_IN_ALL +GType pango_xft_font_get_type (void) G_GNUC_CONST; + +/* For shape engines + */ + +#ifdef PANGO_ENABLE_ENGINE +PANGO_AVAILABLE_IN_ALL +XftFont * pango_xft_font_get_font (PangoFont *font); +PANGO_AVAILABLE_IN_ALL +Display * pango_xft_font_get_display (PangoFont *font); +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_FOR(pango_fc_font_lock_face) +FT_Face pango_xft_font_lock_face (PangoFont *font); +PANGO_DEPRECATED_FOR(pango_fc_font_unlock_face) +void pango_xft_font_unlock_face (PangoFont *font); +PANGO_DEPRECATED_FOR(pango_fc_font_get_glyph) +guint pango_xft_font_get_glyph (PangoFont *font, + gunichar wc); +PANGO_DEPRECATED_FOR(pango_fc_font_has_char) +gboolean pango_xft_font_has_char (PangoFont *font, + gunichar wc); +PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) +PangoGlyph pango_xft_font_get_unknown_glyph (PangoFont *font, + gunichar wc); +#endif /* PANGO_DISABLE_DEPRECATED */ +#endif /* PANGO_ENABLE_ENGINE */ + +G_END_DECLS + +#endif /* __PANGOXFT_H__ */ diff --git a/pango/pangoxft.rc b/pango/pangoxft.rc new file mode 100644 index 0000000..fd27593 --- /dev/null +++ b/pango/pangoxft.rc @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,42,4,0 + PRODUCTVERSION 1,42,4,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "Pangoxft" + VALUE "FileVersion", "1.42.4.0" + VALUE "InternalName", "pangoxft-1.0-0" + VALUE "LegalCopyright", "Copyright � 1999 Red Hat Software." + VALUE "OriginalFilename", "pangoxft-1.0-0.dll" + VALUE "ProductName", "Pangoxft" + VALUE "ProductVersion", "1.42.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/pangoxft.rc.in b/pango/pangoxft.rc.in new file mode 100644 index 0000000..1f39685 --- /dev/null +++ b/pango/pangoxft.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "Pangoxft" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pangoxft-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright � 1999 Red Hat Software." + VALUE "OriginalFilename", "pangoxft-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "Pangoxft" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/pango/reorder-items.c b/pango/reorder-items.c new file mode 100644 index 0000000..62a6a8f --- /dev/null +++ b/pango/reorder-items.c @@ -0,0 +1,115 @@ +/* Pango + * reorder-items.c: + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "pango-glyph.h" + +/* + * NB: The contents of the file implement the exact same algorithm + * pango-layout.c:pango_layout_line_reorder(). + */ + +static GList *reorder_items_recurse (GList *items, int n_items); + +/** + * pango_reorder_items: + * @logical_items: (element-type Pango.Item): a #GList of #PangoItem in logical order. + * + * From a list of items in logical order and the associated + * directional levels, produce a list in visual order. + * The original list is unmodified. + * + * Returns: (transfer full) (element-type Pango.Item): a #GList + * of #PangoItem structures in visual order. + * + * (Please open a bug if you use this function. + * It is not a particularly convenient interface, and the code + * is duplicated elsewhere in Pango for that reason.) + */ +GList * +pango_reorder_items (GList *logical_items) +{ + return reorder_items_recurse (logical_items, g_list_length (logical_items)); +} + +static GList * +reorder_items_recurse (GList *items, int n_items) +{ + GList *tmp_list, *level_start_node; + int i, level_start_i; + int min_level = G_MAXINT; + GList *result = NULL; + + if (n_items == 0) + return NULL; + + tmp_list = items; + for (i=0; idata; + + min_level = MIN (min_level, item->analysis.level); + + tmp_list = tmp_list->next; + } + + level_start_i = 0; + level_start_node = items; + tmp_list = items; + for (i=0; idata; + + if (item->analysis.level == min_level) + { + if (min_level % 2) + { + if (i > level_start_i) + result = g_list_concat (reorder_items_recurse (level_start_node, i - level_start_i), result); + result = g_list_prepend (result, item); + } + else + { + if (i > level_start_i) + result = g_list_concat (result, reorder_items_recurse (level_start_node, i - level_start_i)); + result = g_list_append (result, item); + } + + level_start_i = i + 1; + level_start_node = tmp_list->next; + } + + tmp_list = tmp_list->next; + } + + if (min_level % 2) + { + if (i > level_start_i) + result = g_list_concat (reorder_items_recurse (level_start_node, i - level_start_i), result); + } + else + { + if (i > level_start_i) + result = g_list_concat (result, reorder_items_recurse (level_start_node, i - level_start_i)); + } + + return result; +} diff --git a/pango/shape.c b/pango/shape.c new file mode 100644 index 0000000..6f53526 --- /dev/null +++ b/pango/shape.c @@ -0,0 +1,235 @@ +/* Pango + * shape.c: Convert characters into glyphs. + * + * Copyright (C) 1999 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:glyphs + * @short_description:Structures for storing information about glyphs + * @title:Glyph Storage + * + * pango_shape() produces a string of glyphs which + * can be measured or drawn to the screen. The following + * structures are used to store information about + * glyphs. + */ +#include "config.h" + +#include "pango-impl-utils.h" +#include "pango-glyph.h" +#include "pango-engine-private.h" + +#include + +/** + * pango_shape: + * @text: the text to process + * @length: the length (in bytes) of @text + * @analysis: #PangoAnalysis structure from pango_itemize() + * @glyphs: glyph string in which to store results + * + * Given a segment of text and the corresponding + * #PangoAnalysis structure returned from pango_itemize(), + * convert the characters into glyphs. You may also pass + * in only a substring of the item from pango_itemize(). + * + * It is recommended that you use pango_shape_full() instead, since + * that API allows for shaping interaction happening across text item + * boundaries. + */ +void +pango_shape (const gchar *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) +{ + pango_shape_full (text, length, text, length, analysis, glyphs); +} + +/** + * pango_shape_full: + * @item_text: valid UTF-8 text to shape. + * @item_length: the length (in bytes) of @item_text. -1 means nul-terminated text. + * @paragraph_text: (allow-none): text of the paragraph (see details). May be %NULL. + * @paragraph_length: the length (in bytes) of @paragraph_text. -1 means nul-terminated text. + * @analysis: #PangoAnalysis structure from pango_itemize(). + * @glyphs: glyph string in which to store results. + * + * Given a segment of text and the corresponding + * #PangoAnalysis structure returned from pango_itemize(), + * convert the characters into glyphs. You may also pass + * in only a substring of the item from pango_itemize(). + * + * This is similar to pango_shape(), except it also can optionally take + * the full paragraph text as input, which will then be used to perform + * certain cross-item shaping interactions. If you have access to the broader + * text of which @item_text is part of, provide the broader text as + * @paragraph_text. If @paragraph_text is %NULL, item text is used instead. + * + * Since: 1.32 + */ +void +pango_shape_full (const gchar *item_text, + gint item_length, + const gchar *paragraph_text, + gint paragraph_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) +{ + int i; + int last_cluster; + + glyphs->num_glyphs = 0; + + if (item_length == -1) + item_length = strlen (item_text); + + if (!paragraph_text) + { + paragraph_text = item_text; + paragraph_length = item_length; + } + if (paragraph_length == -1) + paragraph_length = strlen (paragraph_text); + + g_return_if_fail (paragraph_text <= item_text); + g_return_if_fail (paragraph_text + paragraph_length >= item_text + item_length); + + if (G_LIKELY (analysis->shape_engine && analysis->font)) + { + _pango_engine_shape_shape (analysis->shape_engine, analysis->font, + item_text, item_length, + paragraph_text, paragraph_length, + analysis, glyphs); + + if (G_UNLIKELY (glyphs->num_glyphs == 0)) + { + /* If a font has been correctly chosen, but no glyphs are output, + * there's probably something wrong with the shaper, or the font. + * + * Trying to be informative, we print out the font description, + * shaper name, and the text, but to not flood the terminal with + * zillions of the message, we set a flag to only err once per + * font/engine pair. + * + * To do the flag fast, we use the engine qname to qflag the font, + * but also the font description to flag the engine. This is + * supposed to be fast to check, but also avoid writing out + * duplicate warnings when a new PangoFont is created. + */ + GType engine_type = G_OBJECT_TYPE (analysis->shape_engine); + GQuark warned_quark = g_type_qname (engine_type); + + if (!g_object_get_qdata (G_OBJECT (analysis->font), warned_quark)) + { + PangoFontDescription *desc; + char *font_name; + const char *engine_name; + + desc = pango_font_describe (analysis->font); + font_name = pango_font_description_to_string (desc); + pango_font_description_free (desc); + + if (!g_object_get_data (G_OBJECT (analysis->shape_engine), font_name)) + { + engine_name = g_type_name (engine_type); + if (!engine_name) + engine_name = "(unknown)"; + + g_warning ("shaping failure, expect ugly output. shape-engine='%s', font='%s', text='%.*s'", + engine_name, font_name, item_length, item_text); + + g_object_set_data_full (G_OBJECT (analysis->shape_engine), font_name, + GINT_TO_POINTER (1), NULL); + } + + g_free (font_name); + + g_object_set_qdata_full (G_OBJECT (analysis->font), warned_quark, + GINT_TO_POINTER (1), NULL); + } + } + } + else + glyphs->num_glyphs = 0; + + if (G_UNLIKELY (!glyphs->num_glyphs)) + { + PangoEngineShape *fallback_engine = _pango_get_fallback_shaper (); + + _pango_engine_shape_shape (fallback_engine, analysis->font, + item_text, item_length, + paragraph_text, paragraph_length, + analysis, glyphs); + if (G_UNLIKELY (!glyphs->num_glyphs)) + return; + } + + /* make sure last_cluster is invalid */ + last_cluster = glyphs->log_clusters[0] - 1; + for (i = 0; i < glyphs->num_glyphs; i++) + { + /* Set glyphs[i].attr.is_cluster_start based on log_clusters[] */ + if (glyphs->log_clusters[i] != last_cluster) + { + glyphs->glyphs[i].attr.is_cluster_start = TRUE; + last_cluster = glyphs->log_clusters[i]; + } + else + glyphs->glyphs[i].attr.is_cluster_start = FALSE; + + + /* Shift glyph if width is negative, and negate width. + * This is useful for rotated font matrices and shouldn't + * harm in normal cases. + */ + if (glyphs->glyphs[i].geometry.width < 0) + { + glyphs->glyphs[i].geometry.width = -glyphs->glyphs[i].geometry.width; + glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[i].geometry.width; + } + } + + /* Make sure glyphstring direction conforms to analysis->level */ + if (G_UNLIKELY ((analysis->level & 1) && + glyphs->log_clusters[0] < glyphs->log_clusters[glyphs->num_glyphs - 1])) + { + /* Warn once per shaper */ + static GQuark warned_quark = 0; /* MT-safe */ + + if (!warned_quark) + warned_quark = g_quark_from_static_string ("pango-shape-warned"); + + if (analysis->shape_engine && !g_object_get_qdata (G_OBJECT (analysis->shape_engine), warned_quark)) + { + GType engine_type = G_OBJECT_TYPE (analysis->shape_engine); + const char *engine_name = g_type_name (engine_type); + if (!engine_name) + engine_name = "(unknown)"; + + g_warning ("Expected RTL run but shape-engine='%s' returned LTR. Fixing.", engine_name); + + g_object_set_qdata_full (G_OBJECT (analysis->shape_engine), warned_quark, + GINT_TO_POINTER (1), NULL); + } + + /* *Fix* it so we don't crash later */ + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); + } +} diff --git a/pangocairo.pc.in b/pangocairo.pc.in new file mode 100644 index 0000000..ea5e326 --- /dev/null +++ b/pangocairo.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Pango Cairo +Description: Cairo rendering support for Pango +Version: @VERSION@ +Requires: pango @CAIRO_PC@ +Requires.private: @PKGCONFIG_CAIRO_REQUIRES@ +Libs: -L${libdir} -lpangocairo-@PANGO_API_VERSION@ @CAIRO_LIB@ +Cflags: -I${includedir}/pango-1.0 diff --git a/pangoft2.pc.in b/pangoft2.pc.in new file mode 100644 index 0000000..42eea21 --- /dev/null +++ b/pangoft2.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Pango FT2 and Pango Fc +Description: Freetype 2.0 and fontconfig font support for Pango +Version: @VERSION@ +Requires: pango @FREETYPE2_PC@ @FONTCONFIG_PC@ +Requires.private: @HARFBUZZ_PC@ +Libs: -L${libdir} -lpangoft2-@PANGO_API_VERSION@ @FREETYPE2_LIB@ @FONTCONFIG_LIB@ @HARFBUZZ_LIB@ +Cflags: -I${includedir}/pango-1.0 diff --git a/pangowin32.pc.in b/pangowin32.pc.in new file mode 100644 index 0000000..34ea6a3 --- /dev/null +++ b/pangowin32.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Pango Win32 +Description: Win32 GDI font support for Pango +Version: @VERSION@ +Requires: pango +Libs: -L${libdir} -lpangowin32-@PANGO_API_VERSION@ +Libs.private: -lusp10 -lgdi32 +Cflags: -I${includedir}/pango-1.0 diff --git a/pangoxft.pc.in b/pangoxft.pc.in new file mode 100644 index 0000000..66202ec --- /dev/null +++ b/pangoxft.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Pango Xft +Description: Xft font support for Pango +Version: @VERSION@ +Requires: pango pangoft2 xft +Libs: -L${libdir} -lpangoxft-@PANGO_API_VERSION@ +Cflags: -I${includedir}/pango-1.0 diff --git a/test-driver b/test-driver new file mode 100755 index 0000000..de1e61d --- /dev/null +++ b/test-driver @@ -0,0 +1,148 @@ +#!/bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/tests/GraphemeBreakTest.txt b/tests/GraphemeBreakTest.txt new file mode 100644 index 0000000..4bb4b13 --- /dev/null +++ b/tests/GraphemeBreakTest.txt @@ -0,0 +1,849 @@ +# GraphemeBreakTest-9.0.0.txt +# Date: 2016-06-02, 18:28:17 GMT +# © 2016 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# +# Unicode Character Database +# For documentation, see http://www.unicode.org/reports/tr44/ +# +# Default Grapheme Break Test +# +# Format: +# (# )? +# contains hex Unicode code points, with +# ÷ wherever there is a break opportunity, and +# × wherever there is not. +# the format can change, but currently it shows: +# - the sample character name +# - (x) the Grapheme_Cluster_Break property value for the sample character +# - [x] the rule that determines whether there is a break or not +# +# These samples may be extended or changed in the future. +# +÷ 0020 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 × 0308 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 × 0308 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 × 0308 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0308 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 × 0308 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 ÷ 0600 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0020 × 0308 ÷ 0600 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0020 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 × 0308 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 × 0308 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 × 0308 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 × 0308 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 × 0308 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0020 × 0308 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0020 ÷ 1F1E6 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0020 ÷ 261D ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0020 × 0308 ÷ 261D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0020 ÷ 1F3FB ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0020 × 200D ÷ # ÷ [0.2] SPACE (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0020 × 0308 × 200D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0020 ÷ 2764 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0020 × 0308 ÷ 2764 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0020 ÷ 1F466 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F466 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0020 ÷ 0378 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] (Other) ÷ [0.3] +÷ 0020 × 0308 ÷ 0378 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0020 ÷ D800 ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0308 ÷ D800 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] (CR) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000D × 000A ÷ # ÷ [0.2] (CR) × [3.0] (LF) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000D ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Control) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D ÷ 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0308 × 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0600 ÷ # ÷ [0.2] (CR) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000D ÷ 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 0308 × 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 1F1E6 ÷ # ÷ [0.2] (CR) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000D ÷ 261D ÷ # ÷ [0.2] (CR) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000D ÷ 1F3FB ÷ # ÷ [0.2] (CR) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000D ÷ 200D ÷ # ÷ [0.2] (CR) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000D ÷ 0308 × 200D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000D ÷ 2764 ÷ # ÷ [0.2] (CR) ÷ [4.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 2764 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 000D ÷ 1F466 ÷ # ÷ [0.2] (CR) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 000D ÷ 0378 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Other) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 000D ÷ D800 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Control) ÷ [0.3] +÷ 000D ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000A ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] (CR) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000A ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] (LF) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000A ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Control) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000A ÷ 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0308 × 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0600 ÷ # ÷ [0.2] (LF) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000A ÷ 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 0308 × 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 1F1E6 ÷ # ÷ [0.2] (LF) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000A ÷ 261D ÷ # ÷ [0.2] (LF) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000A ÷ 1F3FB ÷ # ÷ [0.2] (LF) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000A ÷ 200D ÷ # ÷ [0.2] (LF) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000A ÷ 0308 × 200D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000A ÷ 2764 ÷ # ÷ [0.2] (LF) ÷ [4.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 2764 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 000A ÷ 1F466 ÷ # ÷ [0.2] (LF) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 000A ÷ 0378 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Other) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 000A ÷ D800 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Control) ÷ [0.3] +÷ 000A ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] (CR) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0001 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0308 × 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0001 ÷ 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 0308 × 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0001 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0001 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0001 ÷ 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0001 ÷ 0308 × 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0001 ÷ 2764 ÷ # ÷ [0.2] (Control) ÷ [4.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 2764 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0001 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0001 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Other) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0001 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 × 0308 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 × 0308 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 × 0308 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0308 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 × 0308 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 ÷ 0600 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0300 × 0308 ÷ 0600 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0300 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 × 0308 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 × 0308 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 × 0308 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 × 0308 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 × 0308 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 × 0308 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 ÷ 1F1E6 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0300 ÷ 261D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0300 × 0308 ÷ 261D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0300 ÷ 1F3FB ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0300 × 200D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0300 × 0308 × 200D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0300 ÷ 2764 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0300 × 0308 ÷ 2764 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0300 ÷ 1F466 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F466 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0300 ÷ 0378 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0300 × 0308 ÷ 0378 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0300 ÷ D800 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0308 ÷ D800 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0020 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] SPACE (Other) ÷ [0.3] +÷ 0600 × 0308 ÷ 0020 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0600 ÷ 000D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0600 × 0308 ÷ 000D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0600 ÷ 000A ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0600 × 0308 ÷ 000A ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0600 ÷ 0001 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0308 ÷ 0001 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0300 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0600 × 0308 × 0300 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0600 × 0600 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0600 × 0308 ÷ 0600 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0600 × 0903 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0600 × 0308 × 0903 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0600 × 1100 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0600 × 0308 ÷ 1100 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0600 × 1160 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0600 × 0308 ÷ 1160 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0600 × 11A8 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0600 × 0308 ÷ 11A8 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0600 × AC00 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0600 × 0308 ÷ AC00 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0600 × AC01 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0600 × 0308 ÷ AC01 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0600 × 1F1E6 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0600 × 261D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0600 × 0308 ÷ 261D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0600 × 1F3FB ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0600 × 200D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0600 × 0308 × 200D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0600 × 2764 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0600 × 0308 ÷ 2764 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0600 × 1F466 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] BOY (EBG) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F466 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0600 × 0378 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] (Other) ÷ [0.3] +÷ 0600 × 0308 ÷ 0378 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0600 ÷ D800 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0308 ÷ D800 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 × 0308 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 × 0308 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 × 0308 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0308 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 × 0308 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 ÷ 0600 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0903 × 0308 ÷ 0600 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0903 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 × 0308 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 × 0308 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 × 0308 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 × 0308 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 × 0308 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 × 0308 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 ÷ 1F1E6 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0903 ÷ 261D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0903 × 0308 ÷ 261D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0903 ÷ 1F3FB ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0903 × 200D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0903 × 0308 × 200D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0903 ÷ 2764 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0903 × 0308 ÷ 2764 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0903 ÷ 1F466 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F466 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0903 ÷ 0378 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] (Other) ÷ [0.3] +÷ 0903 × 0308 ÷ 0378 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0903 ÷ D800 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0308 ÷ D800 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 ÷ 0600 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1100 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1100 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1100 ÷ 261D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1100 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1100 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1100 × 200D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1100 × 0308 × 200D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1100 ÷ 2764 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1100 × 0308 ÷ 2764 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1100 ÷ 1F466 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1100 ÷ 0378 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] (Other) ÷ [0.3] +÷ 1100 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1100 ÷ D800 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 ÷ 0600 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1160 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1160 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1160 ÷ 261D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1160 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1160 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1160 × 200D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1160 × 0308 × 200D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1160 ÷ 2764 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1160 × 0308 ÷ 2764 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1160 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1160 ÷ 0378 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] (Other) ÷ [0.3] +÷ 1160 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1160 ÷ D800 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 ÷ 0600 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 11A8 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 11A8 ÷ 261D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 11A8 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 11A8 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 11A8 × 200D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 11A8 × 0308 × 200D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 11A8 ÷ 2764 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 11A8 × 0308 ÷ 2764 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 11A8 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 11A8 ÷ 0378 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] (Other) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 11A8 ÷ D800 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC00 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC00 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC00 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC00 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC00 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC00 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC00 × 0308 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC00 ÷ 2764 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ AC00 × 0308 ÷ 2764 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ AC00 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC00 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] (Other) ÷ [0.3] +÷ AC00 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ AC00 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC01 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC01 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC01 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC01 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC01 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC01 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC01 × 0308 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC01 ÷ 2764 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ AC01 × 0308 ÷ 2764 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ AC01 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC01 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] (Other) ÷ [0.3] +÷ AC01 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ AC01 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 ÷ 0020 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0020 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F1E6 ÷ 000D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 000D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F1E6 ÷ 000A ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 000A ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F1E6 ÷ 0001 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0001 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0300 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F1E6 × 0308 × 0300 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F1E6 ÷ 0600 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0600 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F1E6 × 0903 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F1E6 × 0308 × 0903 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F1E6 ÷ 1100 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1100 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 ÷ 1160 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1160 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F1E6 ÷ 11A8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 11A8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F1E6 ÷ AC00 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ AC00 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F1E6 ÷ AC01 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ AC01 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F1E6 × 1F1E6 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [12.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F1E6 ÷ 261D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 261D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F1E6 ÷ 1F3FB ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F1E6 × 200D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F1E6 × 0308 × 200D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F1E6 ÷ 2764 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 2764 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F1E6 ÷ 1F466 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F466 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F1E6 ÷ 0378 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0378 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F1E6 ÷ D800 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ D800 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D ÷ 0020 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 261D × 0308 ÷ 0020 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 261D ÷ 000D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (CR) ÷ [0.3] +÷ 261D × 0308 ÷ 000D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 261D ÷ 000A ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (LF) ÷ [0.3] +÷ 261D × 0308 ÷ 000A ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 261D ÷ 0001 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0308 ÷ 0001 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0300 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 261D × 0308 × 0300 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 261D ÷ 0600 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 261D × 0308 ÷ 0600 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 261D × 0903 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 261D × 0308 × 0903 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 261D ÷ 1100 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 261D × 0308 ÷ 1100 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 261D ÷ 1160 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 261D × 0308 ÷ 1160 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 261D ÷ 11A8 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 261D × 0308 ÷ 11A8 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 261D ÷ AC00 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 261D × 0308 ÷ AC00 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 261D ÷ AC01 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 261D × 0308 ÷ AC01 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 261D ÷ 1F1E6 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 261D × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 261D ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 261D × 0308 ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 261D × 1F3FB ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 261D × 0308 × 1F3FB ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 261D × 200D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 261D × 0308 × 200D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 261D ÷ 2764 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 261D × 0308 ÷ 2764 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 261D ÷ 1F466 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 261D × 0308 ÷ 1F466 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 261D ÷ 0378 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] (Other) ÷ [0.3] +÷ 261D × 0308 ÷ 0378 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 261D ÷ D800 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0308 ÷ D800 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB ÷ 0020 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0020 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F3FB ÷ 000D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 000D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F3FB ÷ 000A ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 000A ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F3FB ÷ 0001 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0001 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0300 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F3FB × 0308 × 0300 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F3FB ÷ 0600 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0600 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F3FB × 0903 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F3FB × 0308 × 0903 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F3FB ÷ 1100 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1100 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F3FB ÷ 1160 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1160 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F3FB ÷ 11A8 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 11A8 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F3FB ÷ AC00 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F3FB × 0308 ÷ AC00 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F3FB ÷ AC01 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F3FB × 0308 ÷ AC01 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F3FB ÷ 1F1E6 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F3FB ÷ 261D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 261D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F3FB ÷ 1F3FB ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F3FB ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F3FB × 200D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F3FB × 0308 × 200D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F3FB ÷ 2764 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 2764 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F3FB ÷ 1F466 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F466 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F3FB ÷ 0378 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0378 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F3FB ÷ D800 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0308 ÷ D800 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D ÷ 0020 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 200D × 0308 ÷ 0020 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 200D ÷ 000D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (CR) ÷ [0.3] +÷ 200D × 0308 ÷ 000D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 200D ÷ 000A ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (LF) ÷ [0.3] +÷ 200D × 0308 ÷ 000A ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 200D ÷ 0001 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0308 ÷ 0001 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0300 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 200D × 0308 × 0300 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 200D ÷ 0600 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 200D × 0308 ÷ 0600 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 200D × 0903 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 200D × 0308 × 0903 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 200D ÷ 1100 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 200D × 0308 ÷ 1100 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 200D ÷ 1160 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 200D × 0308 ÷ 1160 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 200D ÷ 11A8 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 200D × 0308 ÷ 11A8 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 200D ÷ AC00 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 200D × 0308 ÷ AC00 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 200D ÷ AC01 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 200D × 0308 ÷ AC01 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 200D ÷ 1F1E6 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 200D × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 200D ÷ 261D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 200D × 0308 ÷ 261D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 200D ÷ 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 0308 ÷ 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 200D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 200D × 0308 × 200D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 200D × 2764 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 0308 ÷ 2764 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) ÷ [0.3] +÷ 200D × 0308 ÷ 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 200D ÷ 0378 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] (Other) ÷ [0.3] +÷ 200D × 0308 ÷ 0378 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 200D ÷ D800 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0308 ÷ D800 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 2764 ÷ 0020 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 2764 × 0308 ÷ 0020 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 2764 ÷ 000D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [5.0] (CR) ÷ [0.3] +÷ 2764 × 0308 ÷ 000D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 2764 ÷ 000A ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [5.0] (LF) ÷ [0.3] +÷ 2764 × 0308 ÷ 000A ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 2764 ÷ 0001 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [5.0] (Control) ÷ [0.3] +÷ 2764 × 0308 ÷ 0001 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 2764 × 0300 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 2764 × 0308 × 0300 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 2764 ÷ 0600 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 2764 × 0308 ÷ 0600 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 2764 × 0903 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 2764 × 0308 × 0903 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 2764 ÷ 1100 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 2764 × 0308 ÷ 1100 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 2764 ÷ 1160 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 2764 × 0308 ÷ 1160 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 2764 ÷ 11A8 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 2764 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 2764 ÷ AC00 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 2764 × 0308 ÷ AC00 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 2764 ÷ AC01 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 2764 × 0308 ÷ AC01 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 2764 ÷ 1F1E6 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 2764 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 2764 ÷ 261D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 2764 × 0308 ÷ 261D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 2764 ÷ 1F3FB ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 2764 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 2764 × 200D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 2764 × 0308 × 200D ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 2764 ÷ 2764 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 2764 × 0308 ÷ 2764 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 2764 ÷ 1F466 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 2764 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 2764 ÷ 0378 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [999.0] (Other) ÷ [0.3] +÷ 2764 × 0308 ÷ 0378 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 2764 ÷ D800 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [5.0] (Control) ÷ [0.3] +÷ 2764 × 0308 ÷ D800 ÷ # ÷ [0.2] HEAVY BLACK HEART (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 ÷ 0020 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0020 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F466 ÷ 000D ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F466 × 0308 ÷ 000D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F466 ÷ 000A ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F466 × 0308 ÷ 000A ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F466 ÷ 0001 ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0001 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0300 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F466 × 0308 × 0300 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F466 ÷ 0600 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0600 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F466 × 0903 ÷ # ÷ [0.2] BOY (EBG) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F466 × 0308 × 0903 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F466 ÷ 1100 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1100 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F466 ÷ 1160 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1160 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F466 ÷ 11A8 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F466 × 0308 ÷ 11A8 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F466 ÷ AC00 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F466 × 0308 ÷ AC00 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F466 ÷ AC01 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F466 × 0308 ÷ AC01 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F466 ÷ 1F1E6 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F466 ÷ 261D ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 0308 ÷ 261D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F466 × 0308 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F466 × 200D ÷ # ÷ [0.2] BOY (EBG) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F466 × 0308 × 200D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F466 ÷ 2764 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F466 × 0308 ÷ 2764 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 1F466 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F466 ÷ 0378 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0378 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F466 ÷ D800 ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0308 ÷ D800 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 ÷ 0020 ÷ # ÷ [0.2] (Other) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0378 × 0308 ÷ 0020 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0378 ÷ 000D ÷ # ÷ [0.2] (Other) ÷ [5.0] (CR) ÷ [0.3] +÷ 0378 × 0308 ÷ 000D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0378 ÷ 000A ÷ # ÷ [0.2] (Other) ÷ [5.0] (LF) ÷ [0.3] +÷ 0378 × 0308 ÷ 000A ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0378 ÷ 0001 ÷ # ÷ [0.2] (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0308 ÷ 0001 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0300 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0378 × 0308 × 0300 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0378 ÷ 0600 ÷ # ÷ [0.2] (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0378 × 0308 ÷ 0600 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0378 × 0903 ÷ # ÷ [0.2] (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0378 × 0308 × 0903 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0378 ÷ 1100 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0378 × 0308 ÷ 1100 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0378 ÷ 1160 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0378 × 0308 ÷ 1160 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0378 ÷ 11A8 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0378 × 0308 ÷ 11A8 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0378 ÷ AC00 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0378 × 0308 ÷ AC00 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0378 ÷ AC01 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0378 × 0308 ÷ AC01 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0378 ÷ 1F1E6 ÷ # ÷ [0.2] (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0378 ÷ 261D ÷ # ÷ [0.2] (Other) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0378 × 0308 ÷ 261D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0378 ÷ 1F3FB ÷ # ÷ [0.2] (Other) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0378 × 200D ÷ # ÷ [0.2] (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0378 × 0308 × 200D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0378 ÷ 2764 ÷ # ÷ [0.2] (Other) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0378 × 0308 ÷ 2764 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 0378 ÷ 1F466 ÷ # ÷ [0.2] (Other) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F466 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0378 ÷ 0378 ÷ # ÷ [0.2] (Other) ÷ [999.0] (Other) ÷ [0.3] +÷ 0378 × 0308 ÷ 0378 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0378 ÷ D800 ÷ # ÷ [0.2] (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0308 ÷ D800 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ D800 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ D800 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] (CR) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ D800 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] (LF) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ D800 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ D800 ÷ 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ D800 ÷ 0308 × 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ D800 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ D800 ÷ 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ D800 ÷ 0308 × 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ D800 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ D800 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ D800 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ D800 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ D800 ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ D800 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ D800 ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ D800 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ D800 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ D800 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ D800 ÷ 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ D800 ÷ 0308 × 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ D800 ÷ 2764 ÷ # ÷ [0.2] (Control) ÷ [4.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 2764 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ D800 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ D800 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Other) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ D800 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ D800 ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D × 000A ÷ 0061 ÷ 000A ÷ 0308 ÷ # ÷ [0.2] (CR) × [3.0] (LF) ÷ [4.0] LATIN SMALL LETTER A (Other) ÷ [5.0] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [0.3] +÷ 0061 × 0308 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [0.3] +÷ 0020 × 200D ÷ 0646 ÷ # ÷ [0.2] SPACE (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] ARABIC LETTER NOON (Other) ÷ [0.3] +÷ 0646 × 200D ÷ 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 × 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 × 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 × 1F1E7 ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 × 200D ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 200D ÷ 1F1E7 × 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 ÷ 1F1E8 × 1F1E9 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER D (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 × 200D ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0061 × 0308 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 × 0903 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 0600 × 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) × [9.2] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 261D × 1F3FB ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 1F466 × 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 2764 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] HEAVY BLACK HEART (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) ÷ [0.3] +÷ 1F466 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] BOY (EBG) ÷ [0.3] +# +# Lines: 822 +# +# EOF diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..b382e52 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,142 @@ +## Process this file with automake to create Makefile.in. + +EXTRA_DIST = \ + boundaries.utf8 \ + GraphemeBreakTest.txt + +DISTCLEANFILES = all-unicode.txt + +AM_CPPFLAGS = \ + -DSRCDIR=\"$(srcdir)\" \ + -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(X_CFLAGS) + +if HAVE_XFT +AM_CPPFLAGS += -DHAVE_X +endif +if HAVE_XFT +AM_CPPFLAGS += -DHAVE_XFT +endif +if HAVE_FREETYPE +AM_CPPFLAGS += -DHAVE_FREETYPE +endif +if HAVE_WIN32 +AM_CPPFLAGS += -DHAVE_WIN32 +endif + + +if CROSS_COMPILING +TESTS = +else +TESTS = $(check_PROGRAMS) +endif + +TESTS_ENVIRONMENT = \ + srcdir=$(srcdir) \ + G_TEST_SRCDIR=$(abs_srcdir) \ + G_TEST_BUILDDIR=$(abs_builddir) + +check_PROGRAMS = \ + testboundaries \ + testboundaries_ucd \ + testcolor \ + testscript \ + markup-parse \ + test-layout \ + test-font \ + testattributes \ + $(NULL) + +if HAVE_CAIRO +check_PROGRAMS += testiter test-pangocairo-threads +endif +if HAVE_FREETYPE +check_PROGRAMS += test-ot-tags +endif + +TEST_PANGO_LIBS = ../pango/libpango-$(PANGO_API_VERSION).la +TEST_PANGOFT2_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangoft2-$(PANGO_API_VERSION).la +TEST_PANGOCAIRO_LIBS = $(TEST_PANGOFT2_LIBS) ../pango/libpangocairo-$(PANGO_API_VERSION).la + +test_layout_SOURCES = \ + test-layout.c \ + test-common.c \ + test-common.h \ + $(NULL) + +testattributes_SOURCES = \ + testattributes.c \ + test-common.c \ + test-common.h \ + $(NULL) + +gen_all_unicode_LDADD = $(GLIB_LIBS) +testboundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testboundaries_ucd_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testcolor_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testiter_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +testscript_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +test_ot_tags_LDADD = $(TEST_PANGOFT2_LIBS) $(GLIB_LIBS) +test_pangocairo_threads_LDADD = $(TEST_PANGOCAIRO_LIBS) $(CAIRO_LIBS) $(GLIB_LIBS) +dump_boundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +markup_parse_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +test_layout_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +test_font_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +testattributes_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) + +if HAVE_CXX +check_PROGRAMS += cxx-test +endif +cxx_test_SOURCES = cxx-test.cpp + +all-unicode.txt: gen-all-unicode$(EXEEXT) + ./gen-all-unicode > all-unicode.txt + +noinst_PROGRAMS = $(check_PROGRAMS) gen-all-unicode dump-boundaries + +markup_tests = \ + valid-1 valid-2 valid-3 valid-4 valid-5 valid-6 valid-7 valid-8 valid-9 \ + fail-1 fail-2 fail-3 fail-4 fail-5 \ + $(NULL) + +all_markup_data = \ + $(addprefix markups/,$(markup_tests:=.markup) $(markup_tests:=.expected)) + +layout_tests = \ + valid-1 valid-2 \ + $(NULL) + +all_layout_data = \ + $(addprefix layouts/,$(layout_tests:=.markup) $(layout_tests:=.expected)) + + +EXTRA_DIST += $(all_markup_data) $(all_layout_data) + +if BUILDOPT_INSTALL_TESTS +insttestdir=$(libexecdir)/installed-tests/$(PACKAGE) +insttest_PROGRAMS = $(check_PROGRAMS) + +testdatadir = $(insttestdir) +nobase_testdata_DATA = \ + all-unicode.txt \ + boundaries.utf8 \ + GraphemeBreakTest.txt \ + $(all_markup_data) \ + $(all_layout_data) + +testmetadir = $(datadir)/installed-tests/$(PACKAGE) +testmeta_DATA = $(check_PROGRAMS:=.test) + +%.test: %$(EXEEXT) Makefile + $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ + echo 'Type=session' >> $@.tmp; \ + echo 'Exec=$(libexecdir)/installed-tests/$(PACKAGE)/$<' >> $@.tmp; \ + mv $@.tmp $@) +endif + +-include $(top_srcdir)/git.mk diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..9489185 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,1484 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_XFT_TRUE@am__append_1 = -DHAVE_X -DHAVE_XFT +@HAVE_FREETYPE_TRUE@am__append_2 = -DHAVE_FREETYPE +@HAVE_WIN32_TRUE@am__append_3 = -DHAVE_WIN32 +@CROSS_COMPILING_FALSE@TESTS = $(check_PROGRAMS) +check_PROGRAMS = testboundaries$(EXEEXT) testboundaries_ucd$(EXEEXT) \ + testcolor$(EXEEXT) testscript$(EXEEXT) markup-parse$(EXEEXT) \ + test-layout$(EXEEXT) test-font$(EXEEXT) \ + testattributes$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ + $(am__EXEEXT_3) +@HAVE_CAIRO_TRUE@am__append_4 = testiter test-pangocairo-threads +@HAVE_FREETYPE_TRUE@am__append_5 = test-ot-tags +@HAVE_CXX_TRUE@am__append_6 = cxx-test +noinst_PROGRAMS = $(check_PROGRAMS) gen-all-unicode$(EXEEXT) \ + dump-boundaries$(EXEEXT) +subdir = tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_CAIRO_TRUE@am__EXEEXT_1 = testiter$(EXEEXT) \ +@HAVE_CAIRO_TRUE@ test-pangocairo-threads$(EXEEXT) +@HAVE_FREETYPE_TRUE@am__EXEEXT_2 = test-ot-tags$(EXEEXT) +@HAVE_CXX_TRUE@am__EXEEXT_3 = cxx-test$(EXEEXT) +am__installdirs = "$(DESTDIR)$(insttestdir)" \ + "$(DESTDIR)$(testdatadir)" "$(DESTDIR)$(testmetadir)" +PROGRAMS = $(insttest_PROGRAMS) $(noinst_PROGRAMS) +am_cxx_test_OBJECTS = cxx-test.$(OBJEXT) +cxx_test_OBJECTS = $(am_cxx_test_OBJECTS) +cxx_test_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +dump_boundaries_SOURCES = dump-boundaries.c +dump_boundaries_OBJECTS = dump-boundaries.$(OBJEXT) +am__DEPENDENCIES_1 = +dump_boundaries_DEPENDENCIES = $(TEST_PANGO_LIBS) \ + $(am__DEPENDENCIES_1) +gen_all_unicode_SOURCES = gen-all-unicode.c +gen_all_unicode_OBJECTS = gen-all-unicode.$(OBJEXT) +gen_all_unicode_DEPENDENCIES = $(am__DEPENDENCIES_1) +markup_parse_SOURCES = markup-parse.c +markup_parse_OBJECTS = markup-parse.$(OBJEXT) +markup_parse_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) \ + $(am__DEPENDENCIES_1) +test_font_SOURCES = test-font.c +test_font_OBJECTS = test-font.$(OBJEXT) +test_font_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) $(am__DEPENDENCIES_1) +am_test_layout_OBJECTS = test-layout.$(OBJEXT) test-common.$(OBJEXT) +test_layout_OBJECTS = $(am_test_layout_OBJECTS) +test_layout_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) \ + $(am__DEPENDENCIES_1) +test_ot_tags_SOURCES = test-ot-tags.c +test_ot_tags_OBJECTS = test-ot-tags.$(OBJEXT) +test_ot_tags_DEPENDENCIES = $(TEST_PANGOFT2_LIBS) \ + $(am__DEPENDENCIES_1) +test_pangocairo_threads_SOURCES = test-pangocairo-threads.c +test_pangocairo_threads_OBJECTS = test-pangocairo-threads.$(OBJEXT) +test_pangocairo_threads_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_testattributes_OBJECTS = testattributes.$(OBJEXT) \ + test-common.$(OBJEXT) +testattributes_OBJECTS = $(am_testattributes_OBJECTS) +testattributes_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) \ + $(am__DEPENDENCIES_1) +testboundaries_SOURCES = testboundaries.c +testboundaries_OBJECTS = testboundaries.$(OBJEXT) +testboundaries_DEPENDENCIES = $(TEST_PANGO_LIBS) $(am__DEPENDENCIES_1) +testboundaries_ucd_SOURCES = testboundaries_ucd.c +testboundaries_ucd_OBJECTS = testboundaries_ucd.$(OBJEXT) +testboundaries_ucd_DEPENDENCIES = $(TEST_PANGO_LIBS) \ + $(am__DEPENDENCIES_1) +testcolor_SOURCES = testcolor.c +testcolor_OBJECTS = testcolor.$(OBJEXT) +testcolor_DEPENDENCIES = $(TEST_PANGO_LIBS) $(am__DEPENDENCIES_1) +testiter_SOURCES = testiter.c +testiter_OBJECTS = testiter.$(OBJEXT) +testiter_DEPENDENCIES = $(TEST_PANGOCAIRO_LIBS) $(am__DEPENDENCIES_1) +testscript_SOURCES = testscript.c +testscript_OBJECTS = testscript.$(OBJEXT) +testscript_DEPENDENCIES = $(TEST_PANGO_LIBS) $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(cxx_test_SOURCES) dump-boundaries.c gen-all-unicode.c \ + markup-parse.c test-font.c $(test_layout_SOURCES) \ + test-ot-tags.c test-pangocairo-threads.c \ + $(testattributes_SOURCES) testboundaries.c \ + testboundaries_ucd.c testcolor.c testiter.c testscript.c +DIST_SOURCES = $(cxx_test_SOURCES) dump-boundaries.c gen-all-unicode.c \ + markup-parse.c test-font.c $(test_layout_SOURCES) \ + test-ot-tags.c test-pangocairo-threads.c \ + $(testattributes_SOURCES) testboundaries.c \ + testboundaries_ucd.c testcolor.c testiter.c testscript.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +DATA = $(nobase_testdata_DATA) $(testmeta_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = boundaries.utf8 GraphemeBreakTest.txt $(all_markup_data) \ + $(all_layout_data) +DISTCLEANFILES = all-unicode.txt +AM_CPPFLAGS = -DSRCDIR=\"$(srcdir)\" -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) $(GLIB_CFLAGS) $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) $(FREETYPE_CFLAGS) $(X_CFLAGS) $(am__append_1) \ + $(am__append_2) $(am__append_3) +TESTS_ENVIRONMENT = \ + srcdir=$(srcdir) \ + G_TEST_SRCDIR=$(abs_srcdir) \ + G_TEST_BUILDDIR=$(abs_builddir) + +TEST_PANGO_LIBS = ../pango/libpango-$(PANGO_API_VERSION).la +TEST_PANGOFT2_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangoft2-$(PANGO_API_VERSION).la +TEST_PANGOCAIRO_LIBS = $(TEST_PANGOFT2_LIBS) ../pango/libpangocairo-$(PANGO_API_VERSION).la +test_layout_SOURCES = \ + test-layout.c \ + test-common.c \ + test-common.h \ + $(NULL) + +testattributes_SOURCES = \ + testattributes.c \ + test-common.c \ + test-common.h \ + $(NULL) + +gen_all_unicode_LDADD = $(GLIB_LIBS) +testboundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testboundaries_ucd_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testcolor_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +testiter_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +testscript_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +test_ot_tags_LDADD = $(TEST_PANGOFT2_LIBS) $(GLIB_LIBS) +test_pangocairo_threads_LDADD = $(TEST_PANGOCAIRO_LIBS) $(CAIRO_LIBS) $(GLIB_LIBS) +dump_boundaries_LDADD = $(TEST_PANGO_LIBS) $(GLIB_LIBS) +markup_parse_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +test_layout_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +test_font_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +testattributes_LDADD = $(TEST_PANGOCAIRO_LIBS) $(GLIB_LIBS) +cxx_test_SOURCES = cxx-test.cpp +markup_tests = \ + valid-1 valid-2 valid-3 valid-4 valid-5 valid-6 valid-7 valid-8 valid-9 \ + fail-1 fail-2 fail-3 fail-4 fail-5 \ + $(NULL) + +all_markup_data = \ + $(addprefix markups/,$(markup_tests:=.markup) $(markup_tests:=.expected)) + +layout_tests = \ + valid-1 valid-2 \ + $(NULL) + +all_layout_data = \ + $(addprefix layouts/,$(layout_tests:=.markup) $(layout_tests:=.expected)) + +@BUILDOPT_INSTALL_TESTS_TRUE@insttestdir = $(libexecdir)/installed-tests/$(PACKAGE) +@BUILDOPT_INSTALL_TESTS_TRUE@insttest_PROGRAMS = $(check_PROGRAMS) +@BUILDOPT_INSTALL_TESTS_TRUE@testdatadir = $(insttestdir) +@BUILDOPT_INSTALL_TESTS_TRUE@nobase_testdata_DATA = \ +@BUILDOPT_INSTALL_TESTS_TRUE@ all-unicode.txt \ +@BUILDOPT_INSTALL_TESTS_TRUE@ boundaries.utf8 \ +@BUILDOPT_INSTALL_TESTS_TRUE@ GraphemeBreakTest.txt \ +@BUILDOPT_INSTALL_TESTS_TRUE@ $(all_markup_data) \ +@BUILDOPT_INSTALL_TESTS_TRUE@ $(all_layout_data) + +@BUILDOPT_INSTALL_TESTS_TRUE@testmetadir = $(datadir)/installed-tests/$(PACKAGE) +@BUILDOPT_INSTALL_TESTS_TRUE@testmeta_DATA = $(check_PROGRAMS:=.test) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-insttestPROGRAMS: $(insttest_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(insttest_PROGRAMS)'; test -n "$(insttestdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(insttestdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(insttestdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(insttestdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(insttestdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-insttestPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(insttest_PROGRAMS)'; test -n "$(insttestdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(insttestdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(insttestdir)" && rm -f $$files + +clean-insttestPROGRAMS: + @list='$(insttest_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +installcheck-insttestPROGRAMS: $(insttest_PROGRAMS) + bad=0; pid=$$$$; list="$(insttest_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(insttestdir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +cxx-test$(EXEEXT): $(cxx_test_OBJECTS) $(cxx_test_DEPENDENCIES) $(EXTRA_cxx_test_DEPENDENCIES) + @rm -f cxx-test$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(cxx_test_OBJECTS) $(cxx_test_LDADD) $(LIBS) + +dump-boundaries$(EXEEXT): $(dump_boundaries_OBJECTS) $(dump_boundaries_DEPENDENCIES) $(EXTRA_dump_boundaries_DEPENDENCIES) + @rm -f dump-boundaries$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dump_boundaries_OBJECTS) $(dump_boundaries_LDADD) $(LIBS) + +gen-all-unicode$(EXEEXT): $(gen_all_unicode_OBJECTS) $(gen_all_unicode_DEPENDENCIES) $(EXTRA_gen_all_unicode_DEPENDENCIES) + @rm -f gen-all-unicode$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gen_all_unicode_OBJECTS) $(gen_all_unicode_LDADD) $(LIBS) + +markup-parse$(EXEEXT): $(markup_parse_OBJECTS) $(markup_parse_DEPENDENCIES) $(EXTRA_markup_parse_DEPENDENCIES) + @rm -f markup-parse$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(markup_parse_OBJECTS) $(markup_parse_LDADD) $(LIBS) + +test-font$(EXEEXT): $(test_font_OBJECTS) $(test_font_DEPENDENCIES) $(EXTRA_test_font_DEPENDENCIES) + @rm -f test-font$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_font_OBJECTS) $(test_font_LDADD) $(LIBS) + +test-layout$(EXEEXT): $(test_layout_OBJECTS) $(test_layout_DEPENDENCIES) $(EXTRA_test_layout_DEPENDENCIES) + @rm -f test-layout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_layout_OBJECTS) $(test_layout_LDADD) $(LIBS) + +test-ot-tags$(EXEEXT): $(test_ot_tags_OBJECTS) $(test_ot_tags_DEPENDENCIES) $(EXTRA_test_ot_tags_DEPENDENCIES) + @rm -f test-ot-tags$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ot_tags_OBJECTS) $(test_ot_tags_LDADD) $(LIBS) + +test-pangocairo-threads$(EXEEXT): $(test_pangocairo_threads_OBJECTS) $(test_pangocairo_threads_DEPENDENCIES) $(EXTRA_test_pangocairo_threads_DEPENDENCIES) + @rm -f test-pangocairo-threads$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pangocairo_threads_OBJECTS) $(test_pangocairo_threads_LDADD) $(LIBS) + +testattributes$(EXEEXT): $(testattributes_OBJECTS) $(testattributes_DEPENDENCIES) $(EXTRA_testattributes_DEPENDENCIES) + @rm -f testattributes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testattributes_OBJECTS) $(testattributes_LDADD) $(LIBS) + +testboundaries$(EXEEXT): $(testboundaries_OBJECTS) $(testboundaries_DEPENDENCIES) $(EXTRA_testboundaries_DEPENDENCIES) + @rm -f testboundaries$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testboundaries_OBJECTS) $(testboundaries_LDADD) $(LIBS) + +testboundaries_ucd$(EXEEXT): $(testboundaries_ucd_OBJECTS) $(testboundaries_ucd_DEPENDENCIES) $(EXTRA_testboundaries_ucd_DEPENDENCIES) + @rm -f testboundaries_ucd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testboundaries_ucd_OBJECTS) $(testboundaries_ucd_LDADD) $(LIBS) + +testcolor$(EXEEXT): $(testcolor_OBJECTS) $(testcolor_DEPENDENCIES) $(EXTRA_testcolor_DEPENDENCIES) + @rm -f testcolor$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testcolor_OBJECTS) $(testcolor_LDADD) $(LIBS) + +testiter$(EXEEXT): $(testiter_OBJECTS) $(testiter_DEPENDENCIES) $(EXTRA_testiter_DEPENDENCIES) + @rm -f testiter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testiter_OBJECTS) $(testiter_LDADD) $(LIBS) + +testscript$(EXEEXT): $(testscript_OBJECTS) $(testscript_DEPENDENCIES) $(EXTRA_testscript_DEPENDENCIES) + @rm -f testscript$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testscript_OBJECTS) $(testscript_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cxx-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump-boundaries.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-all-unicode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/markup-parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-font.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-layout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-tags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pangocairo-threads.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testattributes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testboundaries.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testboundaries_ucd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcolor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testiter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testscript.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nobase_testdataDATA: $(nobase_testdata_DATA) + @$(NORMAL_INSTALL) + @list='$(nobase_testdata_DATA)'; test -n "$(testdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(testdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(testdatadir)" || exit 1; \ + fi; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(testdatadir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(testdatadir)/$$dir"; }; \ + echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(testdatadir)/$$dir'"; \ + $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(testdatadir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_testdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(nobase_testdata_DATA)'; test -n "$(testdatadir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + dir='$(DESTDIR)$(testdatadir)'; $(am__uninstall_files_from_dir) +install-testmetaDATA: $(testmeta_DATA) + @$(NORMAL_INSTALL) + @list='$(testmeta_DATA)'; test -n "$(testmetadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(testmetadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(testmetadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(testmetadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(testmetadir)" || exit $$?; \ + done + +uninstall-testmetaDATA: + @$(NORMAL_UNINSTALL) + @list='$(testmeta_DATA)'; test -n "$(testmetadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(testmetadir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +testboundaries.log: testboundaries$(EXEEXT) + @p='testboundaries$(EXEEXT)'; \ + b='testboundaries'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +testboundaries_ucd.log: testboundaries_ucd$(EXEEXT) + @p='testboundaries_ucd$(EXEEXT)'; \ + b='testboundaries_ucd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +testcolor.log: testcolor$(EXEEXT) + @p='testcolor$(EXEEXT)'; \ + b='testcolor'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +testscript.log: testscript$(EXEEXT) + @p='testscript$(EXEEXT)'; \ + b='testscript'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +markup-parse.log: markup-parse$(EXEEXT) + @p='markup-parse$(EXEEXT)'; \ + b='markup-parse'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-layout.log: test-layout$(EXEEXT) + @p='test-layout$(EXEEXT)'; \ + b='test-layout'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-font.log: test-font$(EXEEXT) + @p='test-font$(EXEEXT)'; \ + b='test-font'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +testattributes.log: testattributes$(EXEEXT) + @p='testattributes$(EXEEXT)'; \ + b='testattributes'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +testiter.log: testiter$(EXEEXT) + @p='testiter$(EXEEXT)'; \ + b='testiter'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-pangocairo-threads.log: test-pangocairo-threads$(EXEEXT) + @p='test-pangocairo-threads$(EXEEXT)'; \ + b='test-pangocairo-threads'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ot-tags.log: test-ot-tags$(EXEEXT) + @p='test-ot-tags$(EXEEXT)'; \ + b='test-ot-tags'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +cxx-test.log: cxx-test$(EXEEXT) + @p='cxx-test$(EXEEXT)'; \ + b='cxx-test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(insttestdir)" "$(DESTDIR)$(testdatadir)" "$(DESTDIR)$(testmetadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-insttestPROGRAMS \ + clean-libtool clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-insttestPROGRAMS install-nobase_testdataDATA \ + install-testmetaDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: installcheck-insttestPROGRAMS + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-insttestPROGRAMS uninstall-nobase_testdataDATA \ + uninstall-testmetaDATA + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-insttestPROGRAMS \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-insttestPROGRAMS install-man \ + install-nobase_testdataDATA install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-testmetaDATA \ + installcheck installcheck-am installcheck-insttestPROGRAMS \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am uninstall-insttestPROGRAMS \ + uninstall-nobase_testdataDATA uninstall-testmetaDATA + +.PRECIOUS: Makefile + + +all-unicode.txt: gen-all-unicode$(EXEEXT) + ./gen-all-unicode > all-unicode.txt + +@BUILDOPT_INSTALL_TESTS_TRUE@%.test: %$(EXEEXT) Makefile +@BUILDOPT_INSTALL_TESTS_TRUE@ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ +@BUILDOPT_INSTALL_TESTS_TRUE@ echo 'Type=session' >> $@.tmp; \ +@BUILDOPT_INSTALL_TESTS_TRUE@ echo 'Exec=$(libexecdir)/installed-tests/$(PACKAGE)/$<' >> $@.tmp; \ +@BUILDOPT_INSTALL_TESTS_TRUE@ mv $@.tmp $@) + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/boundaries.utf8 b/tests/boundaries.utf8 new file mode 100644 index 0000000..28782a8 --- /dev/null +++ b/tests/boundaries.utf8 @@ -0,0 +1,765 @@ +Testing sentence boundaries - this is a sentence ending in several exclamation points!!! Several spaces there. Abbreviations such as Mr. or Mrs. should not result in sentence breaks, should they?! (Parentheses should be included in a sentence.) (((Even nested parentheses, with funny punctuation inside!!?!!...))) Anyhow, this should be enough testing. + +This text has carriage returns +all over the freaking place + such as here here and here + +but not at the end of this line. + +This is some "quoted" text e.g. "this is some stuff in quotes" and +'this is some other stuff in single quotes' and ""this is some stuff with +two levels of double quotes"" and so on. + +Big string of Arabic: +وقد بدأ ثلاث من أكثر المؤسسات تقدما في شبكة اكسيون برامجها كمنظمات لا تسعى للربح، ثم تحولت في السنوات الخمس الماضية إلى مؤسسات مالية منظمة، وباتت جزءا من النظام المالي في بلدانها، ولكنها تتخصص في خدمة قطاع المشروعات الصغيرة. وأحد أكثر هذه المؤسسات نجاحا هو »بانكوسول« في بوليفيا. + + +Παν語 + +This is a list of ways to say hello in various languages. Its purpose is to illustrate a number of scripts. + +(Converted into UTF-8) + +--------------------------------------------------------- +Arabic السلام عليكم +Bengali (বাঙ্লা) ষাগতোম +Burmese (မ္ရန္မာ) +Cherokee (ᏣᎳᎩ) ᎣᏏᏲ +Czech (česky) Dobrý den +Danish (Dansk) Hej, Goddag +English Hello +Esperanto Saluton +Estonian Tere, Tervist +FORTRAN PROGRAM +Finnish (Suomi) Hei +French (Français) Bonjour, Salut +German (Deutsch Nord) Guten Tag +German (Deutsch Süd) Grüß Gott +Georgian (ქართველი) გამარჯობა +Gujarati (ગુજરાતિ) +Greek (Ελληνικά) Γειά σας +Hebrew שלום +Hindi नमस्ते, नमस्कार। +Italiano Ciao, Buon giorno +ɪŋglɪʃ hɛləʊ +Maltese Ċaw, Saħħa +Nederlands, Vlaams Hallo, Dag +Norwegian (Norsk) Hei, God dag +Punjabi (ੁਪੁਂਜਾਬਿ) +Polish Dzień dobry, Hej +Russian (Русский) Здравствуйте! +Slovak Dobrý deň +Spanish (Español) ‎¡Hola!‎ +Swedish (Svenska) Hej, Goddag +Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ +Turkish (Türkçe) Merhaba +Vietnamese (Tiếng Việt) Xin Chào +Yiddish (ײַדישע) דאָס הײַזעלע + +Japanese (日本語) こんにちは, コンニチハ +Chinese (中文,普通话,汉语) 你好 +Cantonese (粵語,廣東話) 早晨, 你好 +Korean (한글) 안녕하세요, 안녕하십니까 + +Difference among chinese characters in GB, JIS, KSC, BIG5:‎ + GB -- 元气 开发 + JIS -- 元気 開発 + KSC -- 元氣 開發 + BIG5 -- 元氣 開發 + + + + + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᅦ + ᄀᅠᆨ깎렚ँ्က್⽔む ँ +
ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + + +ᆹ + + 
 +
 +
ँ + + 
 
ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む

ᄀᅠᆨ깎렚ँ्က್⽔むᆩ က + +
 ᅠ ⽔ 
 ᄀᅠᆨ깎렚ँ्က್⽔む 
 +ᄀᅠᆨ깎렚ँ्က್⽔む + 
ᅦ + 
 ᆹ ᄀᅠᆨ깎렚ँ्က್⽔むᅡ က + +ᄅ

 + 
 
ᄀᅠᆨ깎렚ँ्က್⽔む
 +
 
 + +ᆨ + + ᅡ ᆩ + +ᄅ 
 
 + + 
 + + ⽔ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +
ᄀᅠᆨ깎렚ँ्က್⽔むᆹ + + + 
 +
ᄀᅠᆨ깎렚ँ्က್⽔む
 ᅠ + + 
 +ᄀᅠᆨ깎렚ँ्က್⽔む + ᅠ +
ᄀᅠᆨ깎렚ँ्က್⽔む + + +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + +ᄀᅠᆨ깎렚ँ्က್⽔む ᄀ +
 
 
 + + 
 + 
 +
ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む
 + + + 
ᄀᅠᆨ깎렚ँ्က್⽔む 
 +⽔
 + +⽔
ᄀᅠᆨ깎렚ँ्က್⽔む 
 
 
ᄀᅠᆨ깎렚ँ्က್⽔む 
 + + +ᅠ +ᄀᅠᆨ깎렚ँ्က್⽔む + 
 + + 
ᆨ + ᆨ +
 + + ँ + 
 ᅦ् ᄀᅠᆨ깎렚ँ्က್⽔む + + +
ँ + 
 +ᅠ 
ᄀᅠᆨ깎렚ँ्က್⽔む ᅠ +

ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᅦ + +ᄀᅠᆨ깎렚ँ्က್⽔む + ್ँ
 ᄀ 
 ᄀᅠᆨ깎렚ँ्က್⽔む್ + +ᄀᅠᆨ깎렚ँ्က್⽔む ᄅᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む + + +ᅠ + ᄁ 
 
 ᆨᄀᅠᆨ깎렚ँ्က್⽔む + むᆹ + +ᆹ +
 + +
 + + + + ᄀᅠᆨ깎렚ँ्က್⽔む

 + +
 
 ᄀᅠᆨ깎렚ँ्က್⽔む
 + + + + + + +
 ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + + + + ᅠむ +
 ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + + + + + + + + + + ँ +ᄀᅠᆨ깎렚ँ्က್⽔む + 
 +ᆩ +ᅠ +
 
ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔むむ ᄀᅠᆨ깎렚ँ्က್⽔む + +್ + +ᅡ +က ᅠ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + + +ँᅦ + + ᄀᅠᆨ깎렚ँ्က್⽔む
ᄀँᄀᅠᆨ깎렚ँ्က್⽔む +
 ᄀᄀᅠᆨ깎렚ँ्က್⽔む + 

 ᄀᅠᆨ깎렚ँ्က್⽔む ᆨᅦ +
 ᄀᅠᆨ깎렚ँ्က್⽔む + 
 
ᄀᅠᆨ깎렚ँ्က್⽔む + + + + +
ᅠ ᄀ ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᄀᅠᆨ깎렚ँ्က್⽔む् +
 ँ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +ᆨ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +
् ᄁ 
 + + ᄀᅠᆨ깎렚ँ्က್⽔む +
 ᄀᅠᆨ깎렚ँ्က್⽔む ್ + ᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む 
ᄀᅠᆨ깎렚ँ्က್⽔む +
ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔む +ँ + +ᄀᄅ +ᄀ ᅡ +ँ +ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᅦ ᄀᅠᆨ깎렚ँ्က್⽔む + ್ + + + +
 +ᅠ + +
ᄀᅠᆨ깎렚ँ्က್⽔む ᄅ 
 + + + +
 +ᄀᅠᆨ깎렚ँ्က್⽔む + + 
 +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + + +ᄀ + +ᆩ ᆩ + + ⽔ᆩ +ᅡ +
 +ᄀᅠᆨ깎렚ँ्က್⽔む 
ᄀᅠᆨ깎렚ँ्က್⽔むᅦ + +ᄀ
 
 ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀ + ᄀ
 + + + むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + 
 + + ᆹᅠ + ् + ᄀᅠᆨ깎렚ँ्က್⽔む 
ᅠ + + + + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +् + + 
 +
 ᅡ 
 ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀ +ᄅ
 + +ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᄀᅠᆨ깎렚ँ्က್⽔む 
 + +ᅡᄀᅠᆨ깎렚ँ्က್⽔む + +
 +
 
 + + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む က + ᄀᅠᆨ깎렚ँ्က್⽔む ್ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む + ँᄀᅠᆨ깎렚ँ्က್⽔む
 + + +ᄀ + ᆹᄅ + + ᄀᅠᆨ깎렚ँ्က್⽔む + +ᄀᅠᆨ깎렚ँ्က್⽔む +
 ᄀᅠᆨ깎렚ँ्က್⽔む +् + + む + + +ᄀᅠᆨ깎렚ँ्က್⽔む + 
ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む
 + + 
 + +ᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀᅠᆨ깎렚ँ्က್⽔む + +
ᄀᅠᆨ깎렚ँ्က್⽔む + +
 ᄀᅠᆨ깎렚ँ्က್⽔む +む +ᄀᅠᆨ깎렚ँ्က್⽔む +ᅦ +ᄀᅠᆨ깎렚ँ्က್⽔む
 
 + + 

ᄀᅠᆨ깎렚ँ्က್⽔む 
 ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ್ + + ᅦက ᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + +ᄀᅠᆨ깎렚ँ्က್⽔む +
 ँ + + +
 
 + ᄀᅠᆨ깎렚ँ्က್⽔む 
 + +ᅡ +ᄀᅠᆨ깎렚ँ्က್⽔む
 +ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔む + ँᄀᅠᆨ깎렚ँ्က್⽔む 
 +್ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +
 
 +् ्
 + + + + ᄀᅠᆨ깎렚ँ्က್⽔む + +
 + + ᄀᅠᆨ깎렚ँ्က್⽔む 
 + 
 
 ᄀᅠᆨ깎렚ँ्က್⽔む +ᅠ + + +
ᄀᅠᆨ깎렚ँ्က್⽔む
 ⽔ᅦᄁ +
က + 
 ᄅᄀᅠᆨ깎렚ँ्က್⽔む ್⽔ + + + 
 + + むँ ⽔ + + +
 + + + ್ + ᄀᅠᆨ깎렚ँ्က್⽔む ᅡ ᄀᅠᆨ깎렚ँ्က್⽔むᄅ + +ᅡ ्
 + + + +ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔む 

 +ᄀᅠᆨ깎렚ँ्က್⽔むँ +ᄁᄀᅠᆨ깎렚ँ्က್⽔む
 む ᅦᄀᅠᆨ깎렚ँ्က್⽔む + +ᄁ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀ + +् ⽔ᄀ + + + + ್ ᄀᅠᆨ깎렚ँ्က್⽔む + +ᄀᅠᆨ깎렚ँ्က್⽔む + + +ᄀᅠᆨ깎렚ँ्က್⽔む +ᆹ ᆨ + ᄀᅠᆨ깎렚ँ्က್⽔む +
 +ᅦᆹᄀᅠᆨ깎렚ँ्က್⽔む + +

 ᄀ + ᄀᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むむᄀᄀᅠᆨ깎렚ँ्က್⽔む್ + 
 +ᄀᅠᆨ깎렚ँ्က್⽔む + + 
 ᄀᅠᆨ깎렚ँ्က್⽔む
्
ᄀᅠᆨ깎렚ँ्က್⽔むᅠᄀᅠᆨ깎렚ँ्က್⽔むᄀ
 ँ +ᄀᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む್ ᄀᅠᆨ깎렚ँ्က್⽔む + 

 + + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᅠ + 
 + + + +
 む ᄀᅠᆨ깎렚ँ्က್⽔む ᅦ 
က
 +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むむ 
 +्
 + 
 ᅠ + + 
 ᄀᅠᆨ깎렚ँ्က್⽔む + + 

ᄅ + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + +ᅠ ᅠ 
 + + 
 ᄀᅠᆨ깎렚ँ्က್⽔む + + က
 
ᅠ + ᄅ ᄀᅠᆨ깎렚ँ्က್⽔む ᆹ + +⽔む +ᅦ + ᄀᅠᆨ깎렚ँ्က್⽔む
 + + + ᄀᅠᆨ깎렚ँ्က್⽔むက + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む್ + ᄀᅠᆨ깎렚ँ्က್⽔む್
 + ᆩ +ᆨ +
 +
 + + 

 ᄀᅠᆨ깎렚ँ्က್⽔む
ᄀᅠᆨ깎렚ँ्က್⽔む +ᅠ + + + + ᄀᅠᆨ깎렚ँ्က್⽔む +ᄅ +က ᄀᅠᆨ깎렚ँ्က್⽔む +್ 
 + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +む ᄀᅠᆨ깎렚ँ्က್⽔むᄅᄀᅠᆨ깎렚ँ्က್⽔む
 + ᆩ + + + 
ᆨ्
 +
 ᄀᅠᆨ깎렚ँ्က್⽔む
 +
ᄀᅠᆨ깎렚ँ्က್⽔む + ् 


 + ᅦ 
 + + +
 + ᆨ + + + + +ᄀᅠᆨ깎렚ँ्က್⽔む む + 

 ᆨ +
ᆹ 
 ᄁ 
 + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む
 + +
 
 
 + ᄀᅠᆨ깎렚ँ्က್⽔む ँ ᄀᅠᆨ깎렚ँ्က್⽔む + + + +ᄀᅠᆨ깎렚ँ्က್⽔む + + む +
 +⽔् + ᄀᅠᆨ깎렚ँ्က್⽔む + +
 
ᅠᄀᅠᆨ깎렚ँ्က್⽔む +
ᄁ ᄀᅠᆨ깎렚ँ्က್⽔む
 ⽔ + 
 +
ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + + +ᄀᅠᆨ깎렚ँ्က್⽔む +⽔ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む
 + +
 
 ᄅ
 ᄀ 
 +ᄅ ᄀᅠᆨ깎렚ँ्က್⽔む +ᄁ 
 
ᄁ +ᄀᅠᆨ깎렚ँ्က್⽔む + + 
 + + + +ᄁ + + + 
 + ကᄀ + + ᅦ + + ᅡ + + 

 + + + ँ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + ᄀᅠᆨ깎렚ँ्က್⽔む 
್

 +ᅠ ᄀᅠᆨ깎렚ँ्က್⽔む + + + + + ᄀᅠᆨ깎렚ँ्က್⽔む
 +
 + +

 ᅡᅦ 
 
 ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔む + +む + + + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む 

ᆩ + + + ᄀᅠᆨ깎렚ँ्က್⽔む ᆨ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +ᄅ + +ᆨ
 
 + +
むᄀᅠᆨ깎렚ँ्က್⽔む
 ᄀᅠᆨ깎렚ँ्က್⽔む ⽔ ⽔ + +ᄀ + +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + + +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᆨ ⽔ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +むᄀᅠᆨ깎렚ँ्က್⽔む
 ᄀᄀ +ᅠ +ᆨ + 
 + + +ᆩ ᄀᅠᆨ깎렚ँ्က್⽔む⽔
ᅡ
 
 + 
 
 + ᄅ + ᄀᅠᆨ깎렚ँ्က್⽔む +ᆩ + ᄅ ᆹ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む् +
 
 + + 
ᄀᅠᆨ깎렚ँ्က್⽔む + + ကᄀᅠᆨ깎렚ँ्က್⽔むᄀ ᅠ + +ᄀᅠᆨ깎렚ँ्က್⽔むᆩ + 
 +
 +ᆨᄅ +ᄅ + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む 
 + +
 + 
ᄀᅠᆨ깎렚ँ्က್⽔むᄅ + + +ᄀᅠᆨ깎렚ँ्က್⽔む + +ᅠ 
 ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + +
 +က + 
ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + 

 ᄀᅠᆨ깎렚ँ्က್⽔むᅦ 
 
ᄀᅠᆨ깎렚ँ्က್⽔む 
 +ᄀᅠᆨ깎렚ँ्က್⽔む +
 ँ + +ᆨ ᄀ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + 
 +ᅡ + 
 +ᆨ ᄀᅠᆨ깎렚ँ्က್⽔むむ က + ᆹ ᅡ 
 + +ँ 

 ँᄀᅠᆨ깎렚ँ्က್⽔む 
 + + + +ᄀ +ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む む + ँᄀᅠᆨ깎렚ँ्က್⽔む +ᆩᄀᅠᆨ깎렚ँ्က್⽔む + + ् + ᄀᅠᆨ깎렚ँ्က್⽔む +ᆩᄀᅠᆨ깎렚ँ्က್⽔む +
 +ᅦ + 
 +
 + + +
 + + ᄀᅠᆨ깎렚ँ्က್⽔む + + + ् ᄅ
 ᄁ 


ᄀᅠᆨ깎렚ँ्က್⽔むᄅ + ᄀᅠᆨ깎렚ँ्က್⽔む ् ᄁ ᅡ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔むᄅ +ᄀᅠᆨ깎렚ँ्က್⽔むᆨ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む + む
ᄀᅠᆨ깎렚ँ्က್⽔む + + 
ᄀᅠᆨ깎렚ँ्က್⽔む + ᄅ ᅠ +ᄀᅠᆨ깎렚ँ्က್⽔む + + + + ᅠ + + 
 + ᅦᄀᅠᆨ깎렚ँ्က್⽔む + + ᄀᅠᆨ깎렚ँ्က್⽔む ᄅ + + +ᄀᅠᆨ깎렚ँ्က್⽔む + 
ᄀᅠᆨ깎렚ँ्က್⽔む +
್ᄀᅠᆨ깎렚ँ्က್⽔む + + + ್ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む +
 ᄀ ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + 
 + ᄀᅠᆨ깎렚ँ्က್⽔む
 + + +

 ⽔ ᅡ ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む + +ᄀᅠᆨ깎렚ँ्က್⽔む + + + ᄀᅠᆨ깎렚ँ्က್⽔む 

 
⽔
 ᄀᅠᆨ깎렚ँ्က್⽔む
 ᄀᅠᆨ깎렚ँ्က್⽔む +್ + 

 ᄀᅠᆨ깎렚ँ्က್⽔むᆨ + +
 
 + + + +
 +
ᄀᅠᆨ깎렚ँ्က್⽔む + 
 + ್ + +

 + + 
 
 ᄀᅠᆨ깎렚ँ्က್⽔む + ⽔ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᄅ ᄅ ᆩ 
 
 

ᄀᅠᆨ깎렚ँ्က್⽔む 
 +ᄀᅠᆨ깎렚ँ्က್⽔む + +ᄀ 
 + + + +
 +
 ᄀᅠᆨ깎렚ँ्က್⽔むᄁ ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む + + ᆩ + ᄀᅠᆨ깎렚ँ्က್⽔むむ
ᄀᅠᆨ깎렚ँ्က್⽔むᆨ
ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む ᆩ +ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む +⽔ +ᄀᅠᆨ깎렚ँ्က್⽔む
 + ᄀᅠᆨ깎렚ँ्က್⽔むᆨ +ᄀᅠᆨ깎렚ँ्က್⽔む + + ᅡᄀᅠᆨ깎렚ँ्က್⽔む + +ᄁ + က む ᄀᅠᆨ깎렚ँ्က್⽔む +ᄀᅠᆨ깎렚ँ्က್⽔む + + +
 +ᄀᅠᆨ깎렚ँ्က್⽔む + 
ᄀᆩ + + + + + +ᆨ ᄀᅠᆨ깎렚ँ्က್⽔む

 +ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔む ᅡᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᅠ
 +ᄀँᄀ್
ᅡ + + + 
 ᄀᅠᆨ깎렚ँ्က್⽔む + + + + + ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +むᅡ + ᄀᅠᆨ깎렚ँ्က್⽔む ᅡᄀᅠᆨ깎렚ँ्က್⽔む्् ᄀᄀᅠᆨ깎렚ँ्က್⽔む

 + ⽔ + က + ᄀᅠᆨ깎렚ँ्က್⽔む 
ᆩ 
ᄁ ᄀᅠᆨ깎렚ँ्က್⽔む ᄀᅠᆨ깎렚ँ्က್⽔むᄀᅠᆨ깎렚ँ्က್⽔む +ᆨ diff --git a/tests/cxx-test.cpp b/tests/cxx-test.cpp new file mode 100644 index 0000000..643bc71 --- /dev/null +++ b/tests/cxx-test.cpp @@ -0,0 +1,29 @@ +/* This test makes sure that all Pango headers can be included + * and compiled in a C++ program. + */ +#define PANGO_ENABLE_ENGINE +#define PANGO_ENABLE_BACKEND + +#include + +#ifdef HAVE_WIN32 +#include +#endif + +#ifdef HAVE_XFT +#include +#endif + +#ifdef HAVE_FREETYPE +#include +#endif + +#ifdef HAVE_CAIRO +#include +#endif + +int +main () +{ + return 0; +} diff --git a/tests/dump-boundaries.c b/tests/dump-boundaries.c new file mode 100644 index 0000000..8fd4ee7 --- /dev/null +++ b/tests/dump-boundaries.c @@ -0,0 +1,127 @@ +/* Pango + * dump-boundaries.c: Dump text boundaries for a file + * + * Copyright (C) 1999-2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include + +#include + +#define CHFORMAT "%0#6x" + +static void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN; +static void fail (const char *format, ...) +{ + char *str; + + va_list args; + + va_start (args, format); + str = g_strdup_vprintf (format, args); + va_end (args); + + fprintf (stderr, "Error: %s\n", str); + + g_free (str); + + exit (1); +} + +static void +dump_text (const char *text) +{ + unsigned int len; + PangoLogAttr *attrs; + unsigned int i; + gunichar *ucs4; + + if (!g_utf8_validate (text, -1, NULL)) + fail ("Invalid UTF-8 in file"); + + len = g_utf8_strlen (text, -1); + attrs = g_new0 (PangoLogAttr, len + 1); + + pango_get_log_attrs (text, + -1, + 0, + pango_language_from_string ("C"), + attrs, + len + 1); + + ucs4 = g_utf8_to_ucs4 (text, -1, NULL, NULL, NULL); + + for (i = 0; i < len + 1; i++) + { + char buf[7] = { '\0', }; + char *loc; + + g_unichar_to_utf8 (ucs4[i], buf); + + if (*buf == '\n') + loc = g_strdup ("\\n"); + else if (*buf == '\r') + loc = g_strdup ("\\r"); + else + loc = g_locale_from_utf8 (buf, -1, NULL, NULL, NULL); + + g_print (CHFORMAT " (%s):\t line_break = %d mandatory_break = %d char_break = %d\n" + " \t\t white = %d cursor_position = %d\n" + " \t\t word_start = %d word_end = %d\n" + " \t\t sentence_boundary = %d sentence_start = %d sentence_end = %d\n", + ucs4[i], loc ? loc : "?", + attrs[i].is_line_break, + attrs[i].is_mandatory_break, + attrs[i].is_char_break, + attrs[i].is_white, + attrs[i].is_cursor_position, + attrs[i].is_word_start, + attrs[i].is_word_end, + attrs[i].is_sentence_boundary, + attrs[i].is_sentence_start, + attrs[i].is_sentence_end); + + g_free (loc); + } + + g_free (ucs4); + g_free (attrs); +} + +int +main (int argc, + char **argv) +{ + gchar *text; + + if (argc < 2) + fail ("must give a filename on the command line"); + + if (!g_file_get_contents (argv[1], &text, NULL, NULL)) + fail ("Couldn't open sample text file"); + + dump_text (text); + + g_free (text); + + return 0; +} + diff --git a/tests/gen-all-unicode.c b/tests/gen-all-unicode.c new file mode 100644 index 0000000..4139f23 --- /dev/null +++ b/tests/gen-all-unicode.c @@ -0,0 +1,46 @@ +#include +#include + +int +main (int argc G_GNUC_UNUSED, + char **argv G_GNUC_UNUSED) +{ + gunichar i; + gint j; + + /* Output all characters in the BMP twice, once directly + * concatenated, once with spaces between them + */ + for (j = 0 ; j < 2 ; j++) + { + for (i = 0; i < 65536; i++) + { + if (g_unichar_validate (i)) + { + gchar buffer[7]; + int len = g_unichar_to_utf8 (i, buffer); + buffer[len] = '\0'; + + if (j == 1) + fputs (" ", stdout); + + fputs (buffer, stdout); + + if (j == 0) + { + if (i % 40 == 0 && i != 0) + fputs ("\n", stdout); + } + else + { + if (i % 20 == 0 && i != 0) + fputs ("\n", stdout); + } + } + } + } + fputs ("\n", stdout); + + return 0; +} + diff --git a/tests/gen-all-unicode.py b/tests/gen-all-unicode.py new file mode 100644 index 0000000..011ab9d --- /dev/null +++ b/tests/gen-all-unicode.py @@ -0,0 +1,34 @@ +import sys + +# From glib/gutf8.c: +# +#define UNICODE_VALID(Char) \ +# ((Char) < 0x110000 && (((Char) & 0xFFFFF800) != 0xD800)) + +def is_valid_unicode(ch): + if ch < 0x110000 and (ch & 0xFFFFF800) != 0xD800: + return True + + return False + +if __name__ == '__main__': + if len(sys.argv) < 2: + sys.exit('Usage: gen-all-unicode.py OUTFILE') + + with open(sys.argv[1], 'wb') as f: + for j in range(0, 2): + for i in range(0, 65536): + if is_valid_unicode(i): + f.write(chr(i).encode('utf-8', 'surrogatepass')) + + if j == 1: + f.write(b' ') + + if j == 0: + if i % 40 == 0 and i != 0: + f.write(b'\n') + else: + if i % 20 == 0 and i != 0: + f.write(b'\n') + + f.write(b'\n') diff --git a/tests/gen-installed-test.py b/tests/gen-installed-test.py new file mode 100644 index 0000000..794ea10 --- /dev/null +++ b/tests/gen-installed-test.py @@ -0,0 +1,23 @@ +import sys +import argparse +import os + +template = '''[Test] +Type=session +Exec={} +''' + +def build_template(test_dir, test_name): + return template.format(os.path.join(test_dir, test_name)) + +if __name__ == '__main__': + argparser = argparse.ArgumentParser(description='Generate installed-test description file') + argparser.add_argument('installed_test_dir', help='Path for installed test binaries') + argparser.add_argument('test_name', help='Name of the test unit') + argparser.add_argument('out_dir', help='Path for the output') + + args = argparser.parse_args() + + outfile = os.path.join(args.out_dir, args.test_name + '.test') + with open(outfile, 'w') as f: + f.write(build_template(args.installed_test_dir, args.test_name)) diff --git a/tests/layouts/valid-1.expected b/tests/layouts/valid-1.expected new file mode 100644 index 0000000..91660b9 --- /dev/null +++ b/tests/layouts/valid-1.expected @@ -0,0 +1,35 @@ +This is a test of the automatic emergency brake! + +--- + +wrapped: 0 +ellipsized: 1 +lines: 2 +width: 225280 + +--- + +range 0 22 +range 22 41 +[22 41] foreground #00000000ffff +[22 41] underline 1 +range 41 2147483647 + +--- + +i=1, index=0, paragraph-start=1, dir=ltr 'This is a test of the automatic emergency brake! +' +i=2, index=49, paragraph-start=1, dir=ltr '' + +--- + +i=1, index=0, chars=22, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, 'This is a test of the ' +i=2, index=22, chars=11, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, 'automatic e' + [22 41] foreground #00000000ffff + [22 41] underline 1 +i=3, index=33, chars=15, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=c, 'mergency brake!' + [0 2147483647] fallback 0 + [22 41] foreground #00000000ffff + [22 41] underline 1 +i=4, index=48, no run, line end +i=5, index=49, no run, line end diff --git a/tests/layouts/valid-1.markup b/tests/layouts/valid-1.markup new file mode 100644 index 0000000..780e683 --- /dev/null +++ b/tests/layouts/valid-1.markup @@ -0,0 +1,2 @@ +width=220,ellipsize=end +This is a test of the automatic emergency brake! diff --git a/tests/layouts/valid-2.expected b/tests/layouts/valid-2.expected new file mode 100644 index 0000000..4de28dc --- /dev/null +++ b/tests/layouts/valid-2.expected @@ -0,0 +1,34 @@ +test the blue drink after dinner + +--- + +wrapped: 0 +ellipsized: 0 +lines: 2 + +--- + +range 0 9 +range 9 13 +[9 13] style 2 +range 13 20 +range 20 25 +[20 25] underline 1 +range 25 2147483647 + +--- + +i=1, index=0, paragraph-start=1, dir=ltr 'test the blue drink after dinner +' +i=2, index=33, paragraph-start=1, dir=ltr '' + +--- + +i=1, index=0, chars=9, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, 'test the ' +i=2, index=9, chars=4, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, 'blue' +i=3, index=13, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, ' drink ' +i=4, index=20, chars=5, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, 'after' + [20 25] underline 1 +i=5, index=25, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=c, ' dinner' +i=6, index=32, no run, line end +i=7, index=33, no run, line end diff --git a/tests/layouts/valid-2.markup b/tests/layouts/valid-2.markup new file mode 100644 index 0000000..677f26f --- /dev/null +++ b/tests/layouts/valid-2.markup @@ -0,0 +1,2 @@ + +test the blue drink after dinner diff --git a/tests/markup-parse.c b/tests/markup-parse.c new file mode 100644 index 0000000..633f3e8 --- /dev/null +++ b/tests/markup-parse.c @@ -0,0 +1,324 @@ +/* Pango + * markup-parse.c: Test Pango markup + * + * Copyright (C) 2014 Red Hat, Inc + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +#ifdef G_OS_WIN32 +# include +#else +# include +#endif + +#include + +#include + +static void +print_attr (PangoAttribute *attr, GString *string) +{ + g_string_append_printf (string, "[%d %d] ", attr->start_index, attr->end_index); + switch (attr->klass->type) + { + case PANGO_ATTR_LANGUAGE: + g_string_append_printf (string,"language %s\n", pango_language_to_string (((PangoAttrLanguage *)attr)->value)); + break; + case PANGO_ATTR_FAMILY: + g_string_append_printf (string,"family %s\n", ((PangoAttrString *)attr)->value); + break; + case PANGO_ATTR_STYLE: + g_string_append_printf (string,"style %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_WEIGHT: + g_string_append_printf (string,"weight %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_VARIANT: + g_string_append_printf (string,"variant %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_STRETCH: + g_string_append_printf (string,"stretch %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_SIZE: + g_string_append_printf (string,"size %d\n", ((PangoAttrSize *)attr)->size); + break; + case PANGO_ATTR_FONT_DESC: + g_string_append_printf (string,"font %s\n", pango_font_description_to_string (((PangoAttrFontDesc *)attr)->desc)); + break; + case PANGO_ATTR_FOREGROUND: + g_string_append_printf (string,"foreground %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_BACKGROUND: + g_string_append_printf (string,"background %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_UNDERLINE: + g_string_append_printf (string,"underline %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_STRIKETHROUGH: + g_string_append_printf (string,"strikethrough %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_RISE: + g_string_append_printf (string,"rise %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_SHAPE: + g_string_append_printf (string,"shape\n"); + break; + case PANGO_ATTR_SCALE: + g_string_append_printf (string,"scale %f\n", ((PangoAttrFloat *)attr)->value); + break; + case PANGO_ATTR_FALLBACK: + g_string_append_printf (string,"fallback %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_LETTER_SPACING: + g_string_append_printf (string,"letter-spacing %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_UNDERLINE_COLOR: + g_string_append_printf (string,"underline-color %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_STRIKETHROUGH_COLOR: + g_string_append_printf (string,"strikethrough-color %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_ABSOLUTE_SIZE: + g_string_append_printf (string,"absolute-size %d\n", ((PangoAttrSize *)attr)->size); + break; + case PANGO_ATTR_GRAVITY: + g_string_append_printf (string,"gravity %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_GRAVITY_HINT: + g_string_append_printf (string,"gravity-hint %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_FONT_FEATURES: + g_string_append_printf (string,"font-features %s\n", ((PangoAttrString *)attr)->value); + break; + case PANGO_ATTR_FOREGROUND_ALPHA: + g_string_append_printf (string,"foreground-alpha %04x\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_BACKGROUND_ALPHA: + g_string_append_printf (string,"background-alpha %04x\n", ((PangoAttrInt *)attr)->value); + break; + default: + g_assert_not_reached (); + break; + } +} + +static void +attr_list_dump (PangoAttrList *attrs, GString *string) +{ + PangoAttrIterator *iter; + + iter = pango_attr_list_get_iterator (attrs); + do { + gint start, end; + GSList *list, *l; + + pango_attr_iterator_range (iter, &start, &end); + g_string_append_printf (string, "range %d %d\n", start, end); + list = pango_attr_iterator_get_attrs (iter); + for (l = list; l; l = l->next) + { + PangoAttribute *attr = l->data; + print_attr (attr, string); + } + g_slist_free_full (list, (GDestroyNotify)pango_attribute_destroy); + } while (pango_attr_iterator_next (iter)); + + pango_attr_iterator_destroy (iter); +} + +static void +test_file (const gchar *filename, GString *string) +{ + gchar *contents; + gsize length; + GError *error = NULL; + gchar *text; + PangoAttrList *attrs; + PangoAttrIterator *iter; + PangoFontDescription *desc; + PangoLanguage *lang; + gboolean ret; + char *str; + int start, end; + + if (!g_file_get_contents (filename, &contents, &length, &error)) + { + fprintf (stderr, "%s\n", error->message); + g_error_free (error); + return; + } + + ret = pango_parse_markup (contents, length, 0, &attrs, &text, NULL, &error); + g_free (contents); + + if (ret) + { + g_assert_no_error (error); + g_string_append (string, text); + g_string_append (string, "\n\n---\n\n"); + attr_list_dump (attrs, string); + g_string_append (string, "\n\n---\n\n"); + desc = pango_font_description_new (); + iter = pango_attr_list_get_iterator (attrs); + do { + pango_attr_iterator_range (iter, &start, &end); + pango_attr_iterator_get_font (iter, desc, &lang, NULL); + str = pango_font_description_to_string (desc); + g_string_append_printf (string, "[%d:%d] %s %s\n", start, end, (char *)lang, str); + g_free (str); + } while (pango_attr_iterator_next (iter)); + pango_attr_iterator_destroy (iter); + pango_attr_list_unref (attrs); + pango_font_description_free (desc); + g_free (text); + } + else + { + g_string_append_printf (string, "ERROR: %s", error->message); + g_error_free (error); + } +} + +static gchar * +get_expected_filename (const gchar *filename) +{ + gchar *f, *p, *expected; + + f = g_strdup (filename); + p = strstr (f, ".markup"); + if (p) + *p = 0; + expected = g_strconcat (f, ".expected", NULL); + + g_free (f); + + return expected; +} + +static char * +diff_with_file (const char *file1, + GString *string, + GError **error) +{ + const char *command[] = { "diff", "-u", file1, NULL, NULL }; + char *diff, *tmpfile; + int fd; + + diff = NULL; + + /* write the text buffer to a temporary file */ + fd = g_file_open_tmp (NULL, &tmpfile, error); + if (fd < 0) + return NULL; + + if (write (fd, string->str, string->len) != (int) string->len) + { + close (fd); + g_set_error (error, + G_FILE_ERROR, G_FILE_ERROR_FAILED, + "Could not write data to temporary file '%s'", tmpfile); + goto done; + } + close (fd); + command[3] = tmpfile; + + /* run diff command */ + g_spawn_sync (NULL, (char **)command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &diff, NULL, NULL, error); + +done: + unlink (tmpfile); + g_free (tmpfile); + + return diff; +} + +static void +test_parse (gconstpointer d) +{ + const gchar *filename = d; + gchar *expected_file; + GError *error = NULL; + GString *string; + char *diff; + + expected_file = get_expected_filename (filename); + + string = g_string_sized_new (0); + + test_file (filename, string); + + diff = diff_with_file (expected_file, string, &error); + g_assert_no_error (error); + + if (diff && diff[0]) + { + g_test_message ("Resulting output doesn't match reference:\n%s", diff); + g_test_fail (); + } + g_free (diff); + + g_string_free (string, TRUE); + + g_free (expected_file); +} + +int +main (int argc, char *argv[]) +{ + GDir *dir; + GError *error = NULL; + const gchar *name; + gchar *path; + + g_setenv ("LC_ALL", "C", TRUE); + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + /* allow to easily generate expected output for new test cases */ + if (argc > 1) + { + GString *string; + + string = g_string_sized_new (0); + test_file (argv[1], string); + g_print ("%s", string->str); + + return 0; + } + + path = g_test_build_filename (G_TEST_DIST, "markups", NULL); + dir = g_dir_open (path, 0, &error); + g_free (path); + g_assert_no_error (error); + while ((name = g_dir_read_name (dir)) != NULL) + { + if (!strstr (name, "markup")) + continue; + + path = g_strdup_printf ("/markup/parse/%s", name); + g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "markups", name, NULL), + test_parse, g_free); + g_free (path); + } + g_dir_close (dir); + + return g_test_run (); +} diff --git a/tests/markups/fail-1.expected b/tests/markups/fail-1.expected new file mode 100644 index 0000000..57d8818 --- /dev/null +++ b/tests/markups/fail-1.expected @@ -0,0 +1 @@ +ERROR: Attribute 'foo' is not allowed on the tag on line 1 char 25 \ No newline at end of file diff --git a/tests/markups/fail-1.markup b/tests/markups/fail-1.markup new file mode 100644 index 0000000..df0c487 --- /dev/null +++ b/tests/markups/fail-1.markup @@ -0,0 +1 @@ +blah diff --git a/tests/markups/fail-2.expected b/tests/markups/fail-2.expected new file mode 100644 index 0000000..3ed61e3 --- /dev/null +++ b/tests/markups/fail-2.expected @@ -0,0 +1 @@ +ERROR: Value of 'foreground' attribute on tag on line 1 could not be parsed; should be a color specification, not '#23456' \ No newline at end of file diff --git a/tests/markups/fail-2.markup b/tests/markups/fail-2.markup new file mode 100644 index 0000000..013a84c --- /dev/null +++ b/tests/markups/fail-2.markup @@ -0,0 +1 @@ +Text diff --git a/tests/markups/fail-3.expected b/tests/markups/fail-3.expected new file mode 100644 index 0000000..8a78df5 --- /dev/null +++ b/tests/markups/fail-3.expected @@ -0,0 +1 @@ +ERROR: Value of 'foreground' attribute on tag on line 1 could not be parsed; should be a color specification, not '#2222333344445555a' \ No newline at end of file diff --git a/tests/markups/fail-3.markup b/tests/markups/fail-3.markup new file mode 100644 index 0000000..1cb1996 --- /dev/null +++ b/tests/markups/fail-3.markup @@ -0,0 +1 @@ +Text diff --git a/tests/markups/fail-4.expected b/tests/markups/fail-4.expected new file mode 100644 index 0000000..b3e31c7 --- /dev/null +++ b/tests/markups/fail-4.expected @@ -0,0 +1 @@ +ERROR: Value of 'underline_color' attribute on tag on line 1 could not be parsed; should be a color specification, not '#2345' \ No newline at end of file diff --git a/tests/markups/fail-4.markup b/tests/markups/fail-4.markup new file mode 100644 index 0000000..ab9fc03 --- /dev/null +++ b/tests/markups/fail-4.markup @@ -0,0 +1 @@ +Text diff --git a/tests/markups/fail-5.expected b/tests/markups/fail-5.expected new file mode 100644 index 0000000..403ff7d --- /dev/null +++ b/tests/markups/fail-5.expected @@ -0,0 +1 @@ +ERROR: Value of 'strikethrough_color' attribute on tag on line 1 could not be parsed; should be a color specification, not 'rot' \ No newline at end of file diff --git a/tests/markups/fail-5.markup b/tests/markups/fail-5.markup new file mode 100644 index 0000000..50e6132 --- /dev/null +++ b/tests/markups/fail-5.markup @@ -0,0 +1 @@ +Text diff --git a/tests/markups/valid-1.expected b/tests/markups/valid-1.expected new file mode 100644 index 0000000..0954676 --- /dev/null +++ b/tests/markups/valid-1.expected @@ -0,0 +1,20 @@ +Blue text is cool! + + +--- + +range 0 9 +[0 9] scale 1.440000 +[0 9] foreground #00000000ffff +range 9 13 +range 13 17 +[13 17] style 2 +range 17 2147483647 + + +--- + +[0:9] (null) Normal 0 +[9:13] (null) Normal 0 +[13:17] (null) Italic 0 +[17:2147483647] (null) Italic 0 diff --git a/tests/markups/valid-1.markup b/tests/markups/valid-1.markup new file mode 100644 index 0000000..3c7ea7d --- /dev/null +++ b/tests/markups/valid-1.markup @@ -0,0 +1 @@ +Blue text is cool! diff --git a/tests/markups/valid-2.expected b/tests/markups/valid-2.expected new file mode 100644 index 0000000..0954676 --- /dev/null +++ b/tests/markups/valid-2.expected @@ -0,0 +1,20 @@ +Blue text is cool! + + +--- + +range 0 9 +[0 9] scale 1.440000 +[0 9] foreground #00000000ffff +range 9 13 +range 13 17 +[13 17] style 2 +range 17 2147483647 + + +--- + +[0:9] (null) Normal 0 +[9:13] (null) Normal 0 +[13:17] (null) Italic 0 +[17:2147483647] (null) Italic 0 diff --git a/tests/markups/valid-2.markup b/tests/markups/valid-2.markup new file mode 100644 index 0000000..3e4136f --- /dev/null +++ b/tests/markups/valid-2.markup @@ -0,0 +1 @@ +Blue text is cool! diff --git a/tests/markups/valid-3.expected b/tests/markups/valid-3.expected new file mode 100644 index 0000000..1943fc3 --- /dev/null +++ b/tests/markups/valid-3.expected @@ -0,0 +1,24 @@ +Lots of attrs + + +--- + +range 0 13 +[0 13] font Sans Italic 12 +[0 13] foreground #0000ffff0000 +[0 13] background #f0f0f0f0f0f0 +[0 13] underline 2 +[0 13] underline-color #ffff00000000 +[0 13] gravity 0 +[0 13] gravity-hint 1 +[0 13] strikethrough 1 +[0 13] strikethrough-color #00000000ffff +[0 13] fallback 0 +[0 13] language de +range 13 2147483647 + + +--- + +[0:13] de Sans Italic 12 +[13:2147483647] (null) Sans Italic 12 diff --git a/tests/markups/valid-3.markup b/tests/markups/valid-3.markup new file mode 100644 index 0000000..c2f7ab8 --- /dev/null +++ b/tests/markups/valid-3.markup @@ -0,0 +1,11 @@ +Lots of attrs diff --git a/tests/markups/valid-4.expected b/tests/markups/valid-4.expected new file mode 100644 index 0000000..171e84e --- /dev/null +++ b/tests/markups/valid-4.expected @@ -0,0 +1,56 @@ +bold big italic strikethroughsub smallsup tt underline + + +--- + +range 0 5 +[0 15] weight 700 +range 5 8 +[0 15] weight 700 +[5 8] scale 1.200000 +range 8 9 +[0 15] weight 700 +range 9 15 +[0 15] weight 700 +[9 15] style 2 +range 15 16 +range 16 29 +[16 41] strikethrough 1 +range 29 32 +[16 41] strikethrough 1 +[29 32] scale 0.833333 +[29 32] rise -5000 +range 32 33 +[16 41] strikethrough 1 +range 33 38 +[16 41] strikethrough 1 +[33 38] scale 0.833333 +range 38 41 +[16 41] strikethrough 1 +[38 41] scale 0.833333 +[38 41] rise 5000 +range 41 42 +range 42 45 +[42 54] family Monospace +range 45 54 +[42 54] family Monospace +[45 54] underline 1 +range 54 2147483647 + + +--- + +[0:5] (null) Bold +[5:8] (null) Bold 0 +[8:9] (null) Bold 0 +[9:15] (null) Bold Italic 0 +[15:16] (null) Bold Italic 0 +[16:29] (null) Bold Italic 0 +[29:32] (null) Bold Italic 0 +[32:33] (null) Bold Italic 0 +[33:38] (null) Bold Italic 0 +[38:41] (null) Bold Italic 0 +[41:42] (null) Bold Italic 0 +[42:45] (null) Monospace Bold Italic 0 +[45:54] (null) Monospace Bold Italic 0 +[54:2147483647] (null) Monospace Bold Italic 0 diff --git a/tests/markups/valid-4.markup b/tests/markups/valid-4.markup new file mode 100644 index 0000000..d0e58f3 --- /dev/null +++ b/tests/markups/valid-4.markup @@ -0,0 +1 @@ +bold big italic strikethroughsub smallsup tt underline diff --git a/tests/markups/valid-5.expected b/tests/markups/valid-5.expected new file mode 100644 index 0000000..ee3ae71 --- /dev/null +++ b/tests/markups/valid-5.expected @@ -0,0 +1,32 @@ +Text +Text +Text +Text + + +--- + +range 0 4 +[0 4] foreground #222233334444 +range 4 5 +range 5 9 +[5 9] foreground #222233334444 +range 9 10 +range 10 14 +[10 14] foreground #222233334444 +range 14 15 +range 15 19 +[15 19] foreground #222233334444 +range 19 2147483647 + + +--- + +[0:4] (null) Normal +[4:5] (null) Normal +[5:9] (null) Normal +[9:10] (null) Normal +[10:14] (null) Normal +[14:15] (null) Normal +[15:19] (null) Normal +[19:2147483647] (null) Normal diff --git a/tests/markups/valid-5.markup b/tests/markups/valid-5.markup new file mode 100644 index 0000000..d3bf57c --- /dev/null +++ b/tests/markups/valid-5.markup @@ -0,0 +1,4 @@ +Text +Text +Text +Text diff --git a/tests/markups/valid-6.expected b/tests/markups/valid-6.expected new file mode 100644 index 0000000..d5d6ea4 --- /dev/null +++ b/tests/markups/valid-6.expected @@ -0,0 +1,35 @@ +Text +Text +Text +Text + + +--- + +range 0 4 +[0 4] foreground #222233334444 +[0 4] foreground-alpha 5555 +range 4 5 +range 5 9 +[5 9] foreground #222233334444 +[5 9] foreground-alpha 5555 +range 9 10 +range 10 14 +[10 14] foreground #222233334444 +range 14 15 +range 15 19 +[15 19] foreground #222233334444 +[15 19] foreground-alpha 5555 +range 19 2147483647 + + +--- + +[0:4] (null) Normal +[4:5] (null) Normal +[5:9] (null) Normal +[9:10] (null) Normal +[10:14] (null) Normal +[14:15] (null) Normal +[15:19] (null) Normal +[19:2147483647] (null) Normal diff --git a/tests/markups/valid-6.markup b/tests/markups/valid-6.markup new file mode 100644 index 0000000..637ba40 --- /dev/null +++ b/tests/markups/valid-6.markup @@ -0,0 +1,4 @@ +Text +Text +Text +Text diff --git a/tests/markups/valid-7.expected b/tests/markups/valid-7.expected new file mode 100644 index 0000000..d30d165 --- /dev/null +++ b/tests/markups/valid-7.expected @@ -0,0 +1,20 @@ +Text +Text + + +--- + +range 0 4 +[0 4] underline-color #222233334444 +range 4 5 +range 5 9 +[5 9] strikethrough-color #222233334444 +range 9 2147483647 + + +--- + +[0:4] (null) Normal +[4:5] (null) Normal +[5:9] (null) Normal +[9:2147483647] (null) Normal diff --git a/tests/markups/valid-7.markup b/tests/markups/valid-7.markup new file mode 100644 index 0000000..4289534 --- /dev/null +++ b/tests/markups/valid-7.markup @@ -0,0 +1,2 @@ +Text +Text diff --git a/tests/markups/valid-8.expected b/tests/markups/valid-8.expected new file mode 100644 index 0000000..de8eb6b --- /dev/null +++ b/tests/markups/valid-8.expected @@ -0,0 +1,36 @@ +Text +Text +Text +Text + + +--- + +range 0 4 +[0 4] foreground #00000000ffff +[0 4] foreground-alpha ffff +range 4 5 +range 5 9 +[5 9] foreground #00000000ffff +[5 9] foreground-alpha 7fff +range 9 10 +range 10 14 +[10 14] background #00000000ffff +[10 14] background-alpha 0001 +range 14 15 +range 15 19 +[15 19] background #00000000ffff +[15 19] background-alpha 547a +range 19 2147483647 + + +--- + +[0:4] (null) Normal +[4:5] (null) Normal +[5:9] (null) Normal +[9:10] (null) Normal +[10:14] (null) Normal +[14:15] (null) Normal +[15:19] (null) Normal +[19:2147483647] (null) Normal diff --git a/tests/markups/valid-8.markup b/tests/markups/valid-8.markup new file mode 100644 index 0000000..91e9aca --- /dev/null +++ b/tests/markups/valid-8.markup @@ -0,0 +1,4 @@ +Text +Text +Text +Text diff --git a/tests/markups/valid-9.expected b/tests/markups/valid-9.expected new file mode 100644 index 0000000..7931e70 --- /dev/null +++ b/tests/markups/valid-9.expected @@ -0,0 +1,14 @@ +Blue text + + +--- + +range 0 9 +[0 9] font-features kern 0, dlig, lnum 1, -pnum +range 9 2147483647 + + +--- + +[0:9] (null) Normal +[9:2147483647] (null) Normal diff --git a/tests/markups/valid-9.markup b/tests/markups/valid-9.markup new file mode 100644 index 0000000..b807f76 --- /dev/null +++ b/tests/markups/valid-9.markup @@ -0,0 +1 @@ +Blue text diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000..bceb909 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,129 @@ +test_cflags = [ + '-DSRCDIR=@0@'.format(meson.current_source_dir()), +] + +if xft_dep.found() + test_cflags += [ '-DHAVE_X', '-DHAVE_XFT' ] +endif + +if host_system == 'windows' + test_cflags += '-DHAVE_WIN32' +endif + +test_env = [ + 'srcdir=@0@'.format(meson.current_source_dir()), + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), +] + +tests = [ + [ 'testboundaries' ], + [ 'testboundaries_ucd' ], + [ 'testcolor' ], + [ 'testscript' ], + [ 'cxx-test', [ 'cxx-test.cpp' ] ], +] + +if build_pangoft2 + test_cflags += '-DHAVE_FREETYPE' + tests += [ + [ 'test-ot-tags', [ 'test-ot-tags.c' ], [ libpangoft2_dep ] ], + ] +endif + +if cairo_dep.found() + test_cflags += '-DHAVE_CAIRO' + tests += [ + [ 'testiter', [ 'testiter.c' ], [ libpangocairo_dep ] ], + [ 'test-pangocairo-threads', [ 'test-pangocairo-threads.c' ], [ libpangocairo_dep, cairo_dep ] ], + [ 'markup-parse', [ 'markup-parse.c' ], [ libpangocairo_dep ] ], + [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep ] ], + [ 'test-font', [ 'test-font.c' ], [ libpangocairo_dep ] ], + [ 'testattributes', [ 'testattributes.c', 'test-common.c' ], [ libpangocairo_dep ] ], + ] +endif + +installed_test_data = [ + 'boundaries.utf8', + 'GraphemeBreakTest.txt', +] + +test_layouts_data = [ + 'layouts/valid-1', + 'layouts/valid-2', +] + +test_markups_data = [ + 'markups/fail-1', + 'markups/fail-2', + 'markups/fail-3', + 'markups/fail-4', + 'markups/fail-5', + 'markups/valid-1', + 'markups/valid-2', + 'markups/valid-3', + 'markups/valid-4', + 'markups/valid-5', + 'markups/valid-6', + 'markups/valid-7', + 'markups/valid-8', + 'markups/valid-9', +] + +installed_test_layouts_data = [] +foreach d: test_layouts_data + installed_test_layouts_data += d + '.markup' + installed_test_layouts_data += d + '.expected' +endforeach + +installed_test_markups_data = [] +foreach d: test_markups_data + installed_test_markups_data += d + '.markup' + installed_test_markups_data += d + '.expected' +endforeach + +installed_test_datadir = join_paths(pango_datadir, 'installed-tests', 'pango') +installed_test_bindir = join_paths(pango_libexecdir, 'installed-tests', 'pango') + +install_data(installed_test_data, install_dir: installed_test_bindir) +install_data(installed_test_layouts_data, install_dir: join_paths(installed_test_bindir, 'layouts')) +install_data(installed_test_markups_data, install_dir: join_paths(installed_test_bindir, 'markups')) + +python = import('python3').find_python() +gen_installed_test = files([ 'gen-installed-test.py' ]) +gen_all_unicode = files([ 'gen-all-unicode.py' ]) + +custom_target('all-unicode', + output: 'all-unicode.txt', + command: [ + python, gen_all_unicode, '@OUTPUT@' + ], + install: true, + install_dir: installed_test_bindir) + +foreach t: tests + name = t[0] + src = t.get(1, [ '@0@.c'.format(name) ]) + deps = t.get(2, [ libpango_dep ]) + + custom_target(name + '.test', + output: name + '.test', + command: [ + python, gen_installed_test, + installed_test_bindir, + name, + '@OUTDIR@', + ], + install: true, + install_dir: installed_test_datadir) + + bin = executable(name, src, + dependencies: deps, + include_directories: root_inc, + c_args: common_cflags + pango_debug_cflags + test_cflags, + cpp_args: common_cppflags + pango_debug_cflags + test_cflags, + install: true, + install_dir: installed_test_bindir) + + test(name, bin, env: test_env) +endforeach diff --git a/tests/test-common.c b/tests/test-common.c new file mode 100644 index 0000000..adeb4b6 --- /dev/null +++ b/tests/test-common.c @@ -0,0 +1,211 @@ +/* Pango + * test-common.c: Common test code + * + * Copyright (C) 2014 Red Hat, Inc + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include + +#ifdef G_OS_WIN32 +#include +#else +#include +#endif + +#include +#include "test-common.h" + +char * +diff_with_file (const char *file, + char *text, + gssize len, + GError **error) +{ + const char *command[] = { "diff", "-u", file, NULL, NULL }; + char *diff, *tmpfile; + int fd; + + diff = NULL; + + if (len < 0) + len = strlen (text); + + /* write the text buffer to a temporary file */ + fd = g_file_open_tmp (NULL, &tmpfile, error); + if (fd < 0) + return NULL; + + if (write (fd, text, len) != (int) len) + { + close (fd); + g_set_error (error, + G_FILE_ERROR, G_FILE_ERROR_FAILED, + "Could not write data to temporary file '%s'", tmpfile); + goto done; + } + close (fd); + command[3] = tmpfile; + + /* run diff command */ + g_spawn_sync (NULL, + (char **) command, + NULL, + G_SPAWN_SEARCH_PATH, + NULL, NULL, + &diff, + NULL, NULL, + error); + +done: + unlink (tmpfile); + g_free (tmpfile); + + return diff; +} + +void +print_attribute (PangoAttribute *attr, GString *string) +{ + g_string_append_printf (string, "[%d %d] ", attr->start_index, attr->end_index); + switch (attr->klass->type) + { + case PANGO_ATTR_LANGUAGE: + g_string_append_printf (string,"language %s\n", pango_language_to_string (((PangoAttrLanguage *)attr)->value)); + break; + case PANGO_ATTR_FAMILY: + g_string_append_printf (string,"family %s\n", ((PangoAttrString *)attr)->value); + break; + case PANGO_ATTR_STYLE: + g_string_append_printf (string,"style %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_WEIGHT: + g_string_append_printf (string,"weight %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_VARIANT: + g_string_append_printf (string,"variant %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_STRETCH: + g_string_append_printf (string,"stretch %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_SIZE: + g_string_append_printf (string,"size %d\n", ((PangoAttrSize *)attr)->size); + break; + case PANGO_ATTR_FONT_DESC: + g_string_append_printf (string,"font %s\n", pango_font_description_to_string (((PangoAttrFontDesc *)attr)->desc)); + break; + case PANGO_ATTR_FOREGROUND: + g_string_append_printf (string,"foreground %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_BACKGROUND: + g_string_append_printf (string,"background %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_UNDERLINE: + g_string_append_printf (string,"underline %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_STRIKETHROUGH: + g_string_append_printf (string,"strikethrough %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_RISE: + g_string_append_printf (string,"rise %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_SHAPE: + g_string_append_printf (string,"shape\n"); + break; + case PANGO_ATTR_SCALE: + g_string_append_printf (string,"scale %f\n", ((PangoAttrFloat *)attr)->value); + break; + case PANGO_ATTR_FALLBACK: + g_string_append_printf (string,"fallback %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_LETTER_SPACING: + g_string_append_printf (string,"letter-spacing %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_UNDERLINE_COLOR: + g_string_append_printf (string,"underline-color %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_STRIKETHROUGH_COLOR: + g_string_append_printf (string,"strikethrough-color %s\n", pango_color_to_string (&((PangoAttrColor *)attr)->color)); + break; + case PANGO_ATTR_ABSOLUTE_SIZE: + g_string_append_printf (string,"absolute-size %d\n", ((PangoAttrSize *)attr)->size); + break; + case PANGO_ATTR_GRAVITY: + g_string_append_printf (string,"gravity %d\n", ((PangoAttrInt *)attr)->value); + break; + case PANGO_ATTR_GRAVITY_HINT: + g_string_append_printf (string,"gravity-hint %d\n", ((PangoAttrInt *)attr)->value); + break; + default: + g_assert_not_reached (); + break; + } +} + +void +print_attr_list (PangoAttrList *attrs, GString *string) +{ + PangoAttrIterator *iter; + + iter = pango_attr_list_get_iterator (attrs); + do { + gint start, end; + GSList *list, *l; + + pango_attr_iterator_range (iter, &start, &end); + g_string_append_printf (string, "range %d %d\n", start, end); + list = pango_attr_iterator_get_attrs (iter); + for (l = list; l; l = l->next) + { + PangoAttribute *attr = l->data; + print_attribute (attr, string); + } + g_slist_free_full (list, (GDestroyNotify)pango_attribute_destroy); + } while (pango_attr_iterator_next (iter)); + + pango_attr_iterator_destroy (iter); +} + +void +print_attributes (GSList *attrs, GString *string) +{ + GSList *l; + + for (l = attrs; l; l = l->next) + { + PangoAttribute *attr = l->data; + + g_string_append (string, " "); + print_attribute (attr, string); + } +} + +typedef struct +{ + guint ref_count; + GSList *attributes; + GSList *attributes_tail; +} AL; + +GSList * +attr_list_to_list (PangoAttrList *attrs) +{ + return ((AL*)attrs)->attributes; +} diff --git a/tests/test-common.h b/tests/test-common.h new file mode 100644 index 0000000..ae81d3a --- /dev/null +++ b/tests/test-common.h @@ -0,0 +1,22 @@ +#ifndef __TEST_COMMON_H__ +#define __TEST_COMMON_H__ + +char * diff_with_file (const char *file, + char *text, + gssize len, + GError **error); + +void print_attribute (PangoAttribute *attr, + GString *string); + +void print_attributes (GSList *attrs, + GString *string); + +void print_attr_list (PangoAttrList *attrs, + GString *string); + +GSList *attr_list_to_list (PangoAttrList *attrs); + + + +#endif diff --git a/tests/test-font.c b/tests/test-font.c new file mode 100644 index 0000000..76d0042 --- /dev/null +++ b/tests/test-font.c @@ -0,0 +1,130 @@ +/* Pango + * test-font.c: Test PangoFontDescription + * + * Copyright (C) 2014 Red Hat, Inc + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include + +#include + +static void +test_parse (void) +{ + PangoFontDescription *desc; + + desc = pango_font_description_from_string ("Cantarell 14"); + + g_assert_cmpstr (pango_font_description_get_family (desc), ==, "Cantarell"); + g_assert (!pango_font_description_get_size_is_absolute (desc)); + g_assert_cmpint (pango_font_description_get_size (desc), ==, 14 * PANGO_SCALE); + g_assert_cmpint (pango_font_description_get_style (desc), ==, PANGO_STYLE_NORMAL); + g_assert_cmpint (pango_font_description_get_variant (desc), ==, PANGO_VARIANT_NORMAL); + g_assert_cmpint (pango_font_description_get_weight (desc), ==, PANGO_WEIGHT_NORMAL); + g_assert_cmpint (pango_font_description_get_stretch (desc), ==, PANGO_STRETCH_NORMAL); + g_assert_cmpint (pango_font_description_get_gravity (desc), ==, PANGO_GRAVITY_SOUTH); + g_assert_cmpint (pango_font_description_get_set_fields (desc), ==, PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT | PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH | PANGO_FONT_MASK_SIZE); + + pango_font_description_free (desc); + + desc = pango_font_description_from_string ("Sans Bold Italic Condensed 22.5px"); + + g_assert_cmpstr (pango_font_description_get_family (desc), ==, "Sans"); + g_assert (pango_font_description_get_size_is_absolute (desc)); + g_assert_cmpint (pango_font_description_get_size (desc), ==, 225 * PANGO_SCALE / 10); + g_assert_cmpint (pango_font_description_get_style (desc), ==, PANGO_STYLE_ITALIC); + g_assert_cmpint (pango_font_description_get_variant (desc), ==, PANGO_VARIANT_NORMAL); + g_assert_cmpint (pango_font_description_get_weight (desc), ==, PANGO_WEIGHT_BOLD); + g_assert_cmpint (pango_font_description_get_stretch (desc), ==, PANGO_STRETCH_CONDENSED); + g_assert_cmpint (pango_font_description_get_gravity (desc), ==, PANGO_GRAVITY_SOUTH); g_assert_cmpint (pango_font_description_get_set_fields (desc), ==, PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT | PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH | PANGO_FONT_MASK_SIZE); + + pango_font_description_free (desc); +} + +static void +test_roundtrip (void) +{ + PangoFontDescription *desc; + gchar *str; + + desc = pango_font_description_from_string ("Cantarell 14"); + str = pango_font_description_to_string (desc); + g_assert_cmpstr (str, ==, "Cantarell 14"); + pango_font_description_free (desc); + g_free (str); + + desc = pango_font_description_from_string ("Sans Bold Italic Condensed 22.5px"); + str = pango_font_description_to_string (desc); + g_assert_cmpstr (str, ==, "Sans Bold Italic Condensed 22.5px"); + pango_font_description_free (desc); + g_free (str); +} + +static void +test_variation (void) +{ + PangoFontDescription *desc1; + PangoFontDescription *desc2; + gchar *str; + + desc1 = pango_font_description_from_string ("Cantarell 14"); + g_assert (desc1 != NULL); + g_assert ((pango_font_description_get_set_fields (desc1) & PANGO_FONT_MASK_VARIATIONS) == 0); + g_assert (pango_font_description_get_variations (desc1) == NULL); + + str = pango_font_description_to_string (desc1); + g_assert_cmpstr (str, ==, "Cantarell 14"); + g_free (str); + + desc2 = pango_font_description_from_string ("Cantarell 14 @wght=100,wdth=235"); + g_assert (desc2 != NULL); + g_assert ((pango_font_description_get_set_fields (desc2) & PANGO_FONT_MASK_VARIATIONS) != 0); + g_assert_cmpstr (pango_font_description_get_variations (desc2), ==, "wght=100,wdth=235"); + + str = pango_font_description_to_string (desc2); + g_assert_cmpstr (str, ==, "Cantarell 14 @wght=100,wdth=235"); + g_free (str); + + g_assert (!pango_font_description_equal (desc1, desc2)); + + pango_font_description_set_variations (desc1, "wght=100,wdth=235"); + g_assert ((pango_font_description_get_set_fields (desc1) & PANGO_FONT_MASK_VARIATIONS) != 0); + g_assert_cmpstr (pango_font_description_get_variations (desc1), ==, "wght=100,wdth=235"); + + g_assert (pango_font_description_equal (desc1, desc2)); + + pango_font_description_free (desc1); + pango_font_description_free (desc2); +} + +int +main (int argc, char *argv[]) +{ + g_setenv ("LC_ALL", "C", TRUE); + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/pango/fontdescription/parse", test_parse); + g_test_add_func ("/pango/fontdescription/roundtrip", test_roundtrip); + g_test_add_func ("/pango/fontdescription/variation", test_variation); + + return g_test_run (); +} diff --git a/tests/test-layout.c b/tests/test-layout.c new file mode 100644 index 0000000..4bce443 --- /dev/null +++ b/tests/test-layout.c @@ -0,0 +1,386 @@ +/* Pango + * test-layout.c: Test Pango Layout + * + * Copyright (C) 2014 Red Hat, Inc + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include + +#ifndef G_OS_WIN32 +#include +#endif + +#include "config.h" +#include +#include "test-common.h" + + +static PangoContext *context; + + +static const gchar * +enum_value_nick (GType type, gint value) +{ + GEnumClass *eclass; + GEnumValue *ev; + + eclass = g_type_class_ref (type); + ev = g_enum_get_value (eclass, value); + g_type_class_unref (eclass); + + if (ev) + return ev->value_nick; + else + return "?"; +} + +static const gchar * +direction_name (PangoDirection dir) +{ + return enum_value_nick (PANGO_TYPE_DIRECTION, dir); +} + +static const gchar * +gravity_name (PangoGravity gravity) +{ + return enum_value_nick (PANGO_TYPE_GRAVITY, gravity); +} + +static const gchar * +script_name (PangoScript script) +{ + return enum_value_nick (PANGO_TYPE_SCRIPT, script); +} + +static gchar * +font_name (PangoFont *font) +{ + PangoFontDescription *desc; + gchar *name; + + desc = pango_font_describe (font); + name = pango_font_description_to_string (desc); + pango_font_description_free (desc); + + return name; +} + +static void +dump_lines (PangoLayout *layout, GString *string) +{ + PangoLayoutIter *iter; + const gchar *text; + gint index, index2; + gboolean has_more; + gchar *char_str; + gint i; + PangoLayoutLine *line; + + text = pango_layout_get_text (layout); + iter = pango_layout_get_iter (layout); + + has_more = TRUE; + index = pango_layout_iter_get_index (iter); + index2 = 0; + i = 0; + while (has_more) + { + line = pango_layout_iter_get_line (iter); + has_more = pango_layout_iter_next_line (iter); + i++; + + if (has_more) + { + index2 = pango_layout_iter_get_index (iter); + char_str = g_strndup (text + index, index2 - index); + } + else + { + char_str = g_strdup (text + index); + } + + g_string_append_printf (string, "i=%d, index=%d, paragraph-start=%d, dir=%s '%s'\n", + i, index, line->is_paragraph_start, direction_name (line->resolved_dir), + char_str); + g_free (char_str); + + index = index2; + } + pango_layout_iter_free (iter); +} + +static void +dump_runs (PangoLayout *layout, GString *string) +{ + PangoLayoutIter *iter; + PangoLayoutRun *run; + PangoItem *item; + const gchar *text; + gint index, index2; + gboolean has_more; + gchar *char_str; + gint i; + gchar *font = 0; + + text = pango_layout_get_text (layout); + iter = pango_layout_get_iter (layout); + + has_more = TRUE; + index = pango_layout_iter_get_index (iter); + index2 = 0; + i = 0; + while (has_more) + { + run = pango_layout_iter_get_run (iter); + has_more = pango_layout_iter_next_run (iter); + i++; + + if (has_more) + { + index2 = pango_layout_iter_get_index (iter); + char_str = g_strndup (text + index, index2 - index); + } + else + { + char_str = g_strdup (text + index); + } + + if (run) + { + item = ((PangoGlyphItem*)run)->item; + font = font_name (item->analysis.font); + g_string_append_printf (string, "i=%d, index=%d, chars=%d, level=%d, gravity=%s, flags=%d, font=%s, script=%s, language=%s, '%s'\n", + i, index, item->num_chars, item->analysis.level, + gravity_name (item->analysis.gravity), + item->analysis.flags, + "OMITTED", /* for some reason, this fails on build.gnome.org, so leave it out */ + script_name (item->analysis.script), + pango_language_to_string (item->analysis.language), + char_str); + print_attributes (item->analysis.extra_attrs, string); + g_free (font); + } + else + { + g_string_append_printf (string, "i=%d, index=%d, no run, line end\n", + i, index); + } + + g_free (char_str); + index = index2; + } + pango_layout_iter_free (iter); +} + +static void +parse_params (const gchar *str, + gint *width, + gint *ellipsize_at, + PangoEllipsizeMode *ellipsize, + PangoWrapMode *wrap) +{ + gchar **strings; + gchar **str2; + gint i; + GEnumClass *eclass; + GEnumValue *ev; + + strings = g_strsplit (str, ",", -1); + for (i = 0; strings[i]; i++) + { + str2 = g_strsplit (strings[i], "=", -1); + if (strcmp (str2[0], "width") == 0) + *width = (gint) g_ascii_strtoll (str2[1], NULL, 10); + else if (strcmp (str2[0], "ellipsize-at") == 0) + *ellipsize_at = (gint) g_ascii_strtoll (str2[1], NULL, 10); + else if (strcmp (str2[0], "ellipsize") == 0) + { + eclass = g_type_class_ref (PANGO_TYPE_ELLIPSIZE_MODE); + ev = g_enum_get_value_by_name (eclass, str2[1]); + if (!ev) + ev = g_enum_get_value_by_nick (eclass, str2[1]); + if (ev) + *ellipsize = ev->value; + g_type_class_unref (eclass); + } + else if (strcmp (str2[0], "wrap") == 0) + { + eclass = g_type_class_ref (PANGO_TYPE_WRAP_MODE); + ev = g_enum_get_value_by_name (eclass, str2[1]); + if (!ev) + ev = g_enum_get_value_by_nick (eclass, str2[1]); + if (ev) + *wrap = ev->value; + g_type_class_unref (eclass); + } + g_strfreev (str2); + } + g_strfreev (strings); +} + +static void +test_file (const gchar *filename, GString *string) +{ + gchar *contents; + gchar *markup; + gsize length; + GError *error = NULL; + PangoLayout *layout; + gchar *p; + gint width = 0; + gint ellipsize_at = 0; + PangoEllipsizeMode ellipsize = PANGO_ELLIPSIZE_NONE; + PangoWrapMode wrap = PANGO_WRAP_WORD; + PangoFontDescription *desc; + + if (!g_file_get_contents (filename, &contents, &length, &error)) + { + fprintf (stderr, "%s\n", error->message); + g_error_free (error); + return; + } + + p = strchr (contents, '\n'); + g_assert (p); + markup = p + 1; + *p = '\0'; + + parse_params (contents, &width, &ellipsize_at, &ellipsize, &wrap); + + layout = pango_layout_new (context); + desc = pango_font_description_from_string ("Cantarell 11"); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_markup (layout, markup, length); + g_free (contents); + + if (width != 0) + pango_layout_set_width (layout, width * PANGO_SCALE); + pango_layout_set_ellipsize (layout, ellipsize); + pango_layout_set_wrap (layout, wrap); + + g_string_append (string, pango_layout_get_text (layout)); + g_string_append (string, "\n---\n\n"); + g_string_append_printf (string, "wrapped: %d\n", pango_layout_is_wrapped (layout)); + g_string_append_printf (string, "ellipsized: %d\n", pango_layout_is_ellipsized (layout)); + g_string_append_printf (string, "lines: %d\n", pango_layout_get_line_count (layout)); + if (width != 0) + g_string_append_printf (string, "width: %d\n", pango_layout_get_width (layout)); + g_string_append (string, "\n---\n\n"); + print_attr_list (pango_layout_get_attributes (layout), string); + g_string_append (string, "\n---\n\n"); + dump_lines (layout, string); + g_string_append (string, "\n---\n\n"); + dump_runs (layout, string); + + g_object_unref (layout); +} + +static gchar * +get_expected_filename (const gchar *filename) +{ + gchar *f, *p, *expected; + + f = g_strdup (filename); + p = strstr (f, ".markup"); + if (p) + *p = 0; + expected = g_strconcat (f, ".expected", NULL); + + g_free (f); + + return expected; +} + +static void +test_layout (gconstpointer d) +{ + const gchar *filename = d; + gchar *expected_file; + GError *error = NULL; + GString *dump; + gchar *diff; + + expected_file = get_expected_filename (filename); + + dump = g_string_sized_new (0); + + test_file (filename, dump); + + diff = diff_with_file (expected_file, dump->str, dump->len, &error); + g_assert_no_error (error); + + if (diff && diff[0]) + { + g_printerr ("Contents don't match expected contents:\n%s", diff); + g_test_fail (); + g_free (diff); + } + + g_string_free (dump, TRUE); + g_free (expected_file); +} + +int +main (int argc, char *argv[]) +{ + GDir *dir; + GError *error = NULL; + const gchar *name; + gchar *path; + + g_setenv ("LC_ALL", "C", TRUE); + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + + /* allow to easily generate expected output for new test cases */ + if (argc > 1) + { + GString *string; + + string = g_string_sized_new (0); + test_file (argv[1], string); + g_print ("%s", string->str); + + return 0; + } + + path = g_test_build_filename (G_TEST_DIST, "layouts", NULL); + dir = g_dir_open (path, 0, &error); + g_free (path); + g_assert_no_error (error); + while ((name = g_dir_read_name (dir)) != NULL) + { + if (!strstr (name, "markup")) + continue; + + path = g_strdup_printf ("/layout/%s", name); + g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "layouts", name, NULL), + test_layout, g_free); + g_free (path); + } + g_dir_close (dir); + + return g_test_run (); +} diff --git a/tests/test-ot-tags.c b/tests/test-ot-tags.c new file mode 100644 index 0000000..9ae748c --- /dev/null +++ b/tests/test-ot-tags.c @@ -0,0 +1,135 @@ +/* -*- mode: C; c-file-style: "gnu" -*- */ +/* Pango + * testscript.c: Test cases for PangoScriptIter + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#define PANGO_ENABLE_ENGINE +#include + +#undef VERBOSE + +#define ASSERT(stmt) G_STMT_START { \ + if (stmt) { } \ + else \ + { \ + g_warning ("%s:%d (%s): assertion '%s' failed", \ + __FILE__, __LINE__, G_STRFUNC, #stmt); \ + exit (1); \ + } \ +} G_STMT_END + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +static void +test_script_tags (void) +{ + gunichar ch; + PangoScript i, max_script; + + /* we need to know what the maximum script number is. but we don't + * provide an api for that. instead of looking into internal tables, + * we'll go over all chars and see what their script is, taking the max! + */ + + max_script = PANGO_SCRIPT_INVALID_CODE; + for (ch = 0; ch <= 0x10FFFF; ch++) + max_script = MAX (max_script, pango_script_for_unichar (ch)); + + for (i = PANGO_SCRIPT_COMMON; i <= max_script; i++) + { + PangoOTTag tag = pango_ot_tag_from_script (i); + PangoScript j = pango_ot_tag_to_script (tag); + + if (tag == FT_MAKE_TAG ('k', 'a', 'n', 'a')) + { + /* Hiragana and Katakana both map to tag 'kana' */ + ASSERT (i == PANGO_SCRIPT_HIRAGANA || i == PANGO_SCRIPT_KATAKANA); + ASSERT (j == PANGO_SCRIPT_HIRAGANA || j == PANGO_SCRIPT_KATAKANA); + } + else + { + if (j != i) + g_error ("Got back %d for script %d (OT tag '%c%c%c%c')", j, i, + tag>>24, (tag>>16)&255, (tag>>8)&255, tag&255); + } + } + + ASSERT (pango_ot_tag_to_script (FT_MAKE_TAG ('X', 'Y', 'Z', ' ')) == PANGO_SCRIPT_UNKNOWN); +} + +static void +test_language_tags (void) +{ + /* just test it for a few known languages to make sure it's working */ + const char languages[][6] = { + "xy", /* hopefully nonexistent */ + "aa", + "az_IR", + "en", + "en_US", + "fa", + "fa_IR", + "fr", + "zh_CN", + "zu" + }; + unsigned int i; + + for (i = 0; i < G_N_ELEMENTS (languages); i++) + { + PangoLanguage *l = pango_language_from_string (languages[i]); + PangoOTTag tag = pango_ot_tag_from_language (l); +#if 0 + PangoLanguage *m = pango_ot_tag_to_language (tag); +#endif + + if (i == 0) + { + ASSERT (tag == PANGO_OT_TAG_DEFAULT_LANGUAGE); + } + else + { + if (tag == PANGO_OT_TAG_DEFAULT_LANGUAGE) + g_error ("Got PANGO_OT_TAG_DEFAULT_LANGUAGE for language '%s'", pango_language_to_string (l)); + + /* The following test can't work without proper BCP 47 language tag + * support. So, disable it. */ +#if 0 + if (!pango_language_matches (l, pango_language_to_string (m))) + g_error ("Got back %s for language %s (OT tag '%c%c%c%c')", + pango_language_to_string (m), pango_language_to_string (l), + tag>>24, (tag>>16)&255, (tag>>8)&255, tag&255); +#endif + } + } +} + +int +main (int argc, char **argv) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/tags/script", test_script_tags); + g_test_add_func ("/tags/language", test_language_tags); + + return g_test_run (); +} + +G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/tests/test-pangocairo-threads.c b/tests/test-pangocairo-threads.c new file mode 100644 index 0000000..6462a0e --- /dev/null +++ b/tests/test-pangocairo-threads.c @@ -0,0 +1,146 @@ +#include +#include +#include +#include + +#define WIDTH 100 +#define HEIGHT 100 +const char *text = "Hamburgerfonts\nวิวิวิวิวิวิ\nبهداد"; + +int num_iters = 50; + +GMutex mutex; + +static cairo_surface_t * +create_surface (void) +{ + return cairo_image_surface_create (CAIRO_FORMAT_A8, WIDTH, HEIGHT); +} + +static PangoLayout * +create_layout (cairo_t *cr) +{ + PangoLayout *layout = pango_cairo_create_layout (cr); + pango_layout_set_text (layout, text, -1); + pango_layout_set_width (layout, WIDTH * PANGO_SCALE); + return layout; +} + +static void +draw (cairo_t *cr, PangoLayout *layout, unsigned int i) +{ + cairo_set_source_rgba (cr, 1, 1, 1, 1); + cairo_paint (cr); + cairo_set_source_rgba (cr, 1, 1, 1, 0); + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + + cairo_identity_matrix (cr); + cairo_scale (cr, (100 + i) / 100., (100 + i) / 100.); + pango_cairo_update_layout (cr, layout); + + pango_cairo_show_layout (cr, layout); +} + +static gpointer +thread_func (gpointer data) +{ + cairo_surface_t *surface = data; + PangoLayout *layout; + int i; + + cairo_t *cr = cairo_create (surface); + + layout = create_layout (cr); + + g_mutex_lock (&mutex); + g_mutex_unlock (&mutex); + + for (i = 0; i < num_iters; i++) + draw (cr, layout, i); + + g_object_unref (layout); + + cairo_destroy (cr); + + return 0; +} + +int +main (int argc, char **argv) +{ + int num_threads = 5; + int i; + GPtrArray *threads = g_ptr_array_new (); + GPtrArray *surfaces = g_ptr_array_new (); + + if (argc > 1) + num_threads = atoi (argv[1]); + if (argc > 2) + num_iters = atoi (argv[2]); + +#if !GLIB_CHECK_VERSION (2, 35, 3) + g_type_init(); +#endif + + g_mutex_lock (&mutex); + + for (i = 0; i < num_threads; i++) + { + char buf[10]; + cairo_surface_t *surface = create_surface (); + g_ptr_array_add (surfaces, surface); + g_snprintf (buf, sizeof (buf), "%d", i); + g_ptr_array_add (threads, + g_thread_new (buf, + thread_func, + surface)); + } + + /* Let them loose! */ + g_mutex_unlock (&mutex); + + for (i = 0; i < num_threads; i++) + g_thread_join (g_ptr_array_index (threads, i)); + + g_ptr_array_free (threads, TRUE); + + /* Now, draw a reference image and check results. */ + { + cairo_surface_t *ref_surface = create_surface (); + cairo_t *cr = cairo_create (ref_surface); + PangoLayout *layout = create_layout (cr); + unsigned char *ref_data = cairo_image_surface_get_data (ref_surface); + unsigned int len = WIDTH * HEIGHT; + + draw (cr, layout, num_iters - 1); + + g_object_unref (layout); + cairo_destroy (cr); + + /* cairo_surface_write_to_png (ref_surface, "test-pangocairo-threads-reference.png"); */ + + g_assert (WIDTH == cairo_format_stride_for_width (CAIRO_FORMAT_A8, WIDTH)); + + for (i = 0; i < num_threads; i++) + { + cairo_surface_t *surface = g_ptr_array_index (surfaces, i); + unsigned char *data = cairo_image_surface_get_data (surface); + if (memcmp (ref_data, data, len)) + { + fprintf (stderr, "image for thread %d different from reference image.\n", i); + cairo_surface_write_to_png (ref_surface, "test-pangocairo-threads-reference.png"); + cairo_surface_write_to_png (surface, "test-pangocairo-threads-failed.png"); + return 1; + } + cairo_surface_destroy (surface); + } + + cairo_surface_destroy (ref_surface); + } + + g_ptr_array_free (surfaces, TRUE); + + pango_cairo_font_map_set_default (NULL); + + return 0; +} diff --git a/tests/testattributes.c b/tests/testattributes.c new file mode 100644 index 0000000..f4c33f1 --- /dev/null +++ b/tests/testattributes.c @@ -0,0 +1,630 @@ +/* Pango + * testiter.c: Test pango attributes + * + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "test-common.h" + +static void +test_copy (PangoAttribute *attr) +{ + PangoAttribute *a; + + a = pango_attribute_copy (attr); + g_assert_true (pango_attribute_equal (attr, a)); + pango_attribute_destroy (a); + pango_attribute_destroy (attr); +} + +static void +test_attributes_basic (void) +{ + PangoFontDescription *desc; + PangoRectangle rect = { 0, 0, 10, 10 }; + + test_copy (pango_attr_language_new (pango_language_from_string ("ja-JP"))); + test_copy (pango_attr_family_new ("Times")); + test_copy (pango_attr_foreground_new (100, 200, 300)); + test_copy (pango_attr_background_new (100, 200, 300)); + test_copy (pango_attr_size_new (1024)); + test_copy (pango_attr_size_new_absolute (1024)); + test_copy (pango_attr_style_new (PANGO_STYLE_ITALIC)); + test_copy (pango_attr_weight_new (PANGO_WEIGHT_ULTRALIGHT)); + test_copy (pango_attr_variant_new (PANGO_VARIANT_SMALL_CAPS)); + test_copy (pango_attr_stretch_new (PANGO_STRETCH_SEMI_EXPANDED)); + desc = pango_font_description_from_string ("Computer Modern 12"); + test_copy (pango_attr_font_desc_new (desc)); + pango_font_description_free (desc); + test_copy (pango_attr_underline_new (PANGO_UNDERLINE_LOW)); + test_copy (pango_attr_underline_color_new (100, 200, 300)); + test_copy (pango_attr_strikethrough_new (TRUE)); + test_copy (pango_attr_strikethrough_color_new (100, 200, 300)); + test_copy (pango_attr_rise_new (256)); + test_copy (pango_attr_scale_new (2.56)); + test_copy (pango_attr_fallback_new (FALSE)); + test_copy (pango_attr_letter_spacing_new (1024)); + test_copy (pango_attr_shape_new (&rect, &rect)); + test_copy (pango_attr_gravity_new (PANGO_GRAVITY_SOUTH)); + test_copy (pango_attr_gravity_hint_new (PANGO_GRAVITY_HINT_STRONG)); +} + +static void +test_attributes_equal (void) +{ + PangoAttribute *attr1, *attr2, *attr3; + + /* check that pango_attribute_equal compares values, but not ranges */ + attr1 = pango_attr_size_new (10); + attr2 = pango_attr_size_new (20); + attr3 = pango_attr_size_new (20); + attr3->start_index = 1; + attr3->end_index = 2; + + g_assert_true (!pango_attribute_equal (attr1, attr2)); + g_assert_true (pango_attribute_equal (attr2, attr3)); + + pango_attribute_destroy (attr1); + pango_attribute_destroy (attr2); + pango_attribute_destroy (attr3); +} + +static void +test_list (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + GString *s; + + list = pango_attr_list_new (); + + attr = pango_attr_size_new (10); + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (20); + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (30); + pango_attr_list_insert (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [0 -1] size 20\n" +" [0 -1] size 30\n"); + g_string_free (s, FALSE); + pango_attr_list_unref (list); + + list = pango_attr_list_new (); + + /* test that insertion respects start_index */ + attr = pango_attr_size_new (10); + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (20); + attr->start_index = 10; + attr->end_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (30); + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (40); + attr->start_index = 10; + attr->end_index = 40; + pango_attr_list_insert_before (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [0 -1] size 30\n" +" [10 40] size 40\n" +" [10 20] size 20\n"); + g_string_free (s, FALSE); + pango_attr_list_unref (list); +} + +static void +test_list_change (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + GString *s; + + list = pango_attr_list_new (); + + attr = pango_attr_size_new (10); + attr->start_index = 0; + attr->end_index = 10; + pango_attr_list_insert (list, attr); + attr = pango_attr_size_new (20); + attr->start_index = 20; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 0; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 10] size 10\n" +" [0 30] weight 700\n" +" [20 30] size 20\n"); + g_string_free (s, FALSE); + + /* simple insertion with pango_attr_list_change */ + attr = pango_attr_variant_new (PANGO_VARIANT_SMALL_CAPS); + attr->start_index = 10; + attr->end_index = 20; + pango_attr_list_change (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 10] size 10\n" +" [0 30] weight 700\n" +" [10 20] variant 1\n" +" [20 30] size 20\n"); + g_string_free (s, FALSE); + + /* insertion with splitting */ + attr = pango_attr_weight_new (PANGO_WEIGHT_LIGHT); + attr->start_index = 15; + attr->end_index = 20; + pango_attr_list_change (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 10] size 10\n" +" [0 15] weight 700\n" +" [10 20] variant 1\n" +" [15 20] weight 300\n" +" [20 30] size 20\n" +" [20 30] weight 700\n"); + g_string_free (s, FALSE); + + /* insertion with joining */ + attr = pango_attr_size_new (20); + attr->start_index = 5; + attr->end_index = 20; + pango_attr_list_change (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 5] size 10\n" +" [0 15] weight 700\n" +" [5 30] size 20\n" +" [10 20] variant 1\n" +" [15 20] weight 300\n" +" [20 30] weight 700\n"); + g_string_free (s, FALSE); + + pango_attr_list_unref (list); +} + +static void +test_list_splice (void) +{ + PangoAttrList *base; + PangoAttrList *list; + PangoAttrList *other; + PangoAttribute *attr; + GString *s; + + base = pango_attr_list_new (); + attr = pango_attr_size_new (10); + attr->start_index = 0; + attr->end_index = -1; + pango_attr_list_insert (base, attr); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 10; + attr->end_index = 15; + pango_attr_list_insert (base, attr); + attr = pango_attr_variant_new (PANGO_VARIANT_SMALL_CAPS); + attr->start_index = 20; + attr->end_index = 30; + pango_attr_list_insert (base, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (base), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [10 15] weight 700\n" +" [20 30] variant 1\n"); + g_string_free (s, FALSE); + + /* splice in an empty list */ + list = pango_attr_list_copy (base); + other = pango_attr_list_new (); + pango_attr_list_splice (list, other, 11, 5); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [10 20] weight 700\n" +" [25 35] variant 1\n"); + g_string_free (s, FALSE); + + pango_attr_list_unref (list); + pango_attr_list_unref (other); + + /* splice in some attributes */ + list = pango_attr_list_copy (base); + other = pango_attr_list_new (); + attr = pango_attr_size_new (20); + attr->start_index = 0; + attr->end_index = 3; + pango_attr_list_insert (other, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 2; + attr->end_index = 4; + pango_attr_list_insert (other, attr); + + pango_attr_list_splice (list, other, 11, 5); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 11] size 10\n" +" [10 20] weight 700\n" +" [11 14] size 20\n" +" [13 15] stretch 2\n" +" [14 -1] size 10\n" +" [25 35] variant 1\n"); + g_string_free (s, FALSE); + + pango_attr_list_unref (list); + pango_attr_list_unref (other); + + pango_attr_list_unref (base); +} + +static gboolean +never_true (PangoAttribute *attribute, gpointer user_data) +{ + return FALSE; +} + +static gboolean +just_weight (PangoAttribute *attribute, gpointer user_data) +{ + if (attribute->klass->type == PANGO_ATTR_WEIGHT) + return TRUE; + else + return FALSE; +} + +static void +test_list_filter (void) +{ + PangoAttrList *list; + PangoAttrList *out; + PangoAttribute *attr; + GString *s; + + list = pango_attr_list_new (); + attr = pango_attr_size_new (10); + pango_attr_list_insert (list, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 10; + attr->end_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [10 20] stretch 2\n" +" [20 -1] weight 700\n"); + g_string_free (s, FALSE); + + out = pango_attr_list_filter (list, never_true, NULL); + g_assert_null (out); + + out = pango_attr_list_filter (list, just_weight, NULL); + g_assert_nonnull (out); + + s = g_string_new (""); + print_attributes (attr_list_to_list (list), s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10\n" +" [10 20] stretch 2\n"); + g_string_free (s, FALSE); + + s = g_string_new (""); + print_attributes (attr_list_to_list (out), s); + g_assert_cmpstr (s->str, ==, +" [20 -1] weight 700\n"); + g_string_free (s, FALSE); + + pango_attr_list_unref (list); + pango_attr_list_unref (out); +} + +static void +test_iter (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + PangoAttrIterator *iter; + PangoAttrIterator *copy; + gint start, end; + + list = pango_attr_list_new (); + attr = pango_attr_size_new (10); + pango_attr_list_insert (list, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 10; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + + iter = pango_attr_list_get_iterator (list); + copy = pango_attr_iterator_copy (iter); + pango_attr_iterator_range (iter, &start, &end); + g_assert_cmpint (start, ==, 0); + g_assert_cmpint (end, ==, 10); + g_assert_true (pango_attr_iterator_next (iter)); + pango_attr_iterator_range (iter, &start, &end); + g_assert_cmpint (start, ==, 10); + g_assert_cmpint (end, ==, 20); + g_assert_true (pango_attr_iterator_next (iter)); + pango_attr_iterator_range (iter, &start, &end); + g_assert_cmpint (start, ==, 20); + g_assert_cmpint (end, ==, 30); + g_assert_true (pango_attr_iterator_next (iter)); + pango_attr_iterator_range (iter, &start, &end); + g_assert_cmpint (start, ==, 30); + g_assert_cmpint (end, ==, G_MAXINT); + g_assert_true (pango_attr_iterator_next (iter)); + pango_attr_iterator_range (iter, &start, &end); + g_assert_cmpint (start, ==, G_MAXINT); + g_assert_cmpint (end, ==, G_MAXINT); + g_assert_true (!pango_attr_iterator_next (iter)); + + pango_attr_iterator_destroy (iter); + + pango_attr_iterator_range (copy, &start, &end); + g_assert_cmpint (start, ==, 0); + g_assert_cmpint (end, ==, 10); + pango_attr_iterator_destroy (copy); + + pango_attr_list_unref (list); +} + +static void +test_iter_get (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + PangoAttrIterator *iter; + + list = pango_attr_list_new (); + attr = pango_attr_size_new (10); + pango_attr_list_insert (list, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 10; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + + iter = pango_attr_list_get_iterator (list); + pango_attr_iterator_next (iter); + attr = pango_attr_iterator_get (iter, PANGO_ATTR_SIZE); + g_assert_nonnull (attr); + g_assert_cmpuint (attr->start_index, ==, 0); + g_assert_cmpuint (attr->end_index, ==, G_MAXUINT); + attr = pango_attr_iterator_get (iter, PANGO_ATTR_STRETCH); + g_assert_nonnull (attr); + g_assert_cmpuint (attr->start_index, ==, 10); + g_assert_cmpuint (attr->end_index, ==, 30); + attr = pango_attr_iterator_get (iter, PANGO_ATTR_WEIGHT); + g_assert_null (attr); + attr = pango_attr_iterator_get (iter, PANGO_ATTR_GRAVITY); + g_assert_null (attr); + + pango_attr_iterator_destroy (iter); + pango_attr_list_unref (list); +} + +static void +test_iter_get_font (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + PangoAttrIterator *iter; + PangoFontDescription *desc; + PangoFontDescription *desc2; + PangoLanguage *lang; + GSList *attrs; + GString *s; + + list = pango_attr_list_new (); + attr = pango_attr_size_new (10 * PANGO_SCALE); + pango_attr_list_insert (list, attr); + attr = pango_attr_family_new ("Times"); + pango_attr_list_insert (list, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 10; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + attr = pango_attr_language_new (pango_language_from_string ("ja-JP")); + attr->start_index = 10; + attr->end_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_rise_new (100); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_fallback_new (FALSE); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + + iter = pango_attr_list_get_iterator (list); + desc = pango_font_description_new (); + pango_attr_iterator_get_font (iter, desc, &lang, &attrs); + desc2 = pango_font_description_from_string ("Times 10"); + g_assert_true (pango_font_description_equal (desc, desc2)); + g_assert_null (lang); + g_assert_null (attrs); + pango_font_description_free (desc); + pango_font_description_free (desc2); + + pango_attr_iterator_next (iter); + desc = pango_font_description_new (); + pango_attr_iterator_get_font (iter, desc, &lang, &attrs); + desc2 = pango_font_description_from_string ("Times Condensed 10"); + g_assert_true (pango_font_description_equal (desc, desc2)); + g_assert_nonnull (lang); + g_assert_cmpstr (pango_language_to_string (lang), ==, "ja-jp"); + g_assert_null (attrs); + pango_font_description_free (desc); + pango_font_description_free (desc2); + + pango_attr_iterator_next (iter); + desc = pango_font_description_new (); + pango_attr_iterator_get_font (iter, desc, &lang, &attrs); + desc2 = pango_font_description_from_string ("Times Condensed 10"); + g_assert_true (pango_font_description_equal (desc, desc2)); + g_assert_null (lang); + s = g_string_new (""); + print_attributes (attrs, s); + g_assert_cmpstr (s->str, ==, +" [20 -1] rise 100\n" +" [20 -1] fallback 0\n"); + g_string_free (s, FALSE); + g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy); + + pango_font_description_free (desc); + pango_font_description_free (desc2); + + pango_attr_iterator_destroy (iter); + pango_attr_list_unref (list); +} + +static void +test_iter_get_attrs (void) +{ + PangoAttrList *list; + PangoAttribute *attr; + PangoAttrIterator *iter; + GSList *attrs; + GString *s; + + list = pango_attr_list_new (); + attr = pango_attr_size_new (10 * PANGO_SCALE); + pango_attr_list_insert (list, attr); + attr = pango_attr_family_new ("Times"); + pango_attr_list_insert (list, attr); + attr = pango_attr_stretch_new (PANGO_STRETCH_CONDENSED); + attr->start_index = 10; + attr->end_index = 30; + pango_attr_list_insert (list, attr); + attr = pango_attr_language_new (pango_language_from_string ("ja-JP")); + attr->start_index = 10; + attr->end_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_rise_new (100); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + attr = pango_attr_fallback_new (FALSE); + attr->start_index = 20; + pango_attr_list_insert (list, attr); + + iter = pango_attr_list_get_iterator (list); + attrs = pango_attr_iterator_get_attrs (iter); + s = g_string_new (""); + print_attributes (attrs, s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10240\n" +" [0 -1] family Times\n"); + g_string_free (s, FALSE); + g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy); + + pango_attr_iterator_next (iter); + attrs = pango_attr_iterator_get_attrs (iter); + s = g_string_new (""); + print_attributes (attrs, s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10240\n" +" [0 -1] family Times\n" +" [10 30] stretch 2\n" +" [10 20] language ja-jp\n"); + g_string_free (s, FALSE); + g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy); + + pango_attr_iterator_next (iter); + attrs = pango_attr_iterator_get_attrs (iter); + s = g_string_new (""); + print_attributes (attrs, s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10240\n" +" [0 -1] family Times\n" +" [10 30] stretch 2\n" +" [20 -1] rise 100\n" +" [20 -1] fallback 0\n"); + g_string_free (s, FALSE); + g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy); + + pango_attr_iterator_next (iter); + attrs = pango_attr_iterator_get_attrs (iter); + s = g_string_new (""); + print_attributes (attrs, s); + g_assert_cmpstr (s->str, ==, +" [0 -1] size 10240\n" +" [0 -1] family Times\n" +" [20 -1] rise 100\n" +" [20 -1] fallback 0\n"); + g_string_free (s, FALSE); + g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy); + + pango_attr_iterator_next (iter); + attrs = pango_attr_iterator_get_attrs (iter); + g_assert_null (attrs); + + pango_attr_iterator_destroy (iter); + pango_attr_list_unref (list); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/attributes/basic", test_attributes_basic); + g_test_add_func ("/attributes/equal", test_attributes_equal); + g_test_add_func ("/attributes/list/basic", test_list); + g_test_add_func ("/attributes/list/change", test_list_change); + g_test_add_func ("/attributes/list/splice", test_list_splice); + g_test_add_func ("/attributes/list/filter", test_list_filter); + g_test_add_func ("/attributes/iter/basic", test_iter); + g_test_add_func ("/attributes/iter/get", test_iter_get); + g_test_add_func ("/attributes/iter/get_font", test_iter_get_font); + g_test_add_func ("/attributes/iter/get_attrs", test_iter_get_attrs); + + return g_test_run (); +} diff --git a/tests/testboundaries.c b/tests/testboundaries.c new file mode 100644 index 0000000..75da772 --- /dev/null +++ b/tests/testboundaries.c @@ -0,0 +1,350 @@ +/* Pango + * testboundaries.c: Test text boundary algorithms + * + * Copyright (C) 1999-2000 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include + +#include +#include + +#ifndef G_OS_WIN32 +#include +#endif + +#define CHFORMAT "%0#6x" + +/* FIXME for now this just tests that the breaking of some sample + * text conforms to certain rules and invariants. But eventually + * we should also have test-result pairs, i.e. a string and some + * encoding of the correct way to break the string, to check + * more precisely that things worked + */ + + +static int offset = 0; +static int line = 0; +static gunichar current_wc = 0; +static const char *line_start = NULL; +static const char *line_end = NULL; + +static void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN; +static void fail (const char *format, ...) +{ + char *str; + char *line_text; + + va_list args; + + va_start (args, format); + str = g_strdup_vprintf (format, args); + va_end (args); + + line_text = g_strndup (line_start, line_end - line_start); + + fprintf (stderr, "line %d offset %d char is " CHFORMAT ": %s\n (line is '%s')\n", line, offset, current_wc, str, line_text); + g_free (str); + g_free (line_text); + + exit (1); +} + +typedef void (* CharForeachFunc) (gunichar wc, + gunichar prev_wc, + gunichar next_wc, + GUnicodeType type, + GUnicodeType prev_type, + GUnicodeType next_type, + PangoLogAttr *attr, + PangoLogAttr *prev_attr, + PangoLogAttr *next_attr, + gpointer data); + +static void +log_attr_foreach (const char *text, + PangoLogAttr *attrs, + CharForeachFunc func, + gpointer data) +{ + const gchar *next = text; + gint length = strlen (text); + const gchar *end = text + length; + gint i = 0; + gunichar prev_wc; + gunichar next_wc; + GUnicodeType prev_type; + GUnicodeType next_type; + + if (next == end) + return; + + offset = 0; + line = 1; + + prev_type = (GUnicodeType) -1; + prev_wc = 0; + + next_wc = g_utf8_get_char (next); + next_type = g_unichar_type (next_wc); + + line_start = text; + line_end = text; + + while (next_wc != 0) + { + GUnicodeType type; + gunichar wc; + + wc = next_wc; + type = next_type; + + current_wc = wc; + + next = g_utf8_next_char (next); + line_end = next; + + if (next >= end) + next_wc = 0; + else + next_wc = g_utf8_get_char (next); + + if (next_wc) + next_type = g_unichar_type (next_wc); + + (* func) (wc, prev_wc, next_wc, + type, prev_type, next_type, + &attrs[i], + i != 0 ? &attrs[i-1] : NULL, + next_wc != 0 ? &attrs[i+1] : NULL, + data); + + prev_type = type; + prev_wc = wc; + ++i; + ++offset; + if (wc == '\n') + { + ++line; + offset = 0; + line_start = next; + line_end = next; + } + } +} + +static void +check_line_char (gunichar wc, + gunichar prev_wc, + gunichar next_wc, + GUnicodeType type, + GUnicodeType prev_type, + GUnicodeType next_type, + PangoLogAttr *attr, + PangoLogAttr *prev_attr, + PangoLogAttr *next_attr, + gpointer data) +{ + GUnicodeBreakType break_type; + GUnicodeBreakType prev_break_type; + + break_type = g_unichar_break_type (wc); + if (prev_wc) + prev_break_type = g_unichar_break_type (prev_wc); + else + prev_break_type = G_UNICODE_BREAK_UNKNOWN; + + if (wc == '\n') + { + if (prev_wc == '\r') + { + if (attr->is_line_break) + fail ("line break between \\r and \\n"); + } + + if (next_attr && !next_attr->is_line_break) + fail ("no line break after \\n"); + } + + if (attr->is_line_break && prev_wc == 0) + fail ("first char in string should not be marked as a line break"); + + if (break_type == G_UNICODE_BREAK_SPACE) + { + if (attr->is_line_break && prev_attr != NULL && + !attr->is_mandatory_break && + !(next_wc && g_unichar_break_type (next_wc) == G_UNICODE_BREAK_COMBINING_MARK)) + fail ("can't break lines before a space unless a mandatory break char precedes it or a combining mark follows; prev char was " CHFORMAT, prev_wc); + } + + if (attr->is_mandatory_break && !attr->is_line_break) + fail ("mandatory breaks must also be marked as regular breaks"); + + + + /* FIXME use the break tables from break.c to automatically + * check invariants for each cell in the table. Shouldn't + * be that hard to do. + */ + + if (break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION && + prev_break_type == G_UNICODE_BREAK_OPEN_PUNCTUATION && + attr->is_line_break && + !attr->is_mandatory_break) + fail ("can't break between two open punctuation chars"); + + if (break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION && + prev_break_type == G_UNICODE_BREAK_CLOSE_PUNCTUATION && + attr->is_line_break && + !attr->is_mandatory_break) + fail ("can't break between two close punctuation chars"); + + if (break_type == G_UNICODE_BREAK_QUOTATION && + prev_break_type == G_UNICODE_BREAK_ALPHABETIC && + attr->is_line_break && + !attr->is_mandatory_break) + fail ("can't break letter-quotemark sequence"); +} + +static void +check_line_invariants (const char *text, + PangoLogAttr *attrs) +{ + log_attr_foreach (text, attrs, check_line_char, NULL); +} + +static void +check_word_invariants (const char *text, + PangoLogAttr *attrs) +{ + + +} + +static void +check_sentence_invariants (const char *text, + PangoLogAttr *attrs) +{ + + +} + +static void +check_grapheme_invariants (const char *text, + PangoLogAttr *attrs) +{ + + +} + +#if 0 +static void print_sentences (const char *text, + PangoLogAttr *attrs); +static void +print_sentences (const char *text, + PangoLogAttr *attrs) +{ + const char *p; + const char *last; + int i = 0; + + last = text; + p = text; + + while (*p) + { + if (attrs[i].is_sentence_boundary) + { + char *s = g_strndup (last, p - last); + printf ("%s\n", s); + g_free (s); + last = p; + } + + p = g_utf8_next_char (p); + ++i; + } +} +#endif + +static void +check_invariants (const char *text) +{ + int len; + PangoLogAttr *attrs; + + if (!g_utf8_validate (text, -1, NULL)) + fail ("Invalid UTF-8 in test text"); + + len = g_utf8_strlen (text, -1); + attrs = g_new0 (PangoLogAttr, len + 1); + + pango_get_log_attrs (text, + -1, + 0, + pango_language_from_string ("C"), + attrs, + len + 1); + + check_line_invariants (text, attrs); + check_sentence_invariants (text, attrs); + check_grapheme_invariants (text, attrs); + check_word_invariants (text, attrs); + +#if 0 + print_sentences (text, attrs); +#endif + + g_free (attrs); +} + +static void +test_boundaries (void) +{ + gchar *text; + const gchar *filename; +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "boundaries.utf8", NULL); +#else + filename = SRCDIR "/boundaries.utf8"; +#endif + + g_print ("sample file: %s\n", filename); + + if (!g_file_get_contents (filename, &text, NULL, NULL)) + fail ("Couldn't open sample text file"); + + check_invariants (text); + + g_free (text); + + printf ("testboundaries passed\n"); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/text/boundaries", test_boundaries); + + return g_test_run (); +} + diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c new file mode 100644 index 0000000..53f7b4c --- /dev/null +++ b/tests/testboundaries_ucd.c @@ -0,0 +1,436 @@ +/* Pango + * testboundaries_ucd.c: Test text boundary algorithms with test data from + * Unicode Character Database. + * + * Copyright (C) 2003 Noah Levitt + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include + +static gboolean failed = FALSE; + +/* PangoLogAttr has to be the same size as guint or this hack breaks */ +typedef union +{ + PangoLogAttr attr; + guint bits; +} +AttrBits; + +/* counts the number of multiplication and divison signs up to the first + * '#' or null character */ +static gint +count_attrs (gchar *line) +{ + gunichar ch; + gchar *p = line; + gint count = 0; + + for (;;) + { + ch = g_utf8_get_char (p); + + switch (ch) + { + /* MULTIPLICATION SIGN, DIVISION SIGN */ + case 0x00d7: case 0x00f7: + count++; + break; + + /* null char, NUMBER SIGN */ + case 0x0000: case 0x0023: + return count; + + default: + break; + } + + p = g_utf8_next_char (p); + } + /* not reached */ +} + +static gboolean +parse_line (gchar *line, + AttrBits bits, + gchar **str_return, + PangoLogAttr **attr_return, + gint *num_attrs) +{ + GString *gs; + gunichar ch, character; + gchar *p, *q; + gint i; + AttrBits temp_attr; + + *num_attrs = count_attrs (line); + *attr_return = g_new (PangoLogAttr, *num_attrs); + + p = line; + i = 0; + gs = g_string_new (NULL); + + for (;;) + { + temp_attr.bits = 0; + + /* skip white space */ + do + { + ch = g_utf8_get_char (p); + p = g_utf8_next_char (p); + } + while (g_unichar_isspace (ch)); + + switch (ch) + { + case 0x00f7: /* DIVISION SIGN: boundary here */ + temp_attr.bits |= bits.bits; + /* fall through */ + + case 0x00d7: /* MULTIPLICATION SIGN: no boundary here */ + break; + + case 0x0000: + case 0x0023: + *str_return = g_string_free (gs, FALSE); + return TRUE; + + default: /* unexpected character */ + g_free (*attr_return); + return FALSE; + } + + (*attr_return)[i] = temp_attr.attr; + + /* skip white space */ + do + { + ch = g_utf8_get_char (p); + p = g_utf8_next_char (p); + } + while (g_unichar_isspace (ch)); + p = g_utf8_prev_char (p); + + if (ch == 0x0023 || ch == 0x0000) + { + *str_return = g_string_free (gs, FALSE); + return TRUE; + } + + character = strtoul (p, &q, 16); + if (q < p + 4 || q > p + 6 || character > 0x10ffff) + { + g_free (*attr_return); + return FALSE; + } + + p = q; + + gs = g_string_append_unichar (gs, character); + + i++; + } +} + +static gboolean +attrs_equal (PangoLogAttr *attrs1, + PangoLogAttr *attrs2, + gint len, + AttrBits bits) +{ + AttrBits a, b; + gint i; + + for (i = 0; i < len; i++) + { + a.bits = 0; + a.attr = attrs1[i]; + + b.bits = 0; + b.attr = attrs2[i]; + + /* can't do a straight comparison because the bitmask may have + * multiple bits set, and as long as attr&bitmask is not zero, it + * counts as being set */ + if (((a.bits & bits.bits) && !(b.bits & bits.bits)) || + (!(a.bits & bits.bits) && (b.bits & bits.bits))) + return FALSE; + } + + return TRUE; +} + +static gchar * +make_test_string (gchar *string, + PangoLogAttr *attrs, + AttrBits bits) +{ + GString *gs = g_string_new (NULL); + gint i = 0; + AttrBits a; + gchar *p = string; + gunichar ch; + + for (;;) + { + a.bits = 0; + a.attr = attrs[i]; + if ((a.bits & bits.bits) != 0) + gs = g_string_append_unichar (gs, 0x00f7); + else + gs = g_string_append_unichar (gs, 0x00d7); + + g_string_append_c (gs, ' '); + + if (*p == '\0') + break; + + ch = g_utf8_get_char (p); + g_string_append_printf (gs, "%04X ", ch); + + p = g_utf8_next_char (p); + i++; + } + + return g_string_free (gs, FALSE); +} + +static void +do_test (const gchar *filename, + AttrBits bits) +{ + GIOChannel *channel; + GIOStatus status; + gchar *line; + gsize length, terminator_pos; + GError *error; + gchar *string; + PangoLogAttr *expected_attrs; + gint num_attrs; + gint i; + + error = NULL; + channel = g_io_channel_new_file (filename, "r", &error); + if (!channel) + { + if (error->domain == G_FILE_ERROR && error->code == G_FILE_ERROR_NOENT) + { + g_print ("%s not found. Skipping test.\n", filename); + goto done; + } + else + { + g_printerr ("%s: %s\n", filename, error->message); + exit (1); + } + } + g_print ("Testing %s.\n", filename); + + i = 1; + for (;;) + { + error = NULL; + status = g_io_channel_read_line (channel, &line, &length, &terminator_pos, &error); + + switch (status) + { + case G_IO_STATUS_ERROR: + g_printerr ("%s: %s\n", filename, error->message); + exit (1); + + case G_IO_STATUS_EOF: + goto done; + + case G_IO_STATUS_AGAIN: + continue; + + case G_IO_STATUS_NORMAL: + line[terminator_pos] = '\0'; + break; + } + + if (! parse_line (line, bits, &string, &expected_attrs, &num_attrs)) + { + g_printerr ("%s: error parsing line %d: %s\n", filename, i, line); + exit (1); + } + + if (num_attrs > 0) + { + PangoLogAttr *attrs = g_new (PangoLogAttr, num_attrs); + pango_get_log_attrs (string, -1, 0, pango_language_from_string ("C"), attrs, num_attrs); + + if (! attrs_equal (attrs, expected_attrs, num_attrs, bits)) + { + gchar *str = make_test_string (string, attrs, bits); + gchar *comments = strchr (line, '#'); + if (comments) /* don't print the # comment in the error message. print it separately */ + { + *comments = '\0'; + comments++; + } + else + { + comments = ""; + } + + g_printerr ("%s: line %d failed\n" + " expected: %s\n" + " returned: %s\n" + " comments: %s\n\n", + filename, i, line, str, comments); + + g_free (str); + failed = TRUE; + } + g_free (attrs); + } + g_free (string); + g_free (expected_attrs); + + i++; + } + +done: + if (channel) + g_io_channel_unref (channel); + if (error) + g_error_free (error); + + g_assert (!failed); +} + +static void +test_grapheme_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "GraphemeBreakTest.txt", NULL); +#else + filename = SRCDIR "/GraphemeBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_cursor_position = 1; + do_test (filename, bits); +} + +static void +test_emoji_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "EmojiBreakTest.txt", NULL); +#else + filename = SRCDIR "/EmojiBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_cursor_position = 1; + do_test (filename, bits); +} + +static void +test_char_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "CharBreakTest.txt", NULL); +#else + filename = SRCDIR "/CharBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_char_break = 1; + do_test (filename, bits); +} + +static void +test_word_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "WordBreakTest.txt", NULL); +#else + filename = SRCDIR "/WordBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_word_boundary = 1; + do_test (filename, bits); +} + +static void +test_sentence_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "SentenceBreakTest.txt", NULL); +#else + filename = SRCDIR "/SentenceBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_sentence_boundary = 1; + do_test (filename, bits); +} + +static void +test_line_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "LineBreakTest.txt", NULL); +#else + filename = SRCDIR "/LineBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_line_break = 1; + bits.attr.is_mandatory_break = 1; + do_test (filename, bits); +} + + +gint +main (gint argc, + gchar **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/text/break/grapheme", test_grapheme_break); + g_test_add_func ("/text/break/word", test_word_break); + g_test_add_func ("/text/break/sentence", test_sentence_break); + g_test_add_func ("/text/break/line", test_line_break); + g_test_add_func ("/text/break/emoji", test_emoji_break); + g_test_add_func ("/text/break/char", test_char_break); + + return g_test_run (); +} diff --git a/tests/testcolor.c b/tests/testcolor.c new file mode 100644 index 0000000..36f2dbf --- /dev/null +++ b/tests/testcolor.c @@ -0,0 +1,99 @@ +/* Pango + * test-color.c: Test program for pango_color_parse() + * + * Copyright (C) 2002 Matthias Clasen + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +typedef struct _ColorSpec { + const gchar *spec; + gboolean valid; + guint16 red; + guint16 green; + guint16 blue; +} ColorSpec; + +static gboolean test_one_color (ColorSpec *spec) +{ + PangoColor color; + gboolean accepted; + + accepted = pango_color_parse (&color, spec->spec); + + if (accepted == spec->valid && + (!accepted || + (color.red == spec->red && + color.green == spec->green && + color.blue == spec->blue))) + return TRUE; + else + return FALSE; +} + + +ColorSpec specs [] = { + { "#abc", 1, 0xaaaa, 0xbbbb, 0xcccc }, + { "#aabbcc", 1, 0xaaaa, 0xbbbb, 0xcccc }, + { "#aaabbbccc", 1, 0xaaaa, 0xbbbb, 0xcccc }, + { "#100100100", 1, 0x1001, 0x1001, 0x1001 }, + { "#aaaabbbbcccc", 1, 0xaaaa, 0xbbbb, 0xcccc }, + { "#fff", 1, 0xffff, 0xffff, 0xffff }, + { "#ffffff", 1, 0xffff, 0xffff, 0xffff }, + { "#fffffffff", 1, 0xffff, 0xffff, 0xffff }, + { "#ffffffffffff", 1, 0xffff, 0xffff, 0xffff }, + { "#000", 1, 0x0000, 0x0000, 0x0000 }, + { "#000000", 1, 0x0000, 0x0000, 0x0000 }, + { "#000000000", 1, 0x0000, 0x0000, 0x0000 }, + { "#000000000000", 1, 0x0000, 0x0000, 0x0000 }, + { "#AAAABBBBCCCC", 1, 0xaaaa, 0xbbbb, 0xcccc }, + { "#aa bb cc ", 0, 0, 0, 0 }, + { "#aa bb ccc", 0, 0, 0, 0 }, + { "#ab", 0, 0, 0, 0 }, + { "#aabb", 0, 0, 0, 0 }, + { "#aaabb", 0, 0, 0, 0 }, + { "aaabb", 0, 0, 0, 0 }, + { "", 0, 0, 0, 0 }, + { "#", 0, 0, 0, 0 }, + { "##fff", 0, 0, 0, 0 }, + { "#0000ff+", 0, 0, 0, 0 }, + { "#0000f+", 0, 0, 0, 0 }, + { "#0x00x10x2", 0, 0, 0, 0 }, + { NULL, 0, 0, 0, 0 } +}; + +static void +test_color (void) +{ + ColorSpec *spec; + + for (spec = specs; spec->spec; spec++) + g_assert (test_one_color (spec)); + +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/color/parse", test_color); + + return g_test_run (); +} diff --git a/tests/testiter.c b/tests/testiter.c new file mode 100644 index 0000000..de3b462 --- /dev/null +++ b/tests/testiter.c @@ -0,0 +1,306 @@ +/* Pango + * testiter.c: Test pangolayoutiter.c + * + * Copyright (C) 2005 Amit Aronovitch + * Copyright (C) 2005 Red Hat, Inc + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#include +#include + +#include + +#include + +static void verbose (const char *format, ...) G_GNUC_PRINTF (1, 2); +static void +verbose (const char *format, ...) +{ +#ifdef VERBOSE + va_list vap; + + va_start (vap, format); + vfprintf (stderr, format, vap); + va_end (vap); +#endif +} + +#define LAYOUT_WIDTH (80 * PANGO_SCALE) + +/* Note: The test expects that any newline sequence is of length 1 + * use \n (not \r\n) in the test texts. + * I think the iterator itself should support \r\n without trouble, + * but there are comments in layout-iter.c suggesting otherwise. + */ +const char *test_texts[] = + { + /* English with embedded RTL runs (from ancient-hebrew.org) */ + "The Hebrew word \xd7\x90\xd7\x93\xd7\x9d\xd7\x94 (adamah) is the feminine form of \xd7\x90\xd7\x93\xd7\x9d meaning \"ground\"\n", + /* Arabic, with vowel marks (from Sura Al Fatiha) */ + "\xd8\xa8\xd9\x90\xd8\xb3\xd9\x92\xd9\x85\xd9\x90 \xd8\xa7\xd9\x84\xd9\x84\xd9\x91\xd9\x87\xd9\x90 \xd8\xa7\xd9\x84\xd8\xb1\xd9\x91\xd9\x8e\xd8\xad\xd9\x92\xd9\x85\xd9\x80\xd9\x8e\xd9\x86\xd9\x90 \xd8\xa7\xd9\x84\xd8\xb1\xd9\x91\xd9\x8e\xd8\xad\xd9\x90\xd9\x8a\xd9\x85\xd9\x90\n\xd8\xa7\xd9\x84\xd9\x92\xd8\xad\xd9\x8e\xd9\x85\xd9\x92\xd8\xaf\xd9\x8f \xd9\x84\xd9\x84\xd9\x91\xd9\x87\xd9\x90 \xd8\xb1\xd9\x8e\xd8\xa8\xd9\x91\xd9\x90 \xd8\xa7\xd9\x84\xd9\x92\xd8\xb9\xd9\x8e\xd8\xa7\xd9\x84\xd9\x8e\xd9\x85\xd9\x90\xd9\x8a\xd9\x86\xd9\x8e\n", + /* Arabic, with embedded LTR runs (from a Linux guide) */ + "\xd8\xa7\xd9\x84\xd9\x85\xd8\xaa\xd8\xba\xd9\x8a\xd8\xb1 LC_ALL \xd9\x8a\xd8\xba\xd9\x8a\xd9\x8a\xd8\xb1 \xd9\x83\xd9\x84 \xd8\xa7\xd9\x84\xd9\x85\xd8\xaa\xd8\xba\xd9\x8a\xd8\xb1\xd8\xa7\xd8\xaa \xd8\xa7\xd9\x84\xd8\xaa\xd9\x8a \xd8\xaa\xd8\xa8\xd8\xaf\xd8\xa3 \xd8\xa8\xd8\xa7\xd9\x84\xd8\xb1\xd9\x85\xd8\xb2 LC.", + /* Hebrew, with vowel marks (from Genesis) */ + "\xd7\x91\xd6\xbc\xd6\xb0\xd7\xa8\xd6\xb5\xd7\x90\xd7\xa9\xd7\x81\xd6\xb4\xd7\x99\xd7\xaa, \xd7\x91\xd6\xbc\xd6\xb8\xd7\xa8\xd6\xb8\xd7\x90 \xd7\x90\xd6\xb1\xd7\x9c\xd6\xb9\xd7\x94\xd6\xb4\xd7\x99\xd7\x9d, \xd7\x90\xd6\xb5\xd7\xaa \xd7\x94\xd6\xb7\xd7\xa9\xd6\xbc\xd7\x81\xd6\xb8\xd7\x9e\xd6\xb7\xd7\x99\xd6\xb4\xd7\x9d, \xd7\x95\xd6\xb0\xd7\x90\xd6\xb5\xd7\xaa \xd7\x94\xd6\xb8\xd7\x90\xd6\xb8\xd7\xa8\xd6\xb6\xd7\xa5", + /* Hebrew, with embedded LTR runs (from a Linux guide) */ + "\xd7\x94\xd7\xa7\xd7\x9c\xd7\x93\xd7\x94 \xd7\xa2\xd7\x9c \xd7\xa9\xd7\xa0\xd7\x99 \xd7\x94 SHIFT\xd7\x99\xd7\x9d (\xd7\x99\xd7\x9e\xd7\x99\xd7\x9f \xd7\x95\xd7\xa9\xd7\x9e\xd7\x90\xd7\x9c \xd7\x91\xd7\x99\xd7\x97\xd7\x93) \xd7\x90\xd7\x9e\xd7\x95\xd7\xa8\xd7\x99\xd7\x9d \xd7\x9c\xd7\x94\xd7\x93\xd7\x9c\xd7\x99\xd7\xa7 \xd7\x90\xd7\xaa \xd7\xa0\xd7\x95\xd7\xa8\xd7\xaa \xd7\x94 Scroll Lock , \xd7\x95\xd7\x9c\xd7\x94\xd7\xa2\xd7\x91\xd7\x99\xd7\xa8 \xd7\x90\xd7\x95\xd7\xaa\xd7\xa0\xd7\x95 \xd7\x9c\xd7\x9e\xd7\xa6\xd7\x91 \xd7\x9b\xd7\xaa\xd7\x99\xd7\x91\xd7\x94 \xd7\x91\xd7\xa2\xd7\x91\xd7\xa8\xd7\x99\xd7\xaa.", + /* Different line terminators */ + "AAAA\nBBBB\nCCCC\n", + "DDDD\rEEEE\rFFFF\r", + "GGGG\r\nHHHH\r\nIIII\r\n", + "asdf", + NULL + }; + +/* char iteration test: + * - Total num of iterations match number of chars + * - GlyphString's index_to_x positions match those returned by the Iter + */ +static void +iter_char_test (PangoLayout *layout) +{ + PangoRectangle extents, run_extents; + PangoLayoutIter *iter; + PangoLayoutRun *run; + int num_chars; + int i, index, offset; + int leading_x, trailing_x, x0, x1; + gboolean iter_next_ok, rtl; + const char *text, *ptr; + + text = pango_layout_get_text (layout); + num_chars = g_utf8_strlen (text, -1); + + iter = pango_layout_get_iter (layout); + iter_next_ok = TRUE; + + for (i = 0 ; i < num_chars; ++i) + { + gchar *char_str; + g_assert (iter_next_ok); + + index = pango_layout_iter_get_index (iter); + ptr = text + index; + char_str = g_strndup (ptr, g_utf8_next_char (ptr) - ptr); + verbose ("i=%d (visual), index = %d '%s':\n", + i, index, char_str); + g_free (char_str); + + pango_layout_iter_get_char_extents (iter, &extents); + verbose (" char extents: x=%d,y=%d w=%d,h=%d\n", + extents.x, extents.y, + extents.width, extents.height); + + run = pango_layout_iter_get_run (iter); + + if (run) + { + /* Get needed data for the GlyphString */ + pango_layout_iter_get_run_extents(iter, NULL, &run_extents); + offset = run->item->offset; + rtl = run->item->analysis.level%2; + verbose (" (current run: offset=%d,x=%d,len=%d,rtl=%d)\n", + offset, run_extents.x, run->item->length, rtl); + + /* Calculate expected x result using index_to_x */ + pango_glyph_string_index_to_x (run->glyphs, + (char *)(text + offset), run->item->length, + &run->item->analysis, + index - offset, FALSE, &leading_x); + pango_glyph_string_index_to_x (run->glyphs, + (char *)(text + offset), run->item->length, + &run->item->analysis, + index - offset, TRUE, &trailing_x); + + x0 = run_extents.x + MIN (leading_x, trailing_x); + x1 = run_extents.x + MAX (leading_x, trailing_x); + + verbose (" (index_to_x ind=%d: expected x=%d, width=%d)\n", + index - offset, x0, x1 - x0); + + g_assert (extents.x == x0); + g_assert (extents.width == x1 - x0); + } + else + { + /* We're on a line terminator */ + } + + iter_next_ok = pango_layout_iter_next_char (iter); + verbose ("more to go? %d\n", iter_next_ok); + } + + /* There should be one character position iterator for each character in the + * input string */ + g_assert (!iter_next_ok); + + pango_layout_iter_free (iter); +} + +static void +iter_cluster_test (PangoLayout *layout) +{ + PangoRectangle extents; + PangoLayoutIter *iter; + int index; + gboolean iter_next_ok; + PangoLayoutLine *last_line = NULL; + int expected_next_x = 0; + + iter = pango_layout_get_iter (layout); + iter_next_ok = TRUE; + + while (iter_next_ok) + { + PangoLayoutLine *line = pango_layout_iter_get_line (iter); + + /* Every cluster is part of a run */ + g_assert (pango_layout_iter_get_run (iter)); + + index = pango_layout_iter_get_index (iter); + + pango_layout_iter_get_cluster_extents (iter, NULL, &extents); + + iter_next_ok = pango_layout_iter_next_cluster (iter); + + verbose ("index = %d:\n", index); + verbose (" cluster extents: x=%d,y=%d w=%d,h=%d\n", + extents.x, extents.y, + extents.width, extents.height); + verbose ("more to go? %d\n", iter_next_ok); + + /* All the clusters on a line should be next to each other and occupy + * the entire line. They advance linearly from left to right */ + g_assert (extents.width >= 0); + + if (last_line == line) + g_assert (extents.x == expected_next_x); + + expected_next_x = extents.x + extents.width; + + last_line = line; + } + + g_assert (!iter_next_ok); + + pango_layout_iter_free (iter); +} + +static void +test_layout_iter (void) +{ + const char **ptext; + PangoFontMap *fontmap; + PangoContext *context; + PangoFontDescription *font_desc; + PangoLayout *layout; + + fontmap = pango_cairo_font_map_get_default (); + context = pango_font_map_create_context (fontmap); + font_desc = pango_font_description_from_string ("cantarell 11"); + pango_context_set_font_description (context, font_desc); + + layout = pango_layout_new (context); + pango_layout_set_width (layout, LAYOUT_WIDTH); + + for (ptext = test_texts; *ptext != NULL; ++ptext) + { + verbose ("--------- checking next text ----------\n"); + verbose (" <%s>\n", *ptext); + verbose ( "len=%ld, bytes=%ld\n", + (long)g_utf8_strlen (*ptext, -1), (long)strlen (*ptext)); + + pango_layout_set_text (layout, *ptext, -1); + iter_char_test (layout); + iter_cluster_test (layout); + } + + g_object_unref (layout); + g_object_unref (context); + pango_font_description_free (font_desc); +} + +static void +test_glyphitem_iter (void) +{ + PangoFontMap *fontmap; + PangoContext *context; + PangoFontDescription *font_desc; + PangoLayout *layout; + PangoLayoutLine *line; + const char *text; + GSList *l; + + fontmap = pango_cairo_font_map_get_default (); + context = pango_font_map_create_context (fontmap); + font_desc = pango_font_description_from_string ("cantarell 11"); + pango_context_set_font_description (context, font_desc); + + layout = pango_layout_new (context); + /* This shouldn't form any ligatures. */ + pango_layout_set_text (layout, "test تست", -1); + text = pango_layout_get_text (layout); + + line = pango_layout_get_line (layout, 0); + for (l = line->runs; l; l = l->next) + { + PangoGlyphItem *run = l->data; + int direction; + + for (direction = 0; direction < 2; direction++) + { + PangoGlyphItemIter iter; + gboolean have_cluster; + + + for (have_cluster = direction ? + pango_glyph_item_iter_init_start (&iter, run, text) : + pango_glyph_item_iter_init_end (&iter, run, text); + have_cluster; + have_cluster = direction ? + pango_glyph_item_iter_next_cluster (&iter) : + pango_glyph_item_iter_prev_cluster (&iter)) + { + verbose ("start index %d end index %d\n", iter.start_index, iter.end_index); + g_assert (iter.start_index < iter.end_index); + g_assert (iter.start_index + 2 >= iter.end_index); + g_assert (iter.start_char + 1 == iter.end_char); + } + } + } + + g_object_unref (layout); + g_object_unref (context); + pango_font_description_free (font_desc); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/layout/iter", test_layout_iter); + g_test_add_func ("/layout/glyphitem-iter", test_glyphitem_iter); + + return g_test_run (); +} diff --git a/tests/testscript.c b/tests/testscript.c new file mode 100644 index 0000000..aa610b4 --- /dev/null +++ b/tests/testscript.c @@ -0,0 +1,230 @@ +/* -*- mode: C; c-file-style: "gnu" -*- */ +/* Pango + * testscript.c: Test cases for PangoScriptIter + * + * Copyright (C) 2002 Red Hat Software + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * The test strings here come from ICU: + * + * icu/sources/test/cintltst/cucdtst.c + * + ******************************************************************** + * COPYRIGHT: + * Copyright (c) 1997-2001, International Business Machines Corporation and + * others. All Rights Reserved. + ******************************************************************** + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. + */ + +#include +#include + +#include "pango/pango-script.h" + +#undef VERBOSE + +#define ASSERT(stmt) G_STMT_START { \ + if (stmt) { } \ + else \ + { \ + g_warning ("%s:%d (%s): assertion '%s' failed", \ + __FILE__, __LINE__, G_STRFUNC, #stmt); \ + exit (1); \ + } \ +} G_STMT_END + +typedef struct +{ + const char *run_text_escaped; + char *run_text; + PangoScript run_code; +} RunTestData; + +static gchar * +unescape (const char *text) +{ + gboolean escaped = FALSE; + GString *result = g_string_new (NULL); + const gchar *p; + + for (p = text; *p; p = g_utf8_next_char (p)) + { + gunichar ch = g_utf8_get_char (p); + + if (escaped) + { + if (ch == 'u' || ch == 'U') + { + int n_chars = ch == 'u' ? 4 : 8; + int i; + + ch = 0; + for (i = 0; i < n_chars; i++) + { + p++; + ch <<= 4; + if (*p <= '9' && *p >= '0') + ch += *p - '0'; + else if (*p <= 'F' && *p >= 'A') + ch += 10 + *p - 'A'; + else if (*p <= 'f' && *p >= 'a') + ch += 10 + *p - 'a'; + else + g_assert_not_reached (); + } + } + else if (ch == '\\') + { + ch = '\\'; + } + else + { + g_assert_not_reached (); + } + + escaped = FALSE; + } + else + { + if (ch == '\\') + { + escaped = TRUE; + continue; + } + } + + g_string_append_unichar (result, ch); + } + + return g_string_free (result, FALSE); +} + +static void +test_script_iter (void) +{ + static RunTestData test_data[] = { + { "\\u0020\\u0946\\u0939\\u093F\\u0928\\u094D\\u0926\\u0940\\u0020", NULL, PANGO_SCRIPT_DEVANAGARI }, + { "\\u0627\\u0644\\u0639\\u0631\\u0628\\u064A\\u0629\\u0020", NULL, PANGO_SCRIPT_ARABIC }, + { "\\u0420\\u0443\\u0441\\u0441\\u043A\\u0438\\u0439\\u0020", NULL, PANGO_SCRIPT_CYRILLIC }, + { "English (", NULL, PANGO_SCRIPT_LATIN }, + { "\\u0E44\\u0E17\\u0E22", NULL, PANGO_SCRIPT_THAI }, + { ") ", NULL, PANGO_SCRIPT_LATIN }, + { "\\u6F22\\u5B75", NULL, PANGO_SCRIPT_HAN }, + { "\\u3068\\u3072\\u3089\\u304C\\u306A\\u3068", NULL, PANGO_SCRIPT_HIRAGANA }, + { "\\u30AB\\u30BF\\u30AB\\u30CA", NULL, PANGO_SCRIPT_KATAKANA }, + { "\\U00010400\\U00010401\\U00010402\\U00010403", NULL, PANGO_SCRIPT_DESERET } + }; + + PangoScriptIter *iter; + GString *all = g_string_new (FALSE); + char *pos; + const char *start; + const char *end; + PangoScript script; + unsigned int i; + + for (i = 0; i < G_N_ELEMENTS(test_data); i++) + { + test_data[i].run_text = unescape (test_data[i].run_text_escaped); + g_string_append (all, test_data[i].run_text); + } + + iter = pango_script_iter_new (all->str, -1); + +#ifdef VERBOSE + g_print ("Total length: %d\n", all->len); +#endif + + pos = all->str; + for (i = 0; i < G_N_ELEMENTS(test_data); i++) + { + char *next_pos = pos + strlen (test_data[i].run_text); + gboolean result; + + pango_script_iter_get_range (iter, &start, &end, &script); +#ifdef VERBOSE + g_print ("Range: %d-%d: %d\n", start - all->str, end - all->str, script); +#endif + + ASSERT (start == pos); + ASSERT (end == next_pos); + ASSERT (script == test_data[i].run_code); + + result = pango_script_iter_next (iter); + ASSERT (result == (i != G_N_ELEMENTS (test_data) - 1)); + + pos = next_pos; + } + + pango_script_iter_free (iter); + + /* + * Test an empty string. + */ + iter = pango_script_iter_new (all->str, 0); + + pango_script_iter_get_range (iter, &start, &end, &script); + + ASSERT (start == all->str); + ASSERT (end == all->str); + ASSERT (script == PANGO_SCRIPT_COMMON); + ASSERT (!pango_script_iter_next (iter)); + + pango_script_iter_free (iter); + + /* Cleanup */ + + for (i = 0; i < G_N_ELEMENTS (test_data); i++) + g_free (test_data[i].run_text); + + g_string_free (all, TRUE); +} + +int +main (int argc, char **argv) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/script/iter", test_script_iter); + + return g_test_run (); +} diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 0000000..83d243f --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to create Makefile.in. + +INCLUDES = \ + -I$(top_srcdir) \ + $(GLIB_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + -DPANGO_DISABLE_DEPRECATED \ + $(PANGO_DEBUG_FLAGS) + +EXTRA_PROGRAMS = \ + gen-script-for-lang + +EXTRA_DIST= \ + gen-color-table.pl \ + gen-emoji-table.py \ + rgb.txt + +gen_script_for_lang_SOURCES = gen-script-for-lang.c +gen_script_for_lang_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la $(FONTCONFIG_LIBS) $(GLIB_LIBS) + +-include $(top_srcdir)/git.mk diff --git a/tools/Makefile.in b/tools/Makefile.in new file mode 100644 index 0000000..2414665 --- /dev/null +++ b/tools/Makefile.in @@ -0,0 +1,650 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +EXTRA_PROGRAMS = gen-script-for-lang$(EXEEXT) +subdir = tools +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_gen_script_for_lang_OBJECTS = gen-script-for-lang.$(OBJEXT) +gen_script_for_lang_OBJECTS = $(am_gen_script_for_lang_OBJECTS) +am__DEPENDENCIES_1 = +gen_script_for_lang_DEPENDENCIES = \ + ../pango/libpango-$(PANGO_API_VERSION).la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(gen_script_for_lang_SOURCES) +DIST_SOURCES = $(gen_script_for_lang_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir) \ + $(GLIB_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + -DPANGO_DISABLE_DEPRECATED \ + $(PANGO_DEBUG_FLAGS) + +EXTRA_DIST = \ + gen-color-table.pl \ + gen-emoji-table.py \ + rgb.txt + +gen_script_for_lang_SOURCES = gen-script-for-lang.c +gen_script_for_lang_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la $(FONTCONFIG_LIBS) $(GLIB_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits tools/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +gen-script-for-lang$(EXEEXT): $(gen_script_for_lang_OBJECTS) $(gen_script_for_lang_DEPENDENCIES) $(EXTRA_gen_script_for_lang_DEPENDENCIES) + @rm -f gen-script-for-lang$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gen_script_for_lang_OBJECTS) $(gen_script_for_lang_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-script-for-lang.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tools/gen-color-table.pl b/tools/gen-color-table.pl new file mode 100755 index 0000000..e62994e --- /dev/null +++ b/tools/gen-color-table.pl @@ -0,0 +1,74 @@ +#!/usr/bin/perl -w + +if (@ARGV != 1) { + die "Usage: gen-colors.pl rgb.txt > pango-color-table.h\n"; +} + +open IN, $ARGV[0] || die "Cannot open $ARGV[0]: $!\n"; + +@colors = (); +while (defined($_ = )) { + next if /^!/; + if (!/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+(.*\S)\s+$/) { + die "Cannot parse line $_"; + } + + push @colors, [$1, $2, $3, $4]; +} + +@colors = sort { lc($a->[3]) cmp lc($b->[3]) } @colors; + +$offset = 0; + +$date = gmtime; + +print <[3]; + + if ($offset != 0) { + print qq(\n); + } + print qq( "$name\\0"); + + $color->[4] = $offset; + $offset += length($name) + 1; +} + +print ";\n\n"; + +print <[0]; + $green = $color->[1]; + $blue = $color->[2]; + $offset = $color->[4]; + + if ($i != 0) { + print ",\n"; + } + print " { $offset, $red, $green, $blue }"; + $i++; +} + +print "\n};\n"; diff --git a/tools/gen-emoji-table.py b/tools/gen-emoji-table.py new file mode 100755 index 0000000..600fe80 --- /dev/null +++ b/tools/gen-emoji-table.py @@ -0,0 +1,64 @@ +#!/usr/bin/python + +from __future__ import print_function, division, absolute_import +import sys +import os.path +from collections import OrderedDict + +if len (sys.argv) != 2: + print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr) + sys.exit (1) + +f = open(sys.argv[1]) +header = [f.readline () for _ in range(10)] + +sets = OrderedDict() +for line in f.readlines(): + line = line.strip() + if not line or line[0] == '#': + continue + rang, typ = [s.strip() for s in line.split('#')[0].split(';')[:2]] + + rang = [int(s, 16) for s in rang.split('..')] + if len(rang) > 1: + start, end = rang + else: + start = end = rang[0] + + if typ not in sets: + sets[typ] = set() + sets[typ].add((start, end)) + + + +print("/* == Start of generated table == */") +print("/*") +print(" * The following tables are generated by running:") +print(" *") +print(" * ./gen-emoji-table.py emoji-data.txt") +print(" *") +print(" * on file with this header:") +print(" *") +for l in header: + print(" * %s" % (l.strip())) +print(" */") +print() +print("#ifndef PANGO_EMOJI_TABLE_H") +print("#define PANGO_EMOJI_TABLE_H") +print() +print("#include ") +print() +print("struct Interval {\n gunichar start, end;\n};") + +for typ,s in sets.items(): + print() + print("static const struct Interval _pango_%s_table[] =" % typ) + print("{") + for pair in sorted(s): + print(" {0x%04X, 0x%04X}," % pair) + print("};") + +print() +print("#endif /* PANGO_EMOJI_TABLE_H */") +print() +print("/* == End of generated table == */") diff --git a/tools/gen-script-for-lang.c b/tools/gen-script-for-lang.c new file mode 100644 index 0000000..04614b1 --- /dev/null +++ b/tools/gen-script-for-lang.c @@ -0,0 +1,309 @@ +/* Pango + * gen-script-for-lang.c: Utility program to generate pango-script-lang-table.h + * + * Copyright (C) 2003 Red Hat, Inc. + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define MAX_SCRIPTS 3 + +typedef struct { + PangoScript script; + int freq; +} ScriptInfo; + +typedef struct { + PangoLanguage *lang; + ScriptInfo scripts[MAX_SCRIPTS]; +} LangInfo; + +static const char *get_script_name (PangoScript script) +{ + static GEnumClass *class = NULL; + GEnumValue *value; + if (!class) + class = g_type_class_ref (PANGO_TYPE_SCRIPT); + + value = g_enum_get_value (class, script); + g_assert (value); + + return value->value_name; +} + +static void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN; +static void fail (const char *format, ...) +{ + va_list vap; + + va_start (vap, format); + vfprintf (stderr, format, vap); + va_end (vap); + + exit (1); +} + +static void +script_for_char (gunichar ch, + LangInfo *info) +{ + PangoScript script = pango_script_for_unichar (ch); + if (script != PANGO_SCRIPT_COMMON && + script != PANGO_SCRIPT_INHERITED) + { + int j; + + if (script == PANGO_SCRIPT_UNKNOWN) + { + g_message ("Script unknown for U+%04X", ch); + return; + } + + for (j = 0; j < MAX_SCRIPTS; j++) + { + if (info->scripts[j].script == script) + break; + if (info->scripts[j].script == PANGO_SCRIPT_COMMON) + { + info->scripts[j].script = script; + break; + } + } + + if (j == MAX_SCRIPTS) + fail ("More than %d scripts found for %s. Increase MAX_SCRIPTS.\n", MAX_SCRIPTS, pango_language_to_string (info->lang)); + + info->scripts[j].freq++; + } +} + +static void +scripts_for_lang (LangInfo *info) +{ + const FcCharSet *charset; + FcChar32 ucs4, pos; + FcChar32 map[FC_CHARSET_MAP_SIZE]; + int i; + + charset = FcLangGetCharSet ((const FcChar8 *) info->lang); + if (!charset) + return; + + for (ucs4 = FcCharSetFirstPage (charset, map, &pos); + ucs4 != FC_CHARSET_DONE; + ucs4 = FcCharSetNextPage (charset, map, &pos)) + { + + for (i = 0; i < FC_CHARSET_MAP_SIZE; i++) + { + FcChar32 bits = map[i]; + FcChar32 base = ucs4 + i * 32; + int b = 0; + bits = map[i]; + while (bits) + { + if (bits & 1) + script_for_char (base + b, info); + + bits >>= 1; + b++; + } + } + } +} + +static void +do_lang (GArray *script_array, + const FcChar8 *lang) +{ + LangInfo info; + int j; + + info.lang = pango_language_from_string ((const char *)lang); + + for (j = 0; j < MAX_SCRIPTS; j++) + { + info.scripts[j].script = PANGO_SCRIPT_COMMON; + info.scripts[j].freq = 0; + } + + scripts_for_lang (&info); + + g_array_append_val (script_array, info); +} + +static int +compare_script (gconstpointer a, + gconstpointer b, + gpointer data) +{ + const ScriptInfo *info_a = a; + const ScriptInfo *info_b = b; + G_GNUC_UNUSED LangInfo *lang_info = data; + + /* first compare frequencies, higher first */ + if (info_a->freq > info_b->freq) + return -1; + if (info_a->freq < info_b->freq) + return +1; + + /* next compare script indices, higher first (it's more specific) */ + if (info_a->script > info_b->script) + return -1; + if (info_a->script < info_b->script) + return +1; + + /* for stability, next compare pointers themselves, smaller first */ + if (info_a < info_b) + return -1; + if (info_a > info_b) + return +1; + + return 0; +} + +static int +compare_lang (gconstpointer a, + gconstpointer b) +{ + const LangInfo *info_a = a; + const LangInfo *info_b = b; + + return strcmp (pango_language_to_string (info_a->lang), + pango_language_to_string (info_b->lang)); +} + +int main (void) +{ + GArray *script_array; + + unsigned int i; + int j; + int max_lang_len = 0; + int max_script_len = 0; + + FcStrSet *langs_set; + FcStrList *langs; + FcChar8* lang; + + char date_buf[200]; + const char *date_str = "unknown"; + time_t t; + struct tm *tmp; + int fc_version; + + script_array = g_array_new (FALSE, FALSE, sizeof (LangInfo)); + + + langs_set = FcGetLangs (); + langs = FcStrListCreate (langs_set); + FcStrSetDestroy (langs_set); + + while ((lang = FcStrListNext (langs))) + do_lang (script_array, lang); + + FcStrListDone (langs); + + + g_array_sort (script_array, compare_lang); + + for (i = 0; i < script_array->len; i++) + { + LangInfo *info = &g_array_index (script_array, LangInfo, i); + + max_lang_len = MAX (max_lang_len, + (int)strlen (pango_language_to_string (info->lang))); + + g_qsort_with_data (info->scripts, + G_N_ELEMENTS (info->scripts), + sizeof (info->scripts[0]), + compare_script, + info); + + for (j = 0; j < MAX_SCRIPTS; j++) + if (!info->scripts[j].freq) + break; + + max_script_len = MAX (max_script_len, j); + } + + if ((t = time(NULL), tmp = localtime (&t)) && strftime(date_buf, sizeof(date_buf), "%F", tmp)) + date_str = date_buf; + + fc_version = FcGetVersion (); + + g_print ("/* pango-script-lang-table.h:\n" + " * \n" + " * Generated by %s\n" + " * Date: %s\n" + " * Source: fontconfig-%d.%d.%d\n" + " * \n" + " * Do not edit.\n" + " */\n", + __FILE__, + date_str, + fc_version / 10000, (fc_version / 100) % 100, fc_version % 100); + + g_print ("typedef struct _PangoScriptForLang {\n" + " const char lang[%d];\n" + " PangoScript scripts[%d];\n" + "} PangoScriptForLang;\n" + "\n" + "static const PangoScriptForLang pango_script_for_lang[] = {\n", + max_lang_len + 1, + max_script_len); + + for (i = 0; i < script_array->len; i++) + { + LangInfo *info = &g_array_index (script_array, LangInfo, i); + + g_print (" { \"%s\", %*s{ ", + pango_language_to_string (info->lang), + (int)(max_lang_len - strlen (pango_language_to_string (info->lang))), ""); + for (j = 0; j < MAX_SCRIPTS; j++) + { + if (!info->scripts[j].freq) + break; + + if (j != 0) + g_print (", "); + g_print ("%s/*%d*/", + get_script_name (info->scripts[j].script), + info->scripts[j].freq); + } + g_print (" } }"); + if (i + 1 != script_array->len) + g_print (","); + g_print ("\n"); + } + + g_print ("};\n"); + + return 0; +} diff --git a/tools/meson.build b/tools/meson.build new file mode 100644 index 0000000..37e5243 --- /dev/null +++ b/tools/meson.build @@ -0,0 +1,7 @@ +if fontconfig_dep.found() + executable('gen-script-for-lang', 'gen-script-for-lang.c', + dependencies: pango_deps + [ libpango_dep ], + c_args: common_cflags + pango_debug_cflags + [ '-DPANGO_DISABLE_DEPRECATED' ], + include_directories: root_inc, + install: false) +endif diff --git a/tools/rgb.txt b/tools/rgb.txt new file mode 100644 index 0000000..1d5de91 --- /dev/null +++ b/tools/rgb.txt @@ -0,0 +1,666 @@ +255 250 250 snow +248 248 255 GhostWhite +245 245 245 WhiteSmoke +220 220 220 gainsboro +255 250 240 FloralWhite +253 245 230 OldLace +250 240 230 linen +250 235 215 AntiqueWhite +255 239 213 PapayaWhip +255 235 205 BlanchedAlmond +255 228 196 bisque +255 218 185 PeachPuff +255 222 173 NavajoWhite +255 228 181 moccasin +255 248 220 cornsilk +255 255 240 ivory +255 250 205 LemonChiffon +255 245 238 seashell +240 255 240 honeydew +245 255 250 MintCream +240 255 255 azure +240 248 255 AliceBlue +230 230 250 lavender +255 240 245 LavenderBlush +255 228 225 MistyRose +255 255 255 white + 0 0 0 black + 47 79 79 DarkSlateGray + 47 79 79 DarkSlateGrey +105 105 105 DimGray +105 105 105 DimGrey +112 128 144 SlateGray +112 128 144 SlateGrey +119 136 153 LightSlateGray +119 136 153 LightSlateGrey +128 128 128 gray +128 128 128 grey +211 211 211 LightGrey +211 211 211 LightGray + 25 25 112 MidnightBlue + 0 0 128 navy + 0 0 128 NavyBlue +100 149 237 CornflowerBlue + 72 61 139 DarkSlateBlue +106 90 205 SlateBlue +123 104 238 MediumSlateBlue +132 112 255 LightSlateBlue + 0 0 205 MediumBlue + 65 105 225 RoyalBlue + 0 0 255 blue + 30 144 255 DodgerBlue + 0 191 255 DeepSkyBlue +135 206 235 SkyBlue +135 206 250 LightSkyBlue + 70 130 180 SteelBlue +176 196 222 LightSteelBlue +173 216 230 LightBlue +176 224 230 PowderBlue +175 238 238 PaleTurquoise + 0 206 209 DarkTurquoise + 72 209 204 MediumTurquoise + 64 224 208 turquoise + 0 255 255 cyan +224 255 255 LightCyan + 95 158 160 CadetBlue +102 205 170 MediumAquamarine +127 255 212 aquamarine + 0 100 0 DarkGreen + 85 107 47 DarkOliveGreen +143 188 143 DarkSeaGreen + 46 139 87 SeaGreen + 60 179 113 MediumSeaGreen + 32 178 170 LightSeaGreen +152 251 152 PaleGreen + 0 255 127 SpringGreen +124 252 0 LawnGreen + 0 128 0 green +127 255 0 chartreuse + 0 250 154 MediumSpringGreen +173 255 47 GreenYellow + 50 205 50 LimeGreen +154 205 50 YellowGreen + 34 139 34 ForestGreen +107 142 35 OliveDrab +189 183 107 DarkKhaki +240 230 140 khaki +238 232 170 PaleGoldenrod +250 250 210 LightGoldenrodYellow +255 255 224 LightYellow +255 255 0 yellow +255 215 0 gold +238 221 130 LightGoldenrod +218 165 32 goldenrod +184 134 11 DarkGoldenrod +188 143 143 RosyBrown +205 92 92 IndianRed +139 69 19 SaddleBrown +160 82 45 sienna +205 133 63 peru +222 184 135 burlywood +245 245 220 beige +245 222 179 wheat +244 164 96 SandyBrown +210 180 140 tan +210 105 30 chocolate +178 34 34 firebrick +165 42 42 brown +233 150 122 DarkSalmon +250 128 114 salmon +255 160 122 LightSalmon +255 165 0 orange +255 140 0 DarkOrange +255 127 80 coral +240 128 128 LightCoral +255 99 71 tomato +255 69 0 OrangeRed +255 0 0 red +255 105 180 HotPink +255 20 147 DeepPink +255 192 203 pink +255 182 193 LightPink +219 112 147 PaleVioletRed +128 0 0 maroon +199 21 133 MediumVioletRed +208 32 144 VioletRed +255 0 255 magenta +238 130 238 violet +221 160 221 plum +218 112 214 orchid +186 85 211 MediumOrchid +153 50 204 DarkOrchid +148 0 211 DarkViolet +138 43 226 BlueViolet +128 0 128 purple +147 112 219 MediumPurple +216 191 216 thistle +255 250 250 snow1 +238 233 233 snow2 +205 201 201 snow3 +139 137 137 snow4 +255 245 238 seashell1 +238 229 222 seashell2 +205 197 191 seashell3 +139 134 130 seashell4 +255 239 219 AntiqueWhite1 +238 223 204 AntiqueWhite2 +205 192 176 AntiqueWhite3 +139 131 120 AntiqueWhite4 +255 228 196 bisque1 +238 213 183 bisque2 +205 183 158 bisque3 +139 125 107 bisque4 +255 218 185 PeachPuff1 +238 203 173 PeachPuff2 +205 175 149 PeachPuff3 +139 119 101 PeachPuff4 +255 222 173 NavajoWhite1 +238 207 161 NavajoWhite2 +205 179 139 NavajoWhite3 +139 121 94 NavajoWhite4 +255 250 205 LemonChiffon1 +238 233 191 LemonChiffon2 +205 201 165 LemonChiffon3 +139 137 112 LemonChiffon4 +255 248 220 cornsilk1 +238 232 205 cornsilk2 +205 200 177 cornsilk3 +139 136 120 cornsilk4 +255 255 240 ivory1 +238 238 224 ivory2 +205 205 193 ivory3 +139 139 131 ivory4 +240 255 240 honeydew1 +224 238 224 honeydew2 +193 205 193 honeydew3 +131 139 131 honeydew4 +255 240 245 LavenderBlush1 +238 224 229 LavenderBlush2 +205 193 197 LavenderBlush3 +139 131 134 LavenderBlush4 +255 228 225 MistyRose1 +238 213 210 MistyRose2 +205 183 181 MistyRose3 +139 125 123 MistyRose4 +240 255 255 azure1 +224 238 238 azure2 +193 205 205 azure3 +131 139 139 azure4 +131 111 255 SlateBlue1 +122 103 238 SlateBlue2 +105 89 205 SlateBlue3 + 71 60 139 SlateBlue4 + 72 118 255 RoyalBlue1 + 67 110 238 RoyalBlue2 + 58 95 205 RoyalBlue3 + 39 64 139 RoyalBlue4 + 0 0 255 blue1 + 0 0 238 blue2 + 0 0 205 blue3 + 0 0 139 blue4 + 30 144 255 DodgerBlue1 + 28 134 238 DodgerBlue2 + 24 116 205 DodgerBlue3 + 16 78 139 DodgerBlue4 + 99 184 255 SteelBlue1 + 92 172 238 SteelBlue2 + 79 148 205 SteelBlue3 + 54 100 139 SteelBlue4 + 0 191 255 DeepSkyBlue1 + 0 178 238 DeepSkyBlue2 + 0 154 205 DeepSkyBlue3 + 0 104 139 DeepSkyBlue4 +135 206 255 SkyBlue1 +126 192 238 SkyBlue2 +108 166 205 SkyBlue3 + 74 112 139 SkyBlue4 +176 226 255 LightSkyBlue1 +164 211 238 LightSkyBlue2 +141 182 205 LightSkyBlue3 + 96 123 139 LightSkyBlue4 +198 226 255 SlateGray1 +185 211 238 SlateGray2 +159 182 205 SlateGray3 +108 123 139 SlateGray4 +202 225 255 LightSteelBlue1 +188 210 238 LightSteelBlue2 +162 181 205 LightSteelBlue3 +110 123 139 LightSteelBlue4 +191 239 255 LightBlue1 +178 223 238 LightBlue2 +154 192 205 LightBlue3 +104 131 139 LightBlue4 +224 255 255 LightCyan1 +209 238 238 LightCyan2 +180 205 205 LightCyan3 +122 139 139 LightCyan4 +187 255 255 PaleTurquoise1 +174 238 238 PaleTurquoise2 +150 205 205 PaleTurquoise3 +102 139 139 PaleTurquoise4 +152 245 255 CadetBlue1 +142 229 238 CadetBlue2 +122 197 205 CadetBlue3 + 83 134 139 CadetBlue4 + 0 245 255 turquoise1 + 0 229 238 turquoise2 + 0 197 205 turquoise3 + 0 134 139 turquoise4 + 0 255 255 cyan1 + 0 238 238 cyan2 + 0 205 205 cyan3 + 0 139 139 cyan4 +151 255 255 DarkSlateGray1 +141 238 238 DarkSlateGray2 +121 205 205 DarkSlateGray3 + 82 139 139 DarkSlateGray4 +127 255 212 aquamarine1 +118 238 198 aquamarine2 +102 205 170 aquamarine3 + 69 139 116 aquamarine4 +193 255 193 DarkSeaGreen1 +180 238 180 DarkSeaGreen2 +155 205 155 DarkSeaGreen3 +105 139 105 DarkSeaGreen4 + 84 255 159 SeaGreen1 + 78 238 148 SeaGreen2 + 67 205 128 SeaGreen3 + 46 139 87 SeaGreen4 +154 255 154 PaleGreen1 +144 238 144 PaleGreen2 +124 205 124 PaleGreen3 + 84 139 84 PaleGreen4 + 0 255 127 SpringGreen1 + 0 238 118 SpringGreen2 + 0 205 102 SpringGreen3 + 0 139 69 SpringGreen4 + 0 255 0 green1 + 0 238 0 green2 + 0 205 0 green3 + 0 139 0 green4 +127 255 0 chartreuse1 +118 238 0 chartreuse2 +102 205 0 chartreuse3 + 69 139 0 chartreuse4 +192 255 62 OliveDrab1 +179 238 58 OliveDrab2 +154 205 50 OliveDrab3 +105 139 34 OliveDrab4 +202 255 112 DarkOliveGreen1 +188 238 104 DarkOliveGreen2 +162 205 90 DarkOliveGreen3 +110 139 61 DarkOliveGreen4 +255 246 143 khaki1 +238 230 133 khaki2 +205 198 115 khaki3 +139 134 78 khaki4 +255 236 139 LightGoldenrod1 +238 220 130 LightGoldenrod2 +205 190 112 LightGoldenrod3 +139 129 76 LightGoldenrod4 +255 255 224 LightYellow1 +238 238 209 LightYellow2 +205 205 180 LightYellow3 +139 139 122 LightYellow4 +255 255 0 yellow1 +238 238 0 yellow2 +205 205 0 yellow3 +139 139 0 yellow4 +255 215 0 gold1 +238 201 0 gold2 +205 173 0 gold3 +139 117 0 gold4 +255 193 37 goldenrod1 +238 180 34 goldenrod2 +205 155 29 goldenrod3 +139 105 20 goldenrod4 +255 185 15 DarkGoldenrod1 +238 173 14 DarkGoldenrod2 +205 149 12 DarkGoldenrod3 +139 101 8 DarkGoldenrod4 +255 193 193 RosyBrown1 +238 180 180 RosyBrown2 +205 155 155 RosyBrown3 +139 105 105 RosyBrown4 +255 106 106 IndianRed1 +238 99 99 IndianRed2 +205 85 85 IndianRed3 +139 58 58 IndianRed4 +255 130 71 sienna1 +238 121 66 sienna2 +205 104 57 sienna3 +139 71 38 sienna4 +255 211 155 burlywood1 +238 197 145 burlywood2 +205 170 125 burlywood3 +139 115 85 burlywood4 +255 231 186 wheat1 +238 216 174 wheat2 +205 186 150 wheat3 +139 126 102 wheat4 +255 165 79 tan1 +238 154 73 tan2 +205 133 63 tan3 +139 90 43 tan4 +255 127 36 chocolate1 +238 118 33 chocolate2 +205 102 29 chocolate3 +139 69 19 chocolate4 +255 48 48 firebrick1 +238 44 44 firebrick2 +205 38 38 firebrick3 +139 26 26 firebrick4 +255 64 64 brown1 +238 59 59 brown2 +205 51 51 brown3 +139 35 35 brown4 +255 140 105 salmon1 +238 130 98 salmon2 +205 112 84 salmon3 +139 76 57 salmon4 +255 160 122 LightSalmon1 +238 149 114 LightSalmon2 +205 129 98 LightSalmon3 +139 87 66 LightSalmon4 +255 165 0 orange1 +238 154 0 orange2 +205 133 0 orange3 +139 90 0 orange4 +255 127 0 DarkOrange1 +238 118 0 DarkOrange2 +205 102 0 DarkOrange3 +139 69 0 DarkOrange4 +255 114 86 coral1 +238 106 80 coral2 +205 91 69 coral3 +139 62 47 coral4 +255 99 71 tomato1 +238 92 66 tomato2 +205 79 57 tomato3 +139 54 38 tomato4 +255 69 0 OrangeRed1 +238 64 0 OrangeRed2 +205 55 0 OrangeRed3 +139 37 0 OrangeRed4 +255 0 0 red1 +238 0 0 red2 +205 0 0 red3 +139 0 0 red4 +255 20 147 DeepPink1 +238 18 137 DeepPink2 +205 16 118 DeepPink3 +139 10 80 DeepPink4 +255 110 180 HotPink1 +238 106 167 HotPink2 +205 96 144 HotPink3 +139 58 98 HotPink4 +255 181 197 pink1 +238 169 184 pink2 +205 145 158 pink3 +139 99 108 pink4 +255 174 185 LightPink1 +238 162 173 LightPink2 +205 140 149 LightPink3 +139 95 101 LightPink4 +255 130 171 PaleVioletRed1 +238 121 159 PaleVioletRed2 +205 104 137 PaleVioletRed3 +139 71 93 PaleVioletRed4 +255 52 179 maroon1 +238 48 167 maroon2 +205 41 144 maroon3 +139 28 98 maroon4 +255 62 150 VioletRed1 +238 58 140 VioletRed2 +205 50 120 VioletRed3 +139 34 82 VioletRed4 +255 0 255 magenta1 +238 0 238 magenta2 +205 0 205 magenta3 +139 0 139 magenta4 +255 131 250 orchid1 +238 122 233 orchid2 +205 105 201 orchid3 +139 71 137 orchid4 +255 187 255 plum1 +238 174 238 plum2 +205 150 205 plum3 +139 102 139 plum4 +224 102 255 MediumOrchid1 +209 95 238 MediumOrchid2 +180 82 205 MediumOrchid3 +122 55 139 MediumOrchid4 +191 62 255 DarkOrchid1 +178 58 238 DarkOrchid2 +154 50 205 DarkOrchid3 +104 34 139 DarkOrchid4 +155 48 255 purple1 +145 44 238 purple2 +125 38 205 purple3 + 85 26 139 purple4 +171 130 255 MediumPurple1 +159 121 238 MediumPurple2 +137 104 205 MediumPurple3 + 93 71 139 MediumPurple4 +255 225 255 thistle1 +238 210 238 thistle2 +205 181 205 thistle3 +139 123 139 thistle4 + 0 0 0 gray0 + 0 0 0 grey0 + 3 3 3 gray1 + 3 3 3 grey1 + 5 5 5 gray2 + 5 5 5 grey2 + 8 8 8 gray3 + 8 8 8 grey3 + 10 10 10 gray4 + 10 10 10 grey4 + 13 13 13 gray5 + 13 13 13 grey5 + 15 15 15 gray6 + 15 15 15 grey6 + 18 18 18 gray7 + 18 18 18 grey7 + 20 20 20 gray8 + 20 20 20 grey8 + 23 23 23 gray9 + 23 23 23 grey9 + 26 26 26 gray10 + 26 26 26 grey10 + 28 28 28 gray11 + 28 28 28 grey11 + 31 31 31 gray12 + 31 31 31 grey12 + 33 33 33 gray13 + 33 33 33 grey13 + 36 36 36 gray14 + 36 36 36 grey14 + 38 38 38 gray15 + 38 38 38 grey15 + 41 41 41 gray16 + 41 41 41 grey16 + 43 43 43 gray17 + 43 43 43 grey17 + 46 46 46 gray18 + 46 46 46 grey18 + 48 48 48 gray19 + 48 48 48 grey19 + 51 51 51 gray20 + 51 51 51 grey20 + 54 54 54 gray21 + 54 54 54 grey21 + 56 56 56 gray22 + 56 56 56 grey22 + 59 59 59 gray23 + 59 59 59 grey23 + 61 61 61 gray24 + 61 61 61 grey24 + 64 64 64 gray25 + 64 64 64 grey25 + 66 66 66 gray26 + 66 66 66 grey26 + 69 69 69 gray27 + 69 69 69 grey27 + 71 71 71 gray28 + 71 71 71 grey28 + 74 74 74 gray29 + 74 74 74 grey29 + 77 77 77 gray30 + 77 77 77 grey30 + 79 79 79 gray31 + 79 79 79 grey31 + 82 82 82 gray32 + 82 82 82 grey32 + 84 84 84 gray33 + 84 84 84 grey33 + 87 87 87 gray34 + 87 87 87 grey34 + 89 89 89 gray35 + 89 89 89 grey35 + 92 92 92 gray36 + 92 92 92 grey36 + 94 94 94 gray37 + 94 94 94 grey37 + 97 97 97 gray38 + 97 97 97 grey38 + 99 99 99 gray39 + 99 99 99 grey39 +102 102 102 gray40 +102 102 102 grey40 +105 105 105 gray41 +105 105 105 grey41 +107 107 107 gray42 +107 107 107 grey42 +110 110 110 gray43 +110 110 110 grey43 +112 112 112 gray44 +112 112 112 grey44 +115 115 115 gray45 +115 115 115 grey45 +117 117 117 gray46 +117 117 117 grey46 +120 120 120 gray47 +120 120 120 grey47 +122 122 122 gray48 +122 122 122 grey48 +125 125 125 gray49 +125 125 125 grey49 +127 127 127 gray50 +127 127 127 grey50 +130 130 130 gray51 +130 130 130 grey51 +133 133 133 gray52 +133 133 133 grey52 +135 135 135 gray53 +135 135 135 grey53 +138 138 138 gray54 +138 138 138 grey54 +140 140 140 gray55 +140 140 140 grey55 +143 143 143 gray56 +143 143 143 grey56 +145 145 145 gray57 +145 145 145 grey57 +148 148 148 gray58 +148 148 148 grey58 +150 150 150 gray59 +150 150 150 grey59 +153 153 153 gray60 +153 153 153 grey60 +156 156 156 gray61 +156 156 156 grey61 +158 158 158 gray62 +158 158 158 grey62 +161 161 161 gray63 +161 161 161 grey63 +163 163 163 gray64 +163 163 163 grey64 +166 166 166 gray65 +166 166 166 grey65 +168 168 168 gray66 +168 168 168 grey66 +171 171 171 gray67 +171 171 171 grey67 +173 173 173 gray68 +173 173 173 grey68 +176 176 176 gray69 +176 176 176 grey69 +179 179 179 gray70 +179 179 179 grey70 +181 181 181 gray71 +181 181 181 grey71 +184 184 184 gray72 +184 184 184 grey72 +186 186 186 gray73 +186 186 186 grey73 +189 189 189 gray74 +189 189 189 grey74 +191 191 191 gray75 +191 191 191 grey75 +194 194 194 gray76 +194 194 194 grey76 +196 196 196 gray77 +196 196 196 grey77 +199 199 199 gray78 +199 199 199 grey78 +201 201 201 gray79 +201 201 201 grey79 +204 204 204 gray80 +204 204 204 grey80 +207 207 207 gray81 +207 207 207 grey81 +209 209 209 gray82 +209 209 209 grey82 +212 212 212 gray83 +212 212 212 grey83 +214 214 214 gray84 +214 214 214 grey84 +217 217 217 gray85 +217 217 217 grey85 +219 219 219 gray86 +219 219 219 grey86 +222 222 222 gray87 +222 222 222 grey87 +224 224 224 gray88 +224 224 224 grey88 +227 227 227 gray89 +227 227 227 grey89 +229 229 229 gray90 +229 229 229 grey90 +232 232 232 gray91 +232 232 232 grey91 +235 235 235 gray92 +235 235 235 grey92 +237 237 237 gray93 +237 237 237 grey93 +240 240 240 gray94 +240 240 240 grey94 +242 242 242 gray95 +242 242 242 grey95 +245 245 245 gray96 +245 245 245 grey96 +247 247 247 gray97 +247 247 247 grey97 +250 250 250 gray98 +250 250 250 grey98 +252 252 252 gray99 +252 252 252 grey99 +255 255 255 gray100 +255 255 255 grey100 +169 169 169 DarkGrey +169 169 169 DarkGray +0 0 139 DarkBlue +0 139 139 DarkCyan +139 0 139 DarkMagenta +139 0 0 DarkRed +144 238 144 LightGreen +0 255 255 aqua +192 192 192 silver +75 0 130 indigo +128 128 0 olive +0 255 0 lime +255 0 255 fuchsia +220 20 60 crimson +0 128 128 teal +102 51 153 rebeccapurple diff --git a/utils/GLASS.txt b/utils/GLASS.txt new file mode 100644 index 0000000..8eec334 --- /dev/null +++ b/utils/GLASS.txt @@ -0,0 +1,168 @@ +I Can Eat Glass +In various languages + +Adopted from http://www.columbia.edu/kermit/utf8.html#glass +Do not edit. Submit additions to the URL above and resynch. + +Permission is granted by the Kermit project (http://www.columbia.edu/kermit/) +to redistribute this file, with absolutely no warranty. + + + +Sanskrit: काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥ +Sanskrit (standard transcription): kācaṃ śaknomyattum; nopahinasti mām. +Classical Greek: ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει. +Greek: Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα. +Etruscan: (NEEDED) +Latin: Vitrum edere possum; mihi non nocet. +Old French: Je puis mangier del voirre. Ne me nuit. +French: Je peux manger du verre, ça ne me fait pas de mal. +Provençal / Occitan: Pòdi manjar de veire, me nafrariá pas. +Québécois: J'peux manger d'la vitre, ça m'fa pas mal. +Walloon: Dji pou magnî do vêre, çoula m' freut nén må. +Champenois: (NEEDED) +Lorrain: (NEEDED) +Picard: Ch'peux mingi du verre, cha m'foé mie n'ma. +Corsican: (NEEDED) +Kreyòl Ayisyen: Mwen kap manje vè, li pa blese'm. +Basque: Kristala jan dezaket, ez dit minik ematen. +Catalan: Puc menjar vidre que no em fa mal. +Spanish: Puedo comer vidrio, no me hace daño. +Aragones: Puedo minchar beire, no me'n fa mal . +Galician: Eu podo xantar cristais e non cortarme. +Portuguese: Posso comer vidro, não me faz mal. +Brazilian Portuguese: Posso comer vidro, não me machuca. +Caboverdiano: M' podê cumê vidru, ca ta maguâ-m'. +Papiamentu: Ami por kome glas anto e no ta hasimi daño. +Italian: Posso mangiare il vetro e non mi fa male. +Milanese: Sôn bôn de magnà el véder, el me fa minga mal. +Roman: Me posso magna' er vetro, e nun me fa male. +Napoletano / Neapolitan: M' pozz magna' o'vetr, e nun m' fa mal. +Sicilian: Puotsu mangiari u vitru, nun mi fa mali. +Venetian: Mi posso magnare el vetro, no'l me fa mae. +Zeneise (Genovese): Pòsso mangiâ o veddro e o no me fà mâ. +Rheto-Romance / Romansch: (NEEDED) +Romany / Tsigane: (NEEDED) +Romanian: Pot să mănânc sticlă și ea nu mă rănește. +Esperanto: Mi povas manĝi vitron, ĝi ne damaĝas min. +Pictish: (NEEDED) +Breton: (NEEDED) +Cornish: Mý a yl dybry gwéder hag éf ny wra ow ankenya. +Welsh: Dw i'n gallu bwyta gwydr, 'dyw e ddim yn gwneud dolur i mi. +Manx Gaelic: Foddym gee glonney agh cha jean eh gortaghey mee. +Old Irish (Ogham): ᚛᚛ᚉᚑᚅᚔᚉᚉᚔᚋ ᚔᚈᚔ ᚍᚂᚐᚅᚑ ᚅᚔᚋᚌᚓᚅᚐ᚜ +Old Irish (Latin): Con·iccim ithi nglano. Ním·géna. +Irish: Is féidir liom gloinne a ithe. Ní dhéanann sí dochar ar bith dom. +Scottish Gaelic: S urrainn dhomh gloinne ithe; cha ghoirtich i mi. +Anglo-Saxon (Runes): ᛁᚳ᛫ᛗᚨᚷ᛫ᚷᛚᚨᛋ᛫ᛖᚩᛏᚪᚾ᛫ᚩᚾᛞ᛫ᚻᛁᛏ᛫ᚾᛖ᛫ᚻᛖᚪᚱᛗᛁᚪᚧ᛫ᛗᛖ᛬ +Anglo-Saxon (Latin): Ic mæg glæs eotan ond hit ne hearmiað me. +Middle English: Ich canne glas eten and hit hirtiþ me nouȝt. +English: I can eat glass and it doesn't hurt me. +English (IPA): [aɪ kæn iːt glɑːs ænd ɪt dɐz nɒt hɜːt miː] (Received Pronunciation) +English (Braille): ⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑ +Lalland Scots / Doric: Ah can eat gless, it disnae hurt us. +Glaswegian: (NEEDED) +Gothic: 𐌼𐌰𐌲 𐌲𐌻𐌴𐍃 𐌹̈𐍄𐌰𐌽, 𐌽𐌹 𐌼𐌹𐍃 𐍅𐌿 𐌽𐌳𐌰𐌽 𐌱𐍂𐌹𐌲𐌲𐌹𐌸. +Old Norse (Runes): ᛖᚴ ᚷᛖᛏ ᛖᛏᛁ ᚧ ᚷᛚᛖᚱ ᛘᚾ ᚦᛖᛋᛋ ᚨᚧ ᚡᛖ ᚱᚧᚨ ᛋᚨᚱ +Old Norse (Latin): Ek get etið gler án þess að verða sár. +Norsk / Norwegian Nynorsk: Eg kan eta glas utan å skada meg. +Norsk / Norwegian Bokmål: Jeg kan spise glass uten å skade meg. +Føroyskt / Faroese: (NEEDED) +Íslenska / Icelandic: Ég get etið gler án þess að meiða mig. +Svenska / Swedish: Jag kan äta glas utan att skada mig. +Dansk / Danish: Jeg kan spise glas, det gør ikke ondt på mig. +Frysk / Frisian: Ik kin glês ite, it docht me net sear. +Nederlands / Dutch: Ik kan glas eten, het doet mij geen kwaad. +Afrikaans: Ek kan glas eet, maar dit doen my nie skade nie. +Lëtzebuergescht / Luxemburgish: Ech kan Glas iessen, daat deet mir nët wei. +Deutsch / German: Ich kann Glas essen, ohne mir weh zu tun. +Ruhrdeutsch: Ich kann Glas verkasematuckeln, ohne dattet mich wat jucken tut. +Lausitzer Mundart ("Lusatian"): Ich koann Gloos assn und doas dudd merr ni wii. +Odenwälderisch: Iech konn glaasch voschbachteln ohne dass es mir ebbs daun doun dud. +Sächsisch / Saxon: 'sch kann Glos essn, ohne dass'sch mer wehtue. +Pfälzisch: Isch konn Glass fresse ohne dasses mer ebbes ausmache dud. +Schwäbisch / Swabian: I kå Glas frässa, ond des macht mr nix! +Bayrisch / Bavarian: I koh Glos esa, und es duard ma ned wei. +Allemannisch: I kaun Gloos essen, es tuat ma ned weh. +Schwyzerdütsch: Ich chan Glaas ässe, das tuet mir nöd weeh. +Hungarian: Meg tudom enni az üveget, nem lesz tőle bajom. +Suomi / Finnish: Voin syödä lasia, se ei vahingoita minua. +Sami (Northern): Sáhtán borrat lása, dat ii leat bávččas. +Erzian: Мон ярсан суликадо, ды зыян эйстэнзэ а ули. +Karelian: (NEEDED) +Vepsian: (NEEDED) +Votian: (NEEDED) +Livonian: (NEEDED) +Estonian: Ma võin klaasi süüa, see ei tee mulle midagi. +Latvian: Es varu ēst stiklu, tas man nekaitē. +Lithuanian: Aš galiu valgyti stiklą ir jis manęs nežeidžia +Old Prussian: (NEEDED) +Sorbian (Wendish): (NEEDED) +Czech: Mohu jíst sklo, neublíží mi. +Slovak: Môžem jesť sklo. Nezraní ma. +Polska / Polish: Mogę jeść szkło i mi nie szkodzi. +Slovenian: Lahko jem steklo, ne da bi mi škodovalo. +Croatian: Ja mogu jesti staklo i ne boli me. +Serbian (Latin): Mogu jesti staklo a da mi ne škodi. +Serbian (Cyrillic): Могу јести стакло а да ми не шкоди. +Macedonian: Можам да јадам стакло, а не ме штета. +Russian: Я могу есть стекло, оно мне не вредит. +Belarusian (Cyrillic): Я магу есці шкло, яно мне не шкодзіць. +Belarusian (Lacinka): Ja mahu jeści škło, jano mne ne škodzić. +Ukrainian: Я можу їсти шкло, й воно мені не пошкодить. +Bulgarian: Мога да ям стъкло, то не ми вреди. +Georgian: მინას ვჭამ და არა მტკივა. +Armenian: Կրնամ ապակի ուտել և ինծի անհանգիստ չըներ։ +Albanian: Unë mund të ha qelq dhe nuk më gjen gjë. +Turkish: Cam yiyebilirim, bana zararı dokunmaz. +Turkish (Ottoman): جام ييه بلورم بڭا ضررى طوقونمز +Bangla / Bengali: আমি কাঁচ খেতে পারি, তাতে আমার কোনো ক্ষতি হয় না। +Marathi: मी काच खाऊ शकतो, मला ते दुखत नाही. +Hindi: मैं काँच खा सकता हूँ, मुझे उस से कोई पीडा नहीं होती. +Tamil: நான் கண்ணாடி சாப்பிடுவேன், அதனால் எனக்கு ஒரு கேடும் வராது. +Urdu: میں کانچ کھا سکتا ہوں اور مجھے تکلیف نہیں ہوتی ۔ +Pashto: زه شيشه خوړلې شم، هغه ما نه خوږوي +Farsi / Persian: .من می‌توانم بدونِ احساسِ درد شيشه بخورم +Arabic: أنا قادر على أكل الزجاج و هذا لا يؤلمني. +Aramaic: (NEEDED) +Hebrew: אני יכול לאכול זכוכית וזה לא מזיק לי. +Yiddish: איך קען עסן גלאָז און עס טוט מיר נישט װײ. +Judeo-Arabic: (NEEDED) +Ladino: (NEEDED) +Gǝʼǝz: (NEEDED) +Amharic: (NEEDED) +Twi: Metumi awe tumpan, ɜnyɜ me hwee. +Hausa (Latin): Inā iya taunar gilāshi kuma in gamā lāfiyā. +Hausa (Ajami): إِنا إِىَ تَونَر غِلَاشِ كُمَ إِن غَمَا لَافِىَا +Yoruba: Mo lè je̩ dígí, kò ní pa mí lára. +(Ki)Swahili: Naweza kula bilauri na sikunyui. +Malay: Saya boleh makan kaca dan ia tidak mencederakan saya. +Tagalog: Kaya kong kumain nang bubog at hindi ako masaktan. +Chamorro: Siña yo' chumocho krestat, ti ha na'lalamen yo'. +Javanese: Aku isa mangan beling tanpa lara. +Burmese: (NEEDED) +Vietnamese (quốc ngữ): Tôi có thể ăn thủy tinh mà không hại gì. +Vietnamese (nôm): 些 𣎏 世 咹 水 晶 𦓡 空 𣎏 害 咦 +Khmer: (NEEDED) +Lao: (NEEDED) +Thai: ฉันกินกระจกได้ แต่มันไม่ทำให้ฉันเจ็บ +Mongolian: ᠪᠢ ᠰᠢᠯᠢ ᠢᠳᠡᠶᠦ ᠴᠢᠳᠠᠨᠠ ᠂ ᠨᠠᠳᠤᠷ ᠬᠣᠤᠷᠠᠳᠠᠢ ᠪᠢᠰᠢ +Mongolian (Cyrillic): Би шил идэй чадна, надад хортой биш +Dzongkha: (NEEDED) +Nepali: (NEEDED) +Tibetan: ཤེལ་སྒོ་ཟ་ནས་ང་ན་གི་མ་རེད། +Chinese Simplified: 我能吞下玻璃而不伤身体。 +Chinese Traditional: 我能吞下玻璃而不傷身體。 +Taiwanese: Góa ē-tàng chia̍h po-lê, mā bē tio̍h-siong. +Japanese: 私はガラスを食べられます。それは私を傷つけません。 +Korean: 나는 유리를 먹을 수 있어요. 그래도 아프지 않아요 +Bislama: Mi save kakae glas, hemi no save katem mi. +Hawaiian: Hiki iaʻu ke ʻai i ke aniani; ʻaʻole nō lā au e ʻeha. +Marquesan: E koʻana e kai i te karahi, mea ʻā, ʻaʻe hauhau. +Chinook Jargon: Naika məkmək kakshət labutay, pi weyk ukuk munk-sik nay. +Navajo: Tsésǫʼ yishą́ągo bííníshghah dóó doo shił neezgai da. +Cherokee (and Cree, Ojibwa, Inuktitut, and other Native American languages): (NEEDED) +Garifuna: (NEEDED) +Gullah: (NEEDED) +Lojban: mi kakne le nu citka le blaci .iku'i le se go'i na xrani mi +Nórdicg: Ljœr ye caudran créneþ ý jor cẃran. diff --git a/utils/HELLO.txt b/utils/HELLO.txt new file mode 100644 index 0000000..21acb94 --- /dev/null +++ b/utils/HELLO.txt @@ -0,0 +1,54 @@ +This is Pango (Παν語) + +This is a list of ways to say hello in various languages. +Its purpose is to illustrate a number of scripts. + +--------------------------------------------------------- +Arabic السَّلام عليكُم +Bengali (বাঙ্লা) ষাগতোম +Burmese မ္ရန္မာ +Cherokee (ᏣᎳᎩ) ᎣᏏᏲ +Czech (česky) Dobrý den +Danish (Dansk) Hej, Goddag +English Hello +Esperanto Saluton +Estonian Tere, Tervist +FORTRAN PROGRAM +Finnish (Suomi) Hei +French (Français) Bonjour, Salut +German (Deutsch Nord) Guten Tag +German (Deutsch Süd) Grüß Gott +Georgian (ქართველი) გამარჯობა +Gujarati ગુજરાતિ +Greek (Ελληνικά) Γειά σας +Hebrew שלום +Hindi नमस्ते, नमस्कार। +Italiano Ciao, Buon giorno +IPA English (ɪŋglɪʃ) hɛləʊ +Lao ສບາຍດ +Maltese Ċaw, Saħħa +Nederlands, Vlaams Hallo, Dag +Norwegian (Norsk) Hei, God dag +Punjabi ਪੁਂਜਾਬਿ +Polish Dzień dobry, Hej +Russian (Русский) Здравствуйте! +Sinhala (සිංහල) ආයුබෝවන් +Slovak Dobrý deň +Spanish (Español) ¡Hola! +Swedish (Svenska) Hej, Goddag +Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ +Tamil (தமிழ்) வணக்கம் +Turkish (Türkçe) Merhaba +Vietnamese (Tiếng Việt) Xin Chào +Yiddish (ײַדישע)‎ דאָס הײַזעלע + +Japanese (日本語) こんにちは, コンニチハ +Chinese (中文,普通话,汉语) 你好 +Cantonese (粵語,廣東話) 早晨, 你好 +Korean (한글) 안녕하세요, 안녕하십니까 + +Difference among chinese characters in GB, JIS, KSC, BIG5: + GB -- 元气 开发 + JIS -- 元気 開発 + KSC -- 元氣 開發 + BIG5 -- 元氣 開發 diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 0000000..97c8341 --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,115 @@ +## Process this file with automake to create Makefile.in. + +TEST_TEXTS = \ + test-arabic.txt \ + test-chinese.txt \ + test-devanagari.txt \ + test-feature-tag.markup \ + test-gurmukhi.txt \ + test-hebrew.txt \ + test-ipa.txt \ + test-justify.txt \ + test-lao.txt \ + test-latin.txt \ + test-long-paragraph.txt \ + test-mixed.markup \ + test-mixed.txt \ + test-mongolian.txt \ + test-nko.txt \ + test-opentype-language.markup \ + test-syriac.txt \ + test-tamil.txt \ + test-thai.txt \ + test-tibetan.txt \ + HELLO.txt \ + GLASS.txt + +EXTRA_DIST = \ + $(TEST_TEXTS) + +INCLUDES = \ + -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + $(X_CFLAGS) + +######################################################### + +bin_PROGRAMS = pango-view + +if HAVE_CAIRO +bin_PROGRAMS += pango-list +pango_list_SOURCES = pango-list.c +pango_list_LDADD = \ + ../pango/libpangocairo-$(PANGO_API_VERSION).la \ + ../pango/libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) +endif + + +pango_view_SOURCES = \ + viewer-render.h \ + viewer-render.c \ + viewer.h \ + viewer-main.c \ + pango-view.c +pango_view_LDADD = \ + ../pango/libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) +if HAVE_FREETYPE +pango_view_SOURCES += \ + viewer-pangoft2.c +pango_view_LDADD += \ + ../pango/libpangoft2-$(PANGO_API_VERSION).la \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) +endif +if HAVE_XFT +pango_view_SOURCES += \ + viewer-pangoxft.c \ + viewer-x.h \ + viewer-x.c +pango_view_LDADD += \ + ../pango/libpangoft2-$(PANGO_API_VERSION).la \ + ../pango/libpangoxft-$(PANGO_API_VERSION).la \ + $(XFT_LIBS) +endif +if HAVE_CAIRO +pango_view_SOURCES += \ + viewer-cairo.h \ + viewer-cairo.c \ + viewer-pangocairo.c +pango_view_LDADD += \ + ../pango/libpangocairo-$(PANGO_API_VERSION).la \ + $(CAIRO_LIBS) +endif + +######################################################### + +MAINTAINERCLEANFILES = pango-view.1.in +EXTRA_DIST += pango-view.1.in +CLEANFILES = pango-view.1 + +nodist_man_MANS = pango-view.1 + +# The indirection through pango-view.1.in is to make parallel build work. +# See bug 587768. +$(srcdir)/pango-view.1.in: ../configure.ac $(pango_view_SOURCES) + $(AM_V_GEN) $(top_srcdir)/missing --run \ + help2man --no-info --section=1 \ + --help-option="--help-all" --output="$@.tmp" \ + --name 'Pango text viewer' ./pango-view \ + && mv "$@.tmp" "$@" \ + || (echo Failed to update pango-view.1, the man page may be outdated >&2; \ + (test -f "$@" || echo help2man is required to generate this file. >> "$@")); +pango-view.1: pango-view$(EXEEXT) + $(AM_V_GEN) $(MAKE) $(AM_MAKEFLAGS) pango-view.1.in && \ + cp $(srcdir)/pango-view.1.in $@ + +######################################################### + +-include $(top_srcdir)/git.mk diff --git a/utils/Makefile.in b/utils/Makefile.in new file mode 100644 index 0000000..894c893 --- /dev/null +++ b/utils/Makefile.in @@ -0,0 +1,922 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = pango-view$(EXEEXT) $(am__EXEEXT_1) +@HAVE_CAIRO_TRUE@am__append_1 = pango-list +@HAVE_FREETYPE_TRUE@am__append_2 = \ +@HAVE_FREETYPE_TRUE@ viewer-pangoft2.c + +@HAVE_FREETYPE_TRUE@am__append_3 = \ +@HAVE_FREETYPE_TRUE@ ../pango/libpangoft2-$(PANGO_API_VERSION).la \ +@HAVE_FREETYPE_TRUE@ $(FREETYPE_LIBS) \ +@HAVE_FREETYPE_TRUE@ $(FONTCONFIG_LIBS) + +@HAVE_XFT_TRUE@am__append_4 = \ +@HAVE_XFT_TRUE@ viewer-pangoxft.c \ +@HAVE_XFT_TRUE@ viewer-x.h \ +@HAVE_XFT_TRUE@ viewer-x.c + +@HAVE_XFT_TRUE@am__append_5 = \ +@HAVE_XFT_TRUE@ ../pango/libpangoft2-$(PANGO_API_VERSION).la \ +@HAVE_XFT_TRUE@ ../pango/libpangoxft-$(PANGO_API_VERSION).la \ +@HAVE_XFT_TRUE@ $(XFT_LIBS) + +@HAVE_CAIRO_TRUE@am__append_6 = \ +@HAVE_CAIRO_TRUE@ viewer-cairo.h \ +@HAVE_CAIRO_TRUE@ viewer-cairo.c \ +@HAVE_CAIRO_TRUE@ viewer-pangocairo.c + +@HAVE_CAIRO_TRUE@am__append_7 = \ +@HAVE_CAIRO_TRUE@ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ $(CAIRO_LIBS) + +subdir = utils +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_CAIRO_TRUE@am__EXEEXT_1 = pango-list$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am__pango_list_SOURCES_DIST = pango-list.c +@HAVE_CAIRO_TRUE@am_pango_list_OBJECTS = pango-list.$(OBJEXT) +pango_list_OBJECTS = $(am_pango_list_OBJECTS) +am__DEPENDENCIES_1 = +@HAVE_CAIRO_TRUE@pango_list_DEPENDENCIES = ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ ../pango/libpango-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am__pango_view_SOURCES_DIST = viewer-render.h viewer-render.c viewer.h \ + viewer-main.c pango-view.c viewer-pangoft2.c viewer-pangoxft.c \ + viewer-x.h viewer-x.c viewer-cairo.h viewer-cairo.c \ + viewer-pangocairo.c +@HAVE_FREETYPE_TRUE@am__objects_1 = viewer-pangoft2.$(OBJEXT) +@HAVE_XFT_TRUE@am__objects_2 = viewer-pangoxft.$(OBJEXT) \ +@HAVE_XFT_TRUE@ viewer-x.$(OBJEXT) +@HAVE_CAIRO_TRUE@am__objects_3 = viewer-cairo.$(OBJEXT) \ +@HAVE_CAIRO_TRUE@ viewer-pangocairo.$(OBJEXT) +am_pango_view_OBJECTS = viewer-render.$(OBJEXT) viewer-main.$(OBJEXT) \ + pango-view.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) +pango_view_OBJECTS = $(am_pango_view_OBJECTS) +@HAVE_FREETYPE_TRUE@am__DEPENDENCIES_2 = ../pango/libpangoft2-$(PANGO_API_VERSION).la \ +@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) \ +@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) +@HAVE_XFT_TRUE@am__DEPENDENCIES_3 = \ +@HAVE_XFT_TRUE@ ../pango/libpangoft2-$(PANGO_API_VERSION).la \ +@HAVE_XFT_TRUE@ ../pango/libpangoxft-$(PANGO_API_VERSION).la \ +@HAVE_XFT_TRUE@ $(am__DEPENDENCIES_1) +@HAVE_CAIRO_TRUE@am__DEPENDENCIES_4 = ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ $(am__DEPENDENCIES_1) +pango_view_DEPENDENCIES = ../pango/libpango-$(PANGO_API_VERSION).la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(pango_list_SOURCES) $(pango_view_SOURCES) +DIST_SOURCES = $(am__pango_list_SOURCES_DIST) \ + $(am__pango_view_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(nodist_man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TEST_TEXTS = \ + test-arabic.txt \ + test-chinese.txt \ + test-devanagari.txt \ + test-feature-tag.markup \ + test-gurmukhi.txt \ + test-hebrew.txt \ + test-ipa.txt \ + test-justify.txt \ + test-lao.txt \ + test-latin.txt \ + test-long-paragraph.txt \ + test-mixed.markup \ + test-mixed.txt \ + test-mongolian.txt \ + test-nko.txt \ + test-opentype-language.markup \ + test-syriac.txt \ + test-tamil.txt \ + test-thai.txt \ + test-tibetan.txt \ + HELLO.txt \ + GLASS.txt + +EXTRA_DIST = $(TEST_TEXTS) pango-view.1.in +INCLUDES = \ + -I$(top_srcdir) \ + $(PANGO_DEBUG_FLAGS) \ + $(GLIB_CFLAGS) \ + $(XFT_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + $(X_CFLAGS) + +@HAVE_CAIRO_TRUE@pango_list_SOURCES = pango-list.c +@HAVE_CAIRO_TRUE@pango_list_LDADD = \ +@HAVE_CAIRO_TRUE@ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ ../pango/libpango-$(PANGO_API_VERSION).la \ +@HAVE_CAIRO_TRUE@ $(GLIB_LIBS) + +pango_view_SOURCES = viewer-render.h viewer-render.c viewer.h \ + viewer-main.c pango-view.c $(am__append_2) $(am__append_4) \ + $(am__append_6) +pango_view_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la \ + $(GLIB_LIBS) $(am__append_3) $(am__append_5) $(am__append_7) + +######################################################### +MAINTAINERCLEANFILES = pango-view.1.in +CLEANFILES = pango-view.1 +nodist_man_MANS = pango-view.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits utils/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +pango-list$(EXEEXT): $(pango_list_OBJECTS) $(pango_list_DEPENDENCIES) $(EXTRA_pango_list_DEPENDENCIES) + @rm -f pango-list$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pango_list_OBJECTS) $(pango_list_LDADD) $(LIBS) + +pango-view$(EXEEXT): $(pango_view_OBJECTS) $(pango_view_DEPENDENCIES) $(EXTRA_pango_view_DEPENDENCIES) + @rm -f pango-view$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pango_view_OBJECTS) $(pango_view_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pango-view.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-cairo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-pangocairo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-pangoft2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-pangoxft.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-render.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewer-x.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(nodist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(nodist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: installcheck-binPROGRAMS + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am \ + installcheck-binPROGRAMS installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-man uninstall-man1 + +.PRECIOUS: Makefile + + +# The indirection through pango-view.1.in is to make parallel build work. +# See bug 587768. +$(srcdir)/pango-view.1.in: ../configure.ac $(pango_view_SOURCES) + $(AM_V_GEN) $(top_srcdir)/missing --run \ + help2man --no-info --section=1 \ + --help-option="--help-all" --output="$@.tmp" \ + --name 'Pango text viewer' ./pango-view \ + && mv "$@.tmp" "$@" \ + || (echo Failed to update pango-view.1, the man page may be outdated >&2; \ + (test -f "$@" || echo help2man is required to generate this file. >> "$@")); +pango-view.1: pango-view$(EXEEXT) + $(AM_V_GEN) $(MAKE) $(AM_MAKEFLAGS) pango-view.1.in && \ + cp $(srcdir)/pango-view.1.in $@ + +######################################################### + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/utils/meson.build b/utils/meson.build new file mode 100644 index 0000000..3adcc32 --- /dev/null +++ b/utils/meson.build @@ -0,0 +1,80 @@ +pango_view_sources = [ + 'pango-view.c', + 'viewer-main.c', + 'viewer-render.c', +] + +pango_view_deps = [ + pango_deps, + libpango_dep, +] + +if build_pangoft2 + pango_view_sources += 'viewer-pangoft2.c' + pango_view_deps += libpangoft2_dep +endif + +if xft_dep.found() and build_pangoft2 + pango_view_sources += [ + 'viewer-pangoxft.c', + 'viewer-x.c', + ] + pango_view_deps += [ libpangoft2_dep, libpangoxft_dep, ] +endif + +if cairo_dep.found() + pango_view_sources += [ + 'viewer-cairo.c', + 'viewer-pangocairo.c', + ] + pango_view_deps += libpangocairo_dep +endif + +pango_view = executable('pango-view', pango_view_sources, + dependencies: pango_view_deps, + include_directories: [ root_inc ], + install: true, + c_args: [ + '-DPACKAGE_NAME="@0@"'.format(meson.project_name()), + '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), + ]) + +help2man = find_program('help2man', required: false) +if help2man.found() + help2man_opts = [ + '--no-info', + '--section=1', + '--help-option=--help-all', + '--name=Pango text viewer', + ] + + custom_target('pango-view.1', + output: 'pango-view.1', + command: [ + help2man, help2man_opts, '--output=@OUTPUT@', pango_view + ], + install: true, + install_dir: join_paths(pango_datadir, 'man/man1')) +endif + +if cairo_dep.found() + pango_list_sources = [ + 'pango-list.c', + ] + + pango_list_deps = [ + pango_deps, + libpango_dep, + libpangocairo_dep + ] + + pango_list = executable('pango-list', pango_list_sources, + dependencies: pango_list_deps, + include_directories: [ root_inc ], + install: true, + c_args: [ + '-DPACKAGE_NAME="@0@"'.format(meson.project_name()), + '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), + ]) + +endif diff --git a/utils/pango-list.c b/utils/pango-list.c new file mode 100644 index 0000000..cb92767 --- /dev/null +++ b/utils/pango-list.c @@ -0,0 +1,98 @@ +/* pango-list.c: List all fonts + * + * Copyright (C) 2018 Google + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Google Author(s): Behdad Esfahbod + */ + +#include "config.h" +#include +#include + +int +main (int argc, + char **argv) +{ + PangoFontMap *fontmap; + PangoFontFamily **families; + int n_families; + int i, j, k; + +#if !GLIB_CHECK_VERSION (2, 35, 3) + g_type_init(); +#endif + g_set_prgname ("pango-list"); + + /* Use PangoCairo to get default fontmap so it works on every platform. */ + fontmap = pango_cairo_font_map_get_default (); + + pango_font_map_list_families (fontmap, &families, &n_families); + for (i = 0; i < n_families; i++) + { + PangoFontFace **faces; + int n_faces; + + const char *family_name = pango_font_family_get_name (families[i]); + g_print ("%s\n", family_name); + + pango_font_family_list_faces (families[i], &faces, &n_faces); + for (j = 0; j < n_faces; j++) + { + const char *face_name = pango_font_face_get_face_name (faces[j]); + gboolean is_synth = pango_font_face_is_synthesized (faces[j]); + const char *synth_str = is_synth ? "*" : ""; + g_print (" %s%s\n", synth_str, face_name); + + if (0) + { + int *sizes; + int n_sizes; + pango_font_face_list_sizes (faces[j], &sizes, &n_sizes); + if (n_sizes) + { + g_print (" {"); + for (k = 0; k < n_sizes; k++) + { + if (k) + g_print (", "); + g_print ("%g", pango_units_to_double (sizes[k])); + } + g_print ("}\n"); + } + g_free (sizes); + } + + if (1) + { + PangoFontDescription *desc = pango_font_face_describe (faces[j]); + char *desc_str = pango_font_description_to_string (desc); + + g_print (" \"%s\"\n", desc_str); + + g_free (desc_str); + pango_font_description_free (desc); + } + } + + g_free (faces); + } + g_free (families); + g_object_unref (fontmap); + + return 0; +} diff --git a/utils/pango-view.1.in b/utils/pango-view.1.in new file mode 100644 index 0000000..2ef9100 --- /dev/null +++ b/utils/pango-view.1.in @@ -0,0 +1 @@ +help2man is required to generate this file. diff --git a/utils/pango-view.c b/utils/pango-view.c new file mode 100644 index 0000000..fec00be --- /dev/null +++ b/utils/pango-view.c @@ -0,0 +1,23 @@ +#include "config.h" +#include "viewer.h" + +extern const PangoViewer pangocairo_viewer; +extern const PangoViewer pangoxft_viewer; +extern const PangoViewer pangoft2_viewer; +extern const PangoViewer pangox_viewer; + +const PangoViewer *viewers[] = { +#ifdef HAVE_CAIRO + &pangocairo_viewer, +#endif +#ifdef HAVE_XFT + &pangoxft_viewer, +#endif +#ifdef HAVE_FREETYPE + &pangoft2_viewer, +#endif +#ifdef HAVE_X + &pangox_viewer, +#endif + NULL +}; diff --git a/utils/test-arabic.txt b/utils/test-arabic.txt new file mode 100644 index 0000000..b75f9a6 --- /dev/null +++ b/utils/test-arabic.txt @@ -0,0 +1,7 @@ +بِسْمِ ٱللّٰهِ ٱلرَّحْمٰنِ ٱلرَّحِيمِ +اَلْحَمْدُ لِلّٰهِ رَبِّ الْعَالَمِينَ +اَلرَّحْمٰنِ الرَّحِيمِ +مَالِكِ يَوْمِ الدِّينِ +اِيَّاكَ نَعْبُدُ وَ اِيَّاكَ نَسْتَعِينُ +اِهْدِنَا الصِّرَاطَ الْمُسْتَقِيمَ +صِرَاطَ الَّذِينَ اَنْعَمْتَ عَلَيهِمْ غَيْرِ الْمَغْضُوبِ عَلَيْهِم وَ لَا الضَّاۤلِّينَ diff --git a/utils/test-chinese.txt b/utils/test-chinese.txt new file mode 100644 index 0000000..bddc823 --- /dev/null +++ b/utils/test-chinese.txt @@ -0,0 +1,21 @@ +你好,这是中文竖排测试。 +欢迎来到中国北京。 +白日依山尽, +黄河入海流。 +欲穷千里目, +更上一层楼。 +谢谢! + + +《施氏吃獅子記》 + +有一位住在石室裏的詩人叫施氏,愛吃獅子,決心要吃十隻獅子。 +他常常去市場看獅子。 +十點鐘,剛好有十隻獅子到了市場。 +那時候,剛好施氏也到了市場。 +他看見那十隻獅子,便放箭,把那十隻獅子殺死了。 +他拾起那十隻獅子的屍體,帶到石室。 +石室濕了水,施氏叫侍從把石室擦乾。 +石室擦乾了,他才試試吃那十隻獅子。 +吃的時候,才發現那十隻獅子,原來是十隻石頭的獅子屍體。 +試試解釋這件事吧。 diff --git a/utils/test-devanagari.txt b/utils/test-devanagari.txt new file mode 100644 index 0000000..9cfccc5 --- /dev/null +++ b/utils/test-devanagari.txt @@ -0,0 +1,9 @@ +कि KI +किकि KIKI +क्कि KKI +क्क्कि KKKI +क््कि KKI (sp) +क़्कि KKI (sp) +क््क्कि KKKI (sp) +क््क््कि KKKI (sp) +क़्क़्कि KKKI (sp) diff --git a/utils/test-feature-tag.markup b/utils/test-feature-tag.markup new file mode 100644 index 0000000..c92fc64 --- /dev/null +++ b/utils/test-feature-tag.markup @@ -0,0 +1,130 @@ + +ASCII: +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ +Full Widths: + +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + +Half Widths: +やさしいカレー +やさしいカレー + +Standard Ligatures: + +ffl fi +ffl fi + + +Discretionary Ligatures: +株式会社 +株式会社 + +Discretionary Ligatures (+ Vertical Alternates) +株式会社 +株式会社 + +Vertical Alternates: +私の名前は中野です。 + +Fractions: + +1/1000 +1/1000 + + +Traditional Forms: +亜 + + +JIS X 0213:2000 + +逢芦飴溢茨鰯淫迂厩噂餌襖迦牙廻恢晦蟹葛鞄釜翰翫徽 +祇汲灸笈卿饗僅喰櫛屑粂祁隙倦捲牽鍵諺巷梗膏鵠甑叉 +榊薩鯖錆鮫餐杓灼酋楯薯藷哨鞘杖蝕訊逗摺撰煎煽穿箭 +詮噌遡揃遜腿蛸辿樽歎註瀦捗槌鎚辻挺鄭擢溺兎堵屠賭 +瀞遁謎灘楢禰牌這秤駁箸叛挽誹樋稗逼謬豹廟瀕斧蔽瞥 +蔑篇娩鞭庖蓬鱒迄儲餅籾爺鑓愈猷漣煉簾榔屢冤叟咬嘲 +囀徘扁棘橙狡甕甦疼祟竈筵篝腱艘芒虔蜃蠅訝靄靱騙鴉 + + +JIS X 0213:2004 + +逢芦飴溢茨鰯淫迂厩噂餌襖迦牙廻恢晦蟹葛鞄釜翰翫徽 +祇汲灸笈卿饗僅喰櫛屑粂祁隙倦捲牽鍵諺巷梗膏鵠甑叉 +榊薩鯖錆鮫餐杓灼酋楯薯藷哨鞘杖蝕訊逗摺撰煎煽穿箭 +詮噌遡揃遜腿蛸辿樽歎註瀦捗槌鎚辻挺鄭擢溺兎堵屠賭 +瀞遁謎灘楢禰牌這秤駁箸叛挽誹樋稗逼謬豹廟瀕斧蔽瞥 +蔑篇娩鞭庖蓬鱒迄儲餅籾爺鑓愈猷漣煉簾榔屢冤叟咬嘲 +囀徘扁棘橙狡甕甦疼祟竈筵篝腱艘芒虔蜃蠅訝靄靱騙鴉 + + +Alternate Annotation Forms: +CR+12345一二三月火水木金土日株有社名 +CR+12345一二三月火水木金土日株有社名 + + + +ASCII: +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ +Full Widths: + +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + +Half Widths: +やさしいカレー +やさしいカレー + +Standard Ligatures: + +ffl fi +ffl fi + + +Discretionary Ligatures: +株式会社 +株式会社 + +Discretionary Ligatures (+ Vertical Alternates) +株式会社 +株式会社 + +Vertical Alternates: +私の名前は中野です。 + +Fractions: + +1/1000 +1/1000 + + +Traditional Forms: +亜 + + +JIS X 0213:2000 + +逢芦飴溢茨鰯淫迂厩噂餌襖迦牙廻恢晦蟹葛鞄釜翰翫徽 +祇汲灸笈卿饗僅喰櫛屑粂祁隙倦捲牽鍵諺巷梗膏鵠甑叉 +榊薩鯖錆鮫餐杓灼酋楯薯藷哨鞘杖蝕訊逗摺撰煎煽穿箭 +詮噌遡揃遜腿蛸辿樽歎註瀦捗槌鎚辻挺鄭擢溺兎堵屠賭 +瀞遁謎灘楢禰牌這秤駁箸叛挽誹樋稗逼謬豹廟瀕斧蔽瞥 +蔑篇娩鞭庖蓬鱒迄儲餅籾爺鑓愈猷漣煉簾榔屢冤叟咬嘲 +囀徘扁棘橙狡甕甦疼祟竈筵篝腱艘芒虔蜃蠅訝靄靱騙鴉 + + +JIS X 0213:2004 + +逢芦飴溢茨鰯淫迂厩噂餌襖迦牙廻恢晦蟹葛鞄釜翰翫徽 +祇汲灸笈卿饗僅喰櫛屑粂祁隙倦捲牽鍵諺巷梗膏鵠甑叉 +榊薩鯖錆鮫餐杓灼酋楯薯藷哨鞘杖蝕訊逗摺撰煎煽穿箭 +詮噌遡揃遜腿蛸辿樽歎註瀦捗槌鎚辻挺鄭擢溺兎堵屠賭 +瀞遁謎灘楢禰牌這秤駁箸叛挽誹樋稗逼謬豹廟瀕斧蔽瞥 +蔑篇娩鞭庖蓬鱒迄儲餅籾爺鑓愈猷漣煉簾榔屢冤叟咬嘲 +囀徘扁棘橙狡甕甦疼祟竈筵篝腱艘芒虔蜃蠅訝靄靱騙鴉 + + +Alternate Annotation Forms: +CR+12345一二三月火水木金土日株有社名 +CR+12345一二三月火水木金土日株有社名 + + diff --git a/utils/test-gurmukhi.txt b/utils/test-gurmukhi.txt new file mode 100644 index 0000000..f3d0592 --- /dev/null +++ b/utils/test-gurmukhi.txt @@ -0,0 +1,26 @@ +ਹਰੀ ਸਿੰਘ ਨਲੂਆ + +ਹਰੀ ਸਿੰਘ ਨਲੂਆ (ਨਲਵਾ) + + +ਸਿੱਖ ਕੌਮ ਦਾ ਅਣਖੀ ਅਤੇ ਬਹਾਦਰ ਜਰਨੈਲ, ਜਿਸ ਦੇ ਨਾਂ ਤੋਂ ਪਠਾਣੀਆਂ ਆਪਣੇ ਬੱਚਿਆਂ ਨੂੰ ਡਰਾਉਦੀਆਂ ਸਨ ਕਿ ਪੁੱਤ ਸੌਂ ਜਾ ਨਹੀਂ ਤਾਂ ਨਲੂਆ ਆ ਜਾਵੇਗਾ। + + +ਵਿਸ਼ਾ-ਸੂਚੀ +[ਛੁਪਾਓ] + + * ੧ ਜਨਮ ਅਤੇ ਸਿਖਲਾਈ + * ੨ ਨਲੂਆ + * ੩ ਖਾਲਸਾ ਫੌਜ + * ੪ ਕਸ਼ਮੀਰ + * ੫ ਜੰਗ ਜਮਰੌਦ + * ੬ ਜਾਗੀਰ ਵਾਪਸੀ + + ਜਨਮ ਅਤੇ ਸਿਖਲਾਈ + +ਸਰਦਾਰ ਹਰੀ ਸਿੰਘ ਦਾ ਜਨਮ ਗੁੱਜਰਾਵਾਲੇ ਵਿਖੇ ਹੋਇਆ। ਪਿਤਾ ਦੀ ਮੌਤ ਨਿੱਕੀ ਉਮਰ ਵਿੱਚ ਹੋਣ ਉਪਰੰਤ, ਉਹਨਾਂ ਦਾ ਪਾਲਣ ਪੋਸ਼ਣ ਉਹਨਾਂ ਦੇ ਨਾਨਕੇ ਪਰਿਵਾਰ ਵਿੱਚ ਹੋਇਆ। + +ਸਰਦਾਰ ਹਰੀ ਸਿੰਘ ਨਲੂਆ ਦੇ ਪਰਿਵਾਰ ਵਿੱਚ ਦੋ ਪਤਨੀਆਂ, ਜਿੰਨ੍ਹਾਂ ਦਾ ਜ਼ੋਰਾਵਰ ਸਿੰਘ ਤੇ ਗੁਰਦਿੱਤ ਸਿੰਘ, ਅਤੇ ਅਰਜਨ ਸਿੰਘ ਤੇ ਪੰਜਾਬ ਸਿੰਘ ਨਾਂ ਦੇ ਚਾਰ ਪੁੱਤਰ ਸਨ। ਚਾਰੇ ਪੁੱਤਰ ਆਪਣੇ ਪਿਓ ਵਾਂਗ ਬਹਾਦਰ ਨਹੀਂ ਸਨ। +ਇਹਨਾਂ ਕਰਕੇ ਮਹਾਰਾਜਾ ਰਣਜੀਤ ਸਿੰਘ ਨੇ ਅੰਤ ਵਿੱਚ ਸਰਦਾਰ ਹਰੀ ਸਿੰਘ ਦੀ ਸਾਰੀ ਜਾਗੀਰ ਨੂੰ ਵਾਪਸ ਲੈ ਲਈ ਆਪਣੇ ਸਰਦਾਰ ਵਿੱਚ ਵੰਡ ਦਿੱਤੀ। +ਸਰਦਾਰ ਹਰੀ ਸਿੰਘ ਦੇ ਬਾਅਦ ਇਹਨਾਂ ਕੋਲ 40,000 ਹਜ਼ਾਰ ਦੀ ਸਲਾਨਾ ਜਾਗੀਰ ਅਤੇ 60 ਤੋਂ 70 ਸਵਾਰ ਰਹੇ। + diff --git a/utils/test-hebrew.txt b/utils/test-hebrew.txt new file mode 100644 index 0000000..15467d8 --- /dev/null +++ b/utils/test-hebrew.txt @@ -0,0 +1,13 @@ +בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃ +וְהָאָ֗רֶץ הָֽיְתָ֥ה תֹ֨הוּ֙ וָבֹ֔הוּ וְחֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַמָּֽיִם׃ +וַיֹּ֥אמֶר אֱלֹהִ֖ים יְהִ֣י א֑וֹר וַֽיְהִי־אֽוֹר׃ +וַיַּ֧רְא אֱלֹהִ֛ים אֶת־הָא֖וֹר כִּי־ט֑וֹב וַיַּבְדֵּ֣ל אֱלֹהִ֔ים בֵּ֥ין הָא֖וֹר וּבֵ֥ין הַחֹֽשֶׁךְ׃ +וַיִּקְרָ֨א אֱלֹהִ֤ים ׀ לָאוֹר֙ י֔וֹם וְלַחֹ֖שֶׁךְ קָ֣רָא לָ֑יְלָה וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר י֥וֹם אֶחָֽד׃ +וַיֹּ֣אמֶר אֱלֹהִ֔ים יְהִ֥י רָקִ֖יעַ בְּת֣וֹךְ הַמָּ֑יִם וִיהִ֣י מַבְדִּ֔יל בֵּ֥ין מַ֖יִם לָמָֽיִם׃ +וַיַּ֣עַשׂ אֱלֹהִים֮ אֶת־הָֽרָקִיעַ֒ וַיַּבְדֵּ֗ל בֵּ֤ין הַמַּ֨יִם֙ אֲשֶׁר֙ מִתַּ֣חַת לָֽרָקִ֔יעַ וּבֵ֣ין הַמַּ֔יִם אֲשֶׁ֖ר מֵעַ֣ל לָֽרָקִ֑יעַ וַֽיְהִי־כֵֽן׃ +וַיִּקְרָ֧א אֱלֹהִ֛ים לָֽרָקִ֖יעַ שָׁמָ֑יִם וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר י֥וֹם שֵׁנִֽי׃ +וַיֹּ֣אמֶר אֱלֹהִ֗ים יִקָּו֨וּ הַמַּ֜יִם מִתַּ֤חַת הַשָּׁמַ֨יִם֙ אֶל־מָק֣וֹם אֶחָ֔ד וְתֵֽרָאֶ֖ה הַיַּבָּשָׁ֑ה וַֽיְהִי־כֵֽן׃ +וַיִּקְרָ֨א אֱלֹהִ֤ים ׀ לַיַּבָּשָׁה֙ אֶ֔רֶץ וּלְמִקְוֵ֥ה הַמַּ֖יִם קָרָ֣א יַמִּ֑ים וַיַּ֥רְא אֱלֹהִ֖ים כִּי־טֽוֹב׃ +וַיֹּ֣אמֶר אֱלֹהִ֗ים תַּֽדְשֵׁ֤א הָאָ֨רֶץ֙ דֶּ֗שֶׁא עֵ֚שֶׂב מַזְרִ֣יעַ זֶ֔רַע עֵ֣ץ פְּרִ֞י עֹ֤שֶׂה פְּרִי֙ לְמִינ֔וֹ אֲשֶׁ֥ר זַרְעוֹ־ב֖וֹ עַל־הָאָ֑רֶץ וַֽיְהִי־כֵֽן׃ +וַתּוֹצֵ֨א הָאָ֜רֶץ דֶּ֠שֶׁא עֵ֣שֶׂב מַזְרִ֤יעַ זֶ֨רַע֙ לְמִינֵ֔הוּ וְעֵ֧ץ עֹֽשֶׂה־פְּרִ֛י אֲשֶׁ֥ר זַרְעוֹ־ב֖וֹ לְמִינֵ֑הוּ וַיַּ֥רְא אֱלֹהִ֖ים כִּי־טֽוֹב׃ +וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר י֥וֹם שְׁלִישִֽׁי׃ diff --git a/utils/test-ipa.txt b/utils/test-ipa.txt new file mode 100644 index 0000000..2fdd5e2 --- /dev/null +++ b/utils/test-ipa.txt @@ -0,0 +1,8 @@ +n̩ a̩ m̩ w̩ i̩ l̩ j̩̩ ɳ̩ ŋ̩ +n̽ a̽ m̽ w̽ i̽ l̽ j̽ ɳ̽ ŋ̽ +ff fi fl e˥˩ i˦˨˥ +ä̃́ ɛ̃̈̀ ɩ̂́ ɔ̃̂ ʉ̄̈ ɠ̪̥̈ +ŋ̥ n̥ n̪̰ +k͡p m͡i l͡w l͡i m͡w + + diff --git a/utils/test-justify.txt b/utils/test-justify.txt new file mode 100644 index 0000000..754ed28 --- /dev/null +++ b/utils/test-justify.txt @@ -0,0 +1,5 @@ +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc sit amet nulla. Cras elit. Fusce nibh orci, vehicula ut, congue ut, auctor quis, turpis. + +Fusce ullamcorper porttitor quam. Nullam at nulla sit amet neque rutrum porttitor. Quisque mattis blandit velit. Aenean nec risus sed libero rhoncus suscipit. Cras dapibus. + +قصابه با بابام رفیقه. پشت خونمون یه دباغیه. اینقده بچه گوسفند توشه! خونه‌مون ساس داره. ساس کوچیک و سیاس. هر جا بزنه جاش باد می‌کنه. وقتی داره از دیوار اتاق می‌ره بالا، نمی‌تونه خودشو نگه داره، می‌افته رو تن ما، می‌گیره خونمونو می‌مکه. یه دفعه همه اثاث مثاثامونو ریختیم بیرون، یه عالمه دوا خریدیم زدیم همه جا: به رختخوابا،‌ زیر زیلو، سوراخ سنبه‌ها. ولی ساسها بیشتر شدن، کمتر نشدن. بابام توی حموم کار می‌کنه. diff --git a/utils/test-lao.txt b/utils/test-lao.txt new file mode 100644 index 0000000..012025e --- /dev/null +++ b/utils/test-lao.txt @@ -0,0 +1,2 @@ +ເກັບພາບງາມໆມາຝາກໃຫ້ແຟນໆໄດ້ເຫັນເຕັມໆຕາທີ່ມະຫາສານ.ຄອມ + ປະຈຸບັນ, ຕ້ອງຍອມຮັບກັນວ່າ ກະແສຕອບຮັບແນວເພງສະຕິງກຳລັງມາແຮງອີ່ຫລີ, ບາງບົດເພງນອກຈາກຈະເປັນທີ່ນິຍົມໃນບ້ານເຮົາ ເມືອງເຮົາແລ້ວ ຍັງຂ້າມຝັ່ງໄປດັງຢູ່ບ້ານເພີ່ນອີກ. ບໍ່ແມ່ນຕັ້ງເວົ້າ ເມື່ອກ່ອນນັກທ່ອງທ່ຽວຊາວຕ່າງຊາດທີ່ເຂົ້າມາທ່ຽວບ້ານເຮົາເພິ່ນມັກຖາມວ່າ ເປັນຫຍັງຄົນລາວຈຶ່ງບໍ່ມັກເປິດເພງລາວໂດຍສະເພາະໃນຮ້ານກິນດື່ມ, ຮ້ານອາຫານ ຫລື ແມ່ນແຕ່ຕາມບ້ານເຮືອນ ແລະ ຕະຫລາດ, ແຕ່ດຽວນີ້ຂໍປະທານໂທດ ເພິ່ນຫັນມາເປີດເພງລາວກັນແລ້ວ ເນື່ອງຈາກສັງຄົມກໍ່ຍອມຮັບ, ບົດເພງກໍ່ມ່ວນ ເນື້ອຫາກໍ່ຖືກໃຈແຖມຍັງເປັນການສົ່ງເສີມໃຫ້ສິລະປິນລາວ ແລະ ຜູ້ຢູ່ເບື້ອງຫລັງມີກຳລັງໃຈພັດທະນາວຽກ ແລະ ຜົນງານຂອງຕົນອີກ... ອີກດ້ານໜື່ງນອກຈານສິລະປິນຈະຕ້ອງບຸກບືນ ເພື່ອໃຫ້ຕົວເອງໄດ້ເຂົ້າມາຢູ່ໃນວົງການແລ້ວ, ຝ່າຍເຈົ້າຂອງຄ້າຍເພງກໍ່ພະຍາຍາມເຟັ້ນຫານັກຮ້ອງສຽງດີ ມີແວວດັງເຂົ້າມາເປັນສະມາຊິກຂອງຄ້າຍເພງຕົນເອງເຊັ່ນກັນ. diff --git a/utils/test-latin.txt b/utils/test-latin.txt new file mode 100644 index 0000000..31fe90b --- /dev/null +++ b/utils/test-latin.txt @@ -0,0 +1,9 @@ +'Twas brillig, and the slithy toves +Did gyre and gimble in the wabe; +All mimsy were the borogoves, +And the mome raths outgrabe. + +'Beware the Jabberwock, my son! +The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun +The frumious Bandersnatch!' diff --git a/utils/test-long-paragraph.txt b/utils/test-long-paragraph.txt new file mode 100644 index 0000000..95c795b --- /dev/null +++ b/utils/test-long-paragraph.txt @@ -0,0 +1,18 @@ +از طرف من و بچه‌ها برای +شادان حکمت + +آقا باور کن، آقا! + +-دل من و این تلخی بی‌نهایت + سر چشمه‌اش کجاست؟ +- آب دریاها + سخت تلخ است آقا! + فدریکو گارسیا لورکا + + + + + + + +من اسمم کاظمه. ما توی یه کوچه بن بست خونه داریم. کوچه‌مون خاکیه. اونوقت خیلی پایئن تر از خونه ما - زیاد پایین نه - اینور می‌پیچی یه نونواس. از اونجا صاف می‌ریم اینجا. یه خیابونه اینجا. اونوقت خیلی پایین‌ترش یه حمومه. بعداً یه بقالی هم دم خونمونه. یه خرده انور خرابه، یه قصابیه. قصابه با بابام رفیقه. پشت خونمون یه دباغیه. اینقده بچه گوسفند توشه! خونه‌مون ساس داره. ساس کوچیک و سیاس. هر جا بزنه جاش باد می‌کنه. وقتی داره از دیوار اتاق می‌ره بالا، نمی‌تونه خودشو نگه داره، می‌افته رو تن ما، می‌گیره خونمونو می‌مکه. یه دفعه همه اثاث مثاثامونو ریختیم بیرون، یه عالمه دوا خریدیم زدیم همه جا: به رختخوابا،‌ زیر زیلو، سوراخ سنبه‌ها. ولی ساسها بیشتر شدن، کمتر نشدن. بابام توی حموم کار می‌کنه. دوتا برادر داریم، یه خواهر: من و مصطفی و زهرا کوچولو. بابا وقتی داره شب می‌شه برمی‌گرده خونه. همیشه استخوناش درد می‌کنه. سر هیچی به هیچی می‌گیره می‌زنه‌مون، بازهم طلبکاره. مثلاً وسط سال، صبح ساعت شیش می‌آد می‌گه، «پاشو برو سیگار بفروش، پول دربیار لباس بخر!» من هم می‌گم: «لباس می‌خوام چی‌ کار؟» اون هم می‌گیره با کمربند حالمونو جا می‌آره. باز خوبه سه ماه تعطیلی خودمون می‌ریم کار می‌کنیم. یه کارخونه هست. می‌ریم اونجا قابلمه درست می‌کنیم، کاسه درست می‌کنیم، عصر که شونصد تا کاسه درست کردیم، دستگارو تمیز می‌کنیم برمی‌گردیم خونه. پارسال هفته‌ای پنجاه تومن مزد می‌دادن. امسال دیگه خدا می‌دونه. با همه این حرفا، بمیریم بهتره آقا! هر روز هر روز کتک. بابام دیشب بیخودی مصطفی رو گرفت زد. گرفت زدش گفت: «چرا وقتی می‌ری دست به آب، سر پا می‌شاشی؟ بشی بشاش!» مصطفی‌مون هیچی حالیش نمی‌شه. قد زهرامون بوده که از بالا پشت بوم افتاده، رگ کله‌اش تکون خرده. حالا سیزده سالشه. نه چارده،‌ چارده سالشه. داداش بزرگ‌ مونه. الان مدرسه عقب افتاده‌ها درس می‌خونه. آب، بابا، بار میخونه یاد بگیره، بیاد جلو. دو سه کلمه بلده حرف بزنه ولی چیزه... نمیتونه قشنگ حرف بزنه. بابام می‌خواد از مدرسه ورش داره، بذاره یه جا که کار یاد بگیره. بابا زهرا را از همه بیشتر می‌خواد. اون هم هر کاری دلش بخواد می‌کنه. هرچی می‌گیم گوش نمی‌کنه، می‌ره تو جوب محل کثافت‌کاری می‌کنه. اون روزی حواسم نبود، رفت یه مشت دیگ مونده سر کوچه بود ورداشت خورد. شب دلش درد گرفت نزدیک بود بمیره. اونوقت بابام اومد گرفت منو با شیلنگ کشت. آقا مگه شهر هرته؟ خر کتک می‌خوره. دیگه چرا ما رو می‌زنن؟ برن به خر بزنن! آخه من که نمی‌تونم همه‌ش مواظب زهرا باشم. راستی یه صاحب حیاط داریم، خیلی بد اخلاقه آقا! اسمش عباس آقاس. صبح می‌ره ظهر می‌آد. سپور شهرداریه. بیست و چار ساعت می‌آد بند میکنه به ما، میگه: «آب زیاد مصرف نکنین، چاه پر میشه.» زهرامون که گاهی گریه می‌کنه، دادش بلند می‌شه می‌گه: «صدای این تخم‌سگو خفه کنین!» اونوقت که مادرمون زنده بود، یه دفعه می‌خواست از دست عباس آقا نفت بریزه سرش، خودشو آتیش بزنه. عباس آقا اصلاً رحم حالیش نمی‌شه؛ پسر سیزده ساله‌شو گرفته از خونه انداخته بیرون. اون هم رفته توی کوچه‌ پس ‌کوچه‌‌ها ول شده. حالا خدا می‌دونه کجاس، چه کار می‌کنه،‌ از کجا می‌آره می‌خوره. بچه‌ها می‌گن: «شب‌ها می‌ره توی پارک‌ها پیش سگها می‌خوابه.» که رفته دهات خونهٔ باباش، می‌گه دیگه نمی‌آم تهران. آقا، ما هم دلمون می‌خواد میرفتیم دهمون با گوسفندها بازی می‌کردیم؛ با بابا بزرگ‌مون می‌رفتیم دشت بز می‌چروندیم،‌ بادوم پاک می‌کردیم، انگور می‌چیدیم. دهمون ولی خیلی دوره آخه! زن عباس آقا حق داره، آقا! محله‌مون خیلی بده. هر روز اونجا دعواس، دعوا، چاقو کشی. توی خرابه هم پر معتاده، بگی دوهزار تا هم بیشتر. می‌رن اونجا قمار می‌کنن، شیره می‌کشن، آمپول می‌زنن تو رگشون. ماهم از ترس معتادها جرأت نمی‌کنیم از خونه بریم کوچه، یه ذره بازی کنیم. از کمیته‌م نمی‌ترسن، میگیرن بچه‌های مردمو می‌دزدن، میبرن توی کوره‌ها،‌ توی دلاشون چیز قایم می‌کنن؛ هروئین قایم میکنن. یه امیر ریزه هست تریاکیه، اون روزی اومد خرم کنه، گفت: «بیا سوار ماشین بشیم، بریم یه جائی.» من هم از ترسم خر نشدم. یه چیز خنده دار بگم بخندی، آقا: اینورمون یه همسایه داریم، اسمش ربابه. انوقت توپ،‌ لنگه کفش، تنکه، هرچی بیفته خونشون،‌ شوهرش ور می‌داره می‌اندازه توی آب انبارشون. هروقت هم کوچه شلوغ بشه، شوهر رباب می‌آد بیرون می‌گه: «واق، عو!» اون هم مث مصطفی‌ ما لقوه‌ایه‌؛ دستش می‌لزره، همه جاش می‌لرزه. اون روز اومد دم دکون، رفت اونور جوب نشت. این یکی همسایه‌مون رفت یه کتاب دربارهٔ خدا و فرشته‌ها آورد براش خوند. رباب خانم خودش خونه یه اعیونه کار می‌کنه؛ چیزاشونو می‌شوره، باغ‌شونو آب می‌ده؛ کلفتی می‌کنه. بعد همه‌ش می‌آد پز اربابشو می‌ده. الان دیگه همه اهل محل می‌دونن باغ خونهٔ ارباب رباب خانوم اندازه پارک شهره. استخرش از مال پارک شهر هم گنده‌تره. هروقت هم که ارباب می‌خواد‌ آبتنی کنه،‌ اول یه قطره دوای مخصوص هست، می‌ریزه توی استخر که آب‌شو می‌کنه مث اشک چشم. بعد می‌ره زیر دوش، با عطر و گلاب خودشو می‌شوره. بعد می‌پره توی استخر، می‌گیره شوخی شوخی آب می‌پاشه به رباب خانوم. زن اربابش هم خارجیه. مال همون کشوریه که شیش ماه شبه، شیش ماه روز. رباب یه چاخان‌هایی می‌کنه که کلهٔ آدم سوت می‌کشه! می‌گه ارباب یه سگ پشمالو داره،‌ اسمش مونیکاس. قسم می‌خوره می‌گه مونیکا غذاشو با کارد و چنگال می‌خوره. اللَه اکبر به این دروغ. یه پیرزنه هم هست سر کوچمونه. با خودش تنهایی زندگی می‌کنه. اسمش ننه غلامه. هشتاد نود سالشه ولی خجالت نمی‌کشه،‌ از امریکا خوشش می‌آد. همه ازش می‌ترسن؛ هر وفت بیاد بیرون، فحش می‌ده، جیغ و ویغ می‌زنه. مثلا من اذیتش کردم، می‌آد سر فحش‌رو می‌کشه به تو. وقتی بچه‌ها بخوان لج‌شو در‌بیارن، می‌گن: «مرگ بر امریکا!» اونوقت اون هم حرصش می‌گیره، هزار تا فحش بی‌ناموسی و خوار و مادر می‌کشه به جون همه. ننه غلام دیونه‌س. بعضی وقتا هم با‌ آدم خوبه. یه روز من و زهرا رو گرفت به زور برد خونه‌ش، کله پاچه داد، گفت «بخورین!» ما هم خوردیم. ته کاسه یه لقمه موند که روش یه عالمه مو بود. گفت: «اگه نخورین با همین چاقو سرتونو می‌برم.» ما هم از ترس جونمون خوردیم. ننه غلام وقتی سر حاله، چیز می‌آره می‌ده آدم. مثلا یکی زخمه،‌ دوا می‌آره بهش می‌ده. مثلا کسی چیزی نداره، چیز می‌آره بهش می‌ده، وسط کوچه‌مون یه خونه‌س که دخترهاش خرابن، آقا. اونوقت شیره‌ای‌ها و چاقوکش‌ها می‌رن خونه‌شون، کار بد می‌کنن. بعضی وقتا هم دختر‌هاش لباس سرخ و زرد تن می‌کنن و کفش پاشنه بلند تق‌تقی می‌پوشن، می‌رن واسه بالاشهری‌ها قر می‌دن. یه دفعه هم داشتم می‌رفتم پیش بچه‌ها «لیس پس لیس» بازی کنم که دختر کوچیکه‌ش امیر ریزه رو صدا کرد و بهش گفت: «تو چقدر پاهات لاغره!» بعد امیر ریزه هم نامردی نکرد. گفت:«خودت چرا لمبه‌هات چاقه؟» بعد دوتایی کرکر خندیدن. خودم با همین دو تا چشمام دیدم، آقا! اونوقت ما هم که می‌بینیم محله‌مون پر از بی‌تربیتی‌یه، زدیم با هفت‌تا از بچه محلامون قهر کردیم. با اون هفت‌تا هم بمیرم آشتی نمی‌کنم، آقا. با یکی‌شون یه ساله قهریم، اسمش محمده. یه روز سر کوچه‌مون عروسی بود، ما هم داشتیم بازی می‌کردیم. من دراومدم به محمد گفتم: «محمد امشب چه خبره؟ آبجی‌ت می‌ره حجله؟» ناراحت شد، گفت: «باهات قهرم.» من هم گفتم: «چه بهتر! می‌رم درسامو می‌خونم.» به خدا ما چه می‌دونستیم، به خیالمون عروسی آبجیشه، آقا! فقط با دو نفر دوستیم: مهدی ملخ و حسن گامبو. مهدی از بس مردنیه، همه ملخ صداش می‌کنن. باباش قوری بست می‌زنه. وسط بازی یهو پیداش می‌شه، می‌آد می‌گه: «اگه منو بازی ندین، بازی‌تونو بهم می‌زنم.» اونوقت تا که دس بهش می‌خوره، جیغش می‌ره هوا، میگه: «گه خوردم، گه خوردم.» اونوقت می‌ره از حرصش با میخ یه شکل‌هایی می‌کشه روی دیوار، می‌گه: «این عکس کاظمه.» فسقلی فوتش کنی، قل می‌خوره، ها. آقا، ما دوچرخه خیلی دوست داریم، بعضی وقتا می‌ریم یه تومن می‌دیم چرخ کرایه می‌کنیم. حسن گامبو زورش می‌آد، با سنگ می‌زنه، می‌گه: «منو باید سوار کنی.» من هم می‌بینم داره دلش می‌شکنه، می‌گم: «بیا تو هم سوار شو!» داداش حسن گامبو پنج ماهه رفته لب مرز با خارجیا بجنگه. حسن می‌گه: «رفته امریکا رو نابود کنه، برگرده.» بابای حسن آهنکاره؛ یعنی قالب می‌سازه، پشقاب می‌سازه، همه‌چی می‌سازه. نه که حسن خیکیه، بچه‌ها صداش می‌کنن: «حسن گامبو، سرت تو شامپو!» می‌خواییم با این دو نفر هم قهر کنیم بره. هی می‌آن در خونمون داد می‌زنن: «کاظم، بیا بازی، بیا بازی!» بازی چیه، آقا؟ بده بچه بازی کنه. رفوزه بشیم چه کار؟ دلم می‌خواد دکتر، مهندس، بازنشست، نیرو هوایی، هرچی شد بشیم، بریم پی کارمون بره. ولی تو خونه ما نمی‌شه درس خوند. تا می‌آم بشینم، باید پاشم برم نون بخرم، جارو کنم، خشتک زهرامونو بشورم. پارسال که رفوزه شدم، همه‌ش نیم نمره می‌خواستم قبول بشم. مدرسه‌مونم خیلی هردمبیه، آقا! بچه‌هاش دزدن، می‌آن دفترامونو می‌دزدن. سر کلاس یکی گچ پرت می‌کنه، یکی رو نیمکت ضرب می‌گیره، یکی پا می‌شه می‌رقصه. ما هم که می‌بینیم خر تو خره، حوصله‌مون سر می‌ره، از مدرسه جیم می‌شیم، می‌ریم فروشگاه بزرگ. اونجا پله‌برقی داره. می‌ریم می‌ایستیم خودمونو می‌زینم به اون راه. الکی نگاه می‌کنیم به جنس منس‌ها؛ یعنی مثلا ما هم اومدیم چیز بخریم. بعد می‌ریم سوار پله‌برقی می‌شیم، می‌ریم سواری می‌خوریم، عشق می‌کنیم. آقا، اجازه؟ سه تا دایی هم دارم، آقا! یکی‌شون دایی ضامن، یکی‌شونم دایی مرتضی. اونی که وضعش خوبه اسمش دایی رضوانه. یه وانت داره با یه اتوشویی. تا پامونو می‌ذاریم در دکونش، نامرد یه لگد می‌زنه در اونجامون، می‌گه: «بزن به چاک! باز اومدی از دخل کف ببری» به خدا تهمت می‌زنه، آقا! آقا، به خدا هیچکی به اندازه ما از دزدی بدش نمی‌آد. آقا، دایی مرتضی‌مون اولها کارگر بلورسازی بود، ولی وقتی من هنوز تو دل مادرم بودم، افتاد زندان. یه شب هفت نفر ریختن سرش، اون هم چاقو کشید، زد یکی‌شونو کشت. بعد دادگاه هم اومد بیخودی تقصیر رو گذاشت گردن دایی ما. قبل انقلاب از زندان اومد بیرون، رفت معتاد شد. حالا هم همیشه با زنش دعوا مرافعه داره. گاهی می‌ذاره از خونه‌ش می‌ره، می‌ره می‌ره پیداش نمی‌شه. بعد که برمی‌گرده، الکی به زنش می‌گه، رفته بودم بیمارستان ترک کنم. دایی مرتضی یه بچه کوچولو داره، هروقت می‌آد خونمون، می‌خواد از پله‌هامون بره بالا، بیاد پایین. ما هم می‌ریم دنبالش که نیفته سرش بشکنه. می‌ریم بغلش می‌کنیم. اونوقت می‌ترسه، سفت آدمو می‌گیره. دایی ضامن‌مون توی دولت آباد نفتیه، بعضی روزها که می‌ره نفت پخش کنه منو هم با خودش می‌بره. اون تا می‌ره نفت بده به خونه‌ها، بچه‌ها می‌گیرن مسخره‌م می‌کنن، می‌گن: «ای عرب پا نفتی، کی اومدی، کی رفتی؟» سنگ می‌زنن تو کله‌ام. من هم که زورم نمی‌رسه، گریه‌م می‌گیره. یه روز رفتیم در یه خونه نفت بدیم، اونوقت یه پسره بود - لال بود - دنبالمون کرد تا سر کوچه‌شون. فحش مادر داد، گفت: «دیگه در خونه ما نیا!» لال بود، آقا! نمی‌دونیم چی می‌گفت... آقا، هر وقت از مادرمون حرف می‌زنیم، بغض می‌آد گلومونو می‌گیره، ول‌مون نمی‌کنه... مادرمون سر بچه مرد، آقا! شب درد بچه گرفتش. رفتیم نبات خانومو آوردیم. نبات خانوم مامای محله‌س، شله، یه چشمش هم چپه. صبح که بچه اومد دنیا، مادرمون گذاشت از دنیا رفت. بچه‌ هم پشت سرش مرد، آقا!... مادرمون اون وقت که زنده بود، توی کارخونهٔ استارلایت کار می‌کرد. جوراب شلواری می‌بافت. وقتی شکمش اومد بالا، از اونجا بیرونش کردن. مادرمون اینقده سختی کشیده که خدا بگه، بس! همیشه مریض بود، بعضی وقتا هم غش می‌کرد. پاهاش قد یه متکا باد کرده بود، آقا!... آقا، باور کن، آقا... وقتی مادرمون مرد ما صد برابر الان بغض کردیم. من و زهرا و مصطفی شب تا صبح خوابمون نبرد. بابام اون شب هزار تا سیگار کشید،‌ ولی صبحش مادرمون مرد. وقتی رفتیم خاکش کنیم، ننه غلام نمی‌خواست بذاره ما بریم تماشا، می‌گفت، ما بچه‌ایم، گناه داریم. ولی من دزدکی توی مرده‌شور خونه هم رفتم. بوی بدی می‌ده مرده‌شور خونه، بوی گربهٔ مرده. آدم می‌خواد دل و روده‌شو بالا بیاره. وقتی مادرمونو اوردن گذاشتن توی سالن مرده‌شور خونه، هفت تا مرده زودتر مرده بودن. مادرمون نفر هشتم بود. مرده‌ها منتظر بودن دوش خالی بشه، سر نوبت برن تو، غسل کنن. جنازه یه دختر مدرسه هم بود. نمی‌دونی فک و فامیل دختره چی‌کار می‌کردن؛ یکی سرشو می‌زد به دیوار، یکی کفش‌شو دراورده بود می‌زد تو سر خودش. مادرمونو که اوردن بذارن توی قبر، سروکله‌ٔ مصطفی هم پیداش شد. مادرمون با مصطفی خوب بود. خدا بیامرز که رفت توی قبر، نمی‌دونم از کجا یه مگس اومد نشست روی کفنش. تا مصطفی کیش‌اش کرد، مگسه گذاشت در رفت. بعد شروع کردن با بیل خاک ریختن روی سر مادرمون. رباب خانم با ناخن صورتشو می‌کند. بابام داشت توی دل خودش گریه می‌کرد. اگه مصطفی نمی‌زد زیر گریه و توی خاک و خل غلت نمی‌خورد، من هم گریه نمی‌کردم... مادرمونو که خاک کردیم، دم قبرستان حلوای نذری پخش می‌کردن. واسه اینکه بوی گربهٔ مرده از دماغم بره، یه قاشق حلوا گذاشتم دهنم. ولی صاحب عذا که روشو برگردوند، تفش کردم. آقا، هیچی نمی‌تونستیم بخوریم. آقا، ما دلمون خیلی تنگه، هیشکی نیست ما را زفت کنه. دل‌مون می‌خواد از این دنیا می‌رفتیم. آقا، باورتون نمی‌شه، توی محله ما ملت تند تند می‌میرن، آقا! زهرامون یه همبازی داره، همقد خودشه. اسمش الهامه، پنج سالشه. ده بیست روز پیش باباش از داربست افتاد زمین عکس برگردون شد، مرد. دیروز الهام اومده بود خونه‌مون، یه عکس از باباش هم اورده بود، می‌گفت، هر شب خواب باباشو می‌بینه که اون دنیا آتیش درست کرده، می‌خواد بیاد بگیره اونو کباب کنه بخوره. یه حرفهایی می‌زد که مو به تن آدم سیخ می‌شد. اونوقت شب که خوابم برد، خوابیدم، خواب دیدم عزرائیل و شمر با آتیش اومدن بالای سرم، هی می‌چرخن و چه‌چه می‌خندن. عزرائیل نصفه‌س، آقا! یعنی پا نداره. من هم اومدم از دست‌شون در برم که دیدم یه خرگوشه داره با مامانش قایم موشک بازی می‌کنه. رفتم بگم، من هم بازی که گذاشتن در رفتن. من هم دنبالشون کردم. خسته که شدم دیدم سوار یه قایقم، یه سگ هم داشتم. داشتم با سگ بازی می‌کردم که یهو امیر ریزه پشت پا انداخت، افتادم توی آب. من هم رفتم سوار دوچرخه شدم، زدم به چاک. سگ هم از توی قایق پرید، اومد دنبالم. بعدش دیدم یه هلی‌کوپتر بالای سرمه، می‌خواد باید بستنی لیوانی‌مو قاپ بزنه. من هم با سنگ زدم شیشه‌شو شکوندم. اون هم ترسید در رفت، توی کوچه دباغ‌ها غیب شد. بعدش دیدم عباس آقا گرگ شده، می‌خواد بیاد زهرامونو بگیره لقمه‌ٔ چپش کنه. از ترسم دویدم توی پارک و رفتم سوار تاب شدم. اینقده تاب بازی کردم تا حسابی سرم گیج رفت. اومدم از تاب بپرم پایین، دیدیم زیر پام یه چاهه، یه چاه به این گندگی. داشتم ول می‌شدم ته چاه که از خواب پریدم. نشستم گریه کردم. اونوقت بابام بیدار شد، پرسید: «باز چی شده؟ شاشیدی؟» گفتم: «می‌ترسم.» گفت: «بگیر بخواب بابا تو هم دلت خوشه!» من هم لحافو که کشیدم روی سرم، همه‌ش خدا خدا می‌کردم ایم دفعه که خوابم برد، شانسم بگه، بزنه خواب خوشبختی ببینم، دلم خوش بشه. ولی اگه ما شانس داشتیم، آقا، اسم‌مونو می‌ذاشتن شانسعلی. diff --git a/utils/test-mixed.markup b/utils/test-mixed.markup new file mode 100644 index 0000000..894a1b8 --- /dev/null +++ b/utils/test-mixed.markup @@ -0,0 +1,9 @@ +你好,这是中文竖排测试。 +欢迎来到中国北京。 +白日依山尽, +Roses are Red, +Grass is Green. 2006 +Arabic is گل‌ها قرمزند،‏ +چمن سبز. ۲۰۰۶ +ABC 白日依山尽, 2006 +「ノートを買った。」 diff --git a/utils/test-mixed.txt b/utils/test-mixed.txt new file mode 100644 index 0000000..e23f031 --- /dev/null +++ b/utils/test-mixed.txt @@ -0,0 +1,9 @@ +你好,这是中文竖排测试。 +欢迎来到中国北京。 +白日依山尽, +Roses are Red, +Grass is Green. 2006 +Arabic is گل‌ها قرمزند،‏ +چمن سبز. ۲۰۰۶ +ABC 白日依山尽, 2006 +「ノートを買った。」 diff --git a/utils/test-mongolian.txt b/utils/test-mongolian.txt new file mode 100644 index 0000000..9117b7b --- /dev/null +++ b/utils/test-mongolian.txt @@ -0,0 +1,15 @@ +ᠡᠷᠲᠡ ᠤᠷᠢᠳᠠ ᠺᠠᠪᠠᠯᠢᠺ ᠪᠠᠯᠭᠠᠰᠤᠨ ᠳᠤᠷ ᠪᠢᠷᠠᠮᠠᠨ ᠤ ᠬᠠᠮᠤᠭ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠳᠦᠷ ᠮᠡᠷᠭᠡᠨ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠰᠠᠢᠨ ᠲᠥᠷᠥᠯ ᠲᠦ ᠬᠡᠮᠡᠬᠦ +ᠨᠢᠭᠡᠨ ᠪᠢᠷᠠᠮᠠᠨ ᠪᠦᠯᠦᠭᠡ᠃ ᠲᠡᠷᠡ ᠪᠢᠷᠠᠮᠠᠨ ᠳᠤᠷ ᠰᠡᠳᠬᠢᠯ ᠳᠤᠷ ᠲᠠᠭᠠᠯᠠᠬᠤ ᠨᠡᠷᠡᠲᠦ ᠨᠢᠭᠡᠨ ᠬᠠᠲᠤᠭᠲᠠᠢ ᠪᠦᠯᠦᠭᠡ᠃ ᠲᠡᠷᠡ ᠬᠣᠶᠠᠷ  +ᠠᠴᠠ ᠨᠢᠭᠡᠨ ᠬᠥᠪᠡᠭᠦᠨ ᠲᠥᠷᠥᠵᠦᠬᠦᠢ᠃ ᠲᠡᠷᠡ ᠬᠥᠪᠡᠭᠦᠨ ᠢᠨᠤ ᠦᠴᠦᠭᠦᠬᠡᠨ ᠡᠴᠡ ᠭᠡᠭᠡᠨ ᠣᠶᠤᠲᠤ ᠶᠡᠬᠡᠰ ᠦᠨ ᠶᠠᠪᠤᠳᠠᠯ ᠢᠶᠠᠷ ᠶᠠᠪᠤᠭᠴᠢ +ᠨᠢᠭᠡᠨ ᠪᠣᠯᠪᠠᠢ᠃ ᠲᠡᠨᠳᠡ ᠡᠬᠡ ᠢᠨᠤ ᠠᠶ᠎ᠠ ᠡᠨᠡ ᠬᠥᠪᠡᠭᠦᠨ ᠲᠥᠷᠥᠭᠡᠳ ᠰᠠᠴᠠ ᠶᠡᠬᠡᠰ ᠦᠨ ᠶᠠᠪᠤᠳᠠᠯ ᠢᠶᠠᠷ ᠶᠠᠪᠤᠭᠴᠢ ᠭᠡᠭᠡᠨ ᠣᠶᠤᠲᠤ +ᠪᠦᠬᠦ ᠶᠢᠨ ᠲᠤᠯᠠ᠃ ᠮᠠᠭᠠᠳ ᠨᠢᠭᠡᠨ ᠵᠠᠶᠠᠭ᠋᠎ᠠ ᠲᠤ ᠪᠤᠢ ᠵ᠎ᠠ ᠬᠡᠮᠡᠵᠦ᠃ ᠭᠡᠢᠭᠰᠡᠨ ᠬᠡᠮᠡᠨ ᠨᠡᠷ᠎ᠡ ᠥᠭᠭᠦᠭᠡᠳ᠃ ᠠᠢ ᠡᠨᠡ ᠬᠥᠪᠡᠭᠦᠨ  +ᠳ᠋ᠦᠷ ᠬᠠᠮᠤᠭ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠢ ᠰᠤᠷᠭᠠᠰᠤᠭᠠᠢ ᠬᠡᠮᠡᠵᠦ ᠪᠦᠷᠦᠨ᠃ ᠡᠴᠢᠭᠡ ᠡᠬᠡ ᠬᠣᠶᠠᠷ ᠪᠡᠷ ᠰᠤᠷᠭᠠᠭᠰᠠᠨ ᠳᠤᠷ᠃ ᠳᠥᠷᠪᠡᠯ +ᠦᠭᠡᠢ ᠮᠡᠳᠡᠬᠦᠢ ᠨᠢᠭᠡᠨ ᠪᠣᠯᠪᠠᠢ᠃ ᠲᠡᠷᠡ ᠬᠥᠪᠡᠭᠦᠨ ᠢᠨᠤ ᠳᠣᠯᠣᠭᠠᠨ ᠵᠢᠯ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠳᠤᠷ᠃ ᠪᠢᠷᠠᠮᠠᠨ ᠤ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠳᠦᠷ +ᠮᠡᠷᠭᠡᠨ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠡᠷᠳᠡᠮ ᠦᠳ ᠢᠨᠤ ᠬᠠᠮᠤᠭ ᠪᠦᠭᠦᠳᠡᠭᠡᠷ ᠲᠦᠷ ᠰᠣᠨᠣᠰᠲᠠᠭᠰᠠᠨ᠋᠎ᠠ᠃ ᠲᠡᠷᠡ ᠴᠠᠭ ᠲᠤᠷ ᠺᠠᠪᠠᠯᠢᠺ ᠪᠠᠯᠭᠠᠰᠤᠨ ᠳᠠᠬᠢᠨ ᠤᠬᠠᠭᠠᠨ ᠤ +ᠵᠦᠢᠯ ᠳᠦᠷ ᠮᠡᠷᠭᠡᠨ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠬᠠᠮᠤᠭ ᠪᠢᠷᠠᠮᠠᠨ ᠴᠢᠭᠤᠯᠵᠤ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠳᠦᠷ ᠲᠡᠮᠡᠴᠡᠭᠰᠡᠨ ᠳᠦᠷ᠃ ᠪᠢᠷᠠᠮᠠᠨ ᠤ ᠭᠡᠢᠭᠰᠡᠨ ᠬᠥᠪᠡᠭᠦᠨ +ᠮᠠᠱᠢ ᠶᠡᠬᠡ ᠦᠯᠡᠮᠵᠢ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠳᠤᠷ᠃ ᠲᠡᠳᠡᠭᠡᠷ ᠪᠢᠷᠠᠮᠠᠨ ᠥᠭᠦᠯᠡᠷ ᠦᠨ᠃ ᠠᠢ ᠬᠥᠪᠡᠭᠦᠨ ᠠ᠋ ᠨᠠᠰᠤᠨ ᠴᠢᠨᠤ ᠡᠢᠮᠦ ᠵᠠᠯᠠᠭᠤ +ᠪᠥᠭᠡᠲᠡᠯ᠎ᠡ᠃ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠳᠦᠷ ᠡᠨᠡ ᠮᠡᠲᠦ ᠮᠡᠷᠭᠡᠨ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠬᠡᠷ ᠪᠤᠶᠤ ᠬᠡᠮᠡᠨ ᠠᠰᠠᠭᠪᠠᠰᠤ᠃ ᠬᠥᠪᠡᠭᠦᠨ ᠥᠭᠦᠯᠡᠷ ᠦᠨ᠃ +ᠲᠣᠭᠣᠯᠤᠭᠰᠠᠨ ᠪᠤᠷᠬᠠᠨ ᠪᠡᠷ ᠪᠠᠭᠱᠢ ᠮᠢᠨᠤ ᠪᠤᠢ᠃ ᠪᠣᠭᠳᠠᠰ ᠤᠨ ᠨᠣᠮ ᠪᠡᠷ ᠢᠪᠡᠭᠡᠭᠴᠢ ᠮᠢᠨᠤ ᠪᠤᠢ᠃ ᠪᠤᠷᠰᠠᠩ ᠬᠤᠸᠠᠷᠠᠭ ᠤᠳ ᠪᠡᠷ +ᠤᠳᠤᠷᠢᠳᠳᠤᠭᠴᠢ ᠮᠢᠨᠤ ᠪᠤᠢ᠃ ᠭᠤᠷᠪᠠᠨ ᠡᠷᠳᠡᠨᠢᠰ ᠦᠨ ᠠᠳᠢᠰᠲᠢᠳ ᠬᠢᠭᠰᠡᠨ ᠦ ᠬᠦᠴᠦ ᠪᠡᠷ ᠦᠢᠯᠡ ᠦᠷᠡᠰ ᠲᠦᠷ ᠦᠨᠡᠮᠱᠢᠭᠰᠡᠨ ᠦ ᠲᠤᠯᠠ᠃ +ᠰᠡᠱᠢᠭ ᠦᠭᠡᠢ ᠡᠷᠲᠡ ᠱᠢᠯᠲᠠᠭᠠᠨ ᠤ ᠬᠥᠷᠥᠩᠭᠡ ᠰᠠᠴᠤᠭᠰᠠᠨ ᠳᠤᠷ᠃ ᠦᠷ᠎ᠡ ᠦᠯᠦ ᠬᠣᠮᠰᠠᠳᠬᠤ ᠪᠤᠶᠠᠨ ᠢ ᠬᠢᠴᠢᠶᠡᠭᠰᠡᠨ ᠪᠤᠢ᠃ ᠨᠠᠰᠤᠨ +ᠮᠢᠨᠤ ᠵᠠᠯᠠᠭᠤ ᠪᠣᠯᠪᠠᠰᠤ᠃ ᠤᠬᠠᠭᠠᠨ ᠤ ᠵᠦᠢᠯ ᠳᠦᠷ ᠮᠡᠷᠭᠡᠨ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠤ ᠤᠴᠢᠷ ᠲᠡᠢᠮᠦ ᠪᠤᠢ ᠅ ᠅ diff --git a/utils/test-nko.txt b/utils/test-nko.txt new file mode 100644 index 0000000..65a4347 --- /dev/null +++ b/utils/test-nko.txt @@ -0,0 +1,15 @@ +ߝߘߊ߬ߝߌ߲߬ߠߊ߫ ߟߊ߬ߘߏ߲߬ߞߏ߬ߦߊ߬ߟߌ ߜߙߋ߬ߡߊ߬ߕߍ߰ߟߌ +ߞߖ߭ߊߓߎߟߊ߲ߞߊ ߓߍ߲߬ߡߊ߬ߞߊ߲ ߠߎ߬ : + +ߝߘߊ߬ߝߌ߲߬ߠߊ߫ ߘߎ߰ߙߋ߲ ߠߎ߬ ߟߊ߫ ߢߐ߲߯ߓߍ߲ ߟߊ߬ߘߏ߲߬ߞߏ߬ߦߊ߬ߟߌ ߞߊߡߊ߬ ߞߖ߭ߊߓߎߟߊߟߊ߲ߞߊ߫߸ ( ߞߊ߬ߓߌߛߊ߬ ) ߣߌ߫ ( ߓߌ߬ߛ߭ߊ߯ߙߊ ) ߘߍ߬ߘߊ ߟߎ߬ ߟߊ߫ ߓߊ߯ߙߊ߫ +ߘߊߞߎ߲ ߡߌ߬ߘߊ߬ ߞߣߍ ߞߊ߲߬߸ (IDRC = ߞߣߊߘߊ߫ ߝߘߏ߬ߓߊ߬ ߡߣߊ߬ߙߏ߲߬ߠߌ߲ ߝߊ߲ߓߊ ߞ.ߝ.ߡ.ߝ.) ߞߊ߬ ߡߍ߲ ߖߐ߰ߣߍ ߓߐ߫ ߸ (MTDS = +ߡߊ߬ߙߐߞߎ߫ ߖߊ߬ߥߏ ߟߊ߬ߥߙߎ߬ߞߌ߬ߟߌ ߗߋߢߊߟߌ ߡ.ߖ.ߥߗ.) ߝߊ߬ߙߊ ߘߐ߫ ߊ߬ ߞߊ߲߬ ( ߞߖ߭ߊߓߎߟߊ߲ߞߊ߫ ߕߎߞߑߣߏߔߊߞ ) ߘߍ߬ߞߙߎ ߝߊ߲ߓߊ ߝߍ߬. + +ߞߎ߲߬ߜߙߊ ߣߌ߲߬ ߞߊ߬ ߕߣߐ߬ߓߊ߫ ߛߐ߬ߘߐ߲߬ ߡߊߙߐߞߎ߬ ߖߡߊ߬ߣߊ ߡߊ߬ߞߐ߬ߙߐ߲߬ߞߐ߬ߙߐ߲߬ߠߌ ߞߏߕߌ߮ ߣߴߊ߬ ߣߐ߬ߝߍ߬ ߖߡߊ ߟߊ߫ ߸ ߏ߬ ߟߎ߬ ߡߍ߲ ߠߎ߫ ߣߊ߬ ߘߊ߫ +ߞߏߕߌ߯ ߟߎ߬ ߞߊ߲ߕߌ߮ ߞߐߦߌ߬ߘߊ߬، ߞߊ߬ ߕߐ߬ߣߐ߫ ߛߐ߬ߘߐ߲߬ ߞߣߊߘߊ߫ ߟߊ߬ߛߌ߰ߘߋ߲ ߝߣߊ߫ ߟߊ߫ ߣߊ߬ߟߌ ߣߌ߫ ߜߙߋ߫ ߜߘߍ ߘߎ߰ߙߋ߲߫ ߣߊ߬ߓߊ߮ ߟߎ߬ ߟߊ߫. + +ߕߋ߬ߟߋ߫ ߛߓߊ߬ ߖߊ߬ߣߍ߲߬ ߓߊ߯ߙߊ ߘߝߊߣߍ߲ ߞߐ߫ ߸ ߞߎ߲߬ߜߙߊ ߕߘߍ߬ߒ߬ߘߐ߬ߓߊ߰ߕߐ ߟߎ߫ ߓߍ߲߬ ߘߊ߫ ߞߊ߲߫ ߣߊ߬ߕߐ ߢߌ߲߬ ߠߎ߫ ߡߊ߬ : + +• ߕߟߋ߬ߓߊ߮ ߛߋߒߞߏߟߦߊ ߣߌ߫ ߟߐ߲ߕߊ ( ߕ.ߛ.ߟ. ICT ) ߘߊ߲߬ߠߊߕߍ߭ ߥߊߟߌ߫ ߞߊ߲߫ ߞߋߟߋ߲߫ ߡߊ߬ ߕߋ߲߬ ߸ ߏ߬ ߦߋ߫ ߡߌ߬ߙߌ߲߬ߘߌ ߟߎ߬ ߢߐ߲߯ +ߕߍ߫ ߞߣߍ ߝߏ߬ߣߊ߲ ߥߙߊ߬ ߟߊ߫ ߟߋ߬، ߞߊ߬ ߕߟߋ߬ߓߊ߮ ߟߐ߲ߠߌ߲ ߓߊߓߋ߭ ߥߎ߬ߛߎ ߖߊ߲߬ߧߊ߫ ߸ ߞߵߊ߬ ߞߊ߬ߙߊ߲ ߣߴߊ߬ ߘߊ ߜߟߍ߬ߦߊ߫، ߞߊ߬ߕߎ߯ ߸ ߊ߬ +ߘߌ߫ ߦߙߐ ߟߐ߲ߠߌ߲ߧߊ ߝߣߊ߫ ߖߐ߲ߝߐ߲߫ ߞߏߛߓߍ߫. \ No newline at end of file diff --git a/utils/test-opentype-language.markup b/utils/test-opentype-language.markup new file mode 100644 index 0000000..3d956aa --- /dev/null +++ b/utils/test-opentype-language.markup @@ -0,0 +1,6 @@ +Rendering U+0431 CYRILLIC SMALL LETTER BE +using DejaVu Sans: + +Russian: б +Serbian: б + diff --git a/utils/test-syriac.txt b/utils/test-syriac.txt new file mode 100644 index 0000000..05fedc7 --- /dev/null +++ b/utils/test-syriac.txt @@ -0,0 +1,18 @@ +ܠܫܢܢ +ܒܝܕܦܪܝܕܐ ܒܢܝܡܝܢ ܐܕܡ + +ܐܬܐܡܘܢ ܥܠܝܡܢ ܘܥܠܝܡܬܢ +ܠܫܢܢ ܡܪܢܝܐ +ܦܪܝܣܐ ܡܕܘܪܐ ܩܕܡܝܐ + +ܠܫܢܢ ܝܠܗ ܐܝܬܘܬܢ +ܘܬܘܕܝܬܢ ܘܣܦܪܝܘܬܢ +ܝܠܦܚܠܗ ܒܟܠ ܫܘܒ݂ܗܪܐ + +ܡܒܘܥܐ ܗܘܐ ܕܝܘܠܦܢܐ +ܚܠܝܐ ܒܪܬܡܐ ܘܩܪܝܢܐ +ܬܓ݂ܐ ܝܠܗ ܠܪܫܢ ܪܡܐ + +ܡܠܦܢܢ ܐܢܝ ܓܢܒܪܐ +ܡܫܘܬܐܣܠܗܘܢ ܡܕܪܫܝܬܐ +ܡܫܘܬܐܣܠܗܘܢ ܓܘ ܐܡܘܬܐ diff --git a/utils/test-tamil.txt b/utils/test-tamil.txt new file mode 100644 index 0000000..ff080a2 --- /dev/null +++ b/utils/test-tamil.txt @@ -0,0 +1,13 @@ +முருகன் அல்லது அழகு +திரு வி.க. + + குமரகுருபரர் + +உலகு குளிர எமது மதியில் ஒழுகு மமுத கிரணமே + உருகு மடிய ரிதய நெகிழ உணர்வி லெழுந லுதயமே +கலையு நிறைவு மறிவு முதிர முதிரு மதுர நறவமே + கழுவு துகளர் முழுக நெடிய கருணை பெருகு சலதியே +அலகில் புவன முடியும் வெளியில் அளியு மொளியி னிலயமே + அறிவு ளறிவை யறிவு மவரும் அறிய வரிய பிரமமே +மலையின் மகள்கண் மணியை யனைய மதலை வருக வருகவே + வளமை தழுவு பரிதி புரியின் மருவு குமரன் வருகவே diff --git a/utils/test-thai.txt b/utils/test-thai.txt new file mode 100644 index 0000000..4bb8d2e --- /dev/null +++ b/utils/test-thai.txt @@ -0,0 +1,11 @@ +ลำดับนั้น เทวดากล่าวคาถากะพระมหาสัตว์ว่า: + +“การงานอันใด ยังไม่ถึงที่สุดด้วยความพยายาม การงานอันนั้นก็ไร้ผล มีความลำบากเกิดขึ้น การทำความพยายามในฐานะอันไม่สมควรใด จนความตายปรากฏขึ้น ความพยายามในฐานะอันไม่สมควรนั้น จะมีประโยชน์อะไร” + +เมื่อนางมณีเมขลากล่าวอย่างนี้แล้ว พระมหาสัตว์เมื่อจะทำนางมณีเมขลาให้จำนนต่อถ้อยคำ จึงได้ตรัสคาถาต่อไปว่า: + +“ดูก่อนเทวดา ผู้ใดรู้แจ้งการงานที่ทำจะไม่ลุล่วงไปได้จริง ๆ ชื่อว่าไม่รักษาชีวิตของตน ถ้าผู้นั้นละความเพียรในฐานะเช่นนั้นเสีย ก็จะพึงรู้ผลแห่งความเกียจคร้าน ดูก่อนเทวดา คนบางพวกในโลกนี้เห็นผลแห่งความประสงค์ของตน จึงประกอบการงานทั้งหลาย การงานเหล่านั้นจะสำเร็จหรือไม่ก็ตาม ดูก่อนเทวดา ท่านก็เห็นผลแห่งกรรมประจักษ์แก่ตนแล้วมิใช่หรือ คนอื่น ๆ จมในมหาสมุทรหมด เราคนเดียวยังว่ายข้ามอยู่ และได้เห็น ท่าน มาสถิตอยู่ใกล้ ๆ เรา เรานั้นจักพยายามตามสติกำลัง จักทำความเพียรที่บุรุษควรทำ ไปให้ถึงฝั่งแห่งมหาสมุทร” + +-- +พระมหาชนก +พระราชนิพนธ์ พระบาทสมเด็จพระเจ้าอยู่หัว ภูมิพลอดุลยเดชฯ diff --git a/utils/test-tibetan.txt b/utils/test-tibetan.txt new file mode 100644 index 0000000..83d44aa --- /dev/null +++ b/utils/test-tibetan.txt @@ -0,0 +1,12 @@ +Regular letters འབྲུག་རྒྱལ་ཁབ་འདི་དགའ་ཏོག་ཏོ་ཡོད། +Reordering of Digits ༡༿༢༿༣༿ Illegal ཀ༿ སྐ༿༾ +Digits with other combining marks ༡༾༢༘༤༥༦ Illegal ཀ༘ཁ༙སྐ༘༙ +Tsa phru after base ཀ༹ Illegal ཀྱུ༹ ཀི༹ +Tsa phru after subjoined སྐ༹ རྒྱ༹ +A-Chung ཀཱ ཀྲཱ གླཱ གྱཱ༹ Illegal ཀཱུ ཀཱི +Halanta ཀ྄ ཀ྄ཱ སྐ྄ སྐྱ྄ +Vowels ཀྱུ སྐྱིུ ཀྀ ཀེ ཀོ ལྐཻ ཀཽ +Anusvara ཀུཾ ཀིཾ ཀཾི ཀིཾ ཀཾིཾ +Visaraga ཀཿ Illegal ཀ༵ཿ +Lower Stress Mark ཀ༷ ཀཱ༵ +Candrabindu ཀྃ ཀིྃ Illegal ཀིྃ diff --git a/utils/viewer-cairo.c b/utils/viewer-cairo.c new file mode 100644 index 0000000..ca98c1c --- /dev/null +++ b/utils/viewer-cairo.c @@ -0,0 +1,367 @@ +/* viewer-cairo.c: Common code for Cairo-based viewers + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" + +#include "viewer-cairo.h" +#include "viewer-render.h" + +#include + +#include + + + +#ifdef HAVE_CAIRO_XLIB +#ifdef HAVE_XFT +#include "viewer-x.h" +#include + +static cairo_surface_t * +cairo_x_view_iface_create_surface (gpointer instance, + gpointer surface, + int width, + int height) +{ + XViewer *x = (XViewer *)instance; + Drawable drawable = (Drawable) surface; + + return cairo_xlib_surface_create (x->display, drawable, + DefaultVisual (x->display, x->screen), + width, height); +} + +static void +cairo_x_view_iface_paint_background (gpointer instance G_GNUC_UNUSED, + cairo_t *cr) +{ + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_paint (cr); + + if (opt_bg_set) + { + cairo_set_source_rgba (cr, + opt_bg_color.red / 65535., + opt_bg_color.green / 65535., + opt_bg_color.blue / 65535., + opt_bg_alpha / 65535.); + cairo_paint (cr); + } +} + +static CairoViewerIface cairo_x_viewer_iface = { + &x_viewer, + cairo_x_view_iface_create_surface, + cairo_x_view_iface_paint_background +}; +#endif /* HAVE_XFT */ +#endif /* HAVE_CAIRO_XLIB */ + + + + +static cairo_surface_t * +cairo_view_iface_create_surface (gpointer instance, + gpointer surface, + int width, + int height) +{ + return cairo_surface_reference (surface); +} + + + +static gpointer +cairo_image_view_create (const PangoViewer *klass G_GNUC_UNUSED) +{ + return NULL; +} + +static void +cairo_image_view_destroy (gpointer instance G_GNUC_UNUSED) +{ +} + +static gpointer +cairo_image_view_create_surface (gpointer instance, + int width, + int height) +{ + cairo_t *cr; + cairo_surface_t *surface; + + /* TODO: Be smarter about format? */ + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); + + cr = cairo_create (surface); + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_paint (cr); + cairo_destroy (cr); + + return surface; +} + +static void +cairo_image_view_destroy_surface (gpointer instance, + gpointer surface) +{ + cairo_surface_destroy (surface); +} + +const PangoViewer cairo_image_viewer = { + "CairoImage", + NULL, + NULL, + cairo_image_view_create, + cairo_image_view_destroy, + NULL, + cairo_image_view_create_surface, + cairo_image_view_destroy_surface, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +static void +cairo_image_view_iface_paint_background (gpointer instance G_GNUC_UNUSED, + cairo_t *cr) +{ + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_paint (cr); + + if (opt_bg_set) + { + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + cairo_set_source_rgba (cr, + opt_bg_color.red / 65535., + opt_bg_color.green / 65535., + opt_bg_color.blue / 65535., + opt_bg_alpha / 65535.); + cairo_paint (cr); + } +} + +static CairoViewerIface cairo_image_viewer_iface = { + &cairo_image_viewer, + cairo_view_iface_create_surface, + cairo_image_view_iface_paint_background +}; + + + + +#ifdef CAIRO_HAS_SVG_SURFACE +# include +#endif +#ifdef CAIRO_HAS_PDF_SURFACE +# include +#endif +#ifdef CAIRO_HAS_PS_SURFACE +# include +# if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0) +# define HAS_EPS 1 + +static cairo_surface_t * +_cairo_eps_surface_create (const char *filename, + double width, + double height) +{ + cairo_surface_t *surface; + + surface = cairo_ps_surface_create (filename, width, height); + cairo_ps_surface_set_eps (surface, TRUE); + + return surface; +} + +# else +# undef HAS_EPS +# endif +#endif + +typedef cairo_surface_t *(*CairoVectorFileCreateFunc) (const char *filename, + double width, + double height); + +typedef struct +{ + const char *filename; + CairoVectorFileCreateFunc constructor; +} CairoVectorViewer; + +static gpointer +cairo_vector_view_create (const PangoViewer *klass G_GNUC_UNUSED) +{ + const char *extension = NULL; + CairoVectorFileCreateFunc constructor = NULL; + + if (opt_output) + { + extension = strrchr (opt_output, '.'); + if (extension) + extension++; /* skip the dot */ + } + + if (!extension) + return NULL; + + if (0) + ; + #ifdef CAIRO_HAS_SVG_SURFACE + else if (0 == g_ascii_strcasecmp (extension, "svg")) + constructor = cairo_svg_surface_create; + #endif + #ifdef CAIRO_HAS_PDF_SURFACE + else if (0 == g_ascii_strcasecmp (extension, "pdf")) + constructor = cairo_pdf_surface_create; + #endif + #ifdef CAIRO_HAS_PS_SURFACE + else if (0 == g_ascii_strcasecmp (extension, "ps")) + constructor = cairo_ps_surface_create; + #ifdef HAS_EPS + else if (0 == g_ascii_strcasecmp (extension, "eps")) + constructor = _cairo_eps_surface_create; + #endif + #endif + + if (constructor) + { + CairoVectorViewer *instance; + + instance = g_slice_new (CairoVectorViewer); + + /* save output filename and unset it such that the viewer layer + * doesn't try to save to file. + */ + instance->filename = opt_output; + opt_output = NULL; + + instance->constructor = constructor; + + /* Fix dpi on 72. That's what cairo vector surfaces are. */ + opt_dpi = 72; + + return instance; + } + + return NULL; +} + +static void +cairo_vector_view_destroy (gpointer instance G_GNUC_UNUSED) +{ + CairoVectorViewer *c = (CairoVectorViewer *) instance; + + g_slice_free (CairoVectorViewer, c); +} + +static gpointer +cairo_vector_view_create_surface (gpointer instance, + int width, + int height) +{ + CairoVectorViewer *c = (CairoVectorViewer *) instance; + cairo_surface_t *surface; + + surface = c->constructor (c->filename, width, height); + + /*cairo_surface_set_fallback_resolution (surface, fallback_resolution_x, fallback_resolution_y);*/ + + return surface; +} + +static void +cairo_vector_view_destroy_surface (gpointer instance, + gpointer surface) +{ + /* TODO: check for errors */ + cairo_surface_destroy (surface); +} + +const PangoViewer cairo_vector_viewer = { + "CairoFile", + NULL, + NULL, + cairo_vector_view_create, + cairo_vector_view_destroy, + NULL, + cairo_vector_view_create_surface, + cairo_vector_view_destroy_surface, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +static void +cairo_vector_view_iface_paint_background (gpointer instance G_GNUC_UNUSED, + cairo_t *cr) +{ + if (opt_bg_set) + { + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + cairo_set_source_rgba (cr, + opt_bg_color.red / 65535., + opt_bg_color.green / 65535., + opt_bg_color.blue / 65535., + opt_bg_alpha / 65535.); + cairo_paint (cr); + } +} + +static CairoViewerIface cairo_vector_viewer_iface = { + &cairo_vector_viewer, + cairo_view_iface_create_surface, + cairo_vector_view_iface_paint_background +}; + + + +gpointer +cairo_viewer_iface_create (const CairoViewerIface **iface) +{ + gpointer ret; + + *iface = &cairo_vector_viewer_iface; + ret = (*iface)->backend_class->create ((*iface)->backend_class); + if (ret) + return ret; + +#ifdef HAVE_CAIRO_XLIB +#ifdef HAVE_XFT + if (opt_display) + { + *iface = &cairo_x_viewer_iface; + return (*iface)->backend_class->create ((*iface)->backend_class); + } +#endif /* HAVE_XFT */ +#endif /* HAVE_CAIRO_XLIB */ + + *iface = &cairo_image_viewer_iface; + return (*iface)->backend_class->create ((*iface)->backend_class); +} + +void +cairo_viewer_add_options (GOptionGroup *group G_GNUC_UNUSED) +{ +} diff --git a/utils/viewer-cairo.h b/utils/viewer-cairo.h new file mode 100644 index 0000000..e843664 --- /dev/null +++ b/utils/viewer-cairo.h @@ -0,0 +1,47 @@ +/* viewer-cairo.h: Common headers for Cairo-based viewers + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef VIEWER_CAIRO_H +#define VIEWER_CAIRO_H + +#include + +#include "viewer.h" + +typedef struct _CairoViewerIface CairoViewerIface; + +struct _CairoViewerIface +{ + const PangoViewer *backend_class; + + cairo_surface_t * (*create_surface) (gpointer instance, + gpointer surface, + int width, + int height); + + void (*paint_background) (gpointer instance, + cairo_t *cr); +}; + +gpointer cairo_viewer_iface_create (const CairoViewerIface **iface_out); + +void cairo_viewer_add_options (GOptionGroup *group); + +#endif /* VIEWER_CAIRO_H */ diff --git a/utils/viewer-main.c b/utils/viewer-main.c new file mode 100644 index 0000000..525599a --- /dev/null +++ b/utils/viewer-main.c @@ -0,0 +1,182 @@ +/* viewer-main.c: Main routine for viewers + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * Copyright (C) 2006 Behdad Esfahbod + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" +#include +#include +#include +#include +#include + +#include +#include + +#ifdef G_OS_UNIX +#include +#endif + +#include "viewer.h" +#include "viewer-render.h" + +int +main (int argc, + char **argv) +{ + const PangoViewer *view; + gpointer instance; + PangoContext *context; + int run; + int width, height; + gpointer surface; + +#if !GLIB_CHECK_VERSION (2, 35, 3) + g_type_init(); +#endif + g_set_prgname ("pango-view"); + setlocale (LC_ALL, ""); + parse_options (argc, argv); + + view = opt_viewer; + + g_assert (view->id); + + instance = view->create (view); + context = view->get_context (instance); + width = height = 1; + surface = view->create_surface (instance, width, height); + view->render (instance, surface, context, &width, &height, NULL); + view->destroy_surface (instance, surface); + surface = view->create_surface (instance, width, height); + for (run = 0; run < MAX(1,opt_runs); run++) + view->render (instance, surface, context, &width, &height, NULL); + + if (opt_output) + { + if (!view->write) + fail ("%s viewer backend does not support writing", view->name); + else + { + FILE *stream; + GPid pid = 0; + + if (view->write_suffix && g_str_has_suffix (opt_output, view->write_suffix)) + { + stream = g_fopen (opt_output, "wb"); + if (!stream) + fail ("Cannot open output file %s: %s\n", + opt_output, g_strerror (errno)); + } + else + { + int fd; + const gchar *convert_argv[4] = {"convert", "-", "%s"}; + GError *error; + + convert_argv[2] = opt_output; + + if (!g_spawn_async_with_pipes (NULL, (gchar **)(void*)convert_argv, NULL, + G_SPAWN_DO_NOT_REAP_CHILD | + G_SPAWN_SEARCH_PATH | + G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, &pid, &fd, NULL, NULL, &error)) + fail ("When running ImageMagick 'convert' command: %s\n", error->message); + stream = fdopen (fd, "wb"); + } + view->write (instance, surface, stream, width, height); + fclose (stream); +#ifdef G_OS_UNIX + if (pid) + waitpid (pid, NULL, 0); +#endif + } + } + + if (opt_display) + { + char *title; + title = get_options_string (); + + if (view->display) + { + gpointer window = NULL; + gpointer state = NULL; + + if (view->create_window) + { + window = view->create_window (instance, title, width, height); + if (!window) + goto no_display; + } + + opt_display = FALSE; + while (1) + { + state = view->display (instance, surface, window, width, height, state); + if (state == GINT_TO_POINTER (-1)) + break; + + view->render (instance, surface, context, &width, &height, state); + } + + if (view->destroy_window) + view->destroy_window (instance, window); + } +no_display: + + /* If failed to display natively, call ImageMagick */ + if (opt_display) + { + int fd; + FILE *stream; + const gchar *display_argv[5] = {"display", "-title", "%s", "-"}; + GError *error = NULL; + GPid pid; + + if (!view->write) + fail ("%s viewer backend does not support displaying or writing", view->name); + display_argv[2] = title; + + if (!g_spawn_async_with_pipes (NULL, (gchar **)(void*)display_argv, NULL, + G_SPAWN_DO_NOT_REAP_CHILD | + G_SPAWN_SEARCH_PATH | + G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, &pid, &fd, NULL, NULL, &error)) + fail ("When running ImageMagick 'display' command: %s\n", error->message); + stream = fdopen (fd, "wb"); + view->write (instance, surface, stream, width, height); + fclose (stream); +#ifdef G_OS_UNIX + waitpid (pid, NULL, 0); +#endif + g_spawn_close_pid (pid); + } + + g_free (title); + } + + view->destroy_surface (instance, surface); + g_object_unref (context); + view->destroy (instance); + finalize (); + return 0; +} diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c new file mode 100644 index 0000000..3e89320 --- /dev/null +++ b/utils/viewer-pangocairo.c @@ -0,0 +1,462 @@ +/* viewer-pangocairo.c: PangoCairo viewer backend. + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "viewer-render.h" +#include "viewer-cairo.h" + +#include + +static int opt_annotate = 0; + +typedef struct +{ + const CairoViewerIface *iface; + + gpointer backend; + + PangoFontMap *fontmap; + cairo_font_options_t *font_options; +} CairoViewer; + +static gpointer +pangocairo_view_create (const PangoViewer *klass G_GNUC_UNUSED) +{ + CairoViewer *instance; + + instance = g_slice_new (CairoViewer); + + instance->backend = cairo_viewer_iface_create (&instance->iface); + + instance->fontmap = pango_cairo_font_map_new (); + pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (instance->fontmap), opt_dpi); + + instance->font_options = cairo_font_options_create (); + if (opt_hinting != HINT_DEFAULT) + { + if (opt_hinting == HINT_NONE) + cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_NONE); + else if (opt_hinting == HINT_FULL) + cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_FULL); + } + + return instance; +} + +static void +pangocairo_view_destroy (gpointer instance) +{ + CairoViewer *c = (CairoViewer *) instance; + + cairo_font_options_destroy (c->font_options); + + g_object_unref (c->fontmap); + + c->iface->backend_class->destroy (c->backend); + + cairo_debug_reset_static_data (); + + g_slice_free (CairoViewer, c); +} + +static PangoContext * +pangocairo_view_get_context (gpointer instance) +{ + CairoViewer *c = (CairoViewer *) instance; + PangoContext *context; + + context = pango_font_map_create_context (c->fontmap); + pango_cairo_context_set_font_options (context, c->font_options); + + return context; +} + +typedef struct +{ + gpointer backend; + + cairo_surface_t *cairo; +} CairoSurface; + +static gpointer +pangocairo_view_create_surface (gpointer instance, + int width, + int height) +{ + CairoViewer *c = (CairoViewer *) instance; + CairoSurface *surface; + + surface = g_slice_new (CairoSurface); + + surface->backend = c->iface->backend_class->create_surface (c->backend, + width, height); + + surface->cairo = c->iface->create_surface (c->backend, + surface->backend, + width, height); + + return surface; +} + +static void +pangocairo_view_destroy_surface (gpointer instance, + gpointer surface) +{ + CairoViewer *c = (CairoViewer *) instance; + CairoSurface *c_surface = (CairoSurface *) surface; + + c->iface->backend_class->destroy_surface (c->backend, c_surface->backend); + cairo_surface_destroy (c_surface->cairo); + + g_slice_free (CairoSurface, surface); +} + +static void +render_callback (PangoLayout *layout, + int x, + int y, + gpointer context, + gpointer state) +{ + cairo_t *cr = (cairo_t *) context; + int annotate = (GPOINTER_TO_INT (state) + opt_annotate) % 3; + + cairo_save (cr); + cairo_translate (cr, x, y); + + if (annotate) + { + cairo_pattern_t *pattern; + PangoRectangle ink, logical; + double lw = cairo_get_line_width (cr); + PangoLayoutIter* iter; + + pango_layout_get_extents (layout, &ink, &logical); + + if (annotate >= 2) + { + /* draw resolved gravity "roof" in blue */ + cairo_save (cr); + cairo_translate (cr, + (double)logical.x / PANGO_SCALE, + (double)logical.y / PANGO_SCALE); + cairo_scale (cr, + (double)logical.width / PANGO_SCALE * 0.5, + (double)logical.height / PANGO_SCALE * 0.5); + cairo_translate (cr, 1.0, 1.0); + cairo_rotate (cr, + pango_gravity_to_rotation ( + pango_context_get_gravity ( + pango_layout_get_context (layout)))); + cairo_move_to (cr, -1.0, -1.0); + cairo_rel_line_to (cr, +1.0, -0.2); /* / */ + cairo_rel_line_to (cr, +1.0, +0.2); /* \ */ + cairo_close_path (cr); /* - */ + pattern = cairo_pattern_create_linear (0, -1.0, 0, -1.2); + cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0.0, 1.0, 0.0); + cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0.0, 1.0, 0.15); + cairo_set_source (cr, pattern); + cairo_fill (cr); + /* once more, without close_path this time */ + cairo_move_to (cr, -1.0, -1.0); + cairo_rel_line_to (cr, +1.0, -0.2); /* / */ + cairo_rel_line_to (cr, +1.0, +0.2); /* \ */ + /* silly line_width is not locked :(. get rid of scale. */ + cairo_restore (cr); + cairo_save (cr); + cairo_set_source_rgba (cr, 0.0, 0.0, 0.7, 0.2); + cairo_stroke (cr); + cairo_restore (cr); + + + /* draw block progression arrow in green */ + cairo_save (cr); + cairo_translate (cr, + (double)logical.x / PANGO_SCALE, + (double)logical.y / PANGO_SCALE); + cairo_scale (cr, + (double)logical.width / PANGO_SCALE * 0.5, + (double)logical.height / PANGO_SCALE * 0.5); + cairo_translate (cr, 1.0, 1.0); + cairo_move_to (cr, -0.4, -0.7); + cairo_rel_line_to (cr, +0.8, 0.0); /* -- */ + cairo_rel_line_to (cr, 0.0, +0.9); /* | */ + cairo_rel_line_to (cr, +0.4, 0.0); /* - */ + cairo_rel_line_to (cr, -0.8, +0.5); /* / */ + cairo_rel_line_to (cr, -0.8, -0.5); /* \ */ + cairo_rel_line_to (cr, +0.4, 0.0); /* - */ + cairo_close_path (cr); /* | */ + pattern = cairo_pattern_create_linear (0, -0.7, 0, 0.7); + cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 1.0, 0.0, 0.0); + cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 1.0, 0.0, 0.15); + cairo_set_source (cr, pattern); + cairo_fill_preserve (cr); + /* silly line_width is not locked :(. get rid of scale. */ + cairo_restore (cr); + cairo_save (cr); + cairo_set_source_rgba (cr, 0.0, 0.7, 0.0, 0.2); + cairo_stroke (cr); + cairo_restore (cr); + } + + /* draw baselines with line direction arrow in orange */ + cairo_save (cr); + cairo_set_source_rgba (cr, 1.0, 0.5, 0.0, 0.5); + iter = pango_layout_get_iter (layout); + do + { + PangoLayoutLine *line = pango_layout_iter_get_line (iter); + double width = (double)logical.width / PANGO_SCALE; + + y = pango_layout_iter_get_baseline (iter); + cairo_save (cr); + cairo_translate (cr, + (double)logical.x / PANGO_SCALE + width * 0.5, + (double)y / PANGO_SCALE); + if (line->resolved_dir) + cairo_scale (cr, -1, 1); + cairo_move_to (cr, -width * .5, -lw*0.2); + cairo_rel_line_to (cr, +width * .9, -lw*0.3); + cairo_rel_line_to (cr, 0, -lw); + cairo_rel_line_to (cr, +width * .1, +lw*1.5); + cairo_rel_line_to (cr, -width * .1, +lw*1.5); + cairo_rel_line_to (cr, 0, -lw); + cairo_rel_line_to (cr, -width * .9, -lw*0.3); + cairo_close_path (cr); + cairo_fill (cr); + cairo_restore (cr); + } + while (pango_layout_iter_next_line (iter)); + pango_layout_iter_free (iter); + cairo_restore (cr); + + /* draw the logical rect in red */ + cairo_save (cr); + cairo_set_source_rgba (cr, 1.0, 0.0, 0.0, 0.5); + cairo_rectangle (cr, + (double)logical.x / PANGO_SCALE - lw / 2, + (double)logical.y / PANGO_SCALE - lw / 2, + (double)logical.width / PANGO_SCALE + lw, + (double)logical.height / PANGO_SCALE + lw); + cairo_stroke (cr); + cairo_restore (cr); + + /* draw the ink rect in green */ + cairo_save (cr); + cairo_set_source_rgba (cr, 0.0, 1.0, 0.0, 0.5); + cairo_rectangle (cr, + (double)ink.x / PANGO_SCALE - lw / 2, + (double)ink.y / PANGO_SCALE - lw / 2, + (double)ink.width / PANGO_SCALE + lw, + (double)ink.height / PANGO_SCALE + lw); + cairo_stroke (cr); + cairo_restore (cr); + } + + cairo_move_to (cr, 0, 0); + pango_cairo_show_layout (cr, layout); + + cairo_restore (cr); + + cairo_surface_flush (cairo_get_target (cr)); +} + +static void +transform_callback (PangoContext *context, + PangoMatrix *matrix, + gpointer cr_context, + gpointer state G_GNUC_UNUSED) +{ + cairo_t *cr = (cairo_t *)cr_context; + cairo_matrix_t cairo_matrix; + + if (matrix) + { + cairo_matrix.xx = matrix->xx; + cairo_matrix.yx = matrix->yx; + cairo_matrix.xy = matrix->xy; + cairo_matrix.yy = matrix->yy; + cairo_matrix.x0 = matrix->x0; + cairo_matrix.y0 = matrix->y0; + } + else + { + cairo_matrix_init_identity (&cairo_matrix); + } + + cairo_set_matrix (cr, &cairo_matrix); + + pango_cairo_update_context (cr, context); +} + +static void +pangocairo_view_render (gpointer instance, + gpointer surface, + PangoContext *context, + int *width, + int *height, + gpointer state) +{ + CairoViewer *c = (CairoViewer *) instance; + cairo_t *cr; + CairoSurface *c_surface = (CairoSurface *) surface; + + g_assert (surface); + + cr = cairo_create (c_surface->cairo); + + transform_callback (context, NULL, cr, state); + + c->iface->paint_background (instance, cr); + + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + cairo_set_source_rgba (cr, + opt_fg_color.red / 65535., + opt_fg_color.green / 65535., + opt_fg_color.blue / 65535., + opt_fg_alpha / 65535.); + + do_output (context, render_callback, transform_callback, cr, state, width, height); + + cairo_destroy (cr); +} + +#ifdef HAVE_CAIRO_PNG +static cairo_status_t +write_func (void *closure, + const unsigned char *data, + unsigned int length) +{ + FILE *stream = (FILE *) closure; + unsigned int l; + + l = fwrite (data, 1, length, stream); + + return l == length ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_WRITE_ERROR; +} + +static void +pangocairo_view_write (gpointer instance G_GNUC_UNUSED, + gpointer surface, + FILE *stream, + int width G_GNUC_UNUSED, + int height G_GNUC_UNUSED) +{ + CairoSurface *c_surface = (CairoSurface *) surface; + + cairo_surface_write_to_png_stream (c_surface->cairo, write_func, stream); +} +#endif + +static gpointer +pangocairo_view_create_window (gpointer instance, + const char *title, + int width, + int height) +{ + CairoViewer *c = (CairoViewer *) instance; + + if (!c->iface->backend_class->create_window) + return NULL; + + return c->iface->backend_class->create_window (c->backend, + title, + width, height); +} + +static void +pangocairo_view_destroy_window (gpointer instance, + gpointer window) +{ + CairoViewer *c = (CairoViewer *) instance; + + c->iface->backend_class->destroy_window (c->backend, + window); +} + +static gpointer +pangocairo_view_display (gpointer instance, + gpointer surface, + gpointer window, + int width, int height, + gpointer state) +{ + CairoViewer *c = (CairoViewer *) instance; + CairoSurface *c_surface = (CairoSurface *) surface; + + return c->iface->backend_class->display (c->backend, + c_surface->backend, + window, + width, height, + state); +} + +static GOptionGroup * +pangocairo_view_get_option_group (const PangoViewer *klass G_GNUC_UNUSED) +{ + GOptionEntry entries[] = + { + {"annotate", 0, 0, G_OPTION_ARG_INT, &opt_annotate, + "Annotate the output", "1 or 2"}, + {NULL} + }; + GOptionGroup *group; + + group = g_option_group_new ("cairo", + "Cairo backend options:", + "Options understood by the cairo backend", + NULL, + NULL); + + g_option_group_add_entries (group, entries); + + cairo_viewer_add_options (group); + + return group; +} + +const PangoViewer pangocairo_viewer = { + "PangoCairo", + "cairo", +#ifdef HAVE_CAIRO_PNG + "png", +#else + NULL, +#endif + pangocairo_view_create, + pangocairo_view_destroy, + pangocairo_view_get_context, + pangocairo_view_create_surface, + pangocairo_view_destroy_surface, + pangocairo_view_render, +#ifdef HAVE_CAIRO_PNG + pangocairo_view_write, +#else + NULL, +#endif + pangocairo_view_create_window, + pangocairo_view_destroy_window, + pangocairo_view_display, + NULL, + NULL, + pangocairo_view_get_option_group +}; diff --git a/utils/viewer-pangoft2.c b/utils/viewer-pangoft2.c new file mode 100644 index 0000000..87973c8 --- /dev/null +++ b/utils/viewer-pangoft2.c @@ -0,0 +1,162 @@ +/* viewer-pangoft2.c: PangoFT2 viewer backend. + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "viewer-render.h" +#include "viewer.h" + +#include + +static void +substitute_func (FcPattern *pattern, + gpointer data G_GNUC_UNUSED) +{ + if (opt_hinting != HINT_DEFAULT) + { + FcPatternDel (pattern, FC_HINTING); + FcPatternAddBool (pattern, FC_HINTING, opt_hinting != HINT_NONE); + + FcPatternDel (pattern, FC_AUTOHINT); + FcPatternAddBool (pattern, FC_AUTOHINT, opt_hinting == HINT_AUTO); + } +} + +static gpointer +pangoft2_view_create (const PangoViewer *klass G_GNUC_UNUSED) +{ + PangoFontMap *fontmap; + fontmap = pango_ft2_font_map_new (); + + pango_ft2_font_map_set_resolution (PANGO_FT2_FONT_MAP (fontmap), opt_dpi, opt_dpi); + pango_ft2_font_map_set_default_substitute (PANGO_FT2_FONT_MAP (fontmap), substitute_func, NULL, NULL); + + return fontmap; +} + +static void +pangoft2_view_destroy (gpointer instance) +{ + g_object_unref (instance); +} + +static PangoContext * +pangoft2_view_get_context (gpointer instance) +{ + return pango_font_map_create_context (PANGO_FONT_MAP (instance)); +} + +static gpointer +pangoft2_view_create_surface (gpointer instance G_GNUC_UNUSED, + int width, + int height) +{ + FT_Bitmap *bitmap; + + bitmap = g_slice_new (FT_Bitmap); + bitmap->width = width; + bitmap->pitch = (bitmap->width + 3) & ~3; + bitmap->rows = height; + bitmap->buffer = g_malloc (bitmap->pitch * bitmap->rows); + bitmap->num_grays = 256; + bitmap->pixel_mode = ft_pixel_mode_grays; + memset (bitmap->buffer, 0x00, bitmap->pitch * bitmap->rows); + + return bitmap; +} + +static void +pangoft2_view_destroy_surface (gpointer instance G_GNUC_UNUSED, + gpointer surface) +{ + FT_Bitmap *bitmap = (FT_Bitmap *) surface; + + g_free (bitmap->buffer); + g_slice_free (FT_Bitmap, bitmap); +} + +static void +render_callback (PangoLayout *layout, + int x, + int y, + gpointer context, + gpointer state G_GNUC_UNUSED) +{ + pango_ft2_render_layout ((FT_Bitmap *)context, + layout, + x, y); +} + +static void +pangoft2_view_render (gpointer instance G_GNUC_UNUSED, + gpointer surface, + PangoContext *context, + int *width, + int *height, + gpointer state) +{ + int pix_idx; + FT_Bitmap *bitmap = (FT_Bitmap *) surface; + + do_output (context, render_callback, NULL, surface, state, width, height); + + for (pix_idx=0; pix_idxpitch * bitmap->rows; pix_idx++) + bitmap->buffer[pix_idx] = 255 - bitmap->buffer[pix_idx]; +} + +static void +pangoft2_view_write (gpointer instance G_GNUC_UNUSED, + gpointer surface, + FILE *stream, + int width, + int height) +{ + int row; + FT_Bitmap *bitmap = (FT_Bitmap *) surface; + + /* Write it as pgm to output */ + fprintf(stream, + "P5\n" + "%d %d\n" + "255\n", width, height); + for (row = 0; row < height; row++) + fwrite (bitmap->buffer + row * bitmap->pitch, 1, width, stream); +} + +const PangoViewer pangoft2_viewer = { + "PangoFT2", + "ft2", + ".pgm", + pangoft2_view_create, + pangoft2_view_destroy, + pangoft2_view_get_context, + pangoft2_view_create_surface, + pangoft2_view_destroy_surface, + pangoft2_view_render, + pangoft2_view_write, + NULL, + NULL, + NULL +}; diff --git a/utils/viewer-pangoxft.c b/utils/viewer-pangoxft.c new file mode 100644 index 0000000..948cd90 --- /dev/null +++ b/utils/viewer-pangoxft.c @@ -0,0 +1,154 @@ +/* viewer-pangoxft.c: PangoXft viewer backend. + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" + +#include "viewer-render.h" +#include "viewer-x.h" + +#include + +static void +default_substitute (FcPattern *pattern, + gpointer data G_GNUC_UNUSED) +{ + FcPatternDel (pattern, FC_DPI); + FcPatternAddInteger (pattern, FC_DPI, opt_dpi); + + if (opt_hinting != HINT_DEFAULT) + { + FcPatternDel (pattern, FC_HINTING); + FcPatternAddBool (pattern, FC_HINTING, opt_hinting != HINT_NONE); + + FcPatternDel (pattern, FC_AUTOHINT); + FcPatternAddBool (pattern, FC_AUTOHINT, opt_hinting == HINT_AUTO); + } +} + +static gpointer +pangoxft_view_create (const PangoViewer *klass) +{ + XViewer *instance; + + instance = x_view_create (klass); + + XftInit (NULL); + + pango_xft_set_default_substitute (instance->display, instance->screen, + default_substitute, NULL, NULL); + + return instance; +} + +static void +pangoxft_view_destroy (gpointer instance) +{ + XViewer *x = (XViewer *)instance; + + pango_xft_shutdown_display (x->display, x->screen); + + x_view_destroy (instance); +} + +static PangoContext * +pangoxft_view_get_context (gpointer instance) +{ + XViewer *x = (XViewer *) instance; + + return pango_font_map_create_context (pango_xft_get_font_map (x->display, x->screen)); +} + +typedef struct +{ + XftDraw *draw; + XftColor color; +} MyXftContext; + +static void +render_callback (PangoLayout *layout, + int x, + int y, + gpointer context, + gpointer state G_GNUC_UNUSED) +{ + MyXftContext *xft_context = (MyXftContext *) context; + + pango_xft_render_layout (xft_context->draw, + &xft_context->color, + layout, + x * PANGO_SCALE, y * PANGO_SCALE); +} + +static void +pangoxft_view_render (gpointer instance, + gpointer surface, + PangoContext *context, + int *width, + int *height, + gpointer state) +{ + XViewer *x = (XViewer *) instance; + Pixmap pixmap = (Pixmap) surface; + MyXftContext xft_context; + XftDraw *draw; + XftColor color; + + draw = XftDrawCreate (x->display, pixmap, + DefaultVisual (x->display, x->screen), + DefaultColormap (x->display, x->screen)); + + /* XftDrawRect only fills solid. + * Flatten with white. + */ + color.color.red = ((opt_bg_color.red * opt_bg_alpha) >> 16) + (65535 - opt_bg_alpha); + color.color.green = ((opt_bg_color.green * opt_bg_alpha) >> 16) + (65535 - opt_bg_alpha); + color.color.blue = ((opt_bg_color.blue * opt_bg_alpha) >> 16) + (65535 - opt_bg_alpha); + color.color.alpha = 65535; + + XftDrawRect (draw, &color, 0, 0, *width, *height); + + color.color.red = opt_fg_color.red; + color.color.blue = opt_fg_color.green; + color.color.green = opt_fg_color.blue; + color.color.alpha = opt_fg_alpha; + + xft_context.draw = draw; + xft_context.color = color; + + do_output (context, render_callback, NULL, &xft_context, state, width, height); + + XftDrawDestroy (draw); +} + +const PangoViewer pangoxft_viewer = { + "PangoXft", + "xft", + NULL, + pangoxft_view_create, + pangoxft_view_destroy, + pangoxft_view_get_context, + x_view_create_surface, + x_view_destroy_surface, + pangoxft_view_render, + NULL, + x_view_create_window, + x_view_destroy_window, + x_view_display +}; diff --git a/utils/viewer-render.c b/utils/viewer-render.c new file mode 100644 index 0000000..573cb59 --- /dev/null +++ b/utils/viewer-render.c @@ -0,0 +1,823 @@ +/* viewer-render.c: Common code for rendering in viewers + * + * Copyright (C) 1999, 2004 Red Hat Software + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "viewer-render.h" + +gboolean opt_display = TRUE; +int opt_dpi = 96; +gboolean opt_pixels = FALSE; +const char *opt_font = ""; +gboolean opt_header = FALSE; +const char *opt_output = NULL; +int opt_margin_t = 10; +int opt_margin_r = 10; +int opt_margin_b = 10; +int opt_margin_l = 10; +int opt_markup = FALSE; +gboolean opt_rtl = FALSE; +double opt_rotate = 0; +gboolean opt_auto_dir = TRUE; +const char *opt_text = NULL; +gboolean opt_waterfall = FALSE; +int opt_width = -1; +int opt_height = -1; +int opt_indent = 0; +gboolean opt_justify = 0; +int opt_runs = 1; +PangoAlignment opt_align = PANGO_ALIGN_LEFT; +PangoEllipsizeMode opt_ellipsize = PANGO_ELLIPSIZE_NONE; +PangoGravity opt_gravity = PANGO_GRAVITY_SOUTH; +PangoGravityHint opt_gravity_hint = PANGO_GRAVITY_HINT_NATURAL; +HintMode opt_hinting = HINT_DEFAULT; +PangoWrapMode opt_wrap = PANGO_WRAP_WORD_CHAR; +gboolean opt_wrap_set = FALSE; +static const char *opt_pangorc = NULL; /* Unused */ +const PangoViewer *opt_viewer = NULL; +const char *opt_language = NULL; +gboolean opt_single_par = FALSE; +PangoColor opt_fg_color = {0, 0, 0}; +guint16 opt_fg_alpha = 65535; +gboolean opt_bg_set = FALSE; +PangoColor opt_bg_color = {65535, 65535, 65535}; +guint16 opt_bg_alpha = 65535; + +/* Text (or markup) to render */ +static char *text; + +void +fail (const char *format, ...) +{ + const char *msg; + + va_list vap; + va_start (vap, format); + msg = g_strdup_vprintf (format, vap); + g_printerr ("%s: %s\n", g_get_prgname (), msg); + + exit (1); +} + +static PangoLayout * +make_layout(PangoContext *context, + const char *text, + double size) +{ + static PangoFontDescription *font_description; + PangoAlignment align; + PangoLayout *layout; + + layout = pango_layout_new (context); + if (opt_markup) + pango_layout_set_markup (layout, text, -1); + else + pango_layout_set_text (layout, text, -1); + + pango_layout_set_auto_dir (layout, opt_auto_dir); + pango_layout_set_ellipsize (layout, opt_ellipsize); + pango_layout_set_justify (layout, opt_justify); + pango_layout_set_single_paragraph_mode (layout, opt_single_par); + pango_layout_set_wrap (layout, opt_wrap); + + font_description = pango_font_description_from_string (opt_font); + if (size > 0) + pango_font_description_set_size (font_description, size * PANGO_SCALE); + + if (opt_width > 0) + pango_layout_set_width (layout, (opt_width * opt_dpi * PANGO_SCALE + 36) / 72); + + if (opt_height > 0) + pango_layout_set_height (layout, (opt_height * opt_dpi * PANGO_SCALE + 36) / 72); + else + pango_layout_set_height (layout, opt_height); + + if (opt_indent != 0) + pango_layout_set_indent (layout, (opt_indent * opt_dpi * PANGO_SCALE + 36) / 72); + + align = opt_align; + if (align != PANGO_ALIGN_CENTER && + pango_context_get_base_dir (context) != PANGO_DIRECTION_LTR) { + /* pango reverses left and right if base dir ir rtl. so we should + * reverse to cancel that. unfortunately it also does that for + * rtl paragraphs, so we cannot really get left/right. all we get + * is default/other-side. */ + align = PANGO_ALIGN_LEFT + PANGO_ALIGN_RIGHT - align; + } + pango_layout_set_alignment (layout, align); + + pango_layout_set_font_description (layout, font_description); + + pango_font_description_free (font_description); + + return layout; +} + +gchar * +get_options_string (void) +{ + PangoFontDescription *font_description = pango_font_description_from_string (opt_font); + gchar *font_name; + gchar *result; + + if (opt_waterfall) + pango_font_description_unset_fields (font_description, PANGO_FONT_MASK_SIZE); + + font_name = pango_font_description_to_string (font_description); + result = g_strdup_printf ("%s: %s (%d dpi)", opt_viewer->name, font_name, opt_dpi); + pango_font_description_free (font_description); + g_free (font_name); + + return result; +} + +static void +output_body (PangoLayout *layout, + RenderCallback render_cb, + gpointer cb_context, + gpointer cb_data, + int *width, + int *height, + gboolean supports_matrix) +{ + PangoRectangle logical_rect; + int size, start_size, end_size, increment; + int x = 0, y = 0; + + if (!supports_matrix) + { + const PangoMatrix* matrix; + const PangoMatrix identity = PANGO_MATRIX_INIT; + PangoContext *context = pango_layout_get_context (layout); + matrix = pango_context_get_matrix (context); + if (matrix) + { + x += matrix->x0; + y += matrix->y0; + } + pango_context_set_matrix (context, &identity); + pango_layout_context_changed (layout); + } + + if (opt_waterfall) + { + start_size = 8; + end_size = 48; + increment = 4; + } + else + { + start_size = end_size = -1; + increment = 1; + } + + *width = 0; + *height = 0; + + for (size = start_size; size <= end_size; size += increment) + { + if (size > 0) + { + PangoFontDescription *desc = pango_font_description_copy (pango_layout_get_font_description (layout)); + pango_font_description_set_size (desc, size * PANGO_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + } + + pango_layout_get_pixel_extents (layout, NULL, &logical_rect); + + if (render_cb) + (*render_cb) (layout, x, y+*height, cb_context, cb_data); + + *width = MAX (*width, + MAX (logical_rect.x + logical_rect.width, + PANGO_PIXELS (pango_layout_get_width (layout)))); + *height += MAX (logical_rect.y + logical_rect.height, + PANGO_PIXELS (pango_layout_get_height (layout))); + } +} + +static void +set_transform (PangoContext *context, + TransformCallback transform_cb, + gpointer cb_context, + gpointer cb_data, + PangoMatrix *matrix) +{ + pango_context_set_matrix (context, matrix); + if (transform_cb) + (*transform_cb) (context, matrix, cb_context, cb_data); +} + +void +do_output (PangoContext *context, + RenderCallback render_cb, + TransformCallback transform_cb, + gpointer cb_context, + gpointer cb_data, + int *width_out, + int *height_out) +{ + PangoLayout *layout; + PangoRectangle rect; + PangoMatrix matrix = PANGO_MATRIX_INIT; + PangoMatrix *orig_matrix; + gboolean supports_matrix; + int rotated_width, rotated_height; + int x = opt_margin_l; + int y = opt_margin_t; + int width, height; + + width = 0; + height = 0; + + orig_matrix = pango_matrix_copy (pango_context_get_matrix (context)); + /* If the backend sets an all-zero matrix on the context, + * means that it doesn't support transformations. + */ + supports_matrix = !orig_matrix || + (orig_matrix->xx != 0. || orig_matrix->xy != 0. || + orig_matrix->yx != 0. || orig_matrix->yy != 0. || + orig_matrix->x0 != 0. || orig_matrix->y0 != 0.); + + set_transform (context, transform_cb, cb_context, cb_data, NULL); + + pango_context_set_language (context, + opt_language ? pango_language_from_string (opt_language) + : pango_language_get_default ()); + pango_context_set_base_dir (context, + opt_rtl ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR); + + if (opt_header) + { + char *options_string = get_options_string (); + pango_context_set_base_gravity (context, PANGO_GRAVITY_SOUTH); + layout = make_layout (context, options_string, 10); + pango_layout_get_extents (layout, NULL, &rect); + + width = MAX (width, PANGO_PIXELS (rect.width)); + height += PANGO_PIXELS (rect.height); + + if (render_cb) + (*render_cb) (layout, x, y, cb_context, cb_data); + + y += PANGO_PIXELS (rect.height); + + g_object_unref (layout); + g_free (options_string); + } + + if (opt_rotate != 0) + { + if (supports_matrix) + pango_matrix_rotate (&matrix, opt_rotate); + else + g_printerr ("The backend does not support rotated text\n"); + } + + pango_context_set_base_gravity (context, opt_gravity); + pango_context_set_gravity_hint (context, opt_gravity_hint); + + layout = make_layout (context, text, -1); + + set_transform (context, transform_cb, cb_context, cb_data, &matrix); + + output_body (layout, + NULL, NULL, NULL, + &rotated_width, &rotated_height, + supports_matrix); + + rect.x = rect.y = 0; + rect.width = rotated_width; + rect.height = rotated_height; + + pango_matrix_transform_pixel_rectangle (&matrix, &rect); + + matrix.x0 = x - rect.x; + matrix.y0 = y - rect.y; + + set_transform (context, transform_cb, cb_context, cb_data, &matrix); + + if (render_cb) + output_body (layout, + render_cb, cb_context, cb_data, + &rotated_width, &rotated_height, + supports_matrix); + + width = MAX (width, rect.width); + height += rect.height; + + width += opt_margin_l + opt_margin_r; + height += opt_margin_t + opt_margin_b; + + if (width_out) + *width_out = width; + if (height_out) + *height_out = height; + + pango_context_set_matrix (context, orig_matrix); + pango_matrix_free (orig_matrix); + g_object_unref (layout); +} + +static gboolean +parse_enum (GType type, + int *value, + const char *name, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + char *possible_values = NULL; + gboolean ret; + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + ret = pango_parse_enum (type, + arg, + value, + FALSE, + &possible_values); +G_GNUC_END_IGNORE_DEPRECATIONS + + if (!ret && error) + { + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Argument for %s must be one of %s", + name, + possible_values); + } + + g_free (possible_values); + + return ret; +} + +static gboolean +parse_align (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + return parse_enum (PANGO_TYPE_ALIGNMENT, (int*)(void*)&opt_align, + name, arg, data, error); +} + +static gboolean +parse_ellipsis (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + return parse_enum (PANGO_TYPE_ELLIPSIZE_MODE, (int*)(void*)&opt_ellipsize, + name, arg, data, error); +} + +static gboolean +parse_gravity (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + return parse_enum (PANGO_TYPE_GRAVITY, (int*)(void*)&opt_gravity, + name, arg, data, error); +} + +static gboolean +parse_gravity_hint (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + return parse_enum (PANGO_TYPE_GRAVITY_HINT, (int*)(void*)&opt_gravity_hint, + name, arg, data, error); +} + +static gboolean +parse_hinting (const char *name G_GNUC_UNUSED, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + gboolean ret = TRUE; + + if (strcmp (arg, "none") == 0) + opt_hinting = HINT_NONE; + else if (strcmp (arg, "auto") == 0) + opt_hinting = HINT_AUTO; + else if (strcmp (arg, "full") == 0) + opt_hinting = HINT_FULL; + else + { + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Argument for --hinting must be one of none/auto/full"); + ret = FALSE; + } + + return ret; +} + +static gboolean +parse_wrap (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + gboolean ret; + if ((ret = parse_enum (PANGO_TYPE_WRAP_MODE, (int*)(void*)&opt_wrap, + name, arg, data, error))) + { + opt_wrap_set = TRUE; + } + return ret; +} + +static gboolean +parse_rgba_color (PangoColor *color, + guint16 *alpha, + const char *name, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + gboolean ret; + char buf[32]; + int len; + + len = strlen (arg); + /* handle alpha */ + if (*arg == '#' && (len == 5 || len == 9 || len == 17)) + { + int width, bits; + unsigned int a; + + bits = len - 1; + width = bits >> 2; + + strcpy (buf, arg); + arg = buf; + + if (!sscanf (buf + len - width, "%x", &a)) + { + ret = FALSE; + goto err; + } + buf[len - width] = '\0'; + + a <<= (16 - bits); + while (bits < 16) + { + a |= (a >> bits); + bits *= 2; + } + *alpha = a; + } + else + *alpha = 65535; + + ret = pango_color_parse (color, arg); + +err: + if (!ret && error) + { + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Argument for %s must be a color name like red, or CSS-style #rrggbb / #rrggbbaa", + name); + } + + return ret; +} + +static gboolean +parse_foreground (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + return parse_rgba_color (&opt_fg_color, &opt_fg_alpha, + name, arg, data, error); +} + +static gboolean +parse_background (const char *name, + const char *arg, + gpointer data, + GError **error) +{ + opt_bg_set = TRUE; + + if (0 == strcmp ("transparent", arg)) + { + opt_bg_alpha = 0; + return TRUE; + } + + return parse_rgba_color (&opt_bg_color, &opt_bg_alpha, + name, arg, data, error); +} + +static gboolean +parse_margin (const char *name G_GNUC_UNUSED, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + switch (sscanf (arg, "%d%*[ ,]%d%*[ ,]%d%*[ ,]%d", &opt_margin_t, &opt_margin_r, &opt_margin_b, &opt_margin_l)) + { + case 0: + { + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Argument for --margin must be one to four space-separated numbers"); + return FALSE; + } + case 1: opt_margin_r = opt_margin_t; + case 2: opt_margin_b = opt_margin_t; + case 3: opt_margin_l = opt_margin_r; + } + return TRUE; +} + + +static gchar * +backends_to_string (void) +{ + GString *backends = g_string_new (NULL); + const PangoViewer **viewer; + + for (viewer = viewers; *viewer; viewer++) + if ((*viewer)->id) + { + g_string_append (backends, (*viewer)->id); + g_string_append_c (backends, '/'); + } + g_string_truncate (backends, MAX (0, (gint)backends->len - 1)); + + return g_string_free(backends,FALSE); +} + +static int +backends_get_count (void) +{ + const PangoViewer **viewer; + int i = 0; + + for (viewer = viewers; *viewer; viewer++) + if ((*viewer)->id) + i++; + + return i; +} + + +static gchar * +backend_description (void) +{ + GString *description = g_string_new("Pango backend to use for rendering "); + int backends_count = backends_get_count (); + + if (backends_count > 1) + g_string_append_printf(description,"(default: %s)", (*viewers)->id); + else if (backends_count == 1) + g_string_append_printf(description,"(only available: %s)", (*viewers)->id); + else + g_string_append_printf(description,"(no backends found!)"); + + return g_string_free(description,FALSE); + +} + +static gboolean +parse_backend (const char *name G_GNUC_UNUSED, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + gboolean ret = TRUE; + const PangoViewer **viewer; + + for (viewer = viewers; *viewer; viewer++) + if (!g_ascii_strcasecmp ((*viewer)->id, arg)) + break; + + if (*viewer) + opt_viewer = *viewer; + else + { + gchar *backends = backends_to_string (); + + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Available --backend options are: %s", + backends); + g_free(backends); + ret = FALSE; + } + + return ret; +} + + +static G_GNUC_NORETURN gboolean +show_version(const char *name G_GNUC_UNUSED, + const char *arg G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED, + GError **error G_GNUC_UNUSED) +{ + g_printf("%s (%s) %s\n", g_get_prgname (), PACKAGE_NAME, PACKAGE_VERSION); + + if (PANGO_VERSION != pango_version()) + g_printf("Linked Pango library has a different version: %s\n", pango_version_string ()); + + exit(0); +} + +void +parse_options (int argc, char *argv[]) +{ + gchar *backend_options = backends_to_string (); + GOptionFlags backend_flag = backends_get_count () > 1 ? 0 : G_OPTION_FLAG_HIDDEN; + gchar *backend_desc = backend_description (); + GOptionEntry entries[] = + { + {"no-auto-dir", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_auto_dir, + "No layout direction according to contents", NULL}, + {"backend", 0, backend_flag, G_OPTION_ARG_CALLBACK, &parse_backend, + backend_desc, backend_options}, + {"background", 0, 0, G_OPTION_ARG_CALLBACK, &parse_background, + "Set the background color", "red/#rrggbb/#rrggbbaa/transparent"}, + {"no-display", 'q', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_display, + "Do not display (just write to file or whatever)", NULL}, + {"dpi", 0, 0, G_OPTION_ARG_INT, &opt_dpi, + "Set the resolution", "number"}, + {"align", 0, 0, G_OPTION_ARG_CALLBACK, &parse_align, + "Text alignment", "left/center/right"}, + {"ellipsize", 0, 0, G_OPTION_ARG_CALLBACK, &parse_ellipsis, + "Ellipsization mode", "start/middle/end"}, + {"font", 0, 0, G_OPTION_ARG_STRING, &opt_font, + "Set the font description", "description"}, + {"foreground", 0, 0, G_OPTION_ARG_CALLBACK, &parse_foreground, + "Set the text color", "red/#rrggbb/#rrggbbaa"}, + {"gravity", 0, 0, G_OPTION_ARG_CALLBACK, &parse_gravity, + "Base gravity: glyph rotation", "south/east/north/west/auto"}, + {"gravity-hint", 0, 0, G_OPTION_ARG_CALLBACK, &parse_gravity_hint, + "Gravity hint", "natural/strong/line"}, + {"header", 0, 0, G_OPTION_ARG_NONE, &opt_header, + "Display the options in the output", NULL}, + {"height", 0, 0, G_OPTION_ARG_INT, &opt_height, + "Height in points (positive) or number of lines (negative) for ellipsizing", "+points/-numlines"}, + {"hinting", 0, 0, G_OPTION_ARG_CALLBACK, &parse_hinting, + "Hinting style", "none/auto/full"}, + {"indent", 0, 0, G_OPTION_ARG_INT, &opt_indent, + "Width in points to indent paragraphs", "points"}, + {"justify", 0, 0, G_OPTION_ARG_NONE, &opt_justify, + "Align paragraph lines to be justified", NULL}, + {"language", 0, 0, G_OPTION_ARG_STRING, &opt_language, + "Language to use for font selection", "en_US/etc"}, + {"margin", 0, 0, G_OPTION_ARG_CALLBACK, &parse_margin, + "Set the margin on the output in pixels", "CSS-style numbers in pixels"}, + {"markup", 0, 0, G_OPTION_ARG_NONE, &opt_markup, + "Interpret text as Pango markup", NULL}, + {"output", 'o', 0, G_OPTION_ARG_STRING, &opt_output, + "Save rendered image to output file", "file"}, + {"pangorc", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &opt_pangorc, + "Deprecated", "file"}, + {"pixels", 0, 0, G_OPTION_ARG_NONE, &opt_pixels, + "Use pixel units instead of points (sets dpi to 72)", NULL}, + {"rtl", 0, 0, G_OPTION_ARG_NONE, &opt_rtl, + "Set base direction to right-to-left", NULL}, + {"rotate", 0, 0, G_OPTION_ARG_DOUBLE, &opt_rotate, + "Angle at which to rotate results", "degrees"}, + {"runs", 'n', 0, G_OPTION_ARG_INT, &opt_runs, + "Run Pango layout engine this many times", "integer"}, + {"single-par", 0, 0, G_OPTION_ARG_NONE, &opt_single_par, + "Enable single-paragraph mode", NULL}, + {"text", 't', 0, G_OPTION_ARG_STRING, &opt_text, + "Text to display (instead of a file)", "string"}, + {"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &show_version, + "Show version numbers", NULL}, + {"waterfall", 0, 0, G_OPTION_ARG_NONE, &opt_waterfall, + "Create a waterfall display", NULL}, + {"width", 'w', 0, G_OPTION_ARG_INT, &opt_width, + "Width in points to which to wrap lines or ellipsize", "points"}, + {"wrap", 0, 0, G_OPTION_ARG_CALLBACK, &parse_wrap, + "Text wrapping mode (needs a width to be set)", "word/char/word-char"}, + {NULL} + }; + GError *error = NULL; + GError *parse_error = NULL; + GOptionContext *context; + size_t len; + const PangoViewer **viewer; + + context = g_option_context_new ("- FILE"); + g_option_context_add_main_entries (context, entries, NULL); + + for (viewer = viewers; *viewer; viewer++) + if ((*viewer)->get_option_group) + { + GOptionGroup *group = (*viewer)->get_option_group (*viewer); + if (group) + g_option_context_add_group (context, group); + } + + if (!g_option_context_parse (context, &argc, &argv, &parse_error)) + { + if (parse_error != NULL) + fail("%s", parse_error->message); + else + fail("Option parse error"); + exit(1); + } + g_option_context_free(context); + g_free(backend_options); + g_free(backend_desc); + + if (opt_pixels) + opt_dpi = 72; + + if ((opt_text && argc != 1) || (!opt_text && argc != 2)) + { + if (opt_text && argc != 1) + fail ("When specifying --text, no file should be given"); + + g_printerr ("Usage: %s [OPTION...] FILE\n", g_get_prgname ()); + exit (1); + } + + /* set up the backend */ + if (!opt_viewer) + { + opt_viewer = *viewers; + if (!opt_viewer) + fail ("No viewer backend found"); + } + + /* Get the text + */ + if (opt_text) + { + text = g_strdup (opt_text); + len = strlen (text); + } + else + { + if (!g_file_get_contents (argv[1], &text, &len, &error)) + fail ("%s\n", error->message); + } + + /* Strip one trailing newline + */ + if (len > 0 && text[len - 1] == '\n') + len--; + if (len > 0 && text[len - 1] == '\r') + len--; + text[len] = '\0'; + + /* Make sure we have valid markup + */ + if (opt_markup && + !pango_parse_markup (text, -1, 0, NULL, NULL, NULL, &error)) + fail ("Cannot parse input as markup: %s", error->message); +} + + +void +finalize (void) +{ + g_free (text); +} diff --git a/utils/viewer-render.h b/utils/viewer-render.h new file mode 100644 index 0000000..ade2298 --- /dev/null +++ b/utils/viewer-render.h @@ -0,0 +1,90 @@ +/* viewer-render.c: Common code for rendering in viewers + * + * Copyright (C) 1999, 2004 Red Hat Software + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef VIEWER_RENDER_H +#define VIEWER_RENDER_H + +#include + +#include "viewer.h" + +typedef enum { + HINT_DEFAULT, + HINT_NONE, + HINT_AUTO, + HINT_FULL +} HintMode; + +typedef void (*RenderCallback) (PangoLayout *layout, + int x, + int y, + gpointer cb_context, + gpointer cb_data); +typedef void (*TransformCallback) (PangoContext *context, + PangoMatrix *transform, + gpointer cb_context, + gpointer cb_data); + +void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN; + +void parse_options (int argc, + char *argv[]); +void do_output (PangoContext *context, + RenderCallback render_cb, + TransformCallback transform_cb, + gpointer cb_context, + gpointer cb_data, + int *width, + int *height); +void finalize (void); +gchar *get_options_string (void); + +extern const char *prog_name; + +/* handled by viewer-render.c */ +extern const char *opt_font; +extern gboolean opt_header; +extern int opt_margin; +extern int opt_markup; +extern gboolean opt_rtl; +extern double opt_rotate; +extern gboolean opt_auto_dir; +extern const char *opt_text; +extern gboolean opt_waterfall; +extern int opt_width; +extern int opt_indent; +extern PangoEllipsizeMode opt_ellipsize; + +/* handled by viewer-main.c */ +extern gboolean opt_display; +extern const char *opt_output; +extern int opt_runs; +extern const PangoViewer *opt_viewer; + +/* handled by backend-specific code */ +extern int opt_dpi; +extern HintMode opt_hinting; +extern PangoColor opt_fg_color; +extern guint16 opt_fg_alpha; +extern gboolean opt_bg_set; +extern PangoColor opt_bg_color; +extern guint16 opt_bg_alpha; + +#endif /* VIEWER_RENDER_H */ diff --git a/utils/viewer-x.c b/utils/viewer-x.c new file mode 100644 index 0000000..ad1c9a8 --- /dev/null +++ b/utils/viewer-x.c @@ -0,0 +1,234 @@ +/* viewer-x.c: Common code for X-based viewers + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#include "config.h" +#include + +#include "viewer-render.h" +#include "viewer-x.h" + +void +x_view_init (gpointer instance, + const PangoViewer *klass G_GNUC_UNUSED) +{ + XViewer *x = (XViewer *)instance; + + x->display = XOpenDisplay (NULL); + if (!x->display) + fail ("Cannot open display %s", XDisplayName (NULL)); + + x->screen = DefaultScreen (x->display); +} + +gpointer +x_view_create (const PangoViewer *klass) +{ + XViewer *instance; + + instance = g_slice_new (XViewer); + + x_view_init (instance, klass); + + return instance; +} + +void +x_view_destroy (gpointer instance) +{ + XViewer *x = (XViewer *)instance; + + XCloseDisplay (x->display); + + g_slice_free (XViewer, instance); +} + +gpointer +x_view_create_surface (gpointer instance, + int width, + int height) +{ + XViewer *x = (XViewer *) instance; + Pixmap pixmap; + + pixmap = XCreatePixmap (x->display, DefaultRootWindow (x->display), width, height, + DefaultDepth (x->display, x->screen)); + + return (gpointer) pixmap; +} + +void +x_view_destroy_surface (gpointer instance, + gpointer surface) +{ + XViewer *x = (XViewer *) instance; + Pixmap pixmap = (Pixmap) surface; + + XFreePixmap (x->display, pixmap); +} + +static void +update (Display *display, + Pixmap pixmap, + Window window, + Region *update_region) +{ + GC gc; + XRectangle extents; + + XClipBox (*update_region, &extents); + + gc = XCreateGC (display, pixmap, 0, NULL); + + XCopyArea (display, pixmap, window, gc, + extents.x, extents.y, + extents.width, extents.height, + extents.x, extents.y); + + XFreeGC (display, gc); + + XDestroyRegion (*update_region); + *update_region = NULL; +} + +static void +expose (XExposeEvent *xev, + Region *update_region) +{ + XRectangle r; + + if (!*update_region) + *update_region = XCreateRegion (); + + r.x = xev->x; + r.y = xev->y; + r.width = xev->width; + r.height = xev->height; + + XUnionRectWithRegion (&r, *update_region, *update_region); +} + +gpointer +x_view_create_window (gpointer instance, + const char *title, + int width, + int height) +{ + XViewer *x = (XViewer *) instance; + unsigned long bg; + Window window; + XSizeHints size_hints; + + bg = WhitePixel (x->display, x->screen); + window = XCreateSimpleWindow (x->display, DefaultRootWindow (x->display), + 0, 0, width, height, 0, + bg, bg); + + XSelectInput (x->display, window, ExposureMask | KeyPressMask); + + XMapWindow (x->display, window); + XmbSetWMProperties (x->display, window, + title, + NULL, NULL, 0, NULL, NULL, NULL); + + memset ((char *)&size_hints, 0, sizeof (XSizeHints)); + size_hints.flags = PSize | PMaxSize; + size_hints.width = width; size_hints.height = height; /* for compat only */ + size_hints.max_width = width; size_hints.max_height = height; + + XSetWMNormalHints (x->display, window, &size_hints); + + return (gpointer) window; +} + +void +x_view_destroy_window (gpointer instance, + gpointer window) +{ + XViewer *x = (XViewer *) instance; + Window win = (Window) window; + + XDestroyWindow (x->display, win); +} + +gpointer +x_view_display (gpointer instance, + gpointer surface, + gpointer win, + int width, + int height, + gpointer state) +{ + XViewer *x = (XViewer *) instance; + Pixmap pixmap = (Pixmap) surface; + Window window = (Window) win; + XEvent xev; + XRectangle r; + Region update_region; + unsigned int quit_keycode; + unsigned int annotate_keycode; + + /* force a full redraw */ + update_region = XCreateRegion (); + r.x = 0; + r.y = 0; + r.width = width; + r.height = height; + XUnionRectWithRegion (&r, update_region, update_region); + + annotate_keycode = XKeysymToKeycode(x->display, 'B'); + quit_keycode = XKeysymToKeycode(x->display, 'Q'); + + while (1) + { + if (!XPending (x->display) && update_region) + update (x->display, pixmap, window, &update_region); + + XNextEvent (x->display, &xev); + switch (xev.xany.type) { + case KeyPress: + if (xev.xkey.keycode == quit_keycode) + return GINT_TO_POINTER (-1); + else if (xev.xkey.keycode == annotate_keycode) + { + return GUINT_TO_POINTER (GPOINTER_TO_INT (state) + 1); + } + break; + case Expose: + expose (&xev.xexpose, &update_region); + break; + } + } +} + +const PangoViewer x_viewer = { + "X", + NULL, + NULL, + x_view_create, + x_view_destroy, + NULL, + x_view_create_surface, + x_view_destroy_surface, + NULL, + NULL, + x_view_create_window, + x_view_destroy_window, + x_view_display +}; diff --git a/utils/viewer-x.h b/utils/viewer-x.h new file mode 100644 index 0000000..28f61f6 --- /dev/null +++ b/utils/viewer-x.h @@ -0,0 +1,70 @@ +/* viewer-x.h: Common headers for X-based viewers + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef VIEWER_X_H +#define VIEWER_X_H + +#include + +#include +#include + +#include "viewer.h" + + +typedef struct +{ + Display *display; + int screen; +} XViewer; + + +extern const PangoViewer x_viewer; + +void x_view_init (gpointer instance, + const PangoViewer *klass); + +gpointer x_view_create (const PangoViewer *klass); + +void x_view_destroy (gpointer instance); + +gpointer x_view_create_surface (gpointer instance, + int width, + int height); + +void x_view_destroy_surface (gpointer instance, + gpointer surface); + +gpointer x_view_create_window (gpointer instance, + const char *title, + int width, + int height); + +void x_view_destroy_window (gpointer instance, + gpointer window); + +gpointer x_view_display (gpointer instance, + gpointer surface, + gpointer window, + int width, + int height, + gpointer state); + +#endif /* VIEWER_X_H */ diff --git a/utils/viewer.h b/utils/viewer.h new file mode 100644 index 0000000..c4d5819 --- /dev/null +++ b/utils/viewer.h @@ -0,0 +1,98 @@ +/* viewer.h: PangoViewer class + * + * Copyright (C) 1999,2004,2005 Red Hat, Inc. + * Copyright (C) 2001 Sun Microsystems + * + * 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 GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef VIEWER_H +#define VIEWER_H + +#include + +typedef struct _PangoViewer PangoViewer; + +struct _PangoViewer { + + const char *name; + + const char *id; + + const char *write_suffix; + + gpointer (*create) (const PangoViewer *klass); + + void (*destroy) (gpointer instance); + + PangoContext * (*get_context) (gpointer instance); + + gpointer (*create_surface) (gpointer instance, + int width, + int height); + + void (*destroy_surface) (gpointer instance, + gpointer surface); + + void (*render) (gpointer instance, + gpointer surface, + PangoContext *context, + int *width, + int *height, + gpointer state); + + /* The following can be NULL */ + + void (*write) (gpointer instance, + gpointer surface, + FILE *stream, + int width, + int height); + + gpointer (*create_window) (gpointer instance, + const char *title, + int width, + int height); + + void (*destroy_window) (gpointer instance, + gpointer window); + + gpointer (*display) (gpointer instance, + gpointer surface, + gpointer window, + int width, + int height, + gpointer state); + + void (*load) (gpointer instance, + gpointer surface, + guchar *buffer, + int width, + int height, + int stride); + + void (*save) (gpointer instance, + gpointer surface, + guchar *buffer, + int width, + int height, + int stride); + + GOptionGroup * (*get_option_group) (const PangoViewer *klass); +}; + +extern const PangoViewer *viewers[]; + +#endif /* VIEWER_H */ diff --git a/win32/Makefile-newvs.am b/win32/Makefile-newvs.am new file mode 100644 index 0000000..3a91862 --- /dev/null +++ b/win32/Makefile-newvs.am @@ -0,0 +1,55 @@ +# Centralized autotools file +# Create the Visual Studio 2012/2013/2015 project files +# from the Visual Studio 2010 project files + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# Author: Fan, Chun-wei +# November 05, 2012 + +# MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (100 for 2010, 120 for 2013) +# MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15) +# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning v$(MSVC_BASE_TOOLSET) +# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on) +# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017) +# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET) + +if MSVC_BASE_NO_TOOLSET_SET +MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0 +endif + +if MSVC_NO_TOOLSET_SET +MSVC_TOOLSET = $(MSVC_VER)0 +endif + +%.sln: + sed 's/11\.00/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/$(MSVC_BASE_VER_LONG)/$(MSVC_VER_LONG)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.txt: + sed 's/vs$(MSVC_BASE_VER)/vs$(MSVC_VER)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/VS$(MSVC_BASE_VER)/VS$(MSVC_VER)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.vcxproj: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.vcxproj.filters: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + cp $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + cp $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi diff --git a/win32/Makefile.am b/win32/Makefile.am new file mode 100644 index 0000000..11e40dd --- /dev/null +++ b/win32/Makefile.am @@ -0,0 +1,43 @@ +if HAVE_INTROSPECTION +GENERATED_ITEMS = \ + introspection.body.mak \ + Pango_1_0_gir_list \ + PangoCairo_1_0_gir_list + +MSVC_INTROSPECTION_INTERMEDIATE_FILES = PangoCairo-1.0.gir.msvc.introspect Pango-1.0.gir.msvc.introspect + +introspection.body.mak: $(MSVC_INTROSPECTION_INTERMEDIATE_FILES) + -$(RM) introspection.body.mak + for F in `ls *.msvc.introspect`; do \ + case $$F in \ + *) cat $(top_builddir)/win32/$$F >>introspection.body.mak \ + ;; \ + esac; \ + done + $(RM) $(MSVC_INTROSPECTION_INTERMEDIATE_FILES) + +DISTCLEANFILES = $(GENERATED_ITEMS) + +else +GENERATED_ITEMS = +endif + +SUBDIRS = \ + vs9 \ + vs10 \ + vs11 \ + vs12 \ + vs14 \ + vs15 + +EXTRA_DIST = \ + unistd.h \ + pango-introspection-msvc.mak \ + introspection-msvc.mak \ + detectenv-msvc.mak \ + pangopc.py \ + pc_base.py \ + replace.py \ + $(GENERATED_ITEMS) + +-include $(top_srcdir)/git.mk diff --git a/win32/Makefile.in b/win32/Makefile.in new file mode 100644 index 0000000..533e69b --- /dev/null +++ b/win32/Makefile.in @@ -0,0 +1,717 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@HAVE_INTROSPECTION_FALSE@GENERATED_ITEMS = +@HAVE_INTROSPECTION_TRUE@GENERATED_ITEMS = \ +@HAVE_INTROSPECTION_TRUE@ introspection.body.mak \ +@HAVE_INTROSPECTION_TRUE@ Pango_1_0_gir_list \ +@HAVE_INTROSPECTION_TRUE@ PangoCairo_1_0_gir_list + +@HAVE_INTROSPECTION_TRUE@MSVC_INTROSPECTION_INTERMEDIATE_FILES = PangoCairo-1.0.gir.msvc.introspect Pango-1.0.gir.msvc.introspect +@HAVE_INTROSPECTION_TRUE@DISTCLEANFILES = $(GENERATED_ITEMS) +SUBDIRS = \ + vs9 \ + vs10 \ + vs11 \ + vs12 \ + vs14 \ + vs15 + +EXTRA_DIST = \ + unistd.h \ + pango-introspection-msvc.mak \ + introspection-msvc.mak \ + detectenv-msvc.mak \ + pangopc.py \ + pc_base.py \ + replace.py \ + $(GENERATED_ITEMS) + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +@HAVE_INTROSPECTION_TRUE@introspection.body.mak: $(MSVC_INTROSPECTION_INTERMEDIATE_FILES) +@HAVE_INTROSPECTION_TRUE@ -$(RM) introspection.body.mak +@HAVE_INTROSPECTION_TRUE@ for F in `ls *.msvc.introspect`; do \ +@HAVE_INTROSPECTION_TRUE@ case $$F in \ +@HAVE_INTROSPECTION_TRUE@ *) cat $(top_builddir)/win32/$$F >>introspection.body.mak \ +@HAVE_INTROSPECTION_TRUE@ ;; \ +@HAVE_INTROSPECTION_TRUE@ esac; \ +@HAVE_INTROSPECTION_TRUE@ done +@HAVE_INTROSPECTION_TRUE@ $(RM) $(MSVC_INTROSPECTION_INTERMEDIATE_FILES) + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/Makefile.msvc-introspection b/win32/Makefile.msvc-introspection new file mode 100644 index 0000000..1a244e0 --- /dev/null +++ b/win32/Makefile.msvc-introspection @@ -0,0 +1,129 @@ +# Author: Fan, Chun-wei +# Common autotools file for constructing the g-ir-scanner and +# g-ir-compiler command lines for Visual Studio builds. + +# This is copied from $(srcroot)/win32 from the gobject-introspection +# project, which may be included in projects that support both +# Visual Studio builds and introspection. + +# * Input variables: +# +# MSVC_INTROSPECT_GIRS - List of .gir's that should be built +# in the NMake Makefiles +# +# * Simple tutorial +# +# Add this to Makefile.am where your library/program is built: +# (Either YourLib_1_0_gir_MSVC_LIBS or YourLib_1_0_gir_MSVC_PROGRAM +# is required unless --headers-only is specified in +# YourLib_1_0_gir__MSVC_SCANNERFLAGS) +# +# include +# MSVC_INTROSPECT_GIRS = YourLib-1.0.gir +# YourLib_1_0_gir_NAMESPACE = YourLib # This is optional +# YourLib_1_0_gir_VERSION = 1.0 # This is optional +# YourLib_1_0_gir_MSVC_LIBS = yourlib-1.0 +# YourLib_1_0_gir_MSVC_FILES = $(libyourlib_1_0_SOURCES) +# YourLib_1_0_gir_MSVC_PROGRAM = YourProgram +# YourLib_1_0_gir_MSVC_PACKAGES = (Dependent .pc files) +# YourLib_1_0_gir_MSVC_INCLUDE_GIRS = (Dependent external .gir's) +# YourLib_1_0_gir_MSVC_EXPORT_PACKAGES = (Packages exported by this .gir) +# YourLib_1_0_gir_MSVC_C_INCLUDES = (List of public C headers which need to be included by +# consumers at compile time to make use of the API) + +# Private functions + +## Transform the MSVC project filename (no filename extensions) to something which can reference through a variable +## without automake/make complaining, eg Gtk-2.0 -> Gtk_2_0 +_gir_name=$(subst /,_,$(subst -,_,$(subst .,_,$(1)))) + +# Namespace and Version is either fetched from the gir filename +# or the _NAMESPACE/_VERSION variable combo +_gir_namespace_msvc = $(or $($(_gir_name)_NAMESPACE),$(firstword $(subst -, ,$(notdir $(1))))) +_gir_version_msvc = $(or $($(_gir_name)_VERSION),$(lastword $(subst -, ,$(1:.gir=)))) +_typelib_basename_msvc = $(_gir_namespace_msvc)'-'$(_gir_version_msvc) + +# _PROGRAM is an optional variable which needs its own --program argument +_gir_program_msvc = $(if $($(_gir_name)_MSVC_PROGRAM),--program=$($(_gir_name)_MSVC_PROGRAM)) + +# Deduce the sub-folder from $(srcroot) where the sources reside in +_gir_source_path_raw_msvc:=$(subst $(abs_top_srcdir),,$(abs_srcdir)) +_gir_source_path_msvc=$(subst /,\\,$(_gir_source_path_raw_msvc)) +_gir_source_subdir_int_msvc=$(subst \\\\,\\,\\$(_gir_source_path_msvc)\\) +_gir_source_subdir_msvc=$(subst \\.\\,\\,$(_gir_source_subdir_int_msvc)) + +_gir_files_raw_msvc=$(subst /,\\,$($(_gir_name)_MSVC_FILES)) +_gir_files_msvc=$(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_gir_source_path_msvc)\\,\\,$(_gir_files_raw_msvc)))) + +# Create a list of items for: +# - Libraries +# - Packages +# - GIRs to include +# - packages to export + +_gir_libraries_msvc = $(foreach lib,$($(_gir_name)_MSVC_LIBS),--library=$(lib)) +_gir_packages_msvc = $(foreach pkg,$($(_gir_name)_MSVC_PACKAGES),--pkg=$(pkg)) +_gir_includes_msvc = $(foreach include,$($(_gir_name)_MSVC_INCLUDE_GIRS),--include=$(include)) +_gir_export_packages_msvc = $(foreach pkg,$($(_gir_name)_MSVC_EXPORT_PACKAGES),--pkg-export=$(pkg)) +_gir_c_includes_msvc = $(foreach include,$($(_gir_name)_MSVC_C_INCLUDES),--c-include=$(include)) + +# +# Create NMake Makefile Sections for Building Introspection files +# from autotools files +# $(1) - File Name of the .gir that is to be generated +# + +define gir-nmake-builder + +# Basic sanity check, to make sure required variables are set +$(if $($(_gir_name)_MSVC_FILES),,$(error Need to define $(_gir_name)_MSVC_FILES)) +$(if $(or $(findstring --header-only,$($(_gir_name)_MSVC_SCANNERFLAGS)), + $($(_gir_name)_MSVC_LIBS), + $($(_gir_name)_MSVC_PROGRAM)),, + $(error Need to define $(_gir_name)_MSVC_LIBS or $(_gir_name)_MSVC_PROGRAM)) + +$(top_builddir)/win32/$(_gir_name)_list: + for F in $(_gir_files_msvc); do \ + case $$$$F in \ + *.c|*.cpp|*.cc|*.cxx|*.h|*.hpp|*.hh|*.hxx) \ + echo '..'$(_gir_source_subdir_msvc)$$$$F >>$(top_builddir)/win32/$(_gir_name)_list \ + ;; \ + esac; \ + done + +$(top_builddir)/win32/$(1).msvc.introspect: + -$(RM) $(top_builddir)/win32/$(1).msvc.introspect + +# Assemble the Command to Run g-ir-scanner + echo $(1)': '$(_gir_name)'_list '$($(_gir_name)_MSVC_GIR_DEPS)>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' @-echo Generating $$$$@...'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' $$$$(PYTHON) $$$$(G_IR_SCANNER) \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --verbose -no-libtool \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --namespace='$(_gir_namespace_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --nsversion='$(_gir_version_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_packages_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_libraries_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_program_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --add-include-path=$$$$(G_IR_INCLUDEDIR) \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_includes_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_export_packages_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(_gir_c_includes_msvc)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --cflags-begin \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$($(_gir_name)_MSVC_CFLAGS)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --cflags-end \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$($(_gir_name)_MSVC_SCANNERFLAGS)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --filelist='$(_gir_name)'_list \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' -o $$$$@'>>$(top_builddir)/win32/$(1).msvc.introspect + echo '' >>$(top_builddir)/win32/$(1).msvc.introspect + +# Finally Assemble the Command to Compile the generated .gir + echo '$(_typelib_basename_msvc).typelib: '$(_typelib_basename_msvc)'.gir'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' @-echo Compiling $$$$@...'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' $$$$(G_IR_COMPILER) \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' --includedir=. --debug --verbose \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' '$(1)' \'>>$(top_builddir)/win32/$(1).msvc.introspect + echo ' -o $$$$@'>>$(top_builddir)/win32/$(1).msvc.introspect + echo '' >>$(top_builddir)/win32/$(1).msvc.introspect +endef + +$(foreach gir,$(MSVC_INTROSPECT_GIRS),$(eval $(call gir-nmake-builder,$(gir)))) diff --git a/win32/Makefile.msvcproj b/win32/Makefile.msvcproj new file mode 100644 index 0000000..2e96e12 --- /dev/null +++ b/win32/Makefile.msvcproj @@ -0,0 +1,153 @@ +# Author: Fan, Chun-wei +# Common Autotools file used to generate Visual Studio 2008+ +# Projects from their templates + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# * Input variables: +# +# MSVCPROJS - List of Projects that should be generated +# +# * Simple tutorial +# +# Add this to Makefile.am where your library/program is built: +# include +# MSVCPROJS = YourProject (can be multiple projects in a single srcdir) +# YourProject_FILES = $(libyourlib_1_0_SOURCES) +# YourProject_EXCLUDES = ... # list of sources to exclude, separated by '|', wildcards allowed; use random unsed value if none +# (the following 3 lines if headers need to be installed) +# YourProject_HEADERS_DIR = $(libyourlibincludedir) +# YourProject_HEADERS_INST = $(libyourlib_1_0_HEADERS) +# YourProject_HEADERS_EXCLUDES = ... # +# +# dist-hook: \ # (or add to it if it is already there, note the vs9 items will also call the vs10 items in the process) +# $(top_builddir)/win32/vs9/YourProject.vcproj \ +# $(top_builddir)/win32/vs9/YourProject.headers # if headers need to be installed +# +# --or, if Visual Studio 2013 or later is required-- +# dist-hook: \ # (or add to it if it is already there, this does -not- call other vs items in the process) +# $(top_builddir)/win32/vs12/YourProject.vcxproj \ +# $(top_builddir)/win32/vs12/YourProject.vs12.headers # if headers need to be installed + +# Private functions + +## Transform the MSVC project filename (no filename extensions) to something which can reference through a variable +## without automake/make complaining, eg Gtk-2.0 -> Gtk_2_0 +_proj_name=$(subst /,_,$(subst -,_,$(subst .,_,$(1)))) +_proj_path_raw:=$(subst $(abs_top_srcdir),,$(abs_srcdir)) +_proj_path=$(subst /,\\,$(_proj_path_raw)) +_proj_subdir_int=$(subst \\\\,\\,\\$(_proj_path)\\) +_proj_subdir=$(subst \\.\\,\\,$(_proj_subdir_int)) + +_proj_files_raw=$(subst /,\\,$($(_proj_name)_FILES)) +_proj_files=$(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_proj_path)\\,\\,$(_proj_files_raw)))) +_proj_filters=$($(_proj_name)_EXCLUDES) + +_proj_headers_raw=$(subst /,\\,$($(_proj_name)_HEADERS_INST)) +_proj_headers=$(subst $(srcdir)\\,,$(subst $(builddir)\\,,$(subst $(top_builddir)\\$(_proj_path)\\,\\,$(_proj_headers_raw)))) +_proj_headers_excludes=$($(_proj_name)_HEADERS_EXCLUDES) + +_headers_dest_posix=$(subst $(includedir),,$($(_proj_name)_HEADERS_DIR)) +_headers_destdir=$(subst /,\\,$(_headers_dest_posix)) + +# +# Creates Visual Studio 2008/2010 projects from items passed in from autotools files +# $(1) - Base Name of the MSVC project files (outputs) +# + +define msvcproj-builder + +$(top_builddir)/win32/vs10/$(1).vcxproj: $(top_builddir)/win32/vs9/$(1).vcproj +$(top_builddir)/win32/vs10/$(1).vcxproj.filters: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).sourcefiles: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).vs10.sourcefiles: $(top_builddir)/win32/vs9/$(1).vcproj +$(1).vs10.sourcefiles.filters: $(top_builddir)/win32/vs9/$(1).vcproj + +$(top_builddir)/win32/vs9/$(1).vcproj: Makefile + -$(RM) $(top_builddir)/win32/vs9/$(1).vcproj + -$(RM) $(top_builddir)/win32/vs10/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs10/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs11/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs11/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs12/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs12/$(1).vcxproj.filters + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj.filters + + + for F in $(_proj_files); do \ + case $$$$F in \ + $(_proj_filters)) \ + ;; \ + *.c|*.cpp|*.cc|*.cxx) \ + echo ' ' >>$(1).sourcefiles && \ + echo ' ' >>$(1).vs10.sourcefiles && \ + echo ' Source Files' >>$(1).vs10.sourcefiles.filters \ + ;; \ + esac; \ + done + + + $(CPP) -P - <$(top_srcdir)/win32/vs9/$(1).vcprojin >$(top_builddir)/win32/vs9/$(1).vcproj + $(CPP) -P - <$(top_srcdir)/win32/vs10/$(1).vcxprojin >$(top_builddir)/win32/vs10/$(1).vcxproj + $(CPP) -P - <$(top_srcdir)/win32/vs10/$(1).vcxproj.filtersin >$(top_builddir)/win32/vs10/$(1).vcxproj.filters + $(RM) $(1).sourcefiles + $(RM) $(1).vs10.sourcefiles + $(RM) $(1).vs10.sourcefiles.filters + +$(top_builddir)/win32/vs10/$(1).vs10.headers: $(top_builddir)/win32/vs9/$(1).headers + +$(top_builddir)/win32/vs9/$(1).headers: Makefile + -$(RM) $(top_builddir)/win32/vs9/$(1).headers + -$(RM) $(top_builddir)/win32/vs10/$(1).vs10.headers + + for F in $(_proj_headers); do \ + case $$$$F in \ + $(_proj_headers_excludes)) \ + ;; \ + *.h|*.hpp|*.hh|*.hxx) \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F' ' >>$(top_builddir)/win32/vs9/$(1).headers && \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F >>$(top_builddir)/win32/vs10/$(1).vs10.headers \ + ;; \ + esac; \ + done + +$(top_builddir)/win32/vs12/$(1).vcxproj.filters: $(top_builddir)/win32/vs12/$(1).vcxproj + +$(top_builddir)/win32/vs12/$(1).vcxproj: Makefile + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj + -$(RM) $(top_builddir)/win32/vs14/$(1).vcxproj.filters + + for F in $(_proj_files); do \ + case $$$$F in \ + $(_proj_filters)) \ + ;; \ + *.c|*.cpp|*.cc|*.cxx) \ + echo ' ' >>$(1).vs12.sourcefiles && \ + echo ' Source Files' >>$(1).vs12.sourcefiles.filters \ + ;; \ + esac; \ + done + + $(CPP) -P - <$(top_srcdir)/win32/vs12/$(1).vcxprojin >$(top_builddir)/win32/vs12/$(1).vcxproj + $(CPP) -P - <$(top_srcdir)/win32/vs12/$(1).vcxproj.filtersin >$(top_builddir)/win32/vs12/$(1).vcxproj.filters + $(RM) $(1).vs12.sourcefiles + $(RM) $(1).vs12.sourcefiles.filters + +$(top_builddir)/win32/vs12/$(1).vs12.headers: Makefile + -$(RM) $(top_builddir)/win32/vs12/$(1).vs12.headers + + for F in $(_proj_headers); do \ + case $$$$F in \ + $(_proj_headers_excludes)) \ + ;; \ + *.h|*.hpp|*.hh|*.hxx) \ + echo 'copy ..\..'$(_proj_subdir)$$$$F' $$$$(CopyDir)\include'$(_headers_destdir)'\'$$$$F >>$(top_builddir)/win32/vs12/$(1).vs12.headers \ + ;; \ + esac; \ + done + +endef + +$(foreach proj,$(MSVCPROJS),$(eval $(call msvcproj-builder,$(proj)))) diff --git a/win32/PangoCairo_1_0_gir_list b/win32/PangoCairo_1_0_gir_list new file mode 100644 index 0000000..82caf72 --- /dev/null +++ b/win32/PangoCairo_1_0_gir_list @@ -0,0 +1,8 @@ +..\pango\pangocairo-context.c +..\pango\pangocairo-font.c +..\pango\pangocairo-fontmap.c +..\pango\pangocairo-render.c +..\pango\pangocairo-win32font.c +..\pango\pangocairo-win32fontmap.c +..\pango\pangocairo-win32.h +..\pango\pangocairo.h diff --git a/win32/Pango_1_0_gir_list b/win32/Pango_1_0_gir_list new file mode 100644 index 0000000..71c6122 --- /dev/null +++ b/win32/Pango_1_0_gir_list @@ -0,0 +1,58 @@ +..\pango\break.c +..\pango\ellipsize.c +..\pango\fonts.c +..\pango\glyphstring.c +..\pango\modules.c +..\pango\pango-attributes.c +..\pango\pango-bidi-type.c +..\pango\pango-color.c +..\pango\pango-context.c +..\pango\pango-coverage.c +..\pango\pango-emoji.c +..\pango\pango-emoji-table.h +..\pango\pango-engine.c +..\pango\pango-fontmap.c +..\pango\pango-fontset.c +..\pango\pango-glyph-item.c +..\pango\pango-gravity.c +..\pango\pango-impl-utils.h +..\pango\pango-item.c +..\pango\pango-language.c +..\pango\pango-language-sample-table.h +..\pango\pango-layout.c +..\pango\pango-markup.c +..\pango\pango-matrix.c +..\pango\pango-renderer.c +..\pango\pango-script.c +..\pango\pango-script-lang-table.h +..\pango\pango-tabs.c +..\pango\pango-utils.c +..\pango\pango-utils-internal.h +..\pango\reorder-items.c +..\pango\shape.c +..\pango\pango-enum-types.c +..\pango\pango.h +..\pango\pango-attributes.h +..\pango\pango-bidi-type.h +..\pango\pango-break.h +..\pango\pango-context.h +..\pango\pango-coverage.h +..\pango\pango-engine.h +..\pango\pango-font.h +..\pango\pango-fontmap.h +..\pango\pango-fontset.h +..\pango\pango-glyph.h +..\pango\pango-glyph-item.h +..\pango\pango-gravity.h +..\pango\pango-item.h +..\pango\pango-language.h +..\pango\pango-layout.h +..\pango\pango-matrix.h +..\pango\pango-modules.h +..\pango\pango-renderer.h +..\pango\pango-script.h +..\pango\pango-tabs.h +..\pango\pango-types.h +..\pango\pango-utils.h +..\pango\pango-version-macros.h +..\pango\pango-enum-types.h diff --git a/win32/detectenv-msvc.mak b/win32/detectenv-msvc.mak new file mode 100644 index 0000000..6fd96cc --- /dev/null +++ b/win32/detectenv-msvc.mak @@ -0,0 +1,78 @@ +# Common NMake Makefile module for checking the build environment +# This can be copied from $(glib_srcroot)\build\win32 for GNOME items +# that support MSVC builds and introspection under MSVC, and can be used +# for building test programs as well. + +# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or +# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) +!if !defined(VCINSTALLDIR) && !defined(WINDOWSSDKDIR) +MSG = ^ +This Makefile is only for Visual Studio 2008 and later.^ +You need to ensure that the Visual Studio Environment is properly set up^ +before running this Makefile. +!error $(MSG) +!endif + +ERRNUL = 2>NUL +_HASH=^# + +!if ![echo VCVERSION=_MSC_VER > vercl.x] \ + && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ + && ![echo PLAT=Win32 >> vercl.x] \ + && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ + && ![echo PLAT=x64 >> vercl.x] \ + && ![echo $(_HASH)endif >> vercl.x] \ + && ![cl -nologo -TC -P vercl.x $(ERRNUL)] +!include vercl.i +!if ![echo VCVER= ^\> vercl.vc] \ + && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] +!include vercl.vc +!endif +!endif +!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] +!endif + +!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600 +VSVER = 9 +!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700 +VSVER = 10 +!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800 +VSVER = 11 +!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900 +VSVER = 12 +!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910 +VSVER = 14 +!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 2000 +VSVER = 15 +!else +VSVER = 0 +!endif + +!if "$(VSVER)" == "0" +MSG = ^ +This NMake Makefile set supports Visual Studio^ +9 (2008) through 14 (2015). Your Visual Studio^ +version is not supported. +!error $(MSG) +!endif + +VALID_CFGSET = FALSE +!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug" +VALID_CFGSET = TRUE +!endif + +# We want debugging symbols logged for all builds, +# using .pdb files for release builds +CFLAGS_BASE = /Zi + +!if "$(CFG)" == "release" || "$(CFG)" == "Release" +CFLAGS_ADD = /MD /O2 $(CFLAGS_BASE) +!else +CFLAGS_ADD = /MDd /Od $(CFLAGS_BASE) +!endif + +!if "$(PLAT)" == "x64" +LDFLAGS_ARCH = /machine:x64 +!else +LDFLAGS_ARCH = /machine:x86 +!endif diff --git a/win32/introspection-msvc.mak b/win32/introspection-msvc.mak new file mode 100644 index 0000000..26501f5 --- /dev/null +++ b/win32/introspection-msvc.mak @@ -0,0 +1,94 @@ +# Common NMake Makefile module for checking the build environment is sane +# for building introspection files under MSVC/NMake. +# This can be copied from $(gi_srcroot)\build\win32 for GNOME items +# that support MSVC builds and introspection under MSVC. + +# Can override with env vars as needed +# You will need to have built gobject-introspection for this to work. +# Change or pass in or set the following to suit your environment + +!if "$(PREFIX)" == "" +PREFIX = ..\..\vs$(VSVER)\$(PLAT) +!endif + +!if ![setlocal] && \ + ![set PFX=$(PREFIX)] && \ + ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x] +!endif +!include pfx.x + +!if "$(PKG_CONFIG_PATH)" == "" +PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig +!else +PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig;$(PKG_CONFIG_PATH) +!endif + +!if ![del $(ERRNUL) /q/f pfx.x] +!endif + +# Note: The PYTHON must be the Python release series that was used to build +# the GObject-introspection scanner Python module! +# Either having python.exe your PATH will work or passing in +# PYTHON= will do + +# This is required, and gobject-introspection needs to be built +# before this can be successfully run. +!if "$(PYTHON)" == "" +PYTHON=python +!endif + +# Path to the pkg-config tool, if not already in the PATH +!if "$(PKG_CONFIG)" == "" +PKG_CONFIG=pkg-config +!endif + +# Don't change anything following this line! + +GIR_SUBDIR = share\gir-1.0 +GIR_TYPELIBDIR = lib\girepository-1.0 +G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner +G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe +G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR) +G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR) + +VALID_PKG_CONFIG_PATH = FALSE + +MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH +MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files + +ERROR_MSG = + +BUILD_INTROSPECTION = TRUE + +!if ![set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)] \ + && ![$(PKG_CONFIG) --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \ + && ![setlocal] \ + && ![set file="pkgconfig.x"] \ + && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \ + && ![del $(ERRNUL) /q/f pkgconfig.x] +!endif + +!include pkgconfig.chksize +!if "$(PKG_CHECK_SIZE)" == "0" +VALID_PKG_CONFIG_PATH = TRUE +!else +VALID_PKG_CONFIG_PATH = FALSE +!endif + +!if ![del $(ERRNUL) /q/f pkgconfig.chksize] +!endif + +VALID_CFGSET = FALSE +!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug" +VALID_CFGSET = TRUE +!endif + +!if "$(VALID_PKG_CONFIG_PATH)" != "TRUE" +BUILD_INTROSPECTION = FALSE +ERROR_MSG = $(MSG_INVALID_PKGCONFIG) +!endif + +!if "$(VALID_CFGSET)" != "TRUE" +BUILD_INTROSPECTION = FALSE +ERROR_MSG = $(MSG_INVALID_CFG) +!endif diff --git a/win32/introspection.body.mak b/win32/introspection.body.mak new file mode 100644 index 0000000..aa981bc --- /dev/null +++ b/win32/introspection.body.mak @@ -0,0 +1,54 @@ +Pango-1.0.gir: Pango_1_0_gir_list + @-echo Generating $@... + $(PYTHON) $(G_IR_SCANNER) \ + --verbose -no-libtool \ + --namespace=Pango \ + --nsversion=1.0 \ + --pkg=gobject-2.0 --pkg=cairo --pkg=glib-2.0 \ + --library=pango-1.0 \ + \ + --add-include-path=$(G_IR_INCLUDEDIR) \ + --include=GObject-2.0 --include=cairo-1.0 \ + --pkg-export=pango \ + \ + --cflags-begin \ + -I.. -DG_LOG_DOMAIN="Pango" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE \ + --cflags-end \ + --c-include pango/pango.h \ + --filelist=Pango_1_0_gir_list \ + -o $@ + +Pango-1.0.typelib: Pango-1.0.gir + @-echo Compiling $@... + $(G_IR_COMPILER) \ + --includedir=. --debug --verbose \ + Pango-1.0.gir \ + -o $@ + +PangoCairo-1.0.gir: PangoCairo_1_0_gir_list Pango-1.0.gir + @-echo Generating $@... + $(PYTHON) $(G_IR_SCANNER) \ + --verbose -no-libtool \ + --namespace=PangoCairo \ + --nsversion=1.0 \ + --pkg=gobject-2.0 --pkg=cairo \ + --library=pango-1.0 --library=pangocairo-1.0 \ + \ + --add-include-path=$(G_IR_INCLUDEDIR) \ + --include=GObject-2.0 --include=cairo-1.0 --include=win32-1.0 \ + --pkg-export=pangocairo \ + \ + --cflags-begin \ + -I.. -DG_LOG_DOMAIN="Pango" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE \ + --cflags-end \ + --include-uninstalled=./Pango-1.0.gir --c-include pango/pangocairo.h \ + --filelist=PangoCairo_1_0_gir_list \ + -o $@ + +PangoCairo-1.0.typelib: PangoCairo-1.0.gir + @-echo Compiling $@... + $(G_IR_COMPILER) \ + --includedir=. --debug --verbose \ + PangoCairo-1.0.gir \ + -o $@ + diff --git a/win32/pango-introspection-msvc.mak b/win32/pango-introspection-msvc.mak new file mode 100644 index 0000000..b2961a7 --- /dev/null +++ b/win32/pango-introspection-msvc.mak @@ -0,0 +1,53 @@ +# NMake Makefile to build Introspection Files for Pango + +!include detectenv-msvc.mak + +APIVERSION = 1.0 + +CHECK_PACKAGE = gobject-2.0 cairo + +!include introspection-msvc.mak + +!if "$(BUILD_INTROSPECTION)" == "TRUE" +!if "$(BUILD_PANGOFT2_INTROSPECTION)" == "1" + +# Build of PangoFT2 introspection files is not currently supported. +PangoFT2LIBS = --library=pangoft2-1.0 +PangoFT2GIR = --include-uninstalled=./PangoFT2-$(APIVERSION) + +all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoFT2-$(APIVERSION).gir PangoFT2-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib + +!else + +PangoFT2LIBS = +PangoFT2GIR = + +all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib + +install-introspection: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib + @-copy Pango-$(APIVERSION).gir $(G_IR_INCLUDEDIR) + @-copy /b Pango-$(APIVERSION).typelib $(G_IR_TYPELIBDIR) + @-copy PangoCairo-$(APIVERSION).gir $(G_IR_INCLUDEDIR) + @-copy /b PangoCairo-$(APIVERSION).typelib $(G_IR_TYPELIBDIR) +!endif + +setbuildenv: + @set PYTHONPATH=$(PREFIX)\lib\gobject-introspection + @set PATH=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\bin;$(PATH) + @set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) + @set LIB=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\lib;$(LIB) + +!include introspection.body.mak + +!else +all: + @-echo $(ERROR_MSG) +!endif + +clean: + @-del /f/q PangoCairo-$(APIVERSION).typelib + @-del /f/q PangoCairo-$(APIVERSION).gir + @-del /f/q PangoFT2-$(APIVERSION).typelib + @-del /f/q PangoFT2-$(APIVERSION).gir + @-del /f/q Pango-$(APIVERSION).typelib + @-del /f/q Pango-$(APIVERSION).gir diff --git a/win32/pangopc.py b/win32/pangopc.py new file mode 100644 index 0000000..14eac3f --- /dev/null +++ b/win32/pangopc.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +# +# Utility script to generate .pc files for Pango +# for Visual Studio builds, to be used for +# building introspection files + +# Author: Fan, Chun-wei +# Date: April 21, 2016 + +import os +import sys +import argparse + +from replace import replace_multi +from pc_base import BasePCItems + +def main(argv): + base_pc = BasePCItems() + + pango_parser = argparse.ArgumentParser(description='Setup basic .pc file info') + pango_parser.add_argument('--pangoft2', + action='store_const', + const=1, + help='Create .pc for PangoFT2') + base_pc.setup(argv, pango_parser) + base_pkg_replace_items = {'@PANGO_API_VERSION@': '1.0', + '-lm': ''} + + base_pkg_replace_items.update(base_pc.base_replace_items) + + # Generate pango.pc + replace_multi(base_pc.top_srcdir + '/pango.pc.in', + base_pc.srcdir + '/pango.pc', + base_pkg_replace_items) + + # Generate pangowin32.pc + replace_multi(base_pc.top_srcdir + '/pangowin32.pc.in', + base_pc.srcdir + '/pangowin32.pc', + base_pkg_replace_items) + + # Generate pangoft2.pc, if requested + pango_args = pango_parser.parse_args() + if getattr(pango_args, 'pangoft2', None) is 1: + replace_multi(base_pc.top_srcdir + '/pangoft2.pc.in', + base_pc.srcdir + '/pangoft2.pc', + base_pkg_replace_items) + + # Generate pangocairo.pc + pangocairo_replace_items = {'@PKGCONFIG_CAIRO_REQUIRES@': 'cairo'} + pangocairo_replace_items.update(base_pkg_replace_items) + replace_multi(base_pc.top_srcdir + '/pangocairo.pc.in', + base_pc.srcdir + '/pangocairo.pc', + pangocairo_replace_items) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/win32/pc_base.py b/win32/pc_base.py new file mode 100644 index 0000000..285b6cd --- /dev/null +++ b/win32/pc_base.py @@ -0,0 +1,124 @@ +#!/usr/bin/python +# +# Simple utility script to generate the basic info +# needed in a .pc (pkg-config) file, used especially +# for introspection purposes + +# This can be used in various projects where +# there is the need to generate .pc files, +# and is copied from GLib's $(srcroot)/build/win32 + +# Author: Fan, Chun-wei +# Date: March 10, 2016 + +import os +import sys +import argparse + +class BasePCItems: + def __init__(self): + self.base_replace_items = {} + self.exec_prefix = '' + self.includedir = '' + self.libdir = '' + self.prefix = '' + self.srcdir = os.path.dirname(__file__) + self.top_srcdir = self.srcdir + '\\..' + self.version = '' + + def setup(self, argv, parser=None): + if parser is None: + parser = argparse.ArgumentParser(description='Setup basic .pc file info') + parser.add_argument('--prefix', help='prefix of the installed library', + required=True) + parser.add_argument('--exec-prefix', + help='prefix of the installed programs, \ + if different from the prefix') + parser.add_argument('--includedir', + help='includedir of the installed library, \ + if different from ${prefix}/include') + parser.add_argument('--libdir', + help='libdir of the installed library, \ + if different from ${prefix}/lib') + parser.add_argument('--version', help='Version of the package', + required=True) + args = parser.parse_args() + + self.version = args.version + + # check whether the prefix and exec_prefix are valid + if not os.path.exists(args.prefix): + raise SystemExit('Specified prefix \'%s\' is invalid' % args.prefix) + + # use absolute paths for prefix + self.prefix = os.path.abspath(args.prefix).replace('\\','/') + + # check and setup the exec_prefix + if getattr(args, 'exec_prefix', None) is None: + exec_prefix_use_shorthand = True + self.exec_prefix = '${prefix}' + else: + if args.exec_prefix.startswith('${prefix}'): + exec_prefix_use_shorthand = True + input_exec_prefix = args.prefix + args.exec_prefix[len('${prefix}'):] + else: + exec_prefix_use_shorthand = False + input_exec_prefix = args.exec_prefix + if not os.path.exists(input_exec_prefix): + raise SystemExit('Specified exec_prefix \'%s\' is invalid' % + args.exec_prefix) + if exec_prefix_use_shorthand is True: + self.exec_prefix = args.exec_prefix.replace('\\','/') + else: + self.exec_prefix = os.path.abspath(input_exec_prefix).replace('\\','/') + + # check and setup the includedir + if getattr(args, 'includedir', None) is None: + self.includedir = '${prefix}/include' + else: + if args.includedir.startswith('${prefix}'): + includedir_use_shorthand = True + input_includedir = args.prefix + args.includedir[len('${prefix}'):] + else: + if args.includedir.startswith('${exec_prefix}'): + includedir_use_shorthand = True + input_includedir = input_exec_prefix + args.includedir[len('${exec_prefix}'):] + else: + includedir_use_shorthand = False + input_includedir = args.includedir + if not os.path.exists(input_includedir): + raise SystemExit('Specified includedir \'%s\' is invalid' % + args.includedir) + if includedir_use_shorthand is True: + self.includedir = args.includedir.replace('\\','/') + else: + self.includedir = os.path.abspath(input_includedir).replace('\\','/') + + # check and setup the libdir + if getattr(args, 'libdir', None) is None: + self.libdir = '${prefix}/lib' + else: + if args.libdir.startswith('${prefix}'): + libdir_use_shorthand = True + input_libdir = args.prefix + args.libdir[len('${prefix}'):] + else: + if args.libdir.startswith('${exec_prefix}'): + libdir_use_shorthand = True + input_libdir = input_exec_prefix + args.libdir[len('${exec_prefix}'):] + else: + libdir_use_shorthand = False + input_libdir = args.libdir + if not os.path.exists(input_libdir): + raise SystemExit('Specified libdir \'%s\' is invalid' % + args.libdir) + if libdir_use_shorthand is True: + self.libdir = args.libdir.replace('\\','/') + else: + self.libdir = os.path.abspath(input_libdir).replace('\\','/') + + # setup dictionary for replacing items in *.pc.in + self.base_replace_items.update({'@VERSION@': self.version}) + self.base_replace_items.update({'@prefix@': self.prefix}) + self.base_replace_items.update({'@exec_prefix@': self.exec_prefix}) + self.base_replace_items.update({'@libdir@': self.libdir}) + self.base_replace_items.update({'@includedir@': self.includedir}) diff --git a/win32/replace.py b/win32/replace.py new file mode 100644 index 0000000..f215cce --- /dev/null +++ b/win32/replace.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# +# Simple utility script to manipulate +# certain types of strings in a file + +# This can be used in various projects where +# there is the need to replace strings in files, +# and is copied from GLib's $(srcroot)/build/win32 + +# Author: Fan, Chun-wei +# Date: September 03, 2014 + +import os +import sys +import re +import string +import argparse + +valid_actions = ['remove-prefix', + 'replace-var', + 'replace-str', + 'remove-str'] + +def open_file(filename, mode): + if sys.version_info[0] < 3: + return open(filename, mode=mode) + else: + return open(filename, mode=mode, encoding='utf-8') + +def replace_multi(src, dest, replace_items): + with open_file(src, 'r') as s: + with open_file(dest, 'w') as d: + for line in s: + replace_dict = dict((re.escape(key), value) \ + for key, value in replace_items.items()) + replace_pattern = re.compile("|".join(replace_dict.keys())) + d.write(replace_pattern.sub(lambda m: \ + replace_dict[re.escape(m.group(0))], line)) + +def replace(src, dest, instring, outstring): + replace_item = {instring: outstring} + replace_multi(src, dest, replace_item) + +def check_required_args(args, params): + for param in params: + if getattr(args, param, None) is None: + raise SystemExit('%s: error: --%s argument is required' % (__file__, param)) + +def warn_ignored_args(args, params): + for param in params: + if getattr(args, param, None) is not None: + print('%s: warning: --%s argument is ignored' % (__file__, param)) + +def main(argv): + + parser = argparse.ArgumentParser(description='Process strings in a file.') + parser.add_argument('-a', + '--action', + help='Action to carry out. Can be one of:\n' + 'remove-prefix\n' + 'replace-var\n' + 'replace-str\n' + 'remove-str', + choices=valid_actions) + parser.add_argument('-i', '--input', help='Input file') + parser.add_argument('-o', '--output', help='Output file') + parser.add_argument('--instring', help='String to replace or remove') + parser.add_argument('--var', help='Autotools variable name to replace') + parser.add_argument('--outstring', + help='New String to replace specified string or variable') + parser.add_argument('--removeprefix', help='Prefix of string to remove') + + args = parser.parse_args() + + input_string = '' + output_string = '' + + # We must have action, input, output for all operations + check_required_args(args, ['action','input','output']) + + # Build the arguments by the operation that is to be done, + # to be fed into replace() + + # Get rid of prefixes from a string + if args.action == 'remove-prefix': + check_required_args(args, ['instring','removeprefix']) + warn_ignored_args(args, ['outstring','var']) + input_string = args.removeprefix + args.instring + output_string = args.instring + + # Replace an m4-style variable (those surrounded by @...@) + if args.action == 'replace-var': + check_required_args(args, ['var','outstring']) + warn_ignored_args(args, ['instring','removeprefix']) + input_string = '@' + args.var + '@' + output_string = args.outstring + + # Replace a string + if args.action == 'replace-str': + check_required_args(args, ['instring','outstring']) + warn_ignored_args(args, ['var','removeprefix']) + input_string = args.instring + output_string = args.outstring + + # Remove a string + if args.action == 'remove-str': + check_required_args(args, ['instring']) + warn_ignored_args(args, ['var','outstring','removeprefix']) + input_string = args.instring + output_string = '' + + replace(args.input, args.output, input_string, output_string) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/win32/unistd.h b/win32/unistd.h new file mode 100644 index 0000000..8655b1d --- /dev/null +++ b/win32/unistd.h @@ -0,0 +1 @@ +#include diff --git a/win32/vs10/Makefile.am b/win32/vs10/Makefile.am new file mode 100644 index 0000000..e654c3b --- /dev/null +++ b/win32/vs10/Makefile.am @@ -0,0 +1,44 @@ +GENERATED_ITEMS = \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.props + +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.propsin \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxprojin \ + pango.vcxproj.filtersin \ + pangoft2.vcxprojin \ + pangoft2.vcxproj.filtersin \ + pangowin32.vcxprojin \ + pangowin32.vcxproj.filtersin \ + pangocairo.vcxprojin \ + pangocairo.vcxproj.filtersin \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt \ + $(GENERATED_ITEMS) + +pango-install.props: $(top_srcdir)/win32/vs10/pango-install.propsin pango.vs10.headers + -$(RM) $(top_builddir)/win32/vs11/pango-install.props + -$(RM) $(top_builddir)/win32/vs12/pango-install.props + -$(RM) $(top_builddir)/win32/vs14/pango-install.props + -$(RM) $(top_builddir)/win32/vs15/pango-install.props + $(CPP) -P - <$(top_srcdir)/win32/vs10/pango-install.propsin >$@ + rm pango.vs10.headers + +DISTCLEANFILES = $(GENERATED_ITEMS) + +-include $(top_srcdir)/git.mk diff --git a/win32/vs10/Makefile.in b/win32/vs10/Makefile.in new file mode 100644 index 0000000..60602cb --- /dev/null +++ b/win32/vs10/Makefile.in @@ -0,0 +1,546 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs10 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = pango-version-paths.props +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(srcdir)/pango-version-paths.props.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +GENERATED_ITEMS = \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.props + +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.propsin \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxprojin \ + pango.vcxproj.filtersin \ + pangoft2.vcxprojin \ + pangoft2.vcxproj.filtersin \ + pangowin32.vcxprojin \ + pangowin32.vcxproj.filtersin \ + pangocairo.vcxprojin \ + pangocairo.vcxproj.filtersin \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt \ + $(GENERATED_ITEMS) + +DISTCLEANFILES = $(GENERATED_ITEMS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs10/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs10/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +pango-version-paths.props: $(top_builddir)/config.status $(srcdir)/pango-version-paths.props.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +pango-install.props: $(top_srcdir)/win32/vs10/pango-install.propsin pango.vs10.headers + -$(RM) $(top_builddir)/win32/vs11/pango-install.props + -$(RM) $(top_builddir)/win32/vs12/pango-install.props + -$(RM) $(top_builddir)/win32/vs14/pango-install.props + -$(RM) $(top_builddir)/win32/vs15/pango-install.props + $(CPP) -P - <$(top_srcdir)/win32/vs10/pango-install.propsin >$@ + rm pango.vs10.headers + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs10/README.txt b/win32/vs10/README.txt new file mode 100644 index 0000000..81fffa3 --- /dev/null +++ b/win32/vs10/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS10 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcxprojin/vcxproj.filtersin files +here into .vcxproj/.vcxproj.filters files. + +It is recommended that GLib is compiled with VS10 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs10\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS10 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS10 +using VS project files and/or makefiles at this time of writing. +For GLib, VS10 project files are available under +$(srcroot)\vs10 in the case of GLib (stable/unstable). + +There is no known official VS10 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs10\ + +Unzip the binaries obtained from ftp.gnome.org in \vs10\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs10\\bin + .lib files: \vs10\\lib + .h files: \vs10\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs10 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs10\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS10) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs10\README.txt. + + is either Win32 or x64, as in VS10 project files. + +You should unpack the glib-dev zip file into +\vs10\, so that for instance glib.h ends up at +\vs10\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs10\. For instance, +built DLLs go into \vs10\\bin, built LIBs into +\vs10\\lib and headers into +\vs10\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs10\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs10\\share\gir-1.0 (the .gir file(s)) and +\vs10\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs10/pango-build-defines.props b/win32/vs10/pango-build-defines.props new file mode 100644 index 0000000..65a9dfc --- /dev/null +++ b/win32/vs10/pango-build-defines.props @@ -0,0 +1,71 @@ + + + + + + + 1.8.0 + /dummy + G_LOG_DOMAIN="Pango";PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR="$(PangoDummyPrefix)/etc";LIBDIR="$(PangoDummyPrefix)/lib" + HAVE_CAIRO_FREETYPE=1 + ..;$(GlibEtcInstallRoot)\include\harfbuzz + fontconfig.lib;freetype.lib;harfbuzz.lib + $(GlibEtcInstallRoot)\include\cairo + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f pango-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstallRoot) + $(SolutionDir)\..\PangoCairo-1.0.gir;$(SolutionDir)\..\PangoCairo-1.0.typelib;$(SolutionDir)\..\Pango-1.0.gir;$(SolutionDir)\..\Pango-1.0.typelib + + + <_PropertySheetDisplayName>pangobuilddefinesprops + $(SolutionDir)$(Configuration)\$(PlatformName)\bin\ + $(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\ + + + + ..\..;..\..\pango;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2;%(AdditionalIncludeDirectories) + HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions) + msvc_recommended_pragmas.h;%(ForcedIncludeFiles) + true + /d2Zi+ %(AdditionalOptions) + + + gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) + $(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).pdb + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + + + + + $(PangoBinaryVersion) + + + $(PangoDummyPrefix) + + + $(PangoDefines) + + + $(CairoFTDefines) + + + $(PangoFT2Incs) + + + $(PangoFT2Libs) + + + $(PangoCairoIncs) + + + $(PangoIntrospectNMakeCmd) + + + $(PangoIntrospectBuiltFiles) + + + diff --git a/win32/vs10/pango-ignore-fc.props b/win32/vs10/pango-ignore-fc.props new file mode 100644 index 0000000..fef038d --- /dev/null +++ b/win32/vs10/pango-ignore-fc.props @@ -0,0 +1,14 @@ + + + + <_PropertySheetDisplayName>pangoignorefcprops + + + + false + + + $(OutDir)\pangowin32-1.0.lib;$(OutDir)\pango-1.0.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/win32/vs10/pango-install-bin.props b/win32/vs10/pango-install-bin.props new file mode 100644 index 0000000..aad3ca5 --- /dev/null +++ b/win32/vs10/pango-install-bin.props @@ -0,0 +1,49 @@ + + + + + + + +mkdir $(CopyDir)\bin + +mkdir $(CopyDir)\lib + + +if "$(Configuration)" == "Release_FC" goto DO_FC_BIN +if "$(Configuration)" == "Debug_FC" goto DO_FC_BIN + +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib +goto DONE_BIN + +:DO_FC_BIN +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pangoft2-$(ApiVersion).lib $(CopyDir)\lib +copy $(Configuration)\$(Platform)\bin\pangocairo-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +:DONE_BIN + + + + + <_PropertySheetDisplayName>pangoinstallbinprops + + + + $(PangoDoInstallBin) + + + diff --git a/win32/vs10/pango-install.props b/win32/vs10/pango-install.props new file mode 100644 index 0000000..77e7a0a --- /dev/null +++ b/win32/vs10/pango-install.props @@ -0,0 +1,81 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango.h $(CopyDir)\include\pango-1.0\pango\pango.h +copy ..\..\pango\pango-attributes.h $(CopyDir)\include\pango-1.0\pango\pango-attributes.h +copy ..\..\pango\pango-bidi-type.h $(CopyDir)\include\pango-1.0\pango\pango-bidi-type.h +copy ..\..\pango\pango-break.h $(CopyDir)\include\pango-1.0\pango\pango-break.h +copy ..\..\pango\pango-context.h $(CopyDir)\include\pango-1.0\pango\pango-context.h +copy ..\..\pango\pango-coverage.h $(CopyDir)\include\pango-1.0\pango\pango-coverage.h +copy ..\..\pango\pango-engine.h $(CopyDir)\include\pango-1.0\pango\pango-engine.h +copy ..\..\pango\pango-font.h $(CopyDir)\include\pango-1.0\pango\pango-font.h +copy ..\..\pango\pango-fontmap.h $(CopyDir)\include\pango-1.0\pango\pango-fontmap.h +copy ..\..\pango\pango-fontset.h $(CopyDir)\include\pango-1.0\pango\pango-fontset.h +copy ..\..\pango\pango-glyph.h $(CopyDir)\include\pango-1.0\pango\pango-glyph.h +copy ..\..\pango\pango-glyph-item.h $(CopyDir)\include\pango-1.0\pango\pango-glyph-item.h +copy ..\..\pango\pango-gravity.h $(CopyDir)\include\pango-1.0\pango\pango-gravity.h +copy ..\..\pango\pango-item.h $(CopyDir)\include\pango-1.0\pango\pango-item.h +copy ..\..\pango\pango-language.h $(CopyDir)\include\pango-1.0\pango\pango-language.h +copy ..\..\pango\pango-layout.h $(CopyDir)\include\pango-1.0\pango\pango-layout.h +copy ..\..\pango\pango-matrix.h $(CopyDir)\include\pango-1.0\pango\pango-matrix.h +copy ..\..\pango\pango-modules.h $(CopyDir)\include\pango-1.0\pango\pango-modules.h +copy ..\..\pango\pango-renderer.h $(CopyDir)\include\pango-1.0\pango\pango-renderer.h +copy ..\..\pango\pango-script.h $(CopyDir)\include\pango-1.0\pango\pango-script.h +copy ..\..\pango\pango-tabs.h $(CopyDir)\include\pango-1.0\pango\pango-tabs.h +copy ..\..\pango\pango-types.h $(CopyDir)\include\pango-1.0\pango\pango-types.h +copy ..\..\pango\pango-utils.h $(CopyDir)\include\pango-1.0\pango\pango-utils.h +copy ..\..\pango\pango-version-macros.h $(CopyDir)\include\pango-1.0\pango\pango-version-macros.h +copy ..\..\pango\pangocairo.h $(CopyDir)\include\pango-1.0\pango\pangocairo.h +copy ..\..\pango\pangowin32.h $(CopyDir)\include\pango-1.0\pango\pangowin32.h +copy ..\..\pango\pango-features.h $(CopyDir)\include\pango-1.0\pango\pango-features.h +copy ..\..\pango\pango-enum-types.h $(CopyDir)\include\pango-1.0\pango\pango-enum-types.h +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs10/pango-install.propsin b/win32/vs10/pango-install.propsin new file mode 100644 index 0000000..998d98c --- /dev/null +++ b/win32/vs10/pango-install.propsin @@ -0,0 +1,58 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +#include "pango.vs10.headers" + +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig + +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END + +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango + +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs10/pango-install.vcxproj b/win32/vs10/pango-install.vcxproj new file mode 100644 index 0000000..cce1b88 --- /dev/null +++ b/win32/vs10/pango-install.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + pangoinstall + Win32Proj + + + + Utility + MultiByte + true + v100 + + + Utility + MultiByte + true + v100 + + + Utility + MultiByte + v100 + + + Utility + MultiByte + v100 + + + Utility + MultiByte + true + v100 + + + Utility + MultiByte + true + v100 + + + Utility + MultiByte + v100 + + + Utility + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + + + + + + + + + + + + + + + + + + + + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + + + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c76} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs10/pango-install.vcxproj.filters b/win32/vs10/pango-install.vcxproj.filters new file mode 100644 index 0000000..88fd7b7 --- /dev/null +++ b/win32/vs10/pango-install.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + Resource Files + Resource Files + + diff --git a/win32/vs10/pango-introspect.vcxproj b/win32/vs10/pango-introspect.vcxproj new file mode 100644 index 0000000..6bab31e --- /dev/null +++ b/win32/vs10/pango-introspect.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {2FE2F832-D857-450E-99AF-549AC88422F2} + pangointrospect + + + + Makefile + true + MultiByte + v100 + + + Makefile + false + true + MultiByte + v100 + + + Makefile + MultiByte + v100 + + + Makefile + MultiByte + true + v100 + + + + + + + + + + + + + + + + + + + + + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + + {fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fb} + false + + + + + + \ No newline at end of file diff --git a/win32/vs10/pango-prebuild.props b/win32/vs10/pango-prebuild.props new file mode 100644 index 0000000..f7a441d --- /dev/null +++ b/win32/vs10/pango-prebuild.props @@ -0,0 +1,17 @@ + + + + + + + copy ..\..\config.h.win32 ..\..\config.h + + + <_PropertySheetDisplayName>pangoprebuildprops + + + + $(CopyConfigH) + + + diff --git a/win32/vs10/pango-version-paths.props b/win32/vs10/pango-version-paths.props new file mode 100644 index 0000000..89b809a --- /dev/null +++ b/win32/vs10/pango-version-paths.props @@ -0,0 +1,82 @@ + + + + 10 + 1 + 42 + 4 + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs10/pango-version-paths.props.in b/win32/vs10/pango-version-paths.props.in new file mode 100644 index 0000000..af921aa --- /dev/null +++ b/win32/vs10/pango-version-paths.props.in @@ -0,0 +1,82 @@ + + + + 10 + @PANGO_VERSION_MAJOR@ + @PANGO_VERSION_MINOR@ + @PANGO_VERSION_MICRO@ + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs10/pango.sln b/win32/vs10/pango.sln new file mode 100644 index 0000000..8e144d2 --- /dev/null +++ b/win32/vs10/pango.sln @@ -0,0 +1,111 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcxproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs10/pango.vcxproj b/win32/vs10/pango.vcxproj new file mode 100644 index 0000000..54db513 --- /dev/null +++ b/win32/vs10/pango.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs10/pango.vcxproj.filters b/win32/vs10/pango.vcxproj.filters new file mode 100644 index 0000000..d12ce65 --- /dev/null +++ b/win32/vs10/pango.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs10/pango.vcxproj.filtersin b/win32/vs10/pango.vcxproj.filtersin new file mode 100644 index 0000000..e53594b --- /dev/null +++ b/win32/vs10/pango.vcxproj.filtersin @@ -0,0 +1,28 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files +#include "pango.vs10.sourcefiles.filters" + + diff --git a/win32/vs10/pango.vcxprojin b/win32/vs10/pango.vcxprojin new file mode 100644 index 0000000..4ea5df3 --- /dev/null +++ b/win32/vs10/pango.vcxprojin @@ -0,0 +1,172 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + +#include "pango.vs10.sourcefiles" + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs10/pangocairo.vcxproj b/win32/vs10/pangocairo.vcxproj new file mode 100644 index 0000000..a2efb6c --- /dev/null +++ b/win32/vs10/pangocairo.vcxproj @@ -0,0 +1,344 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs10/pangocairo.vcxproj.filters b/win32/vs10/pangocairo.vcxproj.filters new file mode 100644 index 0000000..770c8d8 --- /dev/null +++ b/win32/vs10/pangocairo.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs10/pangocairo.vcxproj.filtersin b/win32/vs10/pangocairo.vcxproj.filtersin new file mode 100644 index 0000000..6cc96c2 --- /dev/null +++ b/win32/vs10/pangocairo.vcxproj.filtersin @@ -0,0 +1,29 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files +#include "pangocairo.vs10.sourcefiles.filters" + + diff --git a/win32/vs10/pangocairo.vcxprojin b/win32/vs10/pangocairo.vcxprojin new file mode 100644 index 0000000..49b95af --- /dev/null +++ b/win32/vs10/pangocairo.vcxprojin @@ -0,0 +1,341 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + +#include "pangocairo.vs10.sourcefiles" + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs10/pangoft2.vcxproj b/win32/vs10/pangoft2.vcxproj new file mode 100644 index 0000000..baed040 --- /dev/null +++ b/win32/vs10/pangoft2.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs10/pangoft2.vcxproj.filters b/win32/vs10/pangoft2.vcxproj.filters new file mode 100644 index 0000000..a815a60 --- /dev/null +++ b/win32/vs10/pangoft2.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs10/pangoft2.vcxproj.filtersin b/win32/vs10/pangoft2.vcxproj.filtersin new file mode 100644 index 0000000..1d5ceaa --- /dev/null +++ b/win32/vs10/pangoft2.vcxproj.filtersin @@ -0,0 +1,23 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + +#include "pangoft2.vs10.sourcefiles.filters" + + diff --git a/win32/vs10/pangoft2.vcxprojin b/win32/vs10/pangoft2.vcxprojin new file mode 100644 index 0000000..fc7a491 --- /dev/null +++ b/win32/vs10/pangoft2.vcxprojin @@ -0,0 +1,176 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + +#include "pangoft2.vs10.sourcefiles" + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs10/pangowin32.vcxproj b/win32/vs10/pangowin32.vcxproj new file mode 100644 index 0000000..37353ce --- /dev/null +++ b/win32/vs10/pangowin32.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs10/pangowin32.vcxproj.filters b/win32/vs10/pangowin32.vcxproj.filters new file mode 100644 index 0000000..b1069c2 --- /dev/null +++ b/win32/vs10/pangowin32.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs10/pangowin32.vcxproj.filtersin b/win32/vs10/pangowin32.vcxproj.filtersin new file mode 100644 index 0000000..0ad85fd --- /dev/null +++ b/win32/vs10/pangowin32.vcxproj.filtersin @@ -0,0 +1,23 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + +#include "pangowin32.vs10.sourcefiles.filters" + + diff --git a/win32/vs10/pangowin32.vcxprojin b/win32/vs10/pangowin32.vcxprojin new file mode 100644 index 0000000..665d029 --- /dev/null +++ b/win32/vs10/pangowin32.vcxprojin @@ -0,0 +1,188 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + DynamicLibrary + true + MultiByte + v100 + + + DynamicLibrary + MultiByte + v100 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + +#include "pangowin32.vs10.sourcefiles" + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs11/Makefile.am b/win32/vs11/Makefile.am new file mode 100644 index 0000000..2fcbacc --- /dev/null +++ b/win32/vs11/Makefile.am @@ -0,0 +1,29 @@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) + +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 11 +MSVC_VER_LONG = 2012 + +include $(top_srcdir)/win32/Makefile-newvs.am diff --git a/win32/vs11/Makefile.in b/win32/vs11/Makefile.in new file mode 100644 index 0000000..f9015d8 --- /dev/null +++ b/win32/vs11/Makefile.in @@ -0,0 +1,577 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Centralized autotools file +# Create the Visual Studio 2012/2013/2015 project files +# from the Visual Studio 2010 project files + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# Author: Fan, Chun-wei +# November 05, 2012 + +# MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (100 for 2010, 120 for 2013) +# MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15) +# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning v$(MSVC_BASE_TOOLSET) +# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on) +# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017) +# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET) +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs11 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/win32/Makefile-newvs.am +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 11 +MSVC_VER_LONG = 2012 +@MSVC_BASE_NO_TOOLSET_SET_TRUE@MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0 +@MSVC_NO_TOOLSET_SET_TRUE@MSVC_TOOLSET = $(MSVC_VER)0 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/win32/Makefile-newvs.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs11/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs11/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/win32/Makefile-newvs.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +%.sln: + sed 's/11\.00/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/$(MSVC_BASE_VER_LONG)/$(MSVC_VER_LONG)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.txt: + sed 's/vs$(MSVC_BASE_VER)/vs$(MSVC_VER)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/VS$(MSVC_BASE_VER)/VS$(MSVC_VER)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.vcxproj: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.vcxproj.filters: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + cp $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + cp $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs11/README.txt b/win32/vs11/README.txt new file mode 100644 index 0000000..0a7ceb8 --- /dev/null +++ b/win32/vs11/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS11 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcxprojin/vcxproj.filtersin files +here into .vcxproj/.vcxproj.filters files. + +It is recommended that GLib is compiled with VS11 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs11\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS11 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS11 +using VS project files and/or makefiles at this time of writing. +For GLib, VS11 project files are available under +$(srcroot)\vs11 in the case of GLib (stable/unstable). + +There is no known official VS11 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs11\ + +Unzip the binaries obtained from ftp.gnome.org in \vs11\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs11\\bin + .lib files: \vs11\\lib + .h files: \vs11\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs11 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs11\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS11) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs11\README.txt. + + is either Win32 or x64, as in VS11 project files. + +You should unpack the glib-dev zip file into +\vs11\, so that for instance glib.h ends up at +\vs11\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs11\. For instance, +built DLLs go into \vs11\\bin, built LIBs into +\vs11\\lib and headers into +\vs11\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs11\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs11\\share\gir-1.0 (the .gir file(s)) and +\vs11\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs11/pango-build-defines.props b/win32/vs11/pango-build-defines.props new file mode 100644 index 0000000..65a9dfc --- /dev/null +++ b/win32/vs11/pango-build-defines.props @@ -0,0 +1,71 @@ + + + + + + + 1.8.0 + /dummy + G_LOG_DOMAIN="Pango";PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR="$(PangoDummyPrefix)/etc";LIBDIR="$(PangoDummyPrefix)/lib" + HAVE_CAIRO_FREETYPE=1 + ..;$(GlibEtcInstallRoot)\include\harfbuzz + fontconfig.lib;freetype.lib;harfbuzz.lib + $(GlibEtcInstallRoot)\include\cairo + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f pango-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstallRoot) + $(SolutionDir)\..\PangoCairo-1.0.gir;$(SolutionDir)\..\PangoCairo-1.0.typelib;$(SolutionDir)\..\Pango-1.0.gir;$(SolutionDir)\..\Pango-1.0.typelib + + + <_PropertySheetDisplayName>pangobuilddefinesprops + $(SolutionDir)$(Configuration)\$(PlatformName)\bin\ + $(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\ + + + + ..\..;..\..\pango;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2;%(AdditionalIncludeDirectories) + HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions) + msvc_recommended_pragmas.h;%(ForcedIncludeFiles) + true + /d2Zi+ %(AdditionalOptions) + + + gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) + $(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).pdb + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + + + + + $(PangoBinaryVersion) + + + $(PangoDummyPrefix) + + + $(PangoDefines) + + + $(CairoFTDefines) + + + $(PangoFT2Incs) + + + $(PangoFT2Libs) + + + $(PangoCairoIncs) + + + $(PangoIntrospectNMakeCmd) + + + $(PangoIntrospectBuiltFiles) + + + diff --git a/win32/vs11/pango-ignore-fc.props b/win32/vs11/pango-ignore-fc.props new file mode 100644 index 0000000..fef038d --- /dev/null +++ b/win32/vs11/pango-ignore-fc.props @@ -0,0 +1,14 @@ + + + + <_PropertySheetDisplayName>pangoignorefcprops + + + + false + + + $(OutDir)\pangowin32-1.0.lib;$(OutDir)\pango-1.0.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/win32/vs11/pango-install-bin.props b/win32/vs11/pango-install-bin.props new file mode 100644 index 0000000..aad3ca5 --- /dev/null +++ b/win32/vs11/pango-install-bin.props @@ -0,0 +1,49 @@ + + + + + + + +mkdir $(CopyDir)\bin + +mkdir $(CopyDir)\lib + + +if "$(Configuration)" == "Release_FC" goto DO_FC_BIN +if "$(Configuration)" == "Debug_FC" goto DO_FC_BIN + +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib +goto DONE_BIN + +:DO_FC_BIN +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pangoft2-$(ApiVersion).lib $(CopyDir)\lib +copy $(Configuration)\$(Platform)\bin\pangocairo-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +:DONE_BIN + + + + + <_PropertySheetDisplayName>pangoinstallbinprops + + + + $(PangoDoInstallBin) + + + diff --git a/win32/vs11/pango-install.props b/win32/vs11/pango-install.props new file mode 100644 index 0000000..77e7a0a --- /dev/null +++ b/win32/vs11/pango-install.props @@ -0,0 +1,81 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango.h $(CopyDir)\include\pango-1.0\pango\pango.h +copy ..\..\pango\pango-attributes.h $(CopyDir)\include\pango-1.0\pango\pango-attributes.h +copy ..\..\pango\pango-bidi-type.h $(CopyDir)\include\pango-1.0\pango\pango-bidi-type.h +copy ..\..\pango\pango-break.h $(CopyDir)\include\pango-1.0\pango\pango-break.h +copy ..\..\pango\pango-context.h $(CopyDir)\include\pango-1.0\pango\pango-context.h +copy ..\..\pango\pango-coverage.h $(CopyDir)\include\pango-1.0\pango\pango-coverage.h +copy ..\..\pango\pango-engine.h $(CopyDir)\include\pango-1.0\pango\pango-engine.h +copy ..\..\pango\pango-font.h $(CopyDir)\include\pango-1.0\pango\pango-font.h +copy ..\..\pango\pango-fontmap.h $(CopyDir)\include\pango-1.0\pango\pango-fontmap.h +copy ..\..\pango\pango-fontset.h $(CopyDir)\include\pango-1.0\pango\pango-fontset.h +copy ..\..\pango\pango-glyph.h $(CopyDir)\include\pango-1.0\pango\pango-glyph.h +copy ..\..\pango\pango-glyph-item.h $(CopyDir)\include\pango-1.0\pango\pango-glyph-item.h +copy ..\..\pango\pango-gravity.h $(CopyDir)\include\pango-1.0\pango\pango-gravity.h +copy ..\..\pango\pango-item.h $(CopyDir)\include\pango-1.0\pango\pango-item.h +copy ..\..\pango\pango-language.h $(CopyDir)\include\pango-1.0\pango\pango-language.h +copy ..\..\pango\pango-layout.h $(CopyDir)\include\pango-1.0\pango\pango-layout.h +copy ..\..\pango\pango-matrix.h $(CopyDir)\include\pango-1.0\pango\pango-matrix.h +copy ..\..\pango\pango-modules.h $(CopyDir)\include\pango-1.0\pango\pango-modules.h +copy ..\..\pango\pango-renderer.h $(CopyDir)\include\pango-1.0\pango\pango-renderer.h +copy ..\..\pango\pango-script.h $(CopyDir)\include\pango-1.0\pango\pango-script.h +copy ..\..\pango\pango-tabs.h $(CopyDir)\include\pango-1.0\pango\pango-tabs.h +copy ..\..\pango\pango-types.h $(CopyDir)\include\pango-1.0\pango\pango-types.h +copy ..\..\pango\pango-utils.h $(CopyDir)\include\pango-1.0\pango\pango-utils.h +copy ..\..\pango\pango-version-macros.h $(CopyDir)\include\pango-1.0\pango\pango-version-macros.h +copy ..\..\pango\pangocairo.h $(CopyDir)\include\pango-1.0\pango\pangocairo.h +copy ..\..\pango\pangowin32.h $(CopyDir)\include\pango-1.0\pango\pangowin32.h +copy ..\..\pango\pango-features.h $(CopyDir)\include\pango-1.0\pango\pango-features.h +copy ..\..\pango\pango-enum-types.h $(CopyDir)\include\pango-1.0\pango\pango-enum-types.h +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs11/pango-install.vcxproj b/win32/vs11/pango-install.vcxproj new file mode 100644 index 0000000..dbdde2c --- /dev/null +++ b/win32/vs11/pango-install.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + pangoinstall + Win32Proj + + + + Utility + MultiByte + true + v110 + + + Utility + MultiByte + true + v110 + + + Utility + MultiByte + v110 + + + Utility + MultiByte + v110 + + + Utility + MultiByte + true + v110 + + + Utility + MultiByte + true + v110 + + + Utility + MultiByte + v110 + + + Utility + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + + + + + + + + + + + + + + + + + + + + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + + + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c76} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs11/pango-install.vcxproj.filters b/win32/vs11/pango-install.vcxproj.filters new file mode 100644 index 0000000..88fd7b7 --- /dev/null +++ b/win32/vs11/pango-install.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + Resource Files + Resource Files + + diff --git a/win32/vs11/pango-introspect.vcxproj b/win32/vs11/pango-introspect.vcxproj new file mode 100644 index 0000000..65e1bbb --- /dev/null +++ b/win32/vs11/pango-introspect.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {2FE2F832-D857-450E-99AF-549AC88422F2} + pangointrospect + + + + Makefile + true + MultiByte + v110 + + + Makefile + false + true + MultiByte + v110 + + + Makefile + MultiByte + v110 + + + Makefile + MultiByte + true + v110 + + + + + + + + + + + + + + + + + + + + + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + + {fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fb} + false + + + + + + \ No newline at end of file diff --git a/win32/vs11/pango-prebuild.props b/win32/vs11/pango-prebuild.props new file mode 100644 index 0000000..f7a441d --- /dev/null +++ b/win32/vs11/pango-prebuild.props @@ -0,0 +1,17 @@ + + + + + + + copy ..\..\config.h.win32 ..\..\config.h + + + <_PropertySheetDisplayName>pangoprebuildprops + + + + $(CopyConfigH) + + + diff --git a/win32/vs11/pango-version-paths.props b/win32/vs11/pango-version-paths.props new file mode 100644 index 0000000..138a12d --- /dev/null +++ b/win32/vs11/pango-version-paths.props @@ -0,0 +1,82 @@ + + + + 11 + 1 + 42 + 4 + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs11/pango.sln b/win32/vs11/pango.sln new file mode 100644 index 0000000..e57ad62 --- /dev/null +++ b/win32/vs11/pango.sln @@ -0,0 +1,111 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcxproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs11/pango.vcxproj b/win32/vs11/pango.vcxproj new file mode 100644 index 0000000..d9950e1 --- /dev/null +++ b/win32/vs11/pango.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs11/pango.vcxproj.filters b/win32/vs11/pango.vcxproj.filters new file mode 100644 index 0000000..d12ce65 --- /dev/null +++ b/win32/vs11/pango.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs11/pangocairo.vcxproj b/win32/vs11/pangocairo.vcxproj new file mode 100644 index 0000000..13f3e06 --- /dev/null +++ b/win32/vs11/pangocairo.vcxproj @@ -0,0 +1,344 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs11/pangocairo.vcxproj.filters b/win32/vs11/pangocairo.vcxproj.filters new file mode 100644 index 0000000..770c8d8 --- /dev/null +++ b/win32/vs11/pangocairo.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs11/pangoft2.vcxproj b/win32/vs11/pangoft2.vcxproj new file mode 100644 index 0000000..f8e6cc3 --- /dev/null +++ b/win32/vs11/pangoft2.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs11/pangoft2.vcxproj.filters b/win32/vs11/pangoft2.vcxproj.filters new file mode 100644 index 0000000..a815a60 --- /dev/null +++ b/win32/vs11/pangoft2.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs11/pangowin32.vcxproj b/win32/vs11/pangowin32.vcxproj new file mode 100644 index 0000000..a53e8cd --- /dev/null +++ b/win32/vs11/pangowin32.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + true + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs11/pangowin32.vcxproj.filters b/win32/vs11/pangowin32.vcxproj.filters new file mode 100644 index 0000000..b1069c2 --- /dev/null +++ b/win32/vs11/pangowin32.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs12/Makefile.am b/win32/vs12/Makefile.am new file mode 100644 index 0000000..532972b --- /dev/null +++ b/win32/vs12/Makefile.am @@ -0,0 +1,29 @@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) + +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 12 +MSVC_VER_LONG = 2013 + +include $(top_srcdir)/win32/Makefile-newvs.am diff --git a/win32/vs12/Makefile.in b/win32/vs12/Makefile.in new file mode 100644 index 0000000..5543d30 --- /dev/null +++ b/win32/vs12/Makefile.in @@ -0,0 +1,577 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Centralized autotools file +# Create the Visual Studio 2012/2013/2015 project files +# from the Visual Studio 2010 project files + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# Author: Fan, Chun-wei +# November 05, 2012 + +# MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (100 for 2010, 120 for 2013) +# MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15) +# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning v$(MSVC_BASE_TOOLSET) +# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on) +# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017) +# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET) +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs12 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/win32/Makefile-newvs.am +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 12 +MSVC_VER_LONG = 2013 +@MSVC_BASE_NO_TOOLSET_SET_TRUE@MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0 +@MSVC_NO_TOOLSET_SET_TRUE@MSVC_TOOLSET = $(MSVC_VER)0 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/win32/Makefile-newvs.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs12/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs12/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/win32/Makefile-newvs.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +%.sln: + sed 's/11\.00/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/$(MSVC_BASE_VER_LONG)/$(MSVC_VER_LONG)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.txt: + sed 's/vs$(MSVC_BASE_VER)/vs$(MSVC_VER)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/VS$(MSVC_BASE_VER)/VS$(MSVC_VER)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.vcxproj: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.vcxproj.filters: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + cp $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + cp $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs12/README.txt b/win32/vs12/README.txt new file mode 100644 index 0000000..32d7914 --- /dev/null +++ b/win32/vs12/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS12 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcxprojin/vcxproj.filtersin files +here into .vcxproj/.vcxproj.filters files. + +It is recommended that GLib is compiled with VS12 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs12\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS12 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS12 +using VS project files and/or makefiles at this time of writing. +For GLib, VS12 project files are available under +$(srcroot)\vs12 in the case of GLib (stable/unstable). + +There is no known official VS12 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs12\ + +Unzip the binaries obtained from ftp.gnome.org in \vs12\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs12\\bin + .lib files: \vs12\\lib + .h files: \vs12\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs12 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs12\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS12) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs12\README.txt. + + is either Win32 or x64, as in VS12 project files. + +You should unpack the glib-dev zip file into +\vs12\, so that for instance glib.h ends up at +\vs12\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs12\. For instance, +built DLLs go into \vs12\\bin, built LIBs into +\vs12\\lib and headers into +\vs12\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs12\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs12\\share\gir-1.0 (the .gir file(s)) and +\vs12\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs12/pango-build-defines.props b/win32/vs12/pango-build-defines.props new file mode 100644 index 0000000..65a9dfc --- /dev/null +++ b/win32/vs12/pango-build-defines.props @@ -0,0 +1,71 @@ + + + + + + + 1.8.0 + /dummy + G_LOG_DOMAIN="Pango";PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR="$(PangoDummyPrefix)/etc";LIBDIR="$(PangoDummyPrefix)/lib" + HAVE_CAIRO_FREETYPE=1 + ..;$(GlibEtcInstallRoot)\include\harfbuzz + fontconfig.lib;freetype.lib;harfbuzz.lib + $(GlibEtcInstallRoot)\include\cairo + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f pango-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstallRoot) + $(SolutionDir)\..\PangoCairo-1.0.gir;$(SolutionDir)\..\PangoCairo-1.0.typelib;$(SolutionDir)\..\Pango-1.0.gir;$(SolutionDir)\..\Pango-1.0.typelib + + + <_PropertySheetDisplayName>pangobuilddefinesprops + $(SolutionDir)$(Configuration)\$(PlatformName)\bin\ + $(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\ + + + + ..\..;..\..\pango;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2;%(AdditionalIncludeDirectories) + HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions) + msvc_recommended_pragmas.h;%(ForcedIncludeFiles) + true + /d2Zi+ %(AdditionalOptions) + + + gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) + $(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).pdb + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + + + + + $(PangoBinaryVersion) + + + $(PangoDummyPrefix) + + + $(PangoDefines) + + + $(CairoFTDefines) + + + $(PangoFT2Incs) + + + $(PangoFT2Libs) + + + $(PangoCairoIncs) + + + $(PangoIntrospectNMakeCmd) + + + $(PangoIntrospectBuiltFiles) + + + diff --git a/win32/vs12/pango-ignore-fc.props b/win32/vs12/pango-ignore-fc.props new file mode 100644 index 0000000..fef038d --- /dev/null +++ b/win32/vs12/pango-ignore-fc.props @@ -0,0 +1,14 @@ + + + + <_PropertySheetDisplayName>pangoignorefcprops + + + + false + + + $(OutDir)\pangowin32-1.0.lib;$(OutDir)\pango-1.0.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/win32/vs12/pango-install-bin.props b/win32/vs12/pango-install-bin.props new file mode 100644 index 0000000..aad3ca5 --- /dev/null +++ b/win32/vs12/pango-install-bin.props @@ -0,0 +1,49 @@ + + + + + + + +mkdir $(CopyDir)\bin + +mkdir $(CopyDir)\lib + + +if "$(Configuration)" == "Release_FC" goto DO_FC_BIN +if "$(Configuration)" == "Debug_FC" goto DO_FC_BIN + +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib +goto DONE_BIN + +:DO_FC_BIN +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pangoft2-$(ApiVersion).lib $(CopyDir)\lib +copy $(Configuration)\$(Platform)\bin\pangocairo-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +:DONE_BIN + + + + + <_PropertySheetDisplayName>pangoinstallbinprops + + + + $(PangoDoInstallBin) + + + diff --git a/win32/vs12/pango-install.props b/win32/vs12/pango-install.props new file mode 100644 index 0000000..77e7a0a --- /dev/null +++ b/win32/vs12/pango-install.props @@ -0,0 +1,81 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango.h $(CopyDir)\include\pango-1.0\pango\pango.h +copy ..\..\pango\pango-attributes.h $(CopyDir)\include\pango-1.0\pango\pango-attributes.h +copy ..\..\pango\pango-bidi-type.h $(CopyDir)\include\pango-1.0\pango\pango-bidi-type.h +copy ..\..\pango\pango-break.h $(CopyDir)\include\pango-1.0\pango\pango-break.h +copy ..\..\pango\pango-context.h $(CopyDir)\include\pango-1.0\pango\pango-context.h +copy ..\..\pango\pango-coverage.h $(CopyDir)\include\pango-1.0\pango\pango-coverage.h +copy ..\..\pango\pango-engine.h $(CopyDir)\include\pango-1.0\pango\pango-engine.h +copy ..\..\pango\pango-font.h $(CopyDir)\include\pango-1.0\pango\pango-font.h +copy ..\..\pango\pango-fontmap.h $(CopyDir)\include\pango-1.0\pango\pango-fontmap.h +copy ..\..\pango\pango-fontset.h $(CopyDir)\include\pango-1.0\pango\pango-fontset.h +copy ..\..\pango\pango-glyph.h $(CopyDir)\include\pango-1.0\pango\pango-glyph.h +copy ..\..\pango\pango-glyph-item.h $(CopyDir)\include\pango-1.0\pango\pango-glyph-item.h +copy ..\..\pango\pango-gravity.h $(CopyDir)\include\pango-1.0\pango\pango-gravity.h +copy ..\..\pango\pango-item.h $(CopyDir)\include\pango-1.0\pango\pango-item.h +copy ..\..\pango\pango-language.h $(CopyDir)\include\pango-1.0\pango\pango-language.h +copy ..\..\pango\pango-layout.h $(CopyDir)\include\pango-1.0\pango\pango-layout.h +copy ..\..\pango\pango-matrix.h $(CopyDir)\include\pango-1.0\pango\pango-matrix.h +copy ..\..\pango\pango-modules.h $(CopyDir)\include\pango-1.0\pango\pango-modules.h +copy ..\..\pango\pango-renderer.h $(CopyDir)\include\pango-1.0\pango\pango-renderer.h +copy ..\..\pango\pango-script.h $(CopyDir)\include\pango-1.0\pango\pango-script.h +copy ..\..\pango\pango-tabs.h $(CopyDir)\include\pango-1.0\pango\pango-tabs.h +copy ..\..\pango\pango-types.h $(CopyDir)\include\pango-1.0\pango\pango-types.h +copy ..\..\pango\pango-utils.h $(CopyDir)\include\pango-1.0\pango\pango-utils.h +copy ..\..\pango\pango-version-macros.h $(CopyDir)\include\pango-1.0\pango\pango-version-macros.h +copy ..\..\pango\pangocairo.h $(CopyDir)\include\pango-1.0\pango\pangocairo.h +copy ..\..\pango\pangowin32.h $(CopyDir)\include\pango-1.0\pango\pangowin32.h +copy ..\..\pango\pango-features.h $(CopyDir)\include\pango-1.0\pango\pango-features.h +copy ..\..\pango\pango-enum-types.h $(CopyDir)\include\pango-1.0\pango\pango-enum-types.h +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs12/pango-install.vcxproj b/win32/vs12/pango-install.vcxproj new file mode 100644 index 0000000..5e9f89e --- /dev/null +++ b/win32/vs12/pango-install.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + pangoinstall + Win32Proj + + + + Utility + MultiByte + true + v120 + + + Utility + MultiByte + true + v120 + + + Utility + MultiByte + v120 + + + Utility + MultiByte + v120 + + + Utility + MultiByte + true + v120 + + + Utility + MultiByte + true + v120 + + + Utility + MultiByte + v120 + + + Utility + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + + + + + + + + + + + + + + + + + + + + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + + + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c76} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs12/pango-install.vcxproj.filters b/win32/vs12/pango-install.vcxproj.filters new file mode 100644 index 0000000..88fd7b7 --- /dev/null +++ b/win32/vs12/pango-install.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + Resource Files + Resource Files + + diff --git a/win32/vs12/pango-introspect.vcxproj b/win32/vs12/pango-introspect.vcxproj new file mode 100644 index 0000000..81d47e0 --- /dev/null +++ b/win32/vs12/pango-introspect.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {2FE2F832-D857-450E-99AF-549AC88422F2} + pangointrospect + + + + Makefile + true + MultiByte + v120 + + + Makefile + false + true + MultiByte + v120 + + + Makefile + MultiByte + v120 + + + Makefile + MultiByte + true + v120 + + + + + + + + + + + + + + + + + + + + + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + + {fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fb} + false + + + + + + \ No newline at end of file diff --git a/win32/vs12/pango-prebuild.props b/win32/vs12/pango-prebuild.props new file mode 100644 index 0000000..f7a441d --- /dev/null +++ b/win32/vs12/pango-prebuild.props @@ -0,0 +1,17 @@ + + + + + + + copy ..\..\config.h.win32 ..\..\config.h + + + <_PropertySheetDisplayName>pangoprebuildprops + + + + $(CopyConfigH) + + + diff --git a/win32/vs12/pango-version-paths.props b/win32/vs12/pango-version-paths.props new file mode 100644 index 0000000..b1d29b2 --- /dev/null +++ b/win32/vs12/pango-version-paths.props @@ -0,0 +1,82 @@ + + + + 12 + 1 + 42 + 4 + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs12/pango.sln b/win32/vs12/pango.sln new file mode 100644 index 0000000..fb37cf6 --- /dev/null +++ b/win32/vs12/pango.sln @@ -0,0 +1,111 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcxproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs12/pango.vcxproj b/win32/vs12/pango.vcxproj new file mode 100644 index 0000000..4864296 --- /dev/null +++ b/win32/vs12/pango.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs12/pango.vcxproj.filters b/win32/vs12/pango.vcxproj.filters new file mode 100644 index 0000000..d12ce65 --- /dev/null +++ b/win32/vs12/pango.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs12/pangocairo.vcxproj b/win32/vs12/pangocairo.vcxproj new file mode 100644 index 0000000..a89e9e2 --- /dev/null +++ b/win32/vs12/pangocairo.vcxproj @@ -0,0 +1,344 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs12/pangocairo.vcxproj.filters b/win32/vs12/pangocairo.vcxproj.filters new file mode 100644 index 0000000..770c8d8 --- /dev/null +++ b/win32/vs12/pangocairo.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs12/pangoft2.vcxproj b/win32/vs12/pangoft2.vcxproj new file mode 100644 index 0000000..31610df --- /dev/null +++ b/win32/vs12/pangoft2.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs12/pangoft2.vcxproj.filters b/win32/vs12/pangoft2.vcxproj.filters new file mode 100644 index 0000000..a815a60 --- /dev/null +++ b/win32/vs12/pangoft2.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs12/pangowin32.vcxproj b/win32/vs12/pangowin32.vcxproj new file mode 100644 index 0000000..6f0542a --- /dev/null +++ b/win32/vs12/pangowin32.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs12/pangowin32.vcxproj.filters b/win32/vs12/pangowin32.vcxproj.filters new file mode 100644 index 0000000..b1069c2 --- /dev/null +++ b/win32/vs12/pangowin32.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs14/Makefile.am b/win32/vs14/Makefile.am new file mode 100644 index 0000000..7596659 --- /dev/null +++ b/win32/vs14/Makefile.am @@ -0,0 +1,29 @@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) + +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 14 +MSVC_VER_LONG = 14 + +include $(top_srcdir)/win32/Makefile-newvs.am diff --git a/win32/vs14/Makefile.in b/win32/vs14/Makefile.in new file mode 100644 index 0000000..ad28d73 --- /dev/null +++ b/win32/vs14/Makefile.in @@ -0,0 +1,577 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Centralized autotools file +# Create the Visual Studio 2012/2013/2015 project files +# from the Visual Studio 2010 project files + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# Author: Fan, Chun-wei +# November 05, 2012 + +# MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (100 for 2010, 120 for 2013) +# MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15) +# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning v$(MSVC_BASE_TOOLSET) +# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on) +# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017) +# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET) +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs14 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/win32/Makefile-newvs.am +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 14 +MSVC_VER_LONG = 14 +@MSVC_BASE_NO_TOOLSET_SET_TRUE@MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0 +@MSVC_NO_TOOLSET_SET_TRUE@MSVC_TOOLSET = $(MSVC_VER)0 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/win32/Makefile-newvs.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs14/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs14/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/win32/Makefile-newvs.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +%.sln: + sed 's/11\.00/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/$(MSVC_BASE_VER_LONG)/$(MSVC_VER_LONG)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.txt: + sed 's/vs$(MSVC_BASE_VER)/vs$(MSVC_VER)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/VS$(MSVC_BASE_VER)/VS$(MSVC_VER)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.vcxproj: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.vcxproj.filters: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + cp $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + cp $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs14/README.txt b/win32/vs14/README.txt new file mode 100644 index 0000000..32bd5f3 --- /dev/null +++ b/win32/vs14/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS14 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcxprojin/vcxproj.filtersin files +here into .vcxproj/.vcxproj.filters files. + +It is recommended that GLib is compiled with VS14 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs14\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS14 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS14 +using VS project files and/or makefiles at this time of writing. +For GLib, VS14 project files are available under +$(srcroot)\vs14 in the case of GLib (stable/unstable). + +There is no known official VS14 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs14\ + +Unzip the binaries obtained from ftp.gnome.org in \vs14\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs14\\bin + .lib files: \vs14\\lib + .h files: \vs14\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs14 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs14\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS14) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs14\README.txt. + + is either Win32 or x64, as in VS14 project files. + +You should unpack the glib-dev zip file into +\vs14\, so that for instance glib.h ends up at +\vs14\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs14\. For instance, +built DLLs go into \vs14\\bin, built LIBs into +\vs14\\lib and headers into +\vs14\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs14\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs14\\share\gir-1.0 (the .gir file(s)) and +\vs14\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs14/pango-build-defines.props b/win32/vs14/pango-build-defines.props new file mode 100644 index 0000000..65a9dfc --- /dev/null +++ b/win32/vs14/pango-build-defines.props @@ -0,0 +1,71 @@ + + + + + + + 1.8.0 + /dummy + G_LOG_DOMAIN="Pango";PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR="$(PangoDummyPrefix)/etc";LIBDIR="$(PangoDummyPrefix)/lib" + HAVE_CAIRO_FREETYPE=1 + ..;$(GlibEtcInstallRoot)\include\harfbuzz + fontconfig.lib;freetype.lib;harfbuzz.lib + $(GlibEtcInstallRoot)\include\cairo + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f pango-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstallRoot) + $(SolutionDir)\..\PangoCairo-1.0.gir;$(SolutionDir)\..\PangoCairo-1.0.typelib;$(SolutionDir)\..\Pango-1.0.gir;$(SolutionDir)\..\Pango-1.0.typelib + + + <_PropertySheetDisplayName>pangobuilddefinesprops + $(SolutionDir)$(Configuration)\$(PlatformName)\bin\ + $(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\ + + + + ..\..;..\..\pango;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2;%(AdditionalIncludeDirectories) + HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions) + msvc_recommended_pragmas.h;%(ForcedIncludeFiles) + true + /d2Zi+ %(AdditionalOptions) + + + gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) + $(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).pdb + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + + + + + $(PangoBinaryVersion) + + + $(PangoDummyPrefix) + + + $(PangoDefines) + + + $(CairoFTDefines) + + + $(PangoFT2Incs) + + + $(PangoFT2Libs) + + + $(PangoCairoIncs) + + + $(PangoIntrospectNMakeCmd) + + + $(PangoIntrospectBuiltFiles) + + + diff --git a/win32/vs14/pango-ignore-fc.props b/win32/vs14/pango-ignore-fc.props new file mode 100644 index 0000000..fef038d --- /dev/null +++ b/win32/vs14/pango-ignore-fc.props @@ -0,0 +1,14 @@ + + + + <_PropertySheetDisplayName>pangoignorefcprops + + + + false + + + $(OutDir)\pangowin32-1.0.lib;$(OutDir)\pango-1.0.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/win32/vs14/pango-install-bin.props b/win32/vs14/pango-install-bin.props new file mode 100644 index 0000000..aad3ca5 --- /dev/null +++ b/win32/vs14/pango-install-bin.props @@ -0,0 +1,49 @@ + + + + + + + +mkdir $(CopyDir)\bin + +mkdir $(CopyDir)\lib + + +if "$(Configuration)" == "Release_FC" goto DO_FC_BIN +if "$(Configuration)" == "Debug_FC" goto DO_FC_BIN + +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib +goto DONE_BIN + +:DO_FC_BIN +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pangoft2-$(ApiVersion).lib $(CopyDir)\lib +copy $(Configuration)\$(Platform)\bin\pangocairo-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +:DONE_BIN + + + + + <_PropertySheetDisplayName>pangoinstallbinprops + + + + $(PangoDoInstallBin) + + + diff --git a/win32/vs14/pango-install.props b/win32/vs14/pango-install.props new file mode 100644 index 0000000..77e7a0a --- /dev/null +++ b/win32/vs14/pango-install.props @@ -0,0 +1,81 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango.h $(CopyDir)\include\pango-1.0\pango\pango.h +copy ..\..\pango\pango-attributes.h $(CopyDir)\include\pango-1.0\pango\pango-attributes.h +copy ..\..\pango\pango-bidi-type.h $(CopyDir)\include\pango-1.0\pango\pango-bidi-type.h +copy ..\..\pango\pango-break.h $(CopyDir)\include\pango-1.0\pango\pango-break.h +copy ..\..\pango\pango-context.h $(CopyDir)\include\pango-1.0\pango\pango-context.h +copy ..\..\pango\pango-coverage.h $(CopyDir)\include\pango-1.0\pango\pango-coverage.h +copy ..\..\pango\pango-engine.h $(CopyDir)\include\pango-1.0\pango\pango-engine.h +copy ..\..\pango\pango-font.h $(CopyDir)\include\pango-1.0\pango\pango-font.h +copy ..\..\pango\pango-fontmap.h $(CopyDir)\include\pango-1.0\pango\pango-fontmap.h +copy ..\..\pango\pango-fontset.h $(CopyDir)\include\pango-1.0\pango\pango-fontset.h +copy ..\..\pango\pango-glyph.h $(CopyDir)\include\pango-1.0\pango\pango-glyph.h +copy ..\..\pango\pango-glyph-item.h $(CopyDir)\include\pango-1.0\pango\pango-glyph-item.h +copy ..\..\pango\pango-gravity.h $(CopyDir)\include\pango-1.0\pango\pango-gravity.h +copy ..\..\pango\pango-item.h $(CopyDir)\include\pango-1.0\pango\pango-item.h +copy ..\..\pango\pango-language.h $(CopyDir)\include\pango-1.0\pango\pango-language.h +copy ..\..\pango\pango-layout.h $(CopyDir)\include\pango-1.0\pango\pango-layout.h +copy ..\..\pango\pango-matrix.h $(CopyDir)\include\pango-1.0\pango\pango-matrix.h +copy ..\..\pango\pango-modules.h $(CopyDir)\include\pango-1.0\pango\pango-modules.h +copy ..\..\pango\pango-renderer.h $(CopyDir)\include\pango-1.0\pango\pango-renderer.h +copy ..\..\pango\pango-script.h $(CopyDir)\include\pango-1.0\pango\pango-script.h +copy ..\..\pango\pango-tabs.h $(CopyDir)\include\pango-1.0\pango\pango-tabs.h +copy ..\..\pango\pango-types.h $(CopyDir)\include\pango-1.0\pango\pango-types.h +copy ..\..\pango\pango-utils.h $(CopyDir)\include\pango-1.0\pango\pango-utils.h +copy ..\..\pango\pango-version-macros.h $(CopyDir)\include\pango-1.0\pango\pango-version-macros.h +copy ..\..\pango\pangocairo.h $(CopyDir)\include\pango-1.0\pango\pangocairo.h +copy ..\..\pango\pangowin32.h $(CopyDir)\include\pango-1.0\pango\pangowin32.h +copy ..\..\pango\pango-features.h $(CopyDir)\include\pango-1.0\pango\pango-features.h +copy ..\..\pango\pango-enum-types.h $(CopyDir)\include\pango-1.0\pango\pango-enum-types.h +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs14/pango-install.vcxproj b/win32/vs14/pango-install.vcxproj new file mode 100644 index 0000000..4dbaf16 --- /dev/null +++ b/win32/vs14/pango-install.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + pangoinstall + Win32Proj + + + + Utility + MultiByte + true + v140 + + + Utility + MultiByte + true + v140 + + + Utility + MultiByte + v140 + + + Utility + MultiByte + v140 + + + Utility + MultiByte + true + v140 + + + Utility + MultiByte + true + v140 + + + Utility + MultiByte + v140 + + + Utility + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + + + + + + + + + + + + + + + + + + + + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + + + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c76} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs14/pango-install.vcxproj.filters b/win32/vs14/pango-install.vcxproj.filters new file mode 100644 index 0000000..88fd7b7 --- /dev/null +++ b/win32/vs14/pango-install.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + Resource Files + Resource Files + + diff --git a/win32/vs14/pango-introspect.vcxproj b/win32/vs14/pango-introspect.vcxproj new file mode 100644 index 0000000..8117672 --- /dev/null +++ b/win32/vs14/pango-introspect.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {2FE2F832-D857-450E-99AF-549AC88422F2} + pangointrospect + + + + Makefile + true + MultiByte + v140 + + + Makefile + false + true + MultiByte + v140 + + + Makefile + MultiByte + v140 + + + Makefile + MultiByte + true + v140 + + + + + + + + + + + + + + + + + + + + + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + + {fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fb} + false + + + + + + \ No newline at end of file diff --git a/win32/vs14/pango-prebuild.props b/win32/vs14/pango-prebuild.props new file mode 100644 index 0000000..f7a441d --- /dev/null +++ b/win32/vs14/pango-prebuild.props @@ -0,0 +1,17 @@ + + + + + + + copy ..\..\config.h.win32 ..\..\config.h + + + <_PropertySheetDisplayName>pangoprebuildprops + + + + $(CopyConfigH) + + + diff --git a/win32/vs14/pango-version-paths.props b/win32/vs14/pango-version-paths.props new file mode 100644 index 0000000..d816521 --- /dev/null +++ b/win32/vs14/pango-version-paths.props @@ -0,0 +1,82 @@ + + + + 14 + 1 + 42 + 4 + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs14/pango.sln b/win32/vs14/pango.sln new file mode 100644 index 0000000..e364394 --- /dev/null +++ b/win32/vs14/pango.sln @@ -0,0 +1,111 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcxproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs14/pango.vcxproj b/win32/vs14/pango.vcxproj new file mode 100644 index 0000000..e055cd9 --- /dev/null +++ b/win32/vs14/pango.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs14/pango.vcxproj.filters b/win32/vs14/pango.vcxproj.filters new file mode 100644 index 0000000..d12ce65 --- /dev/null +++ b/win32/vs14/pango.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs14/pangocairo.vcxproj b/win32/vs14/pangocairo.vcxproj new file mode 100644 index 0000000..345c11d --- /dev/null +++ b/win32/vs14/pangocairo.vcxproj @@ -0,0 +1,344 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs14/pangocairo.vcxproj.filters b/win32/vs14/pangocairo.vcxproj.filters new file mode 100644 index 0000000..770c8d8 --- /dev/null +++ b/win32/vs14/pangocairo.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs14/pangoft2.vcxproj b/win32/vs14/pangoft2.vcxproj new file mode 100644 index 0000000..70284d3 --- /dev/null +++ b/win32/vs14/pangoft2.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs14/pangoft2.vcxproj.filters b/win32/vs14/pangoft2.vcxproj.filters new file mode 100644 index 0000000..a815a60 --- /dev/null +++ b/win32/vs14/pangoft2.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs14/pangowin32.vcxproj b/win32/vs14/pangowin32.vcxproj new file mode 100644 index 0000000..b7b50d8 --- /dev/null +++ b/win32/vs14/pangowin32.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + true + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs14/pangowin32.vcxproj.filters b/win32/vs14/pangowin32.vcxproj.filters new file mode 100644 index 0000000..b1069c2 --- /dev/null +++ b/win32/vs14/pangowin32.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs15/Makefile.am b/win32/vs15/Makefile.am new file mode 100644 index 0000000..3c7486a --- /dev/null +++ b/win32/vs15/Makefile.am @@ -0,0 +1,30 @@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) + +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 15 +MSVC_VER_LONG = 15 +MSVC_TOOLSET = 141 + +include $(top_srcdir)/win32/Makefile-newvs.am diff --git a/win32/vs15/Makefile.in b/win32/vs15/Makefile.in new file mode 100644 index 0000000..da1b162 --- /dev/null +++ b/win32/vs15/Makefile.in @@ -0,0 +1,578 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Centralized autotools file +# Create the Visual Studio 2012/2013/2015 project files +# from the Visual Studio 2010 project files + +# This autotools file, from GLib, can be used in other projects +# that have Visual Studio build support. + +# Author: Fan, Chun-wei +# November 05, 2012 + +# MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (100 for 2010, 120 for 2013) +# MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15) +# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning v$(MSVC_BASE_TOOLSET) +# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on) +# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017) +# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET) +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs15 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/win32/Makefile-newvs.am +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.props \ + pango-ignore-fc.props \ + pango-install-bin.props \ + pango-install.props \ + pango-prebuild.props \ + pango-version-paths.props \ + pango.vcxproj \ + pango.vcxproj.filters \ + pangoft2.vcxproj \ + pangoft2.vcxproj.filters \ + pangowin32.vcxproj \ + pangowin32.vcxproj.filters \ + pangocairo.vcxproj \ + pangocairo.vcxproj.filters \ + pango-install.vcxproj \ + pango-install.vcxproj.filters \ + pango-introspect.vcxproj \ + README.txt + +DISTCLEANFILES = $(EXTRA_DIST) +MSVC_BASE_VER = 10 +MSVC_BASE_VER_LONG = 2010 +MSVC_VER = 15 +MSVC_VER_LONG = 15 +@MSVC_NO_TOOLSET_SET_TRUE@MSVC_TOOLSET = $(MSVC_VER)0 +MSVC_TOOLSET = 141 +@MSVC_BASE_NO_TOOLSET_SET_TRUE@MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/win32/Makefile-newvs.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs15/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs15/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/win32/Makefile-newvs.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +%.sln: + sed 's/11\.00/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/$(MSVC_BASE_VER_LONG)/$(MSVC_VER_LONG)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.txt: + sed 's/vs$(MSVC_BASE_VER)/vs$(MSVC_VER)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + sed 's/VS$(MSVC_BASE_VER)/VS$(MSVC_VER)/g' < $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/win32/vs$(MSVC_VER)/$@ + rm $(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp + +%.vcxproj: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + sed 's/$(MSVC_BASE_VER)<\/VSVer>/$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +%.vcxproj.filters: + if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \ + cp $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + else \ + cp $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ $(top_builddir)/win32/vs$(MSVC_VER)/$@; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs15/README.txt b/win32/vs15/README.txt new file mode 100644 index 0000000..e0740de --- /dev/null +++ b/win32/vs15/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS15 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcxprojin/vcxproj.filtersin files +here into .vcxproj/.vcxproj.filters files. + +It is recommended that GLib is compiled with VS15 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs15\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS15 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS15 +using VS project files and/or makefiles at this time of writing. +For GLib, VS15 project files are available under +$(srcroot)\vs15 in the case of GLib (stable/unstable). + +There is no known official VS15 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs15\ + +Unzip the binaries obtained from ftp.gnome.org in \vs15\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs15\\bin + .lib files: \vs15\\lib + .h files: \vs15\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs15 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs15\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS15) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs15\README.txt. + + is either Win32 or x64, as in VS15 project files. + +You should unpack the glib-dev zip file into +\vs15\, so that for instance glib.h ends up at +\vs15\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs15\. For instance, +built DLLs go into \vs15\\bin, built LIBs into +\vs15\\lib and headers into +\vs15\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs15\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs15\\share\gir-1.0 (the .gir file(s)) and +\vs15\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs15/pango-build-defines.props b/win32/vs15/pango-build-defines.props new file mode 100644 index 0000000..65a9dfc --- /dev/null +++ b/win32/vs15/pango-build-defines.props @@ -0,0 +1,71 @@ + + + + + + + 1.8.0 + /dummy + G_LOG_DOMAIN="Pango";PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR="$(PangoDummyPrefix)/etc";LIBDIR="$(PangoDummyPrefix)/lib" + HAVE_CAIRO_FREETYPE=1 + ..;$(GlibEtcInstallRoot)\include\harfbuzz + fontconfig.lib;freetype.lib;harfbuzz.lib + $(GlibEtcInstallRoot)\include\cairo + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f pango-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstallRoot) + $(SolutionDir)\..\PangoCairo-1.0.gir;$(SolutionDir)\..\PangoCairo-1.0.typelib;$(SolutionDir)\..\Pango-1.0.gir;$(SolutionDir)\..\Pango-1.0.typelib + + + <_PropertySheetDisplayName>pangobuilddefinesprops + $(SolutionDir)$(Configuration)\$(PlatformName)\bin\ + $(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\ + + + + ..\..;..\..\pango;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2;%(AdditionalIncludeDirectories) + HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions) + msvc_recommended_pragmas.h;%(ForcedIncludeFiles) + true + /d2Zi+ %(AdditionalOptions) + + + gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) + $(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).pdb + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + /HIGHENTROPYVA %(AdditionalOptions) + + + + + $(PangoBinaryVersion) + + + $(PangoDummyPrefix) + + + $(PangoDefines) + + + $(CairoFTDefines) + + + $(PangoFT2Incs) + + + $(PangoFT2Libs) + + + $(PangoCairoIncs) + + + $(PangoIntrospectNMakeCmd) + + + $(PangoIntrospectBuiltFiles) + + + diff --git a/win32/vs15/pango-ignore-fc.props b/win32/vs15/pango-ignore-fc.props new file mode 100644 index 0000000..fef038d --- /dev/null +++ b/win32/vs15/pango-ignore-fc.props @@ -0,0 +1,14 @@ + + + + <_PropertySheetDisplayName>pangoignorefcprops + + + + false + + + $(OutDir)\pangowin32-1.0.lib;$(OutDir)\pango-1.0.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/win32/vs15/pango-install-bin.props b/win32/vs15/pango-install-bin.props new file mode 100644 index 0000000..aad3ca5 --- /dev/null +++ b/win32/vs15/pango-install-bin.props @@ -0,0 +1,49 @@ + + + + + + + +mkdir $(CopyDir)\bin + +mkdir $(CopyDir)\lib + + +if "$(Configuration)" == "Release_FC" goto DO_FC_BIN +if "$(Configuration)" == "Debug_FC" goto DO_FC_BIN + +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib +goto DONE_BIN + +:DO_FC_BIN +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangoft2$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).dll $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\$(PangoDllPrefix)pangocairo$(PangoDllSuffix).pdb $(CopyDir)\bin +copy $(Configuration)\$(Platform)\bin\pangoft2-$(ApiVersion).lib $(CopyDir)\lib +copy $(Configuration)\$(Platform)\bin\pangocairo-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Release_FC" copy $(SolutionDir)\Release\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).dll $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\$(PangoDllPrefix)pango*$(PangoDllSuffix).pdb $(CopyDir)\bin +if "$(Configuration)" == "Debug_FC" copy $(SolutionDir)\Debug\$(Platform)\bin\pango*-$(ApiVersion).lib $(CopyDir)\lib + +:DONE_BIN + + + + + <_PropertySheetDisplayName>pangoinstallbinprops + + + + $(PangoDoInstallBin) + + + diff --git a/win32/vs15/pango-install.props b/win32/vs15/pango-install.props new file mode 100644 index 0000000..77e7a0a --- /dev/null +++ b/win32/vs15/pango-install.props @@ -0,0 +1,81 @@ + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\bin + +mkdir $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango.h $(CopyDir)\include\pango-1.0\pango\pango.h +copy ..\..\pango\pango-attributes.h $(CopyDir)\include\pango-1.0\pango\pango-attributes.h +copy ..\..\pango\pango-bidi-type.h $(CopyDir)\include\pango-1.0\pango\pango-bidi-type.h +copy ..\..\pango\pango-break.h $(CopyDir)\include\pango-1.0\pango\pango-break.h +copy ..\..\pango\pango-context.h $(CopyDir)\include\pango-1.0\pango\pango-context.h +copy ..\..\pango\pango-coverage.h $(CopyDir)\include\pango-1.0\pango\pango-coverage.h +copy ..\..\pango\pango-engine.h $(CopyDir)\include\pango-1.0\pango\pango-engine.h +copy ..\..\pango\pango-font.h $(CopyDir)\include\pango-1.0\pango\pango-font.h +copy ..\..\pango\pango-fontmap.h $(CopyDir)\include\pango-1.0\pango\pango-fontmap.h +copy ..\..\pango\pango-fontset.h $(CopyDir)\include\pango-1.0\pango\pango-fontset.h +copy ..\..\pango\pango-glyph.h $(CopyDir)\include\pango-1.0\pango\pango-glyph.h +copy ..\..\pango\pango-glyph-item.h $(CopyDir)\include\pango-1.0\pango\pango-glyph-item.h +copy ..\..\pango\pango-gravity.h $(CopyDir)\include\pango-1.0\pango\pango-gravity.h +copy ..\..\pango\pango-item.h $(CopyDir)\include\pango-1.0\pango\pango-item.h +copy ..\..\pango\pango-language.h $(CopyDir)\include\pango-1.0\pango\pango-language.h +copy ..\..\pango\pango-layout.h $(CopyDir)\include\pango-1.0\pango\pango-layout.h +copy ..\..\pango\pango-matrix.h $(CopyDir)\include\pango-1.0\pango\pango-matrix.h +copy ..\..\pango\pango-modules.h $(CopyDir)\include\pango-1.0\pango\pango-modules.h +copy ..\..\pango\pango-renderer.h $(CopyDir)\include\pango-1.0\pango\pango-renderer.h +copy ..\..\pango\pango-script.h $(CopyDir)\include\pango-1.0\pango\pango-script.h +copy ..\..\pango\pango-tabs.h $(CopyDir)\include\pango-1.0\pango\pango-tabs.h +copy ..\..\pango\pango-types.h $(CopyDir)\include\pango-1.0\pango\pango-types.h +copy ..\..\pango\pango-utils.h $(CopyDir)\include\pango-1.0\pango\pango-utils.h +copy ..\..\pango\pango-version-macros.h $(CopyDir)\include\pango-1.0\pango\pango-version-macros.h +copy ..\..\pango\pangocairo.h $(CopyDir)\include\pango-1.0\pango\pangocairo.h +copy ..\..\pango\pangowin32.h $(CopyDir)\include\pango-1.0\pango\pangowin32.h +copy ..\..\pango\pango-features.h $(CopyDir)\include\pango-1.0\pango\pango-features.h +copy ..\..\pango\pango-enum-types.h $(CopyDir)\include\pango-1.0\pango\pango-enum-types.h +if exist ..\pango.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\pango.pc $(CopyDir)\lib\pkgconfig) +if exist ..\pangowin32.pc copy ..\pangowin32.pc $(CopyDir)\lib\pkgconfig +if exist ..\pangocairo.pc copy ..\pangocairo.pc $(CopyDir)\lib\pkgconfig +if "$(Configuration)" == "Release" goto END +if "$(Configuration)" == "Debug" goto END +copy ..\..\pango\pangofc-decoder.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-font.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangofc-fontmap.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pango-ot.h $(CopyDir)\include\pango-$(ApiVersion)\pango +copy ..\..\pango\pangoft2.h $(CopyDir)\include\pango-$(ApiVersion)\pango +if exist ..\pangoft2.pc copy ..\pangoft2.pc $(CopyDir)\lib\pkgconfig +:END + + if exist $(PythonDir)\python.exe $(PythonDir)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + if exist $(PythonDirX64)\python.exe $(PythonDirX64)\python.exe ..\pangopc.py --version=$(PangoMajorVersion).$(PangoMinorVersion).$(PangoMicroVersion) --prefix=$(CopyDir) + ..\pango.pc;..\pangowin32.pc;..\pangocairo.pc + ..\pangoft2.pc + + + <_PropertySheetDisplayName>pangoinstallprops + + + + + + $(BinDir) + + + $(PangoInstallHeadersData) + + + $(GenPangoPC) + + + $(GenPangoPCX64) + + + $(PangoPCFiles) + + + $(PangoFT2PCFiles) + + + diff --git a/win32/vs15/pango-install.vcxproj b/win32/vs15/pango-install.vcxproj new file mode 100644 index 0000000..ffcee18 --- /dev/null +++ b/win32/vs15/pango-install.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + pangoinstall + Win32Proj + + + + Utility + MultiByte + true + v141 + + + Utility + MultiByte + true + v141 + + + Utility + MultiByte + v141 + + + Utility + MultiByte + v141 + + + Utility + MultiByte + true + v141 + + + Utility + MultiByte + true + v141 + + + Utility + MultiByte + v141 + + + Utility + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + $(GlibEtcInstallRoot)\ + + + + + + + + + + + + + + + + + + + + + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + Installing Build Results... + $(PangoPCFiles);$(PangoFT2PCFiles) + $(PangoDoInstallBin) $(PangoInstallHeadersData) + blah;%(Outputs) + + + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPC) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPC) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) + $(PangoPCFiles);%(Outputs) + Generating .pc files... + $(GenPangoPCX64) --pangoft2 + $(PangoPCFiles);$(PangoFT2PCFile);%(Outputs) + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c76} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs15/pango-install.vcxproj.filters b/win32/vs15/pango-install.vcxproj.filters new file mode 100644 index 0000000..88fd7b7 --- /dev/null +++ b/win32/vs15/pango-install.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + Resource Files + Resource Files + + diff --git a/win32/vs15/pango-introspect.vcxproj b/win32/vs15/pango-introspect.vcxproj new file mode 100644 index 0000000..793ba6e --- /dev/null +++ b/win32/vs15/pango-introspect.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {2FE2F832-D857-450E-99AF-549AC88422F2} + pangointrospect + + + + Makefile + true + MultiByte + v141 + + + Makefile + false + true + MultiByte + v141 + + + Makefile + MultiByte + v141 + + + Makefile + MultiByte + true + v141 + + + + + + + + + + + + + + + + + + + + + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParam) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean install-introspection + $(PangoIntrospectNMakeCmd) $(IntrospectPythonParamX64) clean + $(PangoIntrospectBuiltFiles) + + + + {fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fb} + false + + + + + + \ No newline at end of file diff --git a/win32/vs15/pango-prebuild.props b/win32/vs15/pango-prebuild.props new file mode 100644 index 0000000..f7a441d --- /dev/null +++ b/win32/vs15/pango-prebuild.props @@ -0,0 +1,17 @@ + + + + + + + copy ..\..\config.h.win32 ..\..\config.h + + + <_PropertySheetDisplayName>pangoprebuildprops + + + + $(CopyConfigH) + + + diff --git a/win32/vs15/pango-version-paths.props b/win32/vs15/pango-version-paths.props new file mode 100644 index 0000000..ba4f050 --- /dev/null +++ b/win32/vs15/pango-version-paths.props @@ -0,0 +1,82 @@ + + + + 15 + 1 + 42 + 4 + 1.0 + $(SolutionDir)\..\..\..\vs$(VSVer)\$(Platform) + $(GlibEtcInstallRoot) + lib + -$(ApiVersion)-0 + + -1-vs$(VSVer) + $(PangoSeparateVSDllPrefix) + $(PangoSeparateVSDllSuffix) + c:\python34 + c:\python34 + c:\python34 + c:\python36 + c:\python36 + $(PythonDir).x64 + PYTHON=$(PythonDir)\python.exe + PYTHON=$(PythonDirX64)\python.exe + + + <_PropertySheetDisplayName>pangoversionpathsprops + + + + $(VSVer) + + + $(PangoMajorVersion) + + + $(PangoMinorVersion) + + + $(PangoMicroVersion) + + + $(ApiVersion) + + + $(GlibEtcInstallRoot) + + + $(CopyDir) + + + $(PangoLibtoolCompatibleDllPrefix) + + + $(PangoLibtoolCompatibleDllSuffix) + + + $(PangoSeparateVSDllPrefix) + + + $(PangoSeparateVSDllSuffix) + + + $(PangoDllPrefix) + + + $(PangoDllSuffix) + + + $(PythonDir) + + + $(PythonDirX64) + + + $(IntrospectPythonParamX64) + + + $(IntrospectPythonParam) + + + diff --git a/win32/vs15/pango.sln b/win32/vs15/pango.sln new file mode 100644 index 0000000..47619db --- /dev/null +++ b/win32/vs15/pango.sln @@ -0,0 +1,111 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcxproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcxproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs15/pango.vcxproj b/win32/vs15/pango.vcxproj new file mode 100644 index 0000000..64b55dc --- /dev/null +++ b/win32/vs15/pango.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + pango + Win32Proj + + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(CopyConfigH) + ..\..\..\config.h;%(Outputs) + + + + + + diff --git a/win32/vs15/pango.vcxproj.filters b/win32/vs15/pango.vcxproj.filters new file mode 100644 index 0000000..d12ce65 --- /dev/null +++ b/win32/vs15/pango.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs15/pangocairo.vcxproj b/win32/vs15/pangocairo.vcxproj new file mode 100644 index 0000000..39515a4 --- /dev/null +++ b/win32/vs15/pangocairo.vcxproj @@ -0,0 +1,344 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + pangocairo + Win32Proj + + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(OutDir)pangoft2-$(ApiVersion).lib;%(IgnoreSpecificDefaultLibraries) + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoCairoIncs);$(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(CairoFTDefines);$(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + cairo.lib;$(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + true + true + + + true + true + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c73} + false + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c74} + false + + + + + + diff --git a/win32/vs15/pangocairo.vcxproj.filters b/win32/vs15/pangocairo.vcxproj.filters new file mode 100644 index 0000000..770c8d8 --- /dev/null +++ b/win32/vs15/pangocairo.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Resource Files + + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs15/pangoft2.vcxproj b/win32/vs15/pangoft2.vcxproj new file mode 100644 index 0000000..98ba188 --- /dev/null +++ b/win32/vs15/pangoft2.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + pangoft2 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoFT2Incs);%(AdditionalIncludeDirectories) + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + $(PangoFT2Libs);%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs15/pangoft2.vcxproj.filters b/win32/vs15/pangoft2.vcxproj.filters new file mode 100644 index 0000000..a815a60 --- /dev/null +++ b/win32/vs15/pangoft2.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs15/pangowin32.vcxproj b/win32/vs15/pangowin32.vcxproj new file mode 100644 index 0000000..f7f05d5 --- /dev/null +++ b/win32/vs15/pangowin32.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug_FC + Win32 + + + Debug_FC + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_FC + Win32 + + + Release_FC + x64 + + + Release + Win32 + + + Release + x64 + + + + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + pangowin32 + Win32Proj + + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + true + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + true + false + true + false + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX86 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX86 + + + + + Disabled + _DEBUG;$(PangoDefines);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + MachineX64 + + + + + $(PangoDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + usp10.lib;%(AdditionalDependencies) + $(OutDir)$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll + $(TargetDir)$(ProjectName)-$(ApiVersion).lib + true + Windows + true + true + MachineX64 + + + + + + + + + + + + + + {68cc80b9-7225-4fb5-b9ab-9c1df50b6c72} + false + + + + + + diff --git a/win32/vs15/pangowin32.vcxproj.filters b/win32/vs15/pangowin32.vcxproj.filters new file mode 100644 index 0000000..b1069c2 --- /dev/null +++ b/win32/vs15/pangowin32.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + Resource Files + + + Source Files + Source Files + Source Files + Source Files + + diff --git a/win32/vs9/Makefile.am b/win32/vs9/Makefile.am new file mode 100644 index 0000000..ecf9bb0 --- /dev/null +++ b/win32/vs9/Makefile.am @@ -0,0 +1,32 @@ +GENERATED_ITEMS = \ + pango.vcproj \ + pangowin32.vcproj \ + pangoft2.vcproj \ + pangocairo.vcproj \ + pango-install.vsprops + +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.vsprops \ + pango-ignore-fc.vsprops \ + pango-install-bin.vsprops \ + pango-install.vspropsin \ + pango-prebuild.vsprops \ + pango-version-paths.vsprops \ + pango.vcprojin \ + pangoft2.vcprojin \ + pangocairo.vcprojin \ + pangowin32.vcprojin \ + pango-install.vcproj \ + pango-introspect.vcproj \ + stdint.h \ + README.txt \ + $(GENERATED_ITEMS) + +pango-install.vsprops: $(top_srcdir)/win32/vs9/pango-install.vspropsin pango.headers + $(CPP) -P - <$(top_srcdir)/win32/vs9/pango-install.vspropsin >$@ + rm pango.headers + +DISTCLEANFILES = $(GENERATED_ITEMS) + +-include $(top_srcdir)/git.mk diff --git a/win32/vs9/Makefile.in b/win32/vs9/Makefile.in new file mode 100644 index 0000000..22991da --- /dev/null +++ b/win32/vs9/Makefile.in @@ -0,0 +1,534 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = win32/vs9 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = pango-version-paths.vsprops +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(srcdir)/pango-version-paths.vsprops.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIB = @CAIRO_LIB@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PC = @CAIRO_PC@ +CAIRO_PREFIX = @CAIRO_PREFIX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIB = @FONTCONFIG_LIB@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_PC = @FONTCONFIG_PC@ +FREETYPE2_LIB = @FREETYPE2_LIB@ +FREETYPE2_PC = @FREETYPE2_PC@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIB = @HARFBUZZ_LIB@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_PC = @HARFBUZZ_PC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBRARY_LIBTOOL_OPTIONS = @LIBRARY_LIBTOOL_OPTIONS@ +LIBS = @LIBS@ +LIBTHAI_CFLAGS = @LIBTHAI_CFLAGS@ +LIBTHAI_LIBS = @LIBTHAI_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_API_VERSION = @PANGO_API_VERSION@ +PANGO_BINARY_AGE = @PANGO_BINARY_AGE@ +PANGO_CURRENT_MINUS_AGE = @PANGO_CURRENT_MINUS_AGE@ +PANGO_DEBUG_FLAGS = @PANGO_DEBUG_FLAGS@ +PANGO_HIDDEN_VISIBILITY_CFLAGS = @PANGO_HIDDEN_VISIBILITY_CFLAGS@ +PANGO_INTERFACE_AGE = @PANGO_INTERFACE_AGE@ +PANGO_VERSION = @PANGO_VERSION@ +PANGO_VERSION_MAJOR = @PANGO_VERSION_MAJOR@ +PANGO_VERSION_MICRO = @PANGO_VERSION_MICRO@ +PANGO_VERSION_MINOR = @PANGO_VERSION_MINOR@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG_CAIRO_REQUIRES = @PKGCONFIG_CAIRO_REQUIRES@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +XFT_CFLAGS = @XFT_CFLAGS@ +XFT_LIBS = @XFT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +GENERATED_ITEMS = \ + pango.vcproj \ + pangowin32.vcproj \ + pangoft2.vcproj \ + pangocairo.vcproj \ + pango-install.vsprops + +EXTRA_DIST = \ + pango.sln \ + pango-build-defines.vsprops \ + pango-ignore-fc.vsprops \ + pango-install-bin.vsprops \ + pango-install.vspropsin \ + pango-prebuild.vsprops \ + pango-version-paths.vsprops \ + pango.vcprojin \ + pangoft2.vcprojin \ + pangocairo.vcprojin \ + pangowin32.vcprojin \ + pango-install.vcproj \ + pango-introspect.vcproj \ + stdint.h \ + README.txt \ + $(GENERATED_ITEMS) + +DISTCLEANFILES = $(GENERATED_ITEMS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits win32/vs9/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits win32/vs9/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +pango-version-paths.vsprops: $(top_builddir)/config.status $(srcdir)/pango-version-paths.vsprops.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +pango-install.vsprops: $(top_srcdir)/win32/vs9/pango-install.vspropsin pango.headers + $(CPP) -P - <$(top_srcdir)/win32/vs9/pango-install.vspropsin >$@ + rm pango.headers + +-include $(top_srcdir)/git.mk + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/win32/vs9/README.txt b/win32/vs9/README.txt new file mode 100644 index 0000000..18f958d --- /dev/null +++ b/win32/vs9/README.txt @@ -0,0 +1,112 @@ +Note that all this is rather experimental. + +Please do not compile Pango in a path with spaces to avoid potential +problems during the build and/or during the usage of the Pango +library. + +Please refer to the following GNOME Live! page for more detailed +instructions on building Pango and its dependencies with Visual C++: + +https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack + +This VS9 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcprojin files here into .vcproj +files. + +It is recommended that GLib is compiled with VS9 to compile Pango. +External dependencies are at least Cairo, zlib, libpng, +gettext-runtime; optional dependencies include fontconfig, freetype, +and expat. Please see the build\win32\vs9\README.txt file in glib +for details where to unpack them. + +Decide first whether you would want to use fontconfig (which also includes +freetype) prior to starting this build-Cairo needs to be built with freetype +*and* fontconfig support before building Pango. You will need fontconfig +support if you plan on building GIMP, or if you need support for complex +language scripts via fontconfig. + +It is recommended that one builds the dependencies with VS9 as far as +possible, especially those from and using the GTK+ stack (i.e. GLib and +Cairo, [Cairo if one is planning to use GTK+ 3.x]), so that crashes +caused by mixing calls to different CRTs can be kept at a minimum. +zlib, libpng, and Cairo do contain support for compiling under VS9 +using VS project files and/or makefiles at this time of writing. +For GLib, VS9 project files are available under +$(srcroot)\vs9 in the case of GLib (stable/unstable). + +There is no known official VS9 build support for fontconfig +(along with freetype and expat which will work with the pre-compiled +fontconfig binary on ftp.gnome.org) and gettext-runtime, so please use +the binaries from: + +ftp://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32 bit) +ftp://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ (64 bit) + +Set up the source tree as follows under some arbitrary top folder +: + +\ +\vs9\ + +Unzip the binaries obtained from ftp.gnome.org in \vs9\, +and build the following, if not already done so: + +Note: put the resulting zlib, libpng, pcre and Cairo files as follows: + .dll files: \vs9\\bin + .lib files: \vs9\\lib + .h files: \vs9\\include + +The recommended build order for these dependencies: +(first unzip any dependent binaries downloaded from the ftp.gnome.org + as described in the README.txt file in the build\win32\vs9 folder) +-zlib +-libpng +-(optional for GLib) PCRE (version 8.12 or later, use of CMake to + build PCRE is recommended-see build\win32\vs9\README.txt of GLib) +-GLib (put the sources in \, and build it from + there with VS9) +-Cairo (inclusive of Cairo-GObject-if using GTK+-3.x) + +Use the *_fc configs if the usage of fontconfig is desired; otherwise +use the configs that do not end with _fc. + +*this* file you are now reading is thus located at +\\win32\vs9\README.txt. + + is either Win32 or x64, as in VS9 project files. + +You should unpack the glib-dev zip file into +\vs9\, so that for instance glib.h ends up at +\vs9\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs9\. For instance, +built DLLs go into \vs9\\bin, built LIBs into +\vs9\\lib and headers into +\vs9\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +There is now a "pango-introspect" project that is used to build the +introspection files. In order for this to work, check that the paths for +PythonDir (32-bit builds) and PythonDirX64 (x64 builds) are correct for your +system. Note that it must be the same Python installation that was used to +build GObject-Introspection (G-I), and a complete G-I build/installation +needs to be found in \vs9\\. Note also that this is not +built by default, so you will need to right-click on the project to build it, +which will build and "install" the other projects that are normally built, if +those were not yet built. The introspection files that are built will be +"installed" to \vs9\\share\gir-1.0 (the .gir file(s)) and +\vs9\\lib\girepository-1.0 (the .typelib files(s)) upon +successful build. for building this in a different configuration, therefore, +you will need to clean this project specifically and then rebuild. Note that +this is currently supported only for the non _FC (i.e. where PangoFT2 is not +built) configurations + +--Tor Lillqvist +--Updated by Fan, Chun-wei diff --git a/win32/vs9/pango-build-defines.vsprops b/win32/vs9/pango-build-defines.vsprops new file mode 100644 index 0000000..7997fa5 --- /dev/null +++ b/win32/vs9/pango-build-defines.vsprops @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango-ignore-fc.vsprops b/win32/vs9/pango-ignore-fc.vsprops new file mode 100644 index 0000000..965186f --- /dev/null +++ b/win32/vs9/pango-ignore-fc.vsprops @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/win32/vs9/pango-install-bin.vsprops b/win32/vs9/pango-install-bin.vsprops new file mode 100644 index 0000000..729762e --- /dev/null +++ b/win32/vs9/pango-install-bin.vsprops @@ -0,0 +1,41 @@ + + + + \ No newline at end of file diff --git a/win32/vs9/pango-install.vcproj b/win32/vs9/pango-install.vcproj new file mode 100644 index 0000000..aba571b --- /dev/null +++ b/win32/vs9/pango-install.vcproj @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango-install.vsprops b/win32/vs9/pango-install.vsprops new file mode 100644 index 0000000..819a976 --- /dev/null +++ b/win32/vs9/pango-install.vsprops @@ -0,0 +1,62 @@ + + + + + + diff --git a/win32/vs9/pango-install.vspropsin b/win32/vs9/pango-install.vspropsin new file mode 100644 index 0000000..e28a91a --- /dev/null +++ b/win32/vs9/pango-install.vspropsin @@ -0,0 +1,40 @@ + + + + + + diff --git a/win32/vs9/pango-introspect.vcproj b/win32/vs9/pango-introspect.vcproj new file mode 100644 index 0000000..f0b930c --- /dev/null +++ b/win32/vs9/pango-introspect.vcproj @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango-prebuild.vsprops b/win32/vs9/pango-prebuild.vsprops new file mode 100644 index 0000000..df0f466 --- /dev/null +++ b/win32/vs9/pango-prebuild.vsprops @@ -0,0 +1,12 @@ + + + + diff --git a/win32/vs9/pango-version-paths.vsprops b/win32/vs9/pango-version-paths.vsprops new file mode 100644 index 0000000..caec19d --- /dev/null +++ b/win32/vs9/pango-version-paths.vsprops @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango-version-paths.vsprops.in b/win32/vs9/pango-version-paths.vsprops.in new file mode 100644 index 0000000..f255ef7 --- /dev/null +++ b/win32/vs9/pango-version-paths.vsprops.in @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango.sln b/win32/vs9/pango.sln new file mode 100644 index 0000000..9131fa0 --- /dev/null +++ b/win32/vs9/pango.sln @@ -0,0 +1,131 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-install", "pango-install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango-introspect", "pango-introspect.vcproj", "{2FE2F832-D857-450E-99AF-549AC88422F2}" + ProjectSection(ProjectDependencies) = postProject + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Debug_FC|Win32 = Debug_FC|Win32 + Debug_FC|x64 = Debug_FC|x64 + Release_FC|Win32 = Release_FC|Win32 + Release_FC|x64 = Release_FC|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release_FC|x64.Build.0 = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug_FC|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release_FC|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release_FC|x64.Build.0 = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.ActiveCfg = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|Win32.Build.0 = Debug_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.ActiveCfg = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_FC|x64.Build.0 = Debug_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.ActiveCfg = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|Win32.Build.0 = Release_FC|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.ActiveCfg = Release_FC|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_FC|x64.Build.0 = Release_FC|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|Win32.ActiveCfg = Release|Win32 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Debug|x64.ActiveCfg = Debug|x64 + {2FE2F832-D857-450E-99AF-549AC88422F2}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs9/pango.vcproj b/win32/vs9/pango.vcproj new file mode 100644 index 0000000..8e21a24 --- /dev/null +++ b/win32/vs9/pango.vcproj @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pango.vcprojin b/win32/vs9/pango.vcprojin new file mode 100644 index 0000000..0b39637 --- /dev/null +++ b/win32/vs9/pango.vcprojin @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "pango.sourcefiles" + + + diff --git a/win32/vs9/pangocairo.vcproj b/win32/vs9/pangocairo.vcproj new file mode 100644 index 0000000..6cb7d33 --- /dev/null +++ b/win32/vs9/pangocairo.vcproj @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pangocairo.vcprojin b/win32/vs9/pangocairo.vcprojin new file mode 100644 index 0000000..498d96e --- /dev/null +++ b/win32/vs9/pangocairo.vcprojin @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "pangocairo.sourcefiles" + + + diff --git a/win32/vs9/pangoft2.vcproj b/win32/vs9/pangoft2.vcproj new file mode 100644 index 0000000..7784304 --- /dev/null +++ b/win32/vs9/pangoft2.vcproj @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pangoft2.vcprojin b/win32/vs9/pangoft2.vcprojin new file mode 100644 index 0000000..e173dc3 --- /dev/null +++ b/win32/vs9/pangoft2.vcprojin @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "pangoft2.sourcefiles" + + + diff --git a/win32/vs9/pangowin32.vcproj b/win32/vs9/pangowin32.vcproj new file mode 100644 index 0000000..05b3e87 --- /dev/null +++ b/win32/vs9/pangowin32.vcproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/pangowin32.vcprojin b/win32/vs9/pangowin32.vcprojin new file mode 100644 index 0000000..449f555 --- /dev/null +++ b/win32/vs9/pangowin32.vcprojin @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "pangowin32.sourcefiles" + + + + + diff --git a/win32/vs9/stdint.h b/win32/vs9/stdint.h new file mode 100644 index 0000000..fcab43a --- /dev/null +++ b/win32/vs9/stdint.h @@ -0,0 +1,36 @@ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef int intptr_t; +#endif +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t;