From 7914feb1045dc215d9e79b1d76d3a587e2ec644c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jeremy=20B=C3=ADcha?= Date: Fri, 15 Mar 2024 16:59:24 -0400 Subject: [PATCH] Import pangomm2.48_2.52.0.orig.tar.xz [dgit import orig pangomm2.48_2.52.0.orig.tar.xz] --- COPYING | 515 + COPYING.tools | 339 + ChangeLog | 1474 ++ ChangeLog.pre-2-34-0 | 745 + MSVC_NMake/Makefile.vc | 66 + MSVC_NMake/build-rules-msvc.mak | 82 + MSVC_NMake/config-msvc.mak | 95 + MSVC_NMake/create-lists-msvc.mak | 67 + MSVC_NMake/create-lists.bat | 42 + MSVC_NMake/detectenv-msvc.mak | 166 + MSVC_NMake/filelist.am | 14 + MSVC_NMake/generate-msvc.mak | 54 + MSVC_NMake/info-msvc.mak | 35 + MSVC_NMake/install.mak | 20 + MSVC_NMake/pangomm/meson.build | 17 + MSVC_NMake/pangomm/pangomm.rc.in | 71 + Makefile.am | 68 + NEWS | 458 + README.md | 132 + README.win32.md | 162 + autogen.sh | 7 + configure.ac | 85 + docs/Makefile.am | 30 + docs/images/gtkmm_logo.gif | Bin 0 -> 4416 bytes docs/images/top.gif | Bin 0 -> 260 bytes docs/reference/Doxyfile.in | 334 + docs/reference/meson.build | 175 + meson.build | 347 + meson_options.txt | 12 + pango/meson.build | 52 + pango/pangomm-uninstalled.pc.in | 10 + pango/pangomm.h | 85 + pango/pangomm.pc.in | 21 + pango/pangomm/Makefile.am | 32 + pango/pangomm/cairofontmapimpl.cc | 41 + pango/pangomm/cairofontmapimpl.h | 63 + pango/pangomm/filelist.am | 13 + pango/pangomm/filelist.gmake.am | 6 + pango/pangomm/init.cc | 34 + pango/pangomm/init.h | 43 + pango/pangomm/meson.build | 246 + pango/pangomm/types.h | 30 + pango/pangomm/wrap_init.h | 35 + pango/pangommconfig.h.in | 37 + pango/pangommconfig.h.meson | 37 + pango/src/Makefile.am | 24 + pango/src/attributes.ccg | 468 + pango/src/attributes.hg | 769 + pango/src/attriter.ccg | 153 + pango/src/attriter.hg | 114 + pango/src/attrlist.ccg | 73 + pango/src/attrlist.hg | 99 + pango/src/cairofontmap.ccg | 19 + pango/src/cairofontmap.hg | 86 + pango/src/color.ccg | 33 + pango/src/color.hg | 76 + pango/src/context.ccg | 91 + pango/src/context.hg | 174 + pango/src/coverage.ccg | 32 + pango/src/coverage.hg | 54 + pango/src/filelist.am | 39 + pango/src/font.ccg | 45 + pango/src/font.hg | 95 + pango/src/fontdescription.ccg | 35 + pango/src/fontdescription.hg | 103 + pango/src/fontface.ccg | 33 + pango/src/fontface.hg | 56 + pango/src/fontfamily.ccg | 38 + pango/src/fontfamily.hg | 80 + pango/src/fontmap.ccg | 46 + pango/src/fontmap.hg | 77 + pango/src/fontmetrics.ccg | 22 + pango/src/fontmetrics.hg | 50 + pango/src/fontset.ccg | 47 + pango/src/fontset.hg | 58 + pango/src/glyph.ccg | 87 + pango/src/glyph.hg | 203 + pango/src/glyphitem.ccg | 20 + pango/src/glyphitem.hg | 69 + pango/src/glyphstring.ccg | 95 + pango/src/glyphstring.hg | 152 + pango/src/item.ccg | 130 + pango/src/item.hg | 191 + pango/src/language.ccg | 70 + pango/src/language.hg | 78 + pango/src/layout.ccg | 151 + pango/src/layout.hg | 341 + pango/src/layoutiter.ccg | 87 + pango/src/layoutiter.hg | 148 + pango/src/layoutline.ccg | 82 + pango/src/layoutline.hg | 117 + pango/src/pango.defs | 7 + pango/src/pango_docs.xml | 17046 ++++++++++++++++ pango/src/pango_docs_override.xml | 388 + pango/src/pango_enums.defs | 945 + pango/src/pango_extra_objects.defs | 97 + pango/src/pango_methods.defs | 6073 ++++++ pango/src/pango_signals.defs | 98 + pango/src/pango_vfuncs.defs | 113 + pango/src/rectangle.ccg | 65 + pango/src/rectangle.hg | 149 + pango/src/renderer.ccg | 38 + pango/src/renderer.hg | 106 + pango/src/tabarray.ccg | 76 + pango/src/tabarray.hg | 58 + subprojects/cairomm-1.16.wrap | 8 + subprojects/glibmm-2.68.wrap | 8 + subprojects/pango.wrap | 8 + tests/Makefile.am | 2 + tools/Makefile.am | 40 + tools/dummy-header.py | 15 + tools/extra_defs_gen/generate_defs_pango.cc | 42 + tools/extra_defs_gen/meson.build | 35 + tools/gen_scripts/generate_all.sh | 14 + tools/gen_scripts/init_generate.sh | 48 + tools/gen_scripts/pango_generate_docs.sh | 17 + tools/gen_scripts/pango_generate_enums.sh | 13 + .../gen_scripts/pango_generate_extra_defs.sh | 11 + tools/gen_scripts/pango_generate_methods.sh | 13 + tools/m4/convert.m4 | 7 + tools/m4/convert_pango.m4 | 179 + tools/m4/convert_pangomm.m4 | 5 + tools/m4/filelist.am | 3 + 123 files changed, 37234 insertions(+) create mode 100644 COPYING create mode 100644 COPYING.tools create mode 100644 ChangeLog create mode 100644 ChangeLog.pre-2-34-0 create mode 100644 MSVC_NMake/Makefile.vc create mode 100644 MSVC_NMake/build-rules-msvc.mak create mode 100644 MSVC_NMake/config-msvc.mak create mode 100644 MSVC_NMake/create-lists-msvc.mak create mode 100644 MSVC_NMake/create-lists.bat create mode 100644 MSVC_NMake/detectenv-msvc.mak create mode 100644 MSVC_NMake/filelist.am create mode 100644 MSVC_NMake/generate-msvc.mak create mode 100644 MSVC_NMake/info-msvc.mak create mode 100644 MSVC_NMake/install.mak create mode 100644 MSVC_NMake/pangomm/meson.build create mode 100644 MSVC_NMake/pangomm/pangomm.rc.in create mode 100644 Makefile.am create mode 100755 NEWS create mode 100644 README.md create mode 100644 README.win32.md create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 docs/Makefile.am create mode 100644 docs/images/gtkmm_logo.gif create mode 100644 docs/images/top.gif create mode 100644 docs/reference/Doxyfile.in create mode 100644 docs/reference/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 pango/meson.build create mode 100644 pango/pangomm-uninstalled.pc.in create mode 100644 pango/pangomm.h create mode 100644 pango/pangomm.pc.in create mode 100644 pango/pangomm/Makefile.am create mode 100644 pango/pangomm/cairofontmapimpl.cc create mode 100644 pango/pangomm/cairofontmapimpl.h create mode 100644 pango/pangomm/filelist.am create mode 100644 pango/pangomm/filelist.gmake.am create mode 100644 pango/pangomm/init.cc create mode 100644 pango/pangomm/init.h create mode 100644 pango/pangomm/meson.build create mode 100644 pango/pangomm/types.h create mode 100644 pango/pangomm/wrap_init.h create mode 100644 pango/pangommconfig.h.in create mode 100644 pango/pangommconfig.h.meson create mode 100644 pango/src/Makefile.am create mode 100644 pango/src/attributes.ccg create mode 100644 pango/src/attributes.hg create mode 100644 pango/src/attriter.ccg create mode 100644 pango/src/attriter.hg create mode 100644 pango/src/attrlist.ccg create mode 100644 pango/src/attrlist.hg create mode 100644 pango/src/cairofontmap.ccg create mode 100644 pango/src/cairofontmap.hg create mode 100644 pango/src/color.ccg create mode 100644 pango/src/color.hg create mode 100644 pango/src/context.ccg create mode 100644 pango/src/context.hg create mode 100644 pango/src/coverage.ccg create mode 100644 pango/src/coverage.hg create mode 100644 pango/src/filelist.am create mode 100644 pango/src/font.ccg create mode 100644 pango/src/font.hg create mode 100644 pango/src/fontdescription.ccg create mode 100644 pango/src/fontdescription.hg create mode 100644 pango/src/fontface.ccg create mode 100644 pango/src/fontface.hg create mode 100644 pango/src/fontfamily.ccg create mode 100644 pango/src/fontfamily.hg create mode 100644 pango/src/fontmap.ccg create mode 100644 pango/src/fontmap.hg create mode 100644 pango/src/fontmetrics.ccg create mode 100644 pango/src/fontmetrics.hg create mode 100644 pango/src/fontset.ccg create mode 100644 pango/src/fontset.hg create mode 100644 pango/src/glyph.ccg create mode 100644 pango/src/glyph.hg create mode 100644 pango/src/glyphitem.ccg create mode 100644 pango/src/glyphitem.hg create mode 100644 pango/src/glyphstring.ccg create mode 100644 pango/src/glyphstring.hg create mode 100644 pango/src/item.ccg create mode 100644 pango/src/item.hg create mode 100644 pango/src/language.ccg create mode 100644 pango/src/language.hg create mode 100644 pango/src/layout.ccg create mode 100644 pango/src/layout.hg create mode 100644 pango/src/layoutiter.ccg create mode 100644 pango/src/layoutiter.hg create mode 100644 pango/src/layoutline.ccg create mode 100644 pango/src/layoutline.hg create mode 100644 pango/src/pango.defs create mode 100644 pango/src/pango_docs.xml create mode 100644 pango/src/pango_docs_override.xml create mode 100644 pango/src/pango_enums.defs create mode 100644 pango/src/pango_extra_objects.defs create mode 100644 pango/src/pango_methods.defs create mode 100644 pango/src/pango_signals.defs create mode 100644 pango/src/pango_vfuncs.defs create mode 100644 pango/src/rectangle.ccg create mode 100644 pango/src/rectangle.hg create mode 100644 pango/src/renderer.ccg create mode 100644 pango/src/renderer.hg create mode 100644 pango/src/tabarray.ccg create mode 100644 pango/src/tabarray.hg create mode 100644 subprojects/cairomm-1.16.wrap create mode 100644 subprojects/glibmm-2.68.wrap create mode 100644 subprojects/pango.wrap create mode 100644 tests/Makefile.am create mode 100644 tools/Makefile.am create mode 100755 tools/dummy-header.py create mode 100644 tools/extra_defs_gen/generate_defs_pango.cc create mode 100644 tools/extra_defs_gen/meson.build create mode 100755 tools/gen_scripts/generate_all.sh create mode 100755 tools/gen_scripts/init_generate.sh create mode 100755 tools/gen_scripts/pango_generate_docs.sh create mode 100755 tools/gen_scripts/pango_generate_enums.sh create mode 100755 tools/gen_scripts/pango_generate_extra_defs.sh create mode 100755 tools/gen_scripts/pango_generate_methods.sh create mode 100644 tools/m4/convert.m4 create mode 100644 tools/m4/convert_pango.m4 create mode 100644 tools/m4/convert_pangomm.m4 create mode 100644 tools/m4/filelist.am diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c4792dd --- /dev/null +++ b/COPYING @@ -0,0 +1,515 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +^L + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. +^L + 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. +^L + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +^L + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. +^L + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. +^L + 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 +^L + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper +mail. + +You should also get your employer (if you work as a programmer) or +your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James +Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/COPYING.tools b/COPYING.tools new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/COPYING.tools @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, 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 software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, 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 redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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 Program or any portion +of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) 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; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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. + + 5. 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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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. + + 7. 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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +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 Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, 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 + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), 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 Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. 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 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 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..c5648cc --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1474 @@ +2024-03-15 Kjell Ahlstedt + + 2.52.0 + +2024-03-15 Kjell Ahlstedt + + CI: Don't use warning_level and werror in meson setup + + They are applied also to subprojects. + +2024-03-15 Kjell Ahlstedt + + Add new API from pango 1.52.0 + + * configure.ac: + * meson.build: Require pangocairo >= 1.52.0 + * pango/src/fontfamily.hg: Add property_item_type(), property_n_items(), + property_name(), property_is_monospace(), property_is_variable(). + * pango/src/fontmap.hg: Add reload_font(), property_item_type(), + property_n_items(). + +2024-03-15 Kjell Ahlstedt + + Regenerate docs.xml and .defs files + + using files from pango 1.52.0. Add pango_signals.defs. + +2024-01-27 Kjell Ahlstedt + + 2.50.2 + +2024-01-15 Kjell Ahlstedt + + meson.build: Update htmlrefpub + +2023-12-11 Kjell Ahlstedt + + meson.build: Don't fail if warning_level=everything + +2023-07-11 Kjell Ahlstedt + + Remove AUTHORS, HACKING, README.SUN; add info to README.md + + See gtkmm#140 + +2023-07-11 Kjell Ahlstedt + + Update pangomm.doap + +2023-06-27 Chun-wei Fan + + README.win32.md: Make dependencies clearer + + Make it clear that glibmm-2.68 and cairomm-1.16 refer to the C++17 branches of + glibmm and cairomm, which are the glibmm-2.68.x and cairo-1.16.x or later + branches/releases, including the master/main branch. + +2023-06-27 Chun-wei Fan + + README.win32: Convert to MarkDown + + Convert to MarkDown format so that the formatting is easier on the eye, and + switch to UNIX line endings. + + Also update the info in there so that the actual build situation is better + refleted, especially in regards to Visual Studio builds. Re-organize items + for the Meson builds to be under their respective headers for MinGW and Visual + Studio. + +2023-05-04 Kjell Ahlstedt + + Coverage: Don't use deprecated pango_coverage_ref/unref() + + They are deprecated since pango 1.52.0. It has been possible + to use g_object_ref/unref() since pango 1.44.0. + +2023-05-04 Kjell Ahlstedt + + Doxyfile.in: Remove obsolete entries + +2023-05-04 Kjell Ahlstedt + + pangomm.pc.in: Update htmlrefpub + +2023-03-25 Kjell Ahlstedt + + fontset.ccg: Use callback function with C linkage + + Code that mixes up C linkage and C++ linkage has undefined behavior. + Most compilers make no difference between C and C++ linkage, so it + has not been an issue so far. But see issue glibmm#1. + +2023-03-25 Kjell Ahlstedt + + meson.build: Simplify if-file-exists test + +2023-03-25 Kjell Ahlstedt + + README.md, CI: meson -> meson setup + +2023-03-25 Kjell Ahlstedt + + Doxyfile.in: Don't hide undocumented classes + + Might make the inheritance diagrams less incomplete when Doxygen's + tag files are not perfect. + +2023-01-04 Kjell Ahlstedt + + CI: Install all dependencies with apt + + Ubuntu 22.10 contains libsigc++-3.0-dev, libglibmm-2.68-dev + and libcairomm-1.16-dev. + +2023-01-04 Kjell Ahlstedt + + meson.build: Simplify lookup of python command + + See libsigcplusplus PR#83 + +2023-01-04 Kjell Ahlstedt + + meson.build: Fix the evaluation of is_git_build on Windows + + See gtkmm#131 + +2023-01-04 Kjell Ahlstedt + + Meson build: Don't copy files with configure_file() + + It's deprecated from Meson 0.64. The replacement, fs.copyfile(), + is not useful here. It only copies from the source directory to + the build directory. + +2022-09-27 Kjell Ahlstedt + + meson.build: Detect if we build from a git subtree + + See gtkmm!72 (William Roy) + +2022-09-21 Kjell Ahlstedt + + 2.50.1 + +2022-09-12 Kjell Ahlstedt + + Convert README to README.md + +2022-05-24 Chun-wei Fan + + meson/MSVC: Re-organize warning-related compiler flags + + Add a short description for each of the warning-related compiler flags that we + apply globally. + + Also, apply '/wd4267' only when we are building a 64-bit build, as that warning + should only be related to 64-bit builds. + +2022-05-20 Kjell Ahlstedt + + meson.build: Avoid configuration warnings + +2022-03-18 Kjell Ahlstedt + + CI: Use artifacts to transfer data between stages, part 2 + +2022-03-16 Kjell Ahlstedt + + CI: Build documentation of dependencies + + Build documentation of libsigc++, glibmm, cairomm, or else pangomm's + inheritance diagrams will be incomplete due to missing tag files. + +2022-03-16 Kjell Ahlstedt + + CI: Use artifacts to transfer data between stages + +2022-02-27 Kjell Ahlstedt + + CI: Don't build everything with warnings=fatal + + Build only pangomm with warnings=fatal. + Select latest released version of libsigc++3. + +2022-02-27 Kjell Ahlstedt + + meson.build: Check if Perl is required for building documentation + + New versions of mm-common use the Python scripts doc_postprocess.py + and doc_install.py instead of the Perl scripts doc-postprocess.pl and + doc-install.pl when documentation is built. + +2022-02-22 Kjell Ahlstedt + + Context::get_font_map(): Fix reference count + + pango_context_get_font_map() returns "(transfer none)". + See https://mail.gnome.org/archives/gtkmm-list/2022-February/msg00031.html + +2022-02-15 Kjell Ahlstedt + + meson.build: Specify 'check' option in run_command() + + The default value will be changed in future Meson releases. + + Don't use deprecated python3.path(). + Let import('python').find_installation() always find the python + installation used to run Meson. + +2022-01-04 Kjell Ahlstedt + + CI: Reinsert 'meson test' + + now with (hopefully) correct YAML syntax. + +2022-01-04 Kjell Ahlstedt + + CI: Skip 'meson test' + +2022-01-04 Kjell Ahlstedt + + CI: Don't build documentation of dependencies + +2021-12-06 Kjell Ahlstedt + + 2.50.0 + +2021-12-06 Kjell Ahlstedt + + CI: Comment out 'meson test' + + If the package manager does not find a new enough version of pango, + pango is built as a subproject, and 'meson test' tests both pango and + pangomm. If a pango test fails, the whole CI fails. + There are no tests in pangomm, anyway. + +2021-12-06 Kjell Ahlstedt + + Attribute: Add some create_attr_*() methods + + and add TextTransform, BaselineShift and FontScale enums. + +2021-12-06 Kjell Ahlstedt + + AttrList: Add to_string() and from_string() + + and require pango >= 1.49.4. + +2021-12-06 Kjell Ahlstedt + + Regenerate docs.xml and .defs files, using files from pango 1.50.0 + + and update pango_docs_override.xml. + +2021-11-10 Chun-wei Fan + + build: Support Visual Studio 2022 builds + + Make these builds distinct from the Visual Studio 2019 builds. + +2021-10-11 Kjell Ahlstedt + + Add FontMap::get_family() + +2021-10-11 Kjell Ahlstedt + + Add the CairoFontMapImpl class + + * pango/pangomm/.gitignore: + * pango/pangomm/filelist.am: + * pango/pangomm/meson.build: Add cairofontmapimpl. + * pango/src/cairofontmap.hg: Improve the documentation of get_default(). + * pango/src/fontmap.[ccg|hg]: Add a custom wrap_new(). Wrap in a + CairoFontMapImpl if the PangoFontMap object implements PangoCairoFontMap. + * pango/pangomm/cairofontmapimpl.[cc|h]: New files. A CairoFontMapImpl + derives from FontMap and implements CairoFontMap. + + Fixes #15 + +2021-09-12 Pavlo Solntsev + + CI: Switching to debian:testing + +2021-09-06 Kjell Ahlstedt + + AttrList: Add get_attributes(), update(), equal() + + Fixes #12 + +2021-09-06 Kjell Ahlstedt + + docs/reference/Doxyfile.in: Remove obsolete entry + +2021-08-25 Kjell Ahlstedt + + CI: Add .gitlab-ci.yml + +2021-08-25 Kjell Ahlstedt + + Don't include individual pango headers, part 2 + +2021-08-24 Matthias Clasen + + Don't include individual pango headers + + As in every gnome library, you are only supposed + to include the main pango.h header from the outside. + + This was causing build failures after some recent + pango header rearrangements. + +2021-07-16 Matthias Clasen + + Use pango from the main branch + + Change the Pango subproject to use the main branch. + + This depends on + https://gitlab.gnome.org/GNOME/pango/-/merge_requests/379 + +2021-05-21 Kjell Ahlstedt + + 2.49.1 + +2021-05-18 Kjell Ahlstedt + + Add dependencies to Doxygen tag files in subprojects + + Doxygen in a main project shall not be called before tag files have been + created or updated in subprojects. + +2021-05-14 Kjell Ahlstedt + + Fix build as subproject without building documentation + + * meson.build: If mm-common-get is not found in maintainer-mode + with 'required: false', try with 'required: true'. + Don't try to use tag_file, if documentation is not built. + * docs/reference/meson.build: Don't use variables from modules + that don't define doxytagfile. These are subprojects that don't build + their documentation. + +2021-05-11 Chun-wei Fan + + Visual Studio builds: Clean up build files + + glibmm will be updated to be clear of classes that export items making the + built binaries dependent on the exact compiler version and the STL version, + which will eliminate the need to ignore warnings C4251, C4273 and C4275. + + We will also use the /EHsc compiler flag so that we can also drop the + ignore on warning C4530. + +2021-05-05 Kjell Ahlstedt + + Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0 + + Call add_dist_script() in a subproject, if meson.version() >= 0.58.0. + +2021-04-08 Kjell Ahlstedt + + Meson build: No implicit_include_directories + +2021-03-26 Kjell Ahlstedt + + Meson build: No implicit_include_directories + + It shall not be possible to find a pangomm header file + with #include instead of #include . + Not fully fixed until https://github.com/mesonbuild/meson/issues/8562 + has been fixed. + +2021-03-16 Kjell Ahlstedt + + Meson build: Make it possible to use pangomm as a subproject + + pango, cairomm and glibmm can be subprojects of pangomm. + +2021-03-09 Chun-wei Fan + + pangommconfig.h.*: Don't dllimport on MinGW + + This will fix warnings when building items using pangomm with MinGW/GCC. + + Please see: https://gitlab.gnome.org/GNOME/gtkmm/-/issues/90 + +2021-02-25 Kjell Ahlstedt + + Meson build: Use relative paths to untracked/ + + The paths to the source code in untracked/ shall be relative to the + meson.build file, when library files are built from a tarball. + With absolute paths Meson may generate too long file names. + See merge request gtkmm!61 + +2021-01-18 Kjell Ahlstedt + + GlyphItem: Make most methods public + + They became private by mistake 12 years ago in + commit d5781fecebf7eeb5bafbfb875027f6f1707a2bf1. + + Fixes #11 + +2021-01-18 Kjell Ahlstedt + + Layout, LayoutIter: Add get_const_line() and get_const_lines() + + * pango/src/layout.hg: Add get_const_line() and get_const_lines(). + * pango/src/layoutiter.hg: Add get_const_line(). + + Fixes #10 + +2021-01-17 Kjell Ahlstedt + + Layout: Speed up get_log_attrs() + + Call pango_layout_get_log_attrs_readonly() instead of + pango_layout_get_log_attrs(). The PangoLogAttr structs + will then be copied once instead of twice. + +2021-01-16 Kjell Ahlstedt + + GlyphItem: Fix a memory leak in split() + +2021-01-16 Kjell Ahlstedt + + docs/reference/Doxyfile.in: Remove obsolete entries + +2020-12-19 Kjell Ahlstedt + + 2.48.0 + +2020-12-18 Kjell Ahlstedt + + Regenerate docs.xml and .defs files + +2020-12-11 Kjell Ahlstedt + + Change ABI to pangomm-2.48; Use glibmm-2.68 instead of glibmm-2.66 + + So we can use the 2.44-2.46 version numbers for stable releases in + the pangomm-1.4 ABI series. + + We've done similar ABI name changes before. + +2020-11-27 Kjell Ahlstedt + + Add Layout::set/get_line_spacing() + + See #9 + +2020-11-27 Kjell Ahlstedt + + configure.ac, meson.build: Require pangocairo >= 1.45.1 + + Overline support, such as pango_attr_overline_new(), was added in + pango 1.45.1. The requirement should have been bumped when those + functions were wrapped. + +2020-11-16 Kjell Ahlstedt + + Wrap pango_shape_with_flags() + + * configure.ac: + * meson.build: Require pangocairo >= 1.44.3 + * pango/src/glyphstring.[ccg|hg]: Add constructor + GlyphString(const Glib::ustring& item_text, + const Glib::ustring& paragraph_text, const Analysis& analysis, + ShapeFlags flags = ShapeFlags::NONE). + * pango/src/item.[ccg|hg]: Add enum ShapeFlags and + shape(const Glib::ustring& item_text, const Glib::ustring& paragraph_text, + ShapeFlags flags = ShapeFlags::NONE). + * tools/m4/convert_pango.m4: Add conversions for ShapeFlags. + + See #9 + +2020-10-07 Kjell Ahlstedt + + Bump version to 2.43.3 + + Even micro version in released versions, odd micro version in Git. + See https://wiki.gnome.org/MaintainersCorner/Releasing + (which says minor version in one sentence where it should + say micro version) + +2020-10-01 Kjell Ahlstedt + + Meson build: Fix versioning on macOS + + See libsigcplusplus, pull request 65 + +2020-07-23 Chun-wei Fan + + NMake Makefiles: Use Meson-style DLL and .lib naming if requested + + To make things more consistent and less prone to confusion, if 'USE_MESON_LIBS' + is specified in the NMake command line, build the DLLs and .lib's that are + named like the Meson counterparts. Binaries built with Meson+Visual Studio + and the ones that are built via NMake using 'USE_MESON_LIBS' are + interchangeable, provided that they are built with the same Visual Studio + version. + +2020-07-23 Chun-wei Fan + + NMake Makefiles: Fix generating pangomm[config.h|.rc] + + The previous additions to generate those files accidentally made the build + attempt to generate them, even if done from a release tarball that is done by + the autotools builds. + + This will fix this situation, and improve the situation that if pangomm.rc or + pangommconfig.h needs to be generated, these files will be generated + automatically + +2020-07-22 Kjell Ahlstedt + + LayoutIter: Fix get_run() and get_line() + + get_run() shall call pango_layout_iter_get_run_readonly() and + take a copy of the returned PangoLayoutRun. + Make proper const and non-const versions of get_line(). + +2020-07-22 Kjell Ahlstedt + + LayoutRun: Rename to GlyphItem + + PangoLayoutRun was renamed to PangoGlyphItem in the year 2002. + For backward compatibility PangoLayoutRun is a typedef of PangoGlyphItem. + No such backward compatibility is needed in this version of pangomm. + +2020-07-22 Kjell Ahlstedt + + Renderer: Add vfuncs + + See #9 + +2020-07-22 Kjell Ahlstedt + + Font, FontFace, FontFamily, FontMetrics: Add new methods + +2020-07-22 Chun-wei Fan + + NMake Makefiles: Link with giomm + + ...since we are now using items from giomm since commit 17021092, and ensure + that we do indeed refer to the glibmm (giomm) master headers + as we are using items from + +2020-07-20 Kjell Ahlstedt + + Attribute: Add Overline and ShowFlags enums and some create*() methods + + Fixes #9 + +2020-07-20 Kjell Ahlstedt + + Regenerate docs.xml and .defs files + +2020-07-19 Andreas Persson + + Let FontMap and FontFamily implement ListModel + + Let the FontMap and FontFamily classes implement the Gio::ListModel + interface, just as the C level pango classes do. For this, a dependency + to giomm was added. Wrap CairoFontMap::get_default(). + +2020-07-08 Chun-wei Fan + + NMake Makefiles: Fix headers search + + We ought to look in $(PREFIX)\include\harfbuzz and $(PREFIX)\include, as the + HarfBuzz and Cairo headers can be found in these respective locations. + +2020-07-08 Chun-wei Fan + + NMake Makefiles: Support ARM64 Windows builds + + This will make the NMake Makefiles capable of building ARM64 binaries of + pangomm, which can be used on Windows 10 on ARM systems. + +2020-06-30 Chun-wei Fan + + README.win32: Update Meson build info + + It is now possible to build Pango directly from a GIT checkout on Visual Studio + builds for a while, so let people know about this. + + Also note that glibmm and cairomm should be built with Meson in order to use the + Meson build files for pangomm, and that it is recommended to use the same compiler + to build pangomm, glibmm and cairomm. + +2020-06-30 Chun-wei Fan + + NMake Makefiles: Use the /utf-8 compiler flag + + This makes it easier to build pangomm on non-Western locales, without requiring + to change the "Locale settings for non-Unicode programs" to English, which will + require a restart, since warning (error) C4819 can be otherwise triggered, which + can indicate broken builds due to Unicode handling issues in the compiler. + +2020-06-30 Chun-wei Fan + + NMake Makefiles: Apply toolset version for Meson-built deps + + As the Meson build files for Visual Studio apply the toolset version in the + .lib filenames by default, apply the toolset version in the Meson-built -mm + .lib files that we link in, just as we did when we we link in the -mm .lib + files that was built with NMake, by default. + + The option 'USE_COMPAT_LIBS' will also mean that we will use the former + behavior when we link in the Meson-built -mm .lib's, just as we did when we + link in the NMake-built -mm .lib's. + + Also fix the case also when the 'USE_COMPAT_LIBS' option is used and when + 'USE_MESON_LIBS' is not used on Visual Studio 2017, where the toolset version + was not correctly applied. + +2020-06-29 Kjell Ahlstedt + + docs/reference/: Update for Doxygen >= 1.8.16 + + * docs/reference/meson.build: Doxygen 1.8.16 and later does not store + tag file names in the html files. This requires changes in meson.build + and in doc-install.pl (in mm-common). Otherwise references to other modules + won't be updated in the html files when they are installed. + * docs/reference/Doxyfile.in: Remove PERL_PATH and MSCGEN_PATH. + Doxygen since version 1.8.0 does not use them. + +2020-06-29 Chun-wei Fan + + Meson/Visual Studio builds: Include toolset version by default + + This makes the built DLL and .lib's contain the toolset version if the build is + carried out using Visual Studio 2017 or later, unless the + 'msvc14x-parallel-installable' option is set to be false during configuration. + + The reasoning behind this change is that there can be subtle problems when, for + instance, one tries to link to a Visual Studio 2017-built pangomm when building + items dependening on pangomm with Visual Studio 2019. This is unfortunate as + Microsoft did try hard to make interoperating between binaries built with + Visual Studio 2017 and 2019 as easy as possible in terms of ABI and API, but + unfortunately this can hit the corner cases where this compatibility does not + work. + + As the name suggests, this attempts to make Visual Studio 2017 and 2019 builds + share a single set of underlying C DLLs easier, while avoiding breakages caused + by such subtle differences. + +2020-06-29 Chun-wei Fan + + meson.build: Check for /utf-8 on Visual Studio + + Enable this compiler flag on Visual Studio if it is supported, so that building + under non-English (East Asian) locales is made easier, which helps to avoid the + C4819 error under such situations, due to a Unicode handling issue in the + compiler when running under such locales + +2020-06-29 Chun-wei Fan + + Meson: Use pkg-config to find glibmm and cairomm for all builds + + Stop manually looking for glibmm and cairomm for better consistency, as: + + -Items that depended on glibmm which added Meson build support after glibmm, + such as gtkmm and libxml++ also required glibmm to be found via pkg-config + files, and they still had NMake Makefile support for Visual Studio builds. + For items that use cairomm directly, this will be the case as well. + -There could be corner cases on the glibmm and cairomm libraries that pangomm + links to in terms of ABI compatibility between Visual Studio 2015, 2017 and + 2019. + +2020-06-16 Chun-wei Fan + + NMake Makefiles: Use toolset version in DLL/.lib naming + + Instead of using the Visual Studio version ('vc150' for Visual Studio 2017), + use the toolset version ('vc141' for Visual Studio 2017 and 'vc142' for Visual + Studio 2019, as defined by Microsoft) so that we are more in-line with what + is now done in the pangomm-2-42 branch. + + If using the old naming convention is desired, an NMake command line option + 'USE_COMPAT_LIBS' have been added-note that this will require glibmm, cairomm, + and libsigc++ to be built with that option enabled. + +2020-05-05 Chun-wei Fan + + meson: Clean up Visual Studio bits + + Streamline how we look for the dependencies manually, by using the + 'has_headers:' attribute of cpp_compiler.find_library(), so that we can + check for the presence of the headers at the same time as looking for + the glibmm, cairomm and/or libsigc++ headers. + +2020-05-05 Chun-wei Fan + + Meson/Visual Studio: Support cairomm lookup using pkg-config + + cairomm recently received Meson build support, which will generate the + pkg-config files for us, so try to look for cairomm first using + pkg-config, before looking for it manually. + + Since cairomm's pkg-config file also pulls in libsigc++, we can also + skip looking for libsigc++ if we found cairomm via pkg-config. + +2020-05-05 Chun-wei Fan + + NMake Makefiles: Support Meson-built cairomm + + Allow linking directly to Meson-built cairomm when using the + USE_MESON_LIBS option when running NMake. + +2020-04-28 Kjell Ahlstedt + + pango/meson.build: Minor fix of pangomm-2.44.pc + + libdir=${exec_prefix}/lib, as when it's generated with Autotools. + +2020-04-11 Chun-wei Fan + + pango/src/fontdescription.hg: Mark operators with PANGOMM_API + + We are using a _WRAP_EQUAL here which generates operator== and + operator!= overloads that actually need to be exported. So, pass in a + function decorator to _WRAP_EQUAL + +2020-04-07 Kjell Ahlstedt + + Meson build: If not maintainer-mode, check that generate-binding.py exists + + Trying to build with maintainer-mode=false from a tarball generated with + Autotools will fail with a proper error message. + Fixes #6 + +2020-03-31 Kjell Ahlstedt + + Meson build: Set default value of the 'warnings' option to 'min' + + And add 'dist-warnings' with default value 'fatal'. It's used when a + tarball is tested by 'ninja dist' or 'meson dist'. + https://mail.gnome.org/archives/gtkmm-list/2020-March/msg00025.html + + Add a better error message if mm-common-get is required but not found. + +2020-03-31 Chun-wei Fan + + pango/src/*.hg: Mark _WRAP_ENUM with decl_prefix + + This way, we can use compiler directives to export the symbols for the + _WRAP_ENUM-generated template<> classes. + +2020-03-30 Chun-wei Fan + + NMake Makefiles: Fix build instruction info display + + Make up the missing escape carats... + +2020-03-29 Kjell Ahlstedt + + Meson build: Avoid some recompilations, and other changes + + * MSVC_NMake/filelist.am: Remove pangomm/copy-pangommconfig-h.py. + * MSVC_NMake/pangomm/copy-pangommconfig-h.py: Removed file. + * MSVC_NMake/pangomm/meson.build: Copy pangommconfig.h with configure_file(). + * Makefile.am: Distribute tools/dummy-header.py instead of tools/dist-cmd.py. + * docs/reference/meson.build: Rename a variable. + * meson.build: Rename some variables. Always set gmmproc_dir. + In maintainer-mode, show its value in the summary. + * pango/meson.build: Set pangommconfig_h. + * pango/pangomm/meson.build: Create dummy_header.h, depending on all + generated headers. It guarantees that all generated headers are built + before pangomm_library is built, at the same time avoiding unnecessary + recompilations. + * tools/dist-cmd.py: Removed file. It's not necessary in add_dist_script() + when the first parameter is python3.path(). + * tools/dummy-header.py: New file. + +2020-03-22 Kjell Ahlstedt + + 2.43.2 + +2020-03-22 Kjell Ahlstedt + + README: Describe building with Meson and Autotools + +2020-03-17 Kjell Ahlstedt + + Use glibmm-2.66 instead of glibmm-2.64 + + We have changed the ABI name in glibmm. + +2020-03-12 Chun-wei Fan + + NMake Makefiles: Support Meson-built glibmm + + Add the correct naming for the DLLs and .lib's for glibmm that is built + with Meson. + +2020-03-12 Chun-wei Fan + + NMake Makefiles: Ignore warnings C4251 and C4275 + + We might well be building against glibmm that is not built using gendef, + so we get C4251 and C4275 warnings when building against such GLib + builds. Ignore those warnings, since we know quite well that we are + importing from glibmm's import libraries using __declspec(dllimport) in + this case. + +2020-03-12 Chun-wei Fan + + Drop gendef from the sources + + Since we are now using compiler directives to export the symbols on + Visual Studio builds, we can now drop the venerable gendef tool from the + sources. + +2020-03-12 Chun-wei Fan + + Visual Studio builds: Do not use gendef.exe + + Instead, use compiler directives to build the pangomm DLLs. + +2020-03-12 Chun-wei Fan + + pango/pangomm/*.h: Decorate APIs with PANGOMM_API + + This prepares for the export of symbols using compiler directives rather + than using gendef.exe. + +2020-03-12 Chun-wei Fan + + pango/src/*.hg: Decorate classes and functions with PANGOMM_API + + This prepares for using compiler directives to export symbols rather + than using gendef.exe. + +2020-03-12 Chun-wei Fan + + pango/pangomm/meson.build: Define PANGOMM_BUILD + + This will eventually let us tell the compiler that we want to use + compiler directives to export the symbols. + +2020-03-12 Chun-wei Fan + + pango/pangommconfig.h.*: Add PANGOMM_API + + This prepares for decoration of the various APIs in pangomm so that we + can export symbols at least on Visual Studio buids using compiler + directives, without the need of gendef.exe. + +2020-03-12 Chun-wei Fan + + NMake Makefiles: Fix build from Meson tarballs + + Look also for headers in untraced/pango and untracked/pango/pangomm, and + fix up headers installation and build rules. + +2020-03-11 Chun-wei Fan + + meson: Ignore warning C4251 and C4275 on MSVC builds + + We might be building against glibmm that is built with + __declspec(dllexport), meaning that warnings C4251 and C4275 will be + generated as we are now in-turn using __declspec(dllimport). We can + just ignore these compiler warnings, since we are pretty sure what we + are doing at this point. + +2020-03-11 Chun-wei Fan + + meson: Build generate_extra_defs with Visual Studio too + + The NMake Makefiles in glibmm now builds glibmm_generate_extra_defs-2.x.lib, + so we can make use of it to build generate_extra_defs on Visual Studio too. + +2020-03-11 Chun-wei Fan + + meson.build: Look for glibmm with pkg-config on MSVC too + + glibmm gained Meson build support for Visual Studio, so we can first + try to look for glibmm with pkg-config first, and then fall back to + manual searching if that cannot be found. + + Note that libsigc++ also has a Meson build system as well, but either we + look for it via glibmm's pkg-config files, or we look for both glibmm + and libsigc++ manually. + + Also support looking for Meson-built libsigc++ .lib's as well if glibmm + is to be looked for manually. + +2020-03-11 Chun-wei Fan + + Meson: allow maintainer builds on Visual Studio too + + glibmm recently gained the ability to build with Visual Studio from a GIT + checkout and to install the PERL scripts used to generate the C++ sources from + the respective templates, so enable this support for pangomm as well as the + needed infrastructure are largely in place. + + Note that a new configuration option has been added for Visual Studio builds + to specify the directory for gmmproc, although there is Meson build support + for building glibmm, but NMake Makefiles could have been used to build + glibmm, meaning glibmm built with Visual Studio may not have pkg-config + files, so it is used to specify the location if gmmproc if necessary. + + Since some portions that we use for non-maintainer builds can be used for + maintainer builds as well, make them shared to keep changes minimal. + +2020-03-11 Chun-wei Fan + + pango/src/color.hg: Fix call to _CLASS_BOXEDTYPE_STATIC + + Remove all the parameters after the second one, they were originally ignored + as _CLASS_BOXEDTYPE_STATIC accepted 2 arguments and will cause issues with + the new api_decoration stuff that was recently added to glibmm, which was the + third argument + +2020-02-27 Chun-wei Fan + + NMake Makefiles: Support Meson-built libsigc++ + + Add an option USE_MESON_LIBS for the NMake command line so that we can use + the Meson-built libsigc++ easier, without needing to manually update Makefiles + +2020-02-27 Chun-wei Fan + + NMake Makefiles: Separate outdir and intdir by toolset version + + This reduces the chances of builds by different Visual Studio versions become + mixed up with other versions, and makes the build tree cleaner. Note that + Visaul Studio 2015 through 2019 are treated as the same toolset version since + they link to the same CRT. + +2020-02-27 Chun-wei Fan + + NMake Makefiles: Allow builds from a GIT checkout + + ...or a Meson-generated release tarball. + + Add targets to the NMake Makefiles which will allow: + + -Generating MSVC_NMake/pangomm/pangommconfig.h and + MSVC_NMake/pangomm/pangomm.rc, needed for GIT checkouts and + Meson-generated release tarballs + + -Generating the sources that need to be generated with gmmproc and + generate_wrap_init.pl, needed for GIT checkouts, and fix installation + accordingly. + + -Look for sources also in $(srcroot)/untracked, which will be the case + for Meson-generated release tarballs. + + -"Install" the m4 files in tools/m4, so that other projects may use it. + +2020-02-27 Chun-wei Fan + + NMake Makefiles: Add rules to generate pre-configured items + + This will generate the pangomm.rc and pangommconfig.h files, which are needed + for a Visual Studio build. This will make builds from a GIT checkout + easier with NMake. + +2020-01-13 Kjell Ahlstedt + + Meson build: Improve internal dependencies + + * docs/reference/meson.build: Less difference between maintainer-mode and + not maintainer-mode. + * pango/pangomm/meson.build: Make separate lists of built .h files and + built .cc files. + +2020-01-02 Kjell Ahlstedt + + docs/reference/meson.build: Check if perl is found + + Don't use perl.path() when configuring Doxyfile, if perl is not found. + Perl is not required, if build-documentation=false. + See https://github.com/libsigcplusplus/libsigcplusplus/issues/53 + +2019-12-27 Kjell Ahlstedt + + meson.build: Check if .git is a directory or file + + In a git worktree, .git is a regular file. + + See MR !8 (Ting-Wei Lan) + +2019-10-22 Chun-wei Fan + + README.win32: Add instructions on Meson builds + + This is added for at least the Visual Studio builds. + +2019-10-22 Chun-wei Fan + + meson.build: Fix library search error messages + + The .format(...) items are placed wrongly in the cases that the required + -mm libraries are not found. Fix this. + + Make these messages clearer to people that all 3 C++-17 versions of the + cairomm, glibmm and sigc++ .lib's are required by combining the 3 + assert messages into a single assert message. + +2019-10-21 Chun-wei Fan + + meson: Link in the version resource on Windows + + For all Windows builds, compile the version resource script (pangomm.rc) + and link it into the pangomm DLL so that we embed the version info in + that DLL. + +2019-10-21 Chun-wei Fan + + meson.build: Add MSVC-specific warning items + + Let MSVC report warnings that roughly match those reported by the GCC + builds, but ignore the warnings that aren't really harmful, by referring + to GLib's msvc_recommended_pragmas.h. + +2019-10-21 Chun-wei Fan + + meson: Build import .lib for MSVC builds + + This first builds gendef.cc in MSVC_NMake/gendef so that we can use it + to generate the .def file that we need to build the import .lib file for + the pangomm DLL. + + However, in order to do this in Meson, we need to build the sources into + a temporary static .lib and run gendef.exe against it (which works with + gendef.cc unchanged, thanks to dumpbin /symbols accepting static .lib's + as well, so we won't have to figure out where the compiled object files + are) in order to obtain the symbols that we need, since Meson does not + support pre-link build steps. + + Note that all the source files are still compiled only once since we are + using extract_all_objects(), so the only overhead is the temporary static + .lib that we need to build to obtain the .def file. + +2019-10-21 Chun-wei Fan + + Meson: Don't use 'cp' in MSVC_NMake + + The 'cp' command is unfortunately not available in non-UNIXy shells, so + use a Python script instead to do the same thing. + +2019-10-21 Chun-wei Fan + + meson: Don't build generate_extra_defs on MSVC + + This depends on portions in glibmm tat is not applicable directly to + MSVC builds, so skip building this on MSVC + +2019-10-21 Chun-wei Fan + + meson: Check for -mm deps manually on MSVC + + The MSVC build files for the -mm library dependencies do not generate + pkg-config files, so check for them manually. This can be eventually + replaced by the pkg-config checks when these dependencies gain + Meson build support for MSVC. + + This will build and link pangomm without the import libraries, which + will require us to build and use gendef.exe that is in + MSVC_NMake/gendef, which will be done in a later commit. + +2019-10-21 Chun-wei Fan + + Meson builds: Improve GIT check on MSVC builds + + Check that we are not attempting to build directly from a GIT + checkout on MSVC, as this is currently not supported as m4 is required, + which is not well supported on a Windows cmd.exe environment. + +2019-10-14 Kjell Ahlstedt + + pango/pangomm/meson.build: Fix output from declare_dependency() + + * meson.build: Rename pangomm_deps -> pangomm_build_dep to avoid mix-up + with pangomm_dep in pango/pangomm/meson.build. + * pango/pangomm/meson.build: Add correct include directories in + declare_dependency() when maintainer_mode is false. Simplify the code. + * tools/extra_defs_gen/meson.build: Depend on pangomm_build_dep. + +2019-09-29 Kjell Ahlstedt + + Add support for building pangomm with Meson + + pangomm can be built with either Autotools or Meson. + + See MR !4 + +2019-09-18 Kjell Ahlstedt + + Use glibmm-2.64 instead of glibmm-2.62 + + We have changed the ABI name in glibmm. + +2019-08-12 Kjell Ahlstedt + + Coverage: Minor documentation fix + +2019-07-28 Kjell Ahlstedt + + tools: Remove obsolete files + + * tools/Makefile.am: Don't distribute README. + * tools/Makefile_list_of_sources.am_fragment: Remove, not used. + * tools/README: + * tools/TODO: Remove, once copied from glibmm, don't belong to pangomm. + +2019-07-24 Kjell Ahlstedt + + LayoutLine: Remove unnecessary forward declaration + + The forward declaration of Glib::wrap(PangoLayoutLine*, bool) became + unnecessary when the LayoutLineTraits struct was moved to layout.ccg + in commit 57d8bceba336e972a4967db6872a373eac1833b9. + +2019-07-22 Kjell Ahlstedt + + Remove deprecated API + + * pango/src/attrlist.[ccg|hg]: Remove non-const operator bool(). + * pango/src/cairofontmap.[ccg|hg]: Remove create_context(). + * pango/src/color.[ccg|hg]: Remove non-const operator bool(). + * pango/src/layout.[ccg|hg]: Remove get_iter(LayoutIter& iter). + * pango/src/layoutiter.[ccg|hg]: Remove assign_gobj(). + +2019-07-22 Kjell Ahlstedt + + Layout::get_lines(): Fix ownership of the GSList + + Change Glib::OWNERSHIP_SHALLOW -> NONE + +2019-07-22 Kjell Ahlstedt + + Coverage: Remove max(), to_bytes() and one create() + + * pango/src/coverage.[ccg|hg]: pango_coverage_from_bytes(), + pango_coverage_to_bytes() and pango_coverage_max() are deprecated in + pango 1.43. Remove them in pangomm. + * pango/src/fontmap.hg: Remove an _IGNORE() macro. + +2019-07-22 Kjell Ahlstedt + + Regenerate pango_docs.xml and .defs files + + and update pango_extra_objects.defs. + +2019-03-21 Kjell Ahlstedt + + Doxyfile.in: Remove obsolete glibmm configuration constants + + They have been removed from glibmm. See issue glibmm#22. + +2019-03-19 Kjell Ahlstedt + + Use glibmm-2.62 instead of glibmm-2.60 + + We have changed the ABI name in glibmm. + +2018-12-30 Kjell Ahlstedt + + tools/gen_scripts: Update for non-source-dir builds + + Most modules (e.g. pango) can be built in a directory separated from the + source directory. Update the scripts that generate .defs and doc.xml files + to handle that. + The environment variable JHBUILD_SOURCES is not used any more. + Instead the environment variables GMMPROC_GEN_SOURCE_DIR and + GMMPROC_GEN_BUILD_DIR are read. See comments in init_generate.sh. + +2018-11-05 Kjell Ahlstedt + + 2.43.1 + +2018-11-05 Kjell Ahlstedt + + Change the ABI to pangomm-2.44 + + So we can use the 2.42 version numbers for stable releases in the + pangomm-1.4 ABI series. + We don't need to release a stable ABI-parallel pangomm until + we need to release gtkmm 4.0, and that won't happen until GTK+ 4.0.0 + happens, and we don't know when that might be. + + We've done similar ABI name changes before. + +2018-11-05 Kjell Ahlstedt + + FontDescription: Add set/get_variations() + +2018-11-05 Kjell Ahlstedt + + Regenerate .defs and docs.xml files + +2018-11-05 Kjell Ahlstedt + + Add tools/gen_scripts/generate_all.sh + +2018-11-05 Kjell Ahlstedt + + Use glibmm-2.60 instead of glibmm-2.58 + + We have changed the ABI name in glibmm. + +2018-10-26 Kjell Ahlstedt + + configure.ac: Update bug report address + +2018-09-10 Kjell Ahlstedt + + Update .gitignore + +2018-09-10 Chun-wei Fan + + Fix reference documentation generation + + * pango/pangomm/Makefile.am: + * pango/pangomm/filelist.gmake.am: Split out again the autotools-specific + portion that we previously split out from pango/pangomm/filelist.am into a + file of its own. + * docs/Makefile.am: Include pango/pangomm/filelist.gmake.am to ensure the + reference documentation is generated for all files. + +2018-09-07 Chun-wei Fan + + build: Remove Visual Studio 2017 projects + + Since they have been superseded with the NMake Makefiles, remove them + from the source tree. + +2018-09-07 Chun-wei Fan + + build: Add NMake Makefiles to build pangomm + + This adds a set of NMake Makefiles to be used to build pangomm with + Visual Studio 2017 and later, which will share the + pango/[src|pangomm]/filelist.am with the autotools build system. By + doing so, this will reduce the likelihood of the Visual Studio build + files getting out-of-date when source files are added or removed. + + This also updates the build instructions in README.win32 (which is also + changed to DOS/Windows line endings), and will dist the NMake Makefiles + instead of the Visual Studio project files, which have been superseded + and will be removed in the next commit. + +2018-09-07 Chun-wei Fan + + build: Split out GNU-specific stuff from filelist.am + + This is to prepare for it to be shared with non-GNU Make build systems. + +2018-09-07 Chun-wei Fan + + build: Rename MSVC_Net2017 to MSVC_NMake + + This prepares for the transition of the Visual Studio build files from + the Visual Studio projects to NMake Makefiles, to ease future + maintenance. + +2018-09-03 Kjell Ahlstedt + + Attribute: Add several create_attr_*() methods + + * pango/src/attributes.[ccg|hg]: Add create_attr_size_absolute(), + create_attr_underline_color(), create_attr_strikethrough_color(), + create_attr_fallback(), create_attr_letter_spacing(), + create_attr_gravity(), create_attr_gravity_hint(), + create_attr_font_features(). Fixes #2 + +2018-09-03 Kjell Ahlstedt + + Fix compilation of each header file + + Add #includes, necessary to make all header files pass the test with + glibmm/tools/test_scripts/testheaders.sh. + +2018-04-08 Murray Cumming + + Require C++17 + + Because libsigc++-3.0 (and therefore glibmm) now requires C++17. + +2018-03-26 Kjell Ahlstedt + + Use glibmm-2.58 instead of glibmm-2.56 + + We have changed the ABI name in glibmm. + +2018-02-22 Murray Cumming + + 2.41.5 + +2017-09-05 Kjell Ahlstedt + + Update .gitignore + +2017-09-05 Kjell Ahlstedt + + GlyphString: Remove some functions from _IGNORE() + + and remove an obsolete TODO comment. There is no + pango_cairo_glyph_string_path() in pango. + +2017-09-05 Kjell Ahlstedt + + Regenerate pango_docs.xml and the .defs files + + and add PangoCoverage to pango_extra_objects.defs. + +2017-09-05 Kjell Ahlstedt + + tools/gen_scripts/: Update for pango built with meson + + When pango is built with meson instead of autotools, generated .h and .c + files are stored in pango/build/pango. Files in that directory shall be read + when pango_docs.xml and the .defs files are generated. + + Don't read private and internal .h files. + +2017-08-25 Murray Cumming + + 2.41.4 + +2017-08-25 Murray Cumming + + Use glibmm-2.56 instead of glibmm-2.54. + + We have changed the ABI name in glibmm. + +2017-07-13 Kjell Ahlstedt + + Fontset: Remove GLIBMM_EXCEPTIONS_ENABLED + +2017-06-26 Kjell Ahlstedt + + AttrString: Let _MEMBER_GET convert from const char* + + It's better to invoke a _CONVERSION that converts from a constant character + array. _MEMBER_GET shall not modify or delete the array. The used _CONVERSION + from non-const char* will be removed from convert_glib.m4. Bug 783360 + +2017-06-11 Kjell Ahlstedt + + Make enum Weight implicitly convertible to int + + Add CONV_TO_INT to _WRAP_ENUM. Bug 86864 + +2017-04-26 Murray Cumming + + 2.41.3 + +2017-04-19 Murray Cumming + + Renderer: Change RendererPart to Renderer::Part. + +2017-04-19 Murray Cumming + + Coverage: Change CoverageLevel to Coverage::Level. + +2017-04-11 Kjell Ahlstedt + + Fix build when _WRAP_ENUM generates enum class + + Bug 86864 + +2017-04-07 Chun-wei Fan + + Visual Studio builds: Update glibmm ABI version + + The glibmm ABI version has been updated in its unstable development series + as we await for GTK+-4.0, so update it accordingly here. + +2017-03-30 Murray Cumming + + 2.41.2 + +2017-03-22 Murray Cumming + + Use glibmm-2.54 instead of glibmm-2.52 + + We changed the ABI name of the currently-unstable glibmm series. + +2017-03-17 Murray Cumming + + Use std::vector instead of Glib::ArrayHandle<>. + + Using Glib::ArrayHandler<>::array_to_vector() and + Glib::ArrayHandler<>::vector_to_array() instead, and only in the + implementation instead of in the API. + +2017-03-17 Murray Cumming + + Layout::get_lines(): Use std::vector instead of Glib::SListHandle<>. + + Using Glib::SListHandler<>::slist_to_vector() and + Glib::SListHandler<>::vector_to_slist() instead, and only in the + implementation instead of in the API. + +2017-03-17 Murray Cumming + + Item, AttrIter: Use std::vector intead of SListHandle<>. + + Using Glib::SListHandler<>::slist_to_vector() and + Glib::SListHandler<>::vector_to_slist() instead, and only in the + implementation instead of in the API. + +2017-03-17 Murray Cumming + + Context::itemize(): Use std::vector instead of ListHandle<>. + + Using Glib::ListHandler<>::list_to_vector() and + Glib::ListHandler<>::vector_to_list() instead, and only in the + implementation instead of in the API. + +2017-03-15 Chun-wei Fan + + Visual Studio builds: Require Visual Studio 2017 + + pangomm now requires C++-14 features that are only adequately supported + with Visual Studio 2017 (and later), so update the projects and related + items accordingly. This also updates the DLL version naming to be in + line with what is in the autotools builds. + + Let people know that this is the case in README.win32. + +2017-01-04 Chun-wei Fan + + Visual Studio builds: "Install" .pdb files + + Since we already generate the .pdb files during the build, make better use + of them so that we could debug easier. Also clean up the property sheet + by removing extra blank lines. + +2016-12-12 Kjell Ahlstedt + + C++11, AttrList: Don't use nullptr with an integer + +2016-12-09 Murray Cumming + + C++11: Use of auto. + +2016-12-09 Murray Cumming + + C++11: Use of nullptr. + +2016-11-23 Murray Cumming + + 2.41.1 + +2016-11-15 Murray Cumming + + Link to the glibmm-2.52 version of glibmm_generate_extra_defs. + +2016-11-15 Murray Cumming + + Correct needed cairomm ABI name to cairomm-1.16 + +2016-11-14 Murray Cumming + + Build: Require C++14 instead of C++11. + + Because we now use a glibmm that requires C++14. + +2016-11-11 Murray Cumming + + Use cairomm-1.14 instead of cairomm-1.0. + +2016-11-11 Murray Cumming + + Use the glibmm-2.52 ABI instead of glibmm-2.4 + diff --git a/ChangeLog.pre-2-34-0 b/ChangeLog.pre-2-34-0 new file mode 100644 index 0000000..3236b2a --- /dev/null +++ b/ChangeLog.pre-2-34-0 @@ -0,0 +1,745 @@ +2.34.0 (stable): + +2012-10-26 José Alburquerque + + Remove the use of g_type_init() because it has been deprecated. + + * tools/extra_defs_gen/generate_defs_pango.cc: The docs for the + function says that the GType system is initialized automatically now + as of glib-2.36. + +2.28.4 (stable): + +2011-10-25 Murray Cumming + + Add #includes needed with the latest glibmm. + + * pango/src/attributes.hg: + * pango/src/color.hg: + * pango/src/fontdescription.hg: + * pango/src/fontface.hg: + * pango/src/fontmetrics.hg: + * pango/src/item.hg: + * pango/src/language.hg: + * pango/src/layoutline.hg: Add individual includes now that gmmproc does not + add #include glibmm.h at the top of every generated header. + +2.28.3 (stable): + +2011-09-21 Krzesimir Nowak + + Don't use obsolete macros. + + * autogen.sh: Warn about everything during autoreconf. + * configure.ac: Replaced obsolete macros with their modern counterparts. + +2011-08-31 Frederic Peters + + Ship convert_pangomm.m4 in tarballs. + Bug #657817 + +2011-05-24 Olav Vitters + + Use tar-ustar instead of tar-pax to ensure OpenBSD compatibility + +2.28.2 (stable): + +2011-03-30 Murray Cumming + + Use the latest mm-common. + + * configure.ac: Require the latest version. + * doc/Makefile.am: Don't specify the mm-common .pl files to distribute + because mm-common now does this automatically. + +2011-03-25 Kalev Lember + + Install the m4 files without --enable-maintainer-mode + + * Makefile.am: Install the convert.m4 files even if we aren't in + maintainer mode; this makes sure distro packages pick up the files. + +2.28.1 (stable): + +2011-03-25 Murray Cumming + + Avoid a tarball dependency on mm-common. + + * configure.ac: Add a call to MM_CONFIG_DOCTOOL_DIR() telling it to + copy the files locally and use them from there. + * docs/Makefile.am: Dist the copied files, so that the build does not + try to use the versions installed by mm-common. + +2.28.0 (stable): + +Just a version increase and a regenerated tarball due to changes in an m4 +macro in mm-common. + +2.27.1: + +2011-01-08 Murray Cumming + + LayoutIter: Wrap this as a boxed type, which needs less code. + + * pango/src/layoutiter.[hg|ccg]: PangoLayoutIter became a boxed type at some + point, with a pango_layout_iter_copy() function, so we can now wrap it + normally without so much hand-coding. This also adds a copy constructor. + * pango/src/layout.ccg: get_iter(): Use the LayoutIter copy constructor + instead of the crappy old assign_gobj() function. Also deprecate this + method, adding a get_iter(void), now that the copy constructor allows us to + use LayoutIter as a return type. + +2011-01-08 Murray Cumming + + Improve the generated API documentation. + + * pango/src/pango_methods.defs: Regenerated with h2defs.py + * pango/src/pango_extra_objects.defs: Added some object definitions to help + the documentation generator, avoiding warnings about not being able to + transform C function names into C++ function names. I did the same thing in + gtkmm a few months ago. + * pango/src/filelist.am: Mention the new files. + * pango/src/pango.defs: Include the new file. + +2011-01-08 Murray Cumming + + Added conversions used by gtkmm. + + * tools/m4/convert_pango.m4: Added the extra conversions that were in the + gtkmm copy of this file. They will probably be needed by other modules so + it makes sense to keep them to here to avoid duplication. + +2011-01-07 Murray Cumming + + Allow other modules to use the m4 files. + + * codegen/Makefile.am: Install the m4 files, like gtkmm installs its files. + * pango/pangomm.pc.in: Add the gmmproc4mdir variable so that other modules such + as gtkmm and cluttermm can get the path to the m4 file, to avoid + duplicating its contents. + +2011-01-07 Murray Cumming + + Fix the build with --enable-warnings=fatal. + + * configure.ac: Add no-long-long to avoid a warning caused by a newer glib. + Also avoid use of deprecated GLIBMM API and make sure that GSEAL is defined. + +2010-12-09 Murray Cumming + + Include convert_glibmm.m4 instead of convert_gtkmm.m4. + + * tools/m4/convert.m4: Inlcude convert_glibmm.m4, just added to glibmm, + instead of convert_gtkmm.m4, which glibmm no longer provides. + Also include convert_pangomm.m4 - we probably used the copy in glibmm until + now. + +2010-09-30 Armin Burgmeier + + * MSVC_Net2005/gendef/gendef.vcproj: + * MSVC_Net2005/pangomm.sln: + * MSVC_Net2005/pangomm/pangomm.vcproj: + * MSVC_Net2008/gendef/gendef.vcproj: + * MSVC_Net2008/pangomm.sln: + * MSVC_Net2008/pangomm/pangomm.vcproj: + * MSVC_Net2010/filelist.am: + * MSVC_Net2010/gendef/gendef.cc: + * MSVC_Net2010/gendef/gendef.vcxproj: + * MSVC_Net2010/gendef/gendef.vcxproj.filters: + * MSVC_Net2010/pangomm.sln: + * MSVC_Net2010/pangomm/pangomm.rc.in: + * MSVC_Net2010/pangomm/pangomm.vcxproj: + * MSVC_Net2010/pangomm/pangomm.vcxproj.filters: + * Makefile.am: + * configure.ac: Add support for MSVC 2010 and 64 bit. + +2.26.2: + +2010-05-04 Murray Cumming + + Documentation: Main page: Improve, linking to class and correcting pkg-config + + * pango/pangomm.h: Simplify the text, improving the link, and link to + Pango::Layout as a starting point. Correct the pkg-config check from pangomm + to pangomm-1.4. + +2010-04-27 David King + + Update link formatting in main page of documentation + + * pango/pangomm.h: Add link text to Pango link. + +2010-04-23 David King + + Add main page to Doxygen documentation + + * docs/Makefile.am: Parse pango/pangomm.h for documentation. + * pango/pangomm.h: Add main page to Doxygen documentation. + +2.26.1: + +2010-04-16 Murray Cumming + + Regenerated C documentation XML. + + * pango/src/pango_docs.xml: Regenerated with the improved docextract_to_xml.py. + +2010-03-17 Murray Cumming + + Regenerated pango function .defs. + + * pango/src/pango_methods.defs: Regnerated with h2defs.py thought there is + no significant change. + +2.26.0: + +2009-09-19 Daniel Elstner + + Support Automake silent rules + + * configure.ac: Call the AM_SILENT_RULES macro if it is defined. + (AM_INIT_AUTOMAKE): Add check-news option. + (MM_INIT_MODULE): Move block below Automake initialization. + +2009-09-07 Daniel Elstner + + Update Doxygen configuration for Doxygen 1.6.1 + + * docs/reference/Doxyfile.in: Update file using Doxygen 1.6.1. + (SORT_MEMBERS_CTORS_1ST): Set option to YES. + +2.25.1.3: + +2009-08-28 Daniel Elstner + + Increment version to 2.25.1.3 and update news + + * configure.ac (AC_INIT): Bump version to pangomm 2.25.1.3. + * NEWS: Write news entry for pangomm 2.25.1.3. + +2009-08-28 Daniel Elstner + + Fix documentation location in pkg-config files + + * pango/pangomm{,-uninstalled}.pc.in (htmlrefpub): Point to + library.gnome.org. + +2009-08-28 Daniel Elstner + + Increment version to 2.25.1.2 and update news + + * configure.ac (AC_INIT): Bump version to pangomm 2.25.1.2. + * NEWS: Write news entry for pangomm 2.25.1.2. + +2009-08-28 Daniel Elstner + + Remove documentation location override + + * docs/Makefile.am (htmlrefpub): Remove variable override as + the documentation is now hosted on library.gnome.org. D'oh. + +2009-08-28 Daniel Elstner + + Increment version to 2.25.1.1 and update news + + * configure.ac (AC_INIT): Bump version to pangomm 2.25.1.1. + (MM_PREREQ): Require mm-common 0.7.1. + * NEWS: Write news entry for pangomm 2.25.1.1. + +2009-08-28 Daniel Elstner + + Use shared mm-common Doxygen style sheet + + * configure.ac (MM_PREREQ): Require mm-common 0.7. + * docs/reference/Doxyfile.in (HTML_STYLESHEET): Assign path + to the shared doxygen.css provided by mm-common. + +2009-08-28 Daniel Elstner + + Remove header and footer HTML fragments + + * docs/reference/pangomm_{header,footer}.html_fragment: Delete + files. These custom fragments were an unnecessary maintenance + hassle. Also, the files were out of date with respect to the + encoding and CSS classes used by Doxygen. + * docs/reference/Doxyfile.in (HTML_HEADER), (HTML_FOOTER): Set + to the empty string. + (PROJECT_NUMBER): Substitute @PACKAGE_VERSION@. It does look + nicer in the generated HTML pages, and is probably also less + confusing. + (SORT_GROUP_NAMES): Enable for predictability. + * docs/Makefile.am (dist_noinst_DATA): Remove deleted HTML + fragment files. + +2009-08-26 Daniel Elstner + + Reenable hierarchy graphs for each class + + * docs/reference/Doxyfile.in (COLLABORATION_GRAPH): Set option + to YES to enable the per-class inheritance graphs. + +2.25.1: + +2009-08-25 Murray Cumming + + Regenerated .defs files. + + * pango/src/pango_docs.xml: + * pango/src/pango_methods.defs: Regenerated. + +This is the master branch. See also the pangomm-2-24 branch. + +2009-08-20 Daniel Elstner + + Rename @since back to @newin + + * docs/reference/Doxyfile.in (ALIASES): Rename the @since alias + back to its old name @newin, but otherwise keep the parameters. + Apparently there is a @since command predefined in Doxygen which + I hadn't noticed. It does seem to get overridden silently, but + it is better not to rely on this. + * pango/src/{language,layout}.hg: Replace all uses of @since with + @newin. + +2009-08-20 Daniel Elstner + + Remove bogus backslash in Doxygen configuration + + * docs/reference/Doxyfile.in (STRIP_FROM_PATH): Remove bogus + trailing \ after the the last assigned value. This probably + caused the following assignment to STRIP_FROM_INC_PATH to be + eaten. + +2009-08-20 Daniel Elstner + + Substitute API version in filenames dynamically + + * pango/pangomm.pc.in: Rename file from pango/pangomm-1.4.pc.in. + * pango/pangomm-uninstalled.pc.in: Rename file from + pango/pangomm-1.4-uninstalled.pc.in. + * configure.ac (AC_CONFIG_FILES): Insert ${PANGOMM_MODULE_NAME} + into output filenames and remove the hard-coded version from the + input filenames. + * pango/pangomm/Makefile.am (lib_LTLIBRARIES): Substitute + @PANGOMM_API_VERSION@ into the libtool archive name as well as + the variable names derived from it instead of hard-coding the + API version. + +2009-08-20 Daniel Elstner + + Do not hard-code API version in resource files + + * MSVC_Net200[58]/pangomm/pangomm.rc.in: Use newer @PACKAGE_VERSION@ + substitution in place of @VERSION@. Use "@PANGOMM_MODULE_NAME@.dll" + instead of hardcoding the API version. + +2009-08-19 Daniel Elstner + + Reference external cairomm documentation + + * configure.ac (MM_ARG_WITH_TAGFILE_DOC): Specify cairomm-1.0.tag + as Doxygen tag file dependency for links to the external reference + documentation of cairomm. + +2009-08-18 Daniel Elstner + + Use parametric Doxygen alias @since{m,n} + + * docs/reference/Doxyfile.in (ALIASES): Define a parametrized alias + @since{major,minor} to replace the old @newin?p?* aliases which had + to be defined manually for every version number used. + * pango/src/*.hg: Change all uses of @newin?p?* to @since{m,n}. + +2009-08-17 Daniel Elstner + + Define PANGOMM_BUILD macro during build + + * pango/pangomm/Makefile.am (local_cppflags): Add -DPANGOMM_BUILD=1. + +2009-08-17 Daniel Elstner + + Make use of new MM_ARG_DISABLE_DEPRECATED macro + + * configure.ac (PANGOMM_DISABLE_DEPRECATED): Call the new + MM_ARG_DISABLE_DEPRECATED_API macro from mm-common in order + to provide the option to omit deprecated API from the library + build, and to define the corresponding configuration macro. + * pango/pangommconfig.h.in (PANGOMM_DISABLE_DEPRECATED): Copy + the #undef statement from the generated config.h.in template. + +2009-08-17 Daniel Elstner + + Append slash to overridden $(htmlrefpub) + + * docs/Makefile.am (htmlrefpub): Append trailing slash for + consistency with the non-overridden value. + +2009-08-17 Daniel Elstner + + Reenable JAVADOC_AUTOBRIEF mode of Doxygen + + * docs/reference/Doxyfile.in (JAVADOC_AUTOBRIEF): Change value + back to 'YES'. I accidentally turned off the setting during the + build infrastructure transition. + +2009-08-16 Daniel Elstner + + Include glibmmconfig.h from pangommconfig.h + + * pango/pangommconfig.h.in: Include glibmmconfig.h for + consistency with gtkmm. Also define an include guard. + +2009-08-16 Daniel Elstner + + List PANGOMM_* macros in pangommconfig.h.in + + * pango/pangommconfig.h.in (PANGOMM_*_VERSION): Add #undef + statements for the version number component macros. + +2009-08-16 Daniel Elstner + + Add pkg-config file for uninstalled use + + * pango/pangomm-1.4-uninstalled.pc.in: New pkg-config metadata + file for building against a non-installed pangomm library. + * configure.ac (AC_CONFIG_FILES): Add configure output file + pango/pangomm-1.4-uninstalled.pc. + +2009-08-16 Daniel Elstner + + Make use of latest mm-common features + + * configure.ac: Insert MM_PREREQ([0.4]) macro call. + (MM_INIT_MODULE): Remove now optional second argument. + * pango/pangomm-1.4.pc.in (htmlrefpub): Append trailing slash + as per new mm-common guidelines. + +2009-08-16 Daniel Elstner + + Get rid of GLIBMM_USING_STD() + + * pango/src/tabarray.hg: Stop using GLIBMM_USING_STD(), now + that it has been removed from glibmm. + +2009-08-12 Daniel Elstner + + Install pangomm.h and pangomm-1.4.pc again + + * Makefile.am (pangomm_include_HEADERS): Install pango/pangomm.h. + (nodist_pangomm_libinclude_HEADERS): Install pango/pangommconfig.h. + (nodist_pkgconfig_DATA): Install pango/pangomm-1.4.pc. + * pango/Makefile.am: Delete already unused file. + +2009-08-11 Daniel Elstner + + Provide documentation location via pkg-config + + * pango/pangomm-1.4.pc.in (datadir), (datarootdir): Substitute. + (docdir), (doxytagfile), (htmlrefdir), (htmlrefpub): Point to the + location of the reference documentation. + +2009-08-11 Daniel Elstner + + Wrap pango_font_map_create_context() + + * pango/src/fontmap.hg (FontMap::create_context): Wrap new + pango_font_map_create_context() method. + * pango/src/cairofontmap.{ccg,hg} (CairoFontMap::create_context): + Wrap method manually in terms of pango_font_map_create_context(), + so that it longer uses deprecated API. The wrapper method should + be removed altogether when we can break API and ABI. + +2009-08-11 Daniel Elstner + + Fix typo in tools/m4/convert_pango.m4 + +2009-08-11 Daniel Elstner + + Regenerate pango/src/pango_methods.defs + +2009-08-11 Daniel Elstner + + Generate more complete extra defs + + * tools/extra_defs_gen/generate_defs_pango.cc (main): Query the + defs for all not backend-specific GObject classes in Pango, just + in case. + +2009-08-11 Daniel Elstner + + Rename scripts/ subdirectory to build/ + + * configure.ac (AC_CONFIG_AUX_DIR): Point to build/ directory. + (AC_CONFIG_MACRO_DIR): ditto. + * Makefile.am (ACLOCAL_AMFLAGS): Use -I build as M4 include path. + * docs/Makefile.am, pango/{src,pangomm}/Makefile.am: Include files + from $(top_srcdir)/build/ instead of $(top_srcdir)/scripts/. + +2009-08-11 Daniel Elstner + + Delete obsolete Autoconf M4 files from scripts/ + + * scripts/*.m4: Delete all Autoconf M4 files from version control. + * scripts/README: Delete superfluous file. + * Makefile.am (text_files): Remove scripts/README. + (msvc_files): Use $(addprefix ...) for readability. + +2009-08-11 Daniel Elstner + + Transition to mm-common documentation build + + * configure.ac (AC_CONFIG_FILES): List docs/Makefile.am and + docs/reference/Doxyfile as output files. + * Makefile.am (SUBDIRS): Resurrect docs/ subdirectory. + * docs/Makefile.am: Rewrite based upon the new mm-common build + infrastructure for the reference documentation. + * docs/reference/Doxyfile.in: Heavily modernize and adapt to the + new documentation build organization. + * docs/Makefile_web.am_fragment: Delete obsolete file. + * docs/images/Makefile.am: ditto, + * docs/reference/Makefile.am: ditto, + * docs/reference/doxygen_to_devhelp.xsl: ditto, + * docs/reference/README: ditto. + * docs/reference/widget_hierarchy.{dia,html,png}: Delete files as + they belong to the documentation of the gtkmm module, not pangomm. + +2009-08-11 Daniel Elstner + + Further reduce pointless make recursion + + * scripts/Makefile.am: Delete file. + * MSVC_Net200[58]/**/Makefile.am: Delete files. + * MSVC_Net200[58]/filelist.am: New files, defining the files to + distribute from the MSVC subdirectories. + * Makefile.am: Include MSVC_Net200[58]/filelist.am and distribute + the files listed there. + (SUBDIRS): Remove scripts/ and MSVC_Net200[58]/. Temporarily + remove docs/ subdirectory. + * configure.ac: Use mm-common Autoconf macros for setting up the + documentation build. + (AC_CONFIG_FILES): Remove deleted Makefiles from the list. + (AC_CONFIG_COMMANDS): Append commands to config.status to copy the + pangommconfig.h configuration header into the MSVC subdirectories. + +2009-08-11 Daniel Elstner + + Convert tools/ and pango/ to new infrastructure + + * Makefile.am (SUBDIRS): Skip the pango/ subdirectory and recurse + directly into pango/src/ and pango/pangomm/. + (EXTRA_DIST): Remove the old build_shared/ include files. + * configure.ac (AC_CONFIG_FILES): Remove files pango/Makefile.am, + pango/pangomm/private/Makefile.am and tools/m4/Makefile.am from + the list of output files. + * pango/src/filelist.am: Rename Makefile_list_of_hg.am_fragment + and adapt to new mm-common Automake include files. + * pango/pangomm/filelist.am: New file, defining the list of source + code files to compile. + * pango/pangomm/private/Makefile.am: Delete obsolete file. + * pango/src/Makefile.am: Rewrite to use new mm-common build + infrastructure. + * pango/pangomm/Makefile.am: ditto, + * tools/Makefile.am: ditto. + * tools/m4/filelist.am: Rename Makefile_list_of_sources.am_fragment + and adapt to new mm-common Automake include files. + * tools/m4/Makefile.am: Delete obsolete file. + * build_shared/*.am_fragment: Delete obsolete build support files. + +2009-08-11 Daniel Elstner + + Begin transition to mm-common build system + + * autogen.sh: Replace with minimal version using mm-common-prepare + and autoreconf. + * configure.ac: Rename file from configure.in. Remove a lot of old + cruft and clean up the remaining bits. Make use of mm-common macros. + Insert temporary dummy conditionals to keep the module buildable. + * config.h.in: Delete file, as it is now generated by autoheader. + * Makefile.am (ACLOCAL_AMFLAGS): Set to help autoreconf do its work. + * MSVC_Net200[58]/pangomm/Makefile.am: Change rule dependency + configure.in to configure.ac. + +2009-03-09 Theppitak Karoonboonyanan + + * docs/reference/Makefile.am: Split out devhelp installation rule, so + VPATH reference is possible for both tarball and VCS builds, fixing + distcheck correctly. + +2.24.0: + +2009-03-09 Murray Cumming + + * docs/reference/Makefile.am: Added srcdir before the devhelp file, to + fix distcheck. + +2009-03-09 Murray Cumming + + * pango/src/pango_docs.xml: Regenerated with doxextract_to_xml.py. + +2009-02-05 Theppitak Karoonboonyanan + + * docs/reference/Doxyfile.in: + * docs/reference/Makefile.am: Allow pangomm to build outside the source + tree. Bug #570322 + +2009-01-20 Deng Xiyue + + * Change license header to mention Lesser General Public License + version 2.1 instead of Library General Public License, to be + consistent with COPYING. + +2008-11-13 Murray Cumming + + * docs/reference/Doxyfile.in: Add some more newin2p* aliases. + * pango/src/layout.hg: Mark show_in_cairo_context as since 2.16. + +2008-11-12 Louis-Francis Ratté-Boulianne + + * pango/src/layout.cgg: + * pango/src/layout.hg: Added show_in_cairo_context(). + Bug #560232, + +2.14.1: + +2008-11-08 Deng Xiyue + + * docs/reference/doxygen_to_devhelp.xsl: Fix references to gtkmm, + should be pangomm, and use reference index.html as start point. + +2008-10-23 Jonathon Jongsma + + * configure.in: + * docs/reference/Makefile.am: + * docs/reference/images: Removed gtk stock image stuff that was accidentally + left over from splitting up pangomm from gtkmm. + +2008-10-09 Armin Burgmeier + + * MSVC_Net2005/pangomm/pangomm.vcproj: Changed the library DLL name to + match the new naming convention. + + * MSVC_Net2008/: Added Visual Studio 2008 project files. + + * Makefile.am: + * configure.in: Added the new files to the distribution. + +2.14.0 (wraps pango 1.22): + +2008-09-08 Deng Xiyue + + * Added COPYING.tools with the GPL because the tools/*.cc file is + GPL. Bug #550789. + +2008-09-08 Deng Xiyue + + * README: Mention pangomm instead of gtkmm. Bug #550789. + +2008-08-27 Armin Burgmeier + + * MSVC_Net2005/pangomm/pangomm.rc.in: Replaced #include "afxres.h" by + #include which does the job equally well, and allows + compilation with the freely available Visual Studio Express compiler. + +2008-08-20 Murray Cumming + + * pango/src/language.ccg: + * pango/src/language.hg: Added get_scripts(). + +2.13.8: + +2008-08-12 Murray Cumming + + * pango/src/context.hg: Added set_font_map() because it is now public + (non backend-only) API. + +2008-08-12 Murray Cumming + + * pango/src/layoutrun.ccg: + * pango/src/layoutrun.hg: Wrap this with CLASS_BOXEDTYPE() instead of + _CLASS_GENERIC(), because the PangoGlyphItem (of which PangoLayoutRun + is a typedef) is a boxed type. This reduces the amount of code in .hg, + while apparently not breaking API or ABI. + This should be renamed to GlyphItem when we can break ABI. + +2008-08-12 Murray Cumming + + * pango/src/layoutrun.hg: Typedef this to GlyphItem, because + that is what it is (and is documented as) in Pango. + Added splt() and letter() space to LayoutRun, wrapping PangoGlyphItem + functions. + * tools/m4/convert_pango.m4: + * pango/src/renderer.hg: Added draw_glyph_item(). + + * pango/src/cairofontmap.hg: Added set_default(). + +2008-08-09 Armin Burgmeier + + * MSVC_Net2005/gendef/gendef.cc: + * MSVC_Net2005/gendef/gendef.vcproj: + * MSVC_Net2005/gendef/Makefile.am: + * MSVC_Net2005/pangomm/pangomm.vcproj: + * MSVC_Net2005/pangomm/pangomm.rc.in: + * MSVC_Net2005/pangomm/Makefile.am: + * MSVC_Net2005/pangomm.sln: + * MSVC_Net2005/blank.cpp: + * MSVC_Net2005/Makefile.am: Added project files to build pangomm with + Visual Studio 2005. + + * configure.in: + * Makefile.am: Adapt build files. + +2.13.7: + +2008-08-02 Murray Cumming + + * docs/Makefile.am: Do not try to upload a non-existant index.html + * docs/images/Makefile.am: Correct the filenames. + * docs/reference/pangomm_header.html_fragment: Change the links as + in glibmm. + +2008-08-01 Deng Xiyue + + * docs/Makefile_web.am_fragment: + * docs/reference/Makefile.am: + * tools/m4/Makefile.am: + * Makefile.am: Fix all references of ABI version 2.4 to version 1.4, + though the tarball version (as reported by pkgconfig --modversion) + must stay as 2.x. + Bug #545537. + +2008-08-01 Murray Cumming + + * docs/Makefile.am: + * docs/index.html: Removed index.html. It was just a copy from + gtkmm (from where I will also be removing it.) The true copy is in + gnomemm-website (uploaded to gtkmm.org). + +2008-07-30 Sebastien Bacher + + * configure.in: require a correct pango version (bug #545378) + +2008-07-27 Murray Cumming + + * docs/Makefile_web.am_fragment: Corrected the upload location. + * docs/reference/Doxyfile.in: Corrected a variable so we really + generate documentation. + +2.13.6: + +2008-07-27 Murray Cumming + + * pango/src/pango_docs.xml: + * pango/src/pango_enums.defs: + * pango/src/pango_methods.defs: Regenerated. + + * pango/src/layout.hg: Added get_height(), set_height(), + get_baseline(). + * pango/src/layoutiter.ccg: + * pango/src/layoutiter.hg: Added get_layout(). + * pango/src/renderer.hg: Added get_layout() and get_layout_line(). + +2.13.5: + +Created a standalone pangomm module from gtkmm in svn trunk, +so that things can depend on pangomm without needing gtkmm at +build time. diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc new file mode 100644 index 0000000..0868479 --- /dev/null +++ b/MSVC_NMake/Makefile.vc @@ -0,0 +1,66 @@ +# NMake Makefile for building libsigc++ on Windows using Visual Studio + +# The items below this line should not be changed, unless one is maintaining +# the NMake Makefiles. Customizations can be done in the following NMake Makefile +# portions (please see comments in the these files to see what can be customized): +# +# detectenv-msvc.mak +# config-msvc.mak + +!include detectenv-msvc.mak + +# Include the Makefile portions with the source listings +!include ..\pango\src\filelist.am +!include ..\pango\pangomm\filelist.am + +# Include the Makefile portion that enables features based on user input +!include config-msvc.mak + +!if "$(VALID_CFGSET)" == "TRUE" + +# We need Visual Studio 2017 or later +!if $(VSVER) < 15 +VALID_MSC = FALSE +!else +VALID_MSC = TRUE +!endif + +!if $(VCVERSION) < 1915 +!message Some portions may fail to build for Visual Studio 2017 15.7 or earlier! +!endif + +!if "$(VALID_MSC)" == "TRUE" + +!ifdef GENERATE_VERSIONED_FILES +!include pkg-ver.mak +DO_REAL_GEN = 1 +!endif + +# Include the Makefile portion to convert the source and header lists +# into the lists we need for compilation and introspection +!include create-lists-msvc.mak + +all: $(PANGOMM_LIB) all-build-info + +tests: all + @echo No tests are provided with this package! + +# Include the build rules for sources, DLLs and executables +!include generate-msvc.mak +!include build-rules-msvc.mak + +!include install.mak + +!else # "$(VALID_MSC)" == "TRUE" +all: + @echo You need Visual Studio 2017 or later. + +!endif # "$(VALID_MSC)" == "TRUE" + +!else # "$(VALID_CFGSET)" == "TRUE" +all: help + @echo You need to specify a valid configuration, via + @echo CFG=release or CFG=debug +!endif # "$(VALID_CFGSET)" == "TRUE" + +!include info-msvc.mak diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak new file mode 100644 index 0000000..386473a --- /dev/null +++ b/MSVC_NMake/build-rules-msvc.mak @@ -0,0 +1,82 @@ +# NMake Makefile portion for compilation rules +# Items in here should not need to be edited unless +# one is maintaining the NMake build files. The format +# of NMake Makefiles here are different from the GNU +# Makefiles. Please see the comments about these formats. + +# Inference rules for compiling the .obj files. +# Used for libs and programs with more than a single source file. +# Format is as follows +# (all dirs must have a trailing '\'): +# +# {$(srcdir)}.$(srcext){$(destdir)}.obj:: +# $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<< +# $< +# << +{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj:: + $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /c @<< +$< +<< + +{..\untracked\pango\pangomm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj:: + $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /c @<< +$< +<< + +{..\pango\pangomm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj:: + $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /c @<< +$< +<< + +{..\pango\src\}.ccg{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj: + @if not exist $(@D)\private\ $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)\private + @for %%s in ($( 14 && "$(USE_COMPAT_LIBS)" != "" +VSVER_LIB = 150 +MESON_VSVER_LIB = +!else +VSVER_LIB = $(PDBVER)$(VSVER_SUFFIX) +MESON_VSVER_LIB = -vc$(VSVER_LIB) +!endif + +!ifdef USE_MESON_LIBS +LIBSIGC_LIBNAME = sigc-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION) +GIOMM_LIBNAME = giomm$(MESON_VSVER_LIB)-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION) +GLIBMM_LIBNAME = glibmm$(MESON_VSVER_LIB)-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION) +CAIROMM_LIBNAME = cairomm$(MESON_VSVER_LIB)-$(CAIROMM_MAJOR_VERSION).$(CAIROMM_MINOR_VERSION) +PANGOMM_LIBNAME = pangomm$(MESON_VSVER_LIB)-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION) + +PANGOMM_DLLNAME = $(PANGOMM_LIBNAME)-1 +!else +LIBSIGC_LIBNAME = sigc-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION) +GIOMM_LIBNAME = giomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION) +GLIBMM_LIBNAME = glibmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION) +CAIROMM_LIBNAME = cairomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION) +PANGOMM_LIBNAME = pangomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(PANGOMM_MAJOR_VERSION)_$(PANGOMM_MINOR_VERSION) + +PANGOMM_DLLNAME = $(PANGOMM_LIBNAME) +!endif + +LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib +GIOMM_LIB = $(GIOMM_LIBNAME).lib +GLIBMM_LIB = $(GLIBMM_LIBNAME).lib +CAIROMM_LIB = $(CAIROMM_LIBNAME).lib +PANGOMM_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib + +PANGOMM_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_DLLNAME).dll + +GOBJECT_LIBS = gobject-$(GLIB_API_VERSION).lib glib-$(GLIB_API_VERSION).lib +CAIRO_LIB = cairo.lib +PANGO_LIBS = pangocairo-$(PANGO_API_VERSION).lib pango-$(PANGO_API_VERSION).lib $(GOBJECT_LIBS) $(CAIRO_LIB) +PANGOMM_DEP_LIBS = $(GIOMM_LIB) $(GLIBMM_LIB) $(CAIROMM_LIB) $(LIBSIGC_LIB) $(PANGO_LIBS) diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak new file mode 100644 index 0000000..3ab1b5a --- /dev/null +++ b/MSVC_NMake/create-lists-msvc.mak @@ -0,0 +1,67 @@ +# Convert the source listing to object (.obj) listing in +# another NMake Makefile module, include it, and clean it up. +# This is a "fact-of-life" regarding NMake Makefiles... +# This file does not need to be changed unless one is maintaining the NMake Makefiles + +# For those wanting to add things here: +# To add a list, do the following: +# # $(description_of_list) +# if [call create-lists.bat header $(makefile_snippet_file) $(variable_name)] +# endif +# +# if [call create-lists.bat file $(makefile_snippet_file) $(file_name)] +# endif +# +# if [call create-lists.bat footer $(makefile_snippet_file)] +# endif +# ... (repeat the if [call ...] lines in the above order if needed) +# !include $(makefile_snippet_file) +# +# (add the following after checking the entries in $(makefile_snippet_file) is correct) +# (the batch script appends to $(makefile_snippet_file), you will need to clear the file unless the following line is added) +#!if [del /f /q $(makefile_snippet_file)] +#!endif + +# In order to obtain the .obj filename that is needed for NMake Makefiles to build DLLs/static LIBs or EXEs, do the following +# instead when doing 'if [call create-lists.bat file $(makefile_snippet_file) $(file_name)]' +# (repeat if there are multiple $(srcext)'s in $(source_list), ignore any headers): +# !if [for %c in ($(source_list)) do @if "%~xc" == ".$(srcext)" @call create-lists.bat file $(makefile_snippet_file) $(intdir)\%~nc.obj] +# +# $(intdir)\%~nc.obj needs to correspond to the rules added in build-rules-msvc.mak +# %~xc gives the file extension of a given file, %c in this case, so if %c is a.cc, %~xc means .cc +# %~nc gives the file name of a given file without extension, %c in this case, so if %c is a.cc, %~nc means a + +NULL= + +pangomm_generated_private_headers = $(files_hg:.hg=_p.h) + +# For pangomm + +!if [call create-lists.bat header pangomm.mak pangomm_OBJS] +!endif + +!if [for %c in ($(files_built_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\%~nc.obj] +!endif + +!if [for %c in ($(files_extra_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\%~nc.obj] +!endif + +!if [@call create-lists.bat file pangomm.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\pangomm.res] +!endif + +!if [call create-lists.bat footer pangomm.mak] +!endif + +!if [call create-lists.bat header pangomm.mak pangomm_real_hg] +!endif + +!if [for %c in ($(files_hg)) do @call create-lists.bat file pangomm.mak ..\pango\src\%c] +!endif + +!if [call create-lists.bat footer pangomm.mak] +!endif + +!include pangomm.mak + +!if [del /f /q pangomm.mak] +!endif diff --git a/MSVC_NMake/create-lists.bat b/MSVC_NMake/create-lists.bat new file mode 100644 index 0000000..ef60d5c --- /dev/null +++ b/MSVC_NMake/create-lists.bat @@ -0,0 +1,42 @@ +@echo off +rem Simple .bat script for creating the NMake Makefile snippets. + +if not "%1" == "header" if not "%1" == "file" if not "%1" == "footer" goto :error_cmd +if "%2" == "" goto error_no_destfile + +if "%1" == "header" goto :header +if "%1" == "file" goto :addfile +if "%1" == "footer" goto :footer + +:header +if "%3" == "" goto error_var +echo %3 = \>>%2 +goto done + +:addfile +if "%3" == "" goto error_file +echo. %3 \>>%2 +goto done + +:footer +echo. $(NULL)>>%2 +echo.>>%2 +goto done + +:error_cmd +echo Specified command '%1' was invalid. Valid commands are: header file footer. +goto done + +:error_no_destfile +echo Destination NMake snippet file must be specified +goto done + +:error_var +echo A name must be specified for using '%1'. +goto done + +:error_file +echo A file must be specified for using '%1'. +goto done + +:done \ No newline at end of file diff --git a/MSVC_NMake/detectenv-msvc.mak b/MSVC_NMake/detectenv-msvc.mak new file mode 100644 index 0000000..b99227c --- /dev/null +++ b/MSVC_NMake/detectenv-msvc.mak @@ -0,0 +1,166 @@ +# Change this (or specify PREFIX= when invoking this NMake Makefile) if +# necessary, so that the libs and headers of the dependent third-party +# libraries can be located. For instance, if building from GLib's +# included Visual Studio projects, this should be able to locate the GLib +# build out-of-the-box if they were not moved. GLib's headers will be +# found in $(GLIB_PREFIX)\include\glib-2.0 and +# $(GLIB_PREFIX)\lib\glib-2.0\include and its import library will be found +# in $(GLIB_PREFIX)\lib. + +!if "$(PREFIX)" == "" +PREFIX = ..\..\vs$(VSVER)\$(PLAT) +!endif + +# Location of the PERL interpreter, for running glib-mkenums. glib-mkenums +# needs to be found in $(PREFIX)\bin. Using either a 32-bit or x64 PERL +# interpreter are supported for either a 32-bit or x64 build. + +!if "$(PERL)" == "" +PERL = perl +!endif + +# Location of the Python interpreter, for building introspection. The complete set +# of Python Modules for introspection (the giscanner Python scripts and the _giscanner.pyd +# compiled module) needs to be found in $(PREFIX)\lib\gobject-introspection\giscanner, and +# the g-ir-scanner Python script and g-ir-compiler utility program needs to be found +# in $(PREFIX)\bin, together with any DLLs they will depend on, if those DLLs are not already +# in your PATH. +# Note that the Python interpreter and the introspection modules and utility progam must +# correspond to the build type (i.e. 32-bit Release for 32-bit Release builds, and so on). +# +# For introspection, currently only Python 2.7.x is supported. This may change when Python 3.x +# support is added upstream in gobject-introspection--when this happens, the _giscanner.pyd must +# be the one that is built against the release series of Python that is used here. + +!if "$(PYTHON)" == "" +PYTHON = python +!endif + +# Location of the pkg-config utility program, for building introspection. It needs to be able +# to find the pkg-config (.pc) files so that the correct libraries and headers for the needed libraries +# can be located, using PKG_CONFIG_PATH. Using either a 32-bit or x64 pkg-config are supported for +# either a 32-bit or x64 build. + +!if "$(PKG_CONFIG)" == "" +PKG_CONFIG = pkg-config +!endif + +# The items below this line should not be changed, unless one is maintaining +# the NMake Makefiles. The exception is for the CFLAGS_ADD line(s) where one +# could use his/her desired compiler optimization flags, if he/she knows what is +# being done. + +# 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)elif defined(_M_ARM64) >> vercl.x] \ + && ![echo PLAT=arm64 >> 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 + +VSVER = 0 +PDBVER = 0 +VSVER_SUFFIX = 0 + +!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600 +PDBVER = 9 +!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700 +PDBVER = 10 +!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800 +PDBVER = 11 +!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900 +PDBVER = 12 +!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000 +PDBVER = 14 +!if $(VCVERSION) > 1909 && $(VCVERSION) < 1920 +VSVER_SUFFIX = 1 +VSVER = 15 +!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 1930 +VSVER_SUFFIX = 2 +VSVER = 16 +!elseif $(VCVERSION) > 1929 && $(VCVERSION) < 2000 +VSVER_SUFFIX = 3 +VSVER = 17 +!else +VSVER = $(PDBVER) +!endif +!else +VSVER = $(PDBVER) +!endif + +!if "$(VSVER)" == "0" +MSG = ^ +This NMake Makefile set supports Visual Studio^ +9 (2008) through 16 (2019). Your Visual Studio^ +version is not supported. +!error $(MSG) +!endif + +VALID_CFGSET = FALSE +!if "$(CFG)" == "release" || "$(CFG)" == "Release" || "$(CFG)" == "debug" || "$(CFG)" == "Debug" +VALID_CFGSET = TRUE +!endif + +# One may change these items, but be sure to test +# the resulting binaries +!if "$(CFG)" == "release" || "$(CFG)" == "Release" +CFLAGS_ADD_NO_GL = /MD /O2 /MP +CFLAGS_ADD = $(CFLAGS_ADD_NO_GL) /GL +!if "$(VSVER)" != "9" +CFLAGS_ADD = $(CFLAGS_ADD) /d2Zi+ +CFLAGS_ADD_NO_GL = $(CFLAGS_ADD_NO_GL) /d2Zi+ +!endif +!else +CFLAGS_ADD = /MDd /Od +CFLAGS_ADD_NO_GL = $(CFLAGS_ADD) +!endif + +!if "$(PLAT)" == "x64" +LDFLAGS_ARCH = /machine:x64 +!elseif "$(PLAT)" == "arm64" +LDFLAGS_ARCH = /machine:arm64 +!else +LDFLAGS_ARCH = /machine:x86 +!endif + +!if "$(VALID_CFGSET)" == "TRUE" +CFLAGS_NOGL = $(CFLAGS_ADD_NO_GL) /W3 /Zi +CFLAGS = $(CFLAGS_ADD) /W3 /Zi + +LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG + +!if "$(CFG)" == "debug" || "$(CFG)" == "Debug" +ARFLAGS_NOLTCG = $(LDFLAGS_ARCH) +ARFLAGS = $(LDFLAGS_ARCH) +LDFLAGS_NOLTCG = $(LDFLAGS_BASE) +LDFLAGS = $(LDFLAGS_BASE) +!else +ARFLAGS_NOLTCG = $(LDFLAGS_ARCH) /LTCG +ARFLAGS = $(ARFLAGS_NOLTCG) /LTCG +LDFLAGS_NOLTCG = $(LDFLAGS_BASE) /opt:ref +LDFLAGS = $(LDFLAGS_NOLTCG) /LTCG +!endif +!endif diff --git a/MSVC_NMake/filelist.am b/MSVC_NMake/filelist.am new file mode 100644 index 0000000..7e77f51 --- /dev/null +++ b/MSVC_NMake/filelist.am @@ -0,0 +1,14 @@ +## This file is part of pangomm. + +msvc_nmake_data = \ + build-rules-msvc.mak \ + config-msvc.mak \ + create-lists-msvc.mak \ + create-lists.bat \ + detectenv-msvc.mak \ + generate-msvc.mak \ + info-msvc.mak \ + install.mak \ + Makefile.vc \ + pangomm/pangomm.rc \ + pangomm/pangommconfig.h diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak new file mode 100644 index 0000000..9bb86c8 --- /dev/null +++ b/MSVC_NMake/generate-msvc.mak @@ -0,0 +1,54 @@ +# NMake Makefile portion for code generation and +# intermediate build directory creation +# Items in here should not need to be edited unless +# one is maintaining the NMake build files. + +# Create the build directories +vs$(VSVER)\$(CFG)\$(PLAT)\pangomm \ +vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private: + @-md $@ + +# Generate wrap_init.cc files +vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\wrap_init.cc: $(pangomm_real_hg) + @if not exist ..\pango\pangomm\wrap_init.cc $(PERL) -- "$(GMMPROC_DIR)/generate_wrap_init.pl" --namespace=Pango --parent_dir=pangomm $(pangomm_real_hg:\=/)>$@ + +# Generate pre-generated resources and configuration headers (builds from GIT) +prep-git-build: pkg-ver.mak + $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 pangomm\pangomm.rc pangomm\pangommconfig.h + +pangomm\pangomm.rc: ..\configure.ac pangomm\pangomm.rc.in + @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak + @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build + @if "$(DO_REAL_GEN)" == "1" echo Generating $@... + @if "$(DO_REAL_GEN)" == "1" copy $@.in $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PANGOMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PANGOMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PANGOMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PANGOMM_MODULE_NAME\@/pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" del $@.bak + +# You may change PANGOMM_DISABLE_DEPRECATED if you know what you are doing +pangomm\pangommconfig.h: ..\configure.ac ..\pango\pangommconfig.h.in + @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak + @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build + @if "$(DO_REAL_GEN)" == "1" echo Generating $@... + @if "$(DO_REAL_GEN)" == "1" copy ..\pango\$(@F).in $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef PANGOMM_DISABLE_DEPRECATED/\/\* \#undef PANGOMM_DISABLE_DEPRECATED \*\//g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef PANGOMM_MAJOR_VERSION/\#define PANGOMM_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef PANGOMM_MINOR_VERSION/\#define PANGOMM_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef PANGOMM_MICRO_VERSION/\#define PANGOMM_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@ + @if "$(DO_REAL_GEN)" == "1" del $@.bak + +pkg-ver.mak: ..\configure.ac + @echo Generating version info Makefile Snippet... + @$(PERL) -00 -ne "print if /AC_INIT\(/" $** | \ + $(PERL) -pe "tr/, /\n/s" | \ + $(PERL) -ne "print if 2 .. 2" | \ + $(PERL) -ne "print /\[(.*)\]/" > ver.txt + @echo @echo off>pkg-ver.bat + @echo.>>pkg-ver.bat + @echo set /p pangomm_ver=^>pkg-ver.bat + @echo for /f "tokens=1,2,3 delims=." %%%%a IN ("%pangomm_ver%") do (echo PKG_MAJOR_VERSION=%%%%a^& echo PKG_MINOR_VERSION=%%%%b^& echo PKG_MICRO_VERSION=%%%%c)^>$@>>pkg-ver.bat + @pkg-ver.bat + @del ver.txt pkg-ver.bat diff --git a/MSVC_NMake/info-msvc.mak b/MSVC_NMake/info-msvc.mak new file mode 100644 index 0000000..54c4a3c --- /dev/null +++ b/MSVC_NMake/info-msvc.mak @@ -0,0 +1,35 @@ +# NMake Makefile portion for displaying config info + +all-build-info: + @echo. + @echo ---------- + @echo Build info + @echo --------- + @echo Build Type: $(CFG) + +help: + @echo. + @echo ============================ + @echo Building pangomm Using NMake + @echo ============================ + @echo nmake /f Makefile.vc CFG=[release^|debug] ^ ^ + @echo. + @echo Where: + @echo ------ + @echo CFG: Required, use CFG=release for an optimized build and CFG=debug + @echo for a debug build. PDB files are generated for all builds. + @echo. + @echo PREFIX: Optional, the path where dependent libraries and tools may be + @echo found, default is ^$(srcrootdir)\..\vs^$(short_vs_ver)\^$(platform), + @echo where ^$(short_vs_ver) is 15 for VS 2017 and so on; and + @echo ^$(platform) is Win32 for 32-bit builds and x64 for x64 builds. + @echo. + @echo ====== + @echo A 'clean' target is supported to remove all generated files, intermediate + @echo object files and binaries for the specified configuration. + @echo. + @echo An 'install' target is supported to copy the build (DLLs, utility programs, + @echo LIBs, along with the introspection files if applicable) to appropriate + @echo locations under ^$(PREFIX). + @echo ====== + @echo. diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak new file mode 100644 index 0000000..a2acb45 --- /dev/null +++ b/MSVC_NMake/install.mak @@ -0,0 +1,20 @@ +# NMake Makefile snippet for copying the built libraries, utilities and headers to +# a path under $(PREFIX). + +install: all + @if not exist $(PREFIX)\bin\ mkdir $(PREFIX)\bin + @if not exist $(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include\ mkdir $(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include + @if not exist $(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\ @mkdir $(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private + @if not exist $(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4\ @mkdir $(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4 + @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll $(PREFIX)\bin + @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).pdb $(PREFIX)\bin + @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib $(PREFIX)\lib + @copy ..\pango\pangomm.h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\" + @for %h in ($(files_built_h) $(files_extra_h)) do @if exist ..\untracked\pango\pangomm\%h copy ..\untracked\pango\pangomm\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h" + @for %h in ($(files_built_h) $(files_extra_h)) do @if exist ..\pango\pangomm\%h if not exist ..\untracked\pango\pangomm\%h copy ..\pango\pangomm\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h" + @for %h in ($(files_built_h) $(files_extra_h)) do @if exist vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\%h copy vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h" + @for %h in ($(pangomm_generated_private_headers)) do @if exist ..\untracked\pango\pangomm\private\%h copy ..\untracked\pango\pangomm\private\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h" + @for %h in ($(pangomm_generated_private_headers)) do @if exist ..\pango\pangomm\private\%h if not exist ..\pango\pangomm\private\%h copy ..\pango\pangomm\private\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h" + @for %h in ($(pangomm_generated_private_headers)) do @if exist vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private\%h copy vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private\%h "$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h" + @copy ".\pangomm\pangommconfig.h" "$(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include\" + @copy ..\tools\m4\*.m4 $(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4 diff --git a/MSVC_NMake/pangomm/meson.build b/MSVC_NMake/pangomm/meson.build new file mode 100644 index 0000000..2ff641b --- /dev/null +++ b/MSVC_NMake/pangomm/meson.build @@ -0,0 +1,17 @@ +# MSVC_NMake/pangomm + +# Input: pkg_conf_data, pangommconfig_h_meson +# Output: pangomm_rc + +pangomm_rc = configure_file( + input: 'pangomm.rc.in', + output: '@BASENAME@', + configuration: pkg_conf_data, +) + +# Make a copy of the generated configuration header in the MSVC project directory. +configure_file( + input: pangommconfig_h_meson, + output: 'pangommconfig.h', + configuration: pkg_conf_data, +) diff --git a/MSVC_NMake/pangomm/pangomm.rc.in b/MSVC_NMake/pangomm/pangomm.rc.in new file mode 100644 index 0000000..6b42f24 --- /dev/null +++ b/MSVC_NMake/pangomm/pangomm.rc.in @@ -0,0 +1,71 @@ + +#define APSTUDIO_READONLY_SYMBOLS + +#include + +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGOMM_MAJOR_VERSION@,@PANGOMM_MINOR_VERSION@,@PANGOMM_MICRO_VERSION@,1 + PRODUCTVERSION @PANGOMM_MAJOR_VERSION@,@PANGOMM_MINOR_VERSION@,@PANGOMM_MICRO_VERSION@,1 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "The gtkmm development team (see AUTHORS)" + VALUE "FileDescription", "The official C++ wrapper for pango" + VALUE "FileVersion", "@PACKAGE_VERSION@" + VALUE "LegalCopyright", "Distribution is under the LGPL (see COPYING)" + VALUE "OriginalFilename", "@PANGOMM_MODULE_NAME@.dll" + VALUE "ProductName", "pangomm" + VALUE "ProductVersion", "@PACKAGE_VERSION@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources + +#ifndef APSTUDIO_INVOKED + +#endif // not APSTUDIO_INVOKED diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..adefc63 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,68 @@ +## Copyright (c) 2009 Openismus GmbH +## +## This file is part of pangomm. +## +## pangomm is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 2.1 of the License, +## or (at your option) any later version. +## +## pangomm is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . + +ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS} +DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal + +if MAINTAINER_MODE +src_subdirs = pango/src +else +src_subdirs = +endif +if ENABLE_DOCUMENTATION +doc_subdirs = docs +else +doc_subdirs = +endif +SUBDIRS = tools $(src_subdirs) pango/pangomm $(doc_subdirs) + +pangomm_includedir = $(includedir)/$(PANGOMM_MODULE_NAME) +pangomm_include_HEADERS = pango/pangomm.h +pangomm_libincludedir = $(libdir)/$(PANGOMM_MODULE_NAME)/include +nodist_pangomm_libinclude_HEADERS = pango/pangommconfig.h + +pkgconfigdir = $(libdir)/pkgconfig +nodist_pkgconfig_DATA = pango/$(PANGOMM_MODULE_NAME).pc + +include $(srcdir)/MSVC_NMake/filelist.am + +text_files = COPYING.tools README.md README.win32.md +msvc_files = $(addprefix MSVC_NMake/,$(msvc_nmake_data)) + +dist_noinst_DATA = $(text_files) $(msvc_files) +dist_noinst_SCRIPTS = autogen.sh + +DISTCLEANFILES = MSVC_NMake/pangomm/pangommconfig.h + +# Distribute files needed when building pangomm with Meson. +EXTRA_DIST = \ + meson.build \ + meson_options.txt \ + MSVC_NMake/pangomm/meson.build \ + docs/reference/meson.build \ + pango/meson.build \ + pango/pangomm/meson.build \ + pango/pangommconfig.h.meson \ + subprojects/cairomm-1.16.wrap \ + subprojects/glibmm-2.68.wrap \ + subprojects/pango.wrap \ + tools/dummy-header.py \ + tools/extra_defs_gen/meson.build \ + untracked/README + +# Optional: auto-generate the ChangeLog file from the git log on make dist +include $(top_srcdir)/build/dist-changelog.am diff --git a/NEWS b/NEWS new file mode 100755 index 0000000..db4edce --- /dev/null +++ b/NEWS @@ -0,0 +1,458 @@ +2.52.0 (stable): + +* FontFamily: Add property_item_type(), property_n_items(), + property_name(), property_is_monospace(), property_is_variable(). +* FontMap: Add reload_font(), property_item_type(), + property_n_items(). + (Kjell Ahlstedt) + +Build: +* Require pango >= 1.52.0. + (Kjell Ahlstedt) + + +2.50.2 (stable): + +* Fontset: Use callback functions with C linkage + (Kjell Ahlstedt) Issue glibmm#1 (Murray Cumming) +* Coverage: Don't use deprecated pango_coverage_ref/unref() + (Kjell Ahlstedt) + +Documentation: +* Doxyfile.in: Don't hide undocumented classes + (Kjell Ahlstedt) +* README.win32: Convert to MarkDown and rename to README.win32.md + Make dependencies clearer + (Chun-wei Fan) +* Remove AUTHORS, HACKING, README.SUN; add general info to README.md + (Kjell Ahlstedt) Issue gtkmm#140 + +Meson build: +* Detect if we build from a git subtree + (William Roy) Merge request gtkmm!72 +* Don't copy files with configure_file() + (Kjell Ahlstedt) +* Fix the evaluation of is_git_build on Windows + (Kjell Ahlstedt) Issue gtkmm#131 (William Roy) +* Don't fail if warning_level=everything + (Daniel Boles, Kjell Ahlstedt) Merge request gtkmm!87 + + +2.50.1 (stable): + +* Context::get_font_map(): Fix reference count + (Kjell Ahlstedt) + +Build: +* Meson build: Specify 'check' option in run_command() + Will be necessary with future versions of Meson. + Require Meson >= 0.55.0 +* Meson build: Check if Perl is required for building documentation +* Meson build: Avoid unnecessary configuration warnings + (Kjell Ahlstedt) +* Meson build: Re-organize warning-related compiler flags for MSVC + (Chun-wei Fan) + + +2.50.0 (stable): + +* AttrList: Add get_attributes(), update(), equal() + (Kjell Ahlstedt) Issue #12 (misos1) +* Make CairoFontMap::set_resolution() usable + by adding the CairoFontMapImpl class + (Kjell Ahlstedt) Issue #15 (Ievgenii Meshcheriakov) +* Add FontMap::get_family() + (Kjell Ahlstedt) +* AttrList: Add to_string() and from_string() + Attribute: Add TextTransform, BaselineShift and FontScle enums + and some create_attr_*() methods + (Kjell Ahlstedt) + +Build: +* Don't include individual pango headers + (Matthias Clasen, Kjell Ahlstedt) Merge request !22 +* Support Visual Studio 2022 builds + (Chun-wei Fan) +* Require pango >= 1.49.4 + (Kjell Ahlstedt) + + +2.49.1 (unstable) + +* Layout, LayoutIter: Add get_const_line() and get_const_lines() + (Kjell Ahlstedt) Issue #10 (misos1) +* GlyphItem: Make most methods public + (Kjell Ahlstedt) Issue #11 (Josh Bialkowski) + + +2.48.1 (stable): + +* GlyphItem: Fix a memory leak in split() + (Kjell Ahlstedt) +* Layout: Speed up get_log_attrs() + (Kjell Ahlstedt) + +Build: +* Meson build: Use relative paths to untracked/ + (Kjell Ahlstedt) Merge request gtkmm!61 (Mingli Yu) +* pangommconfig.h.*: Don't dllimport on MinGW + (Chun-wei Fan) Issue gtkmm#90 (Lukas K.) +* Meson build: Make it possible to use pangomm as a subproject + (Kjell Ahlstedt) +* Meson build: No implicit_include_directories + (Kjell Ahlstedt) + + +2.48.0 (stable): +This is the first stable release in the pangomm-2.48 ABI series. +It is parallel-installable with the pangomm-1.4 ABI. + +The tarball for 2.48.0 has been created with 'meson dist'. +If you build with Autotools from the tarball, please read the relevant +part of the README file. + +* FontFamily, FontMap: Implement the Gio::ListModel interface + CairoFontMap: Add get_default() + (Andreas Persson) Merge request !20 +* Attribute: Add Overline and ShowFlags enums and some create*() methods + Renderer: Add vfuncs + (Kjell Ahlstedt) Issue #9 (misos1) +* Font, FontFace, FontFamily, FontMetrics: Add new methods + (Kjell Ahlstedt) +* LayoutRun: Rename to GlyphItem + (Kjell Ahlstedt) +* LayoutIter: Fix get_run() and get_line() + (Kjell Ahlstedt) +* GlyphString, Item: Wrap pango_shape_with_flags() + (Kjell Ahlstedt) Issue #9 (Tavmjong Bah) +* Layout: Add set/get_line_spacing() + (Kjell Ahlstedt) Issue #9 (misos1) + +Build: +* Depend on giomm (not just glibmm) + (Andreas Persson) Merge request !20 +* Use __declspec(dllexport) when building with Visual Studio + (Chun-wei Fan) Merge request !15, !16 +* Meson build: Avoid some recompilations + (Kjell Ahlstedt) +* Meson build: Better error message if trying to build with + maintainer-mode=false when true is necessary + (Kjell Ahlstedt) Issue #6 (Rasmus Thomsen) +* Meson build: Set default value of the 'warnings' option to 'min' + (Kjell Ahlstedt) +* Improve NMake support + (Chun-wei Fan) +* Improve Visual Studio support + (Chun-wei Fan) Merge request !15, !19 +* docs/reference/: Update for Doxygen >= 1.8.16 + (Kjell Ahlstedt) +* Meson build: Fix versioning on macOS + (Kjell Ahlstedt) Pull request libsigcplusplus#65 (Tom Schoonjans) +* Change the ABI to pangomm-2.48 + (Kjell Ahlstedt) + + +2.43.2 (unstable): +Distro packagers should probably not package this yet. + +* Coverage: Remove max(), to_bytes() and one create() + (Kjell Ahlstedt) +* Layout::get_lines(): Fix ownership of the GSList + (Kjell Ahlstedt) +* Remove deprecated API + - AttrList: non-const operator bool() + - CairoFontMap: create_context() + - Color: non-const operator bool() + - Layout: get_iter(LayoutIter& iter) + - LayoutIter: assign_gobj() + (Kjell Ahlstedt) +* pango/src/color.hg: Fix call to _CLASS_BOXEDTYPE_STATIC + (Chun-wei Fan) Merge request !9 + +Build: +* Use glibmm-2.66 instead of glibmm-2.60 + (Kjell Ahlstedt) +* tools/gen_scripts: Update for non-source-dir builds + (Kjell Ahlstedt) +* Add support for building pangomm with Meson + (Chun-wei Fan, Kjell Ahlstedt) Merge request !4, !5, !6 +* meson.build: Check if .git is a directory or file + (Ting-Wei Lan) Merge request !8 +* NMake Makefiles: Allow builds from a GIT checkout + (Chun-wei Fan) +* Visual Studio: Drop gendef.exe, use __declspec(dllexport) + (Chun-wei Fan) Merge request !13 +* The fixed call to _CLASS_BOXEDTYPE_STATIC in color.hg + is necessary in order to use glibmm 2.65.1 or later, + combined with maintainer-mode in pangomm. + + +2.43.1 (unstable): +Distro packagers should probably not package this yet. + +* Attribute: Add several create_attr_*() methods + (Kjell Ahlstedt) Bug #781059 = Issue #2 (Tony Houghton) +* FontDescription: Add set/get_variations() + (Kjell Ahlstedt) + +Build: +* Require C++17. + (Murray Cumming) +* Replace the Visual Studio project files with MSVC NMake project files + (Chun-wei Fan) Merge request !1 +* Use glibmm-2.60 instead of glibmm-2.56 + (Kjell Ahlstedt) +* Requires pango >= 1.41.0 + because of FontDescription::set/get_variations() + (Kjell Ahlstedt) +* Change the ABI to pangomm-2.44 + (Kjell Ahlstedt) + +2.41.5 (unstable): +Distro packagers should probably not package this yet. + +* Only build changes. + (Kjell Ahlstedt) + +2.41.4 (unstable): +Distro packagers should probably not package this yet. + +* Build: Use glibmm-2.56 instead of glibmm-2.54. + We have changed the ABI name in glibmm. + (Murray Cumming) +* Build: Fontset: Remove GLIBMM_EXCEPTIONS_ENABLED + (Kjell Ahlstedt) +* AttrString: Let _MEMBER_GET convert from const char*. + (Kjell Ahlstedt) Bug #783360 +* Weight enum: Make this implicitly convertible to int. + (Kjell Ahlstedt) Bug #86864 + +2.41.3 (unstable): + +* Use C++11 enum classes instead of old-style enums, and put many enums + inside relevant class declarations: + - Coverage: Change CoverageLevel to Coverage::Level. + - Renderer: Change RendererPart to Renderer::Part. + (Kjell Ahlstedt, Murray Cumming) +* Build: Windows: Visual Studio builds: Update glibmm ABI version. + + +2.41.2 (unstable): + +* Build: Use glibmm-2.54 instead of glibmm-2.52. + (Murray Cumming) +* Visual Studio: Require Visual Studio 2017. + (Chun-wei Fan) + +* Replace uses of Glib::ArrayHandle<>, Glib::ListHandle, and Glib::SListHandle + in the API with std::vector. + (Murray Cumming) + + +2.41.1 (unstable): + +This is the first release of the pangomm-2.42 API/ABI. +It installs in parallel with the pangomm-1.4 API/ABI, of which +the most recent version is pangomm 2.40.1. + +* Require C++14. + (Murray Cumming) +* Use glibmm-2.52 instead of glibmm-2.4. + (Murray Cumming) +* Use cairomm-1.16 instad of cairomm-1.0 + (Murray Cumming) + + +2.40.1 (stable): + +* C++11: Make all operator bool()s explicit. + (Murray Cumming) +* Build: Fix silent builds. + (Kjell Ahlstedt) Bug #768797 + +2.40.0 (stable): + +* No major changes compared to 2.39.1. + +2.39.1 (unstable): + +* Renderer: Added get/set_alpha(). + (Murray Cumming) +* Attribute: Added create_attr_background_alpha() and + create_attr_foreground_alpha(). + (Murray Cumming) +* Reduce the cairomm dependency back to 1.2.2. + (Murray Cumming) Bug #755460 (Daniel Stone) + +2.38.1 (stable): + +* Regenerate with the latest glibmm. + +2.38.0 (stable): + +* MSVC build fixes. + (Chun-wei Fan) + +2.37.2 (unstable): + +* Rebuilt with latest glibmm, + whose gmmproc generates C++ move operations. + (Murray Cumming) +* C++11: Mark all _CLASS_OPAQUE_REFCOUNTED classes as final. + (Murray Cumming) + +2.37.1 (unstable): + +* Use (and require) C++11. +* Attribute: fix operator!=. + (Maks Naumov) Bug #751531 + +2.36.0 (stable): + +No changes compared to 2.35.1. + +2.35.1 (unstable): + +* Context: Add get_serial(). + (Murray Cumming) +* FontMap: Add get_serial(). + (Murray Cumming) +* Layout: Add get_character_count() and get_serial(). + (Murray Cumming) +* Documentatoin: Update appearance to match recent glibmm and gtkmm. +* Win32 MSVC 2008/2010 Build: Many updates and corrections. + (Chun-wei Fan) + +2.34.0 (stable): + +* Remove the use of g_type_init() because it has been deprecated. + (José Alburquerque) + +2.28.4 (stable): + +* Add #includes needed with the latest glibmm. + (Murray Cumming) + +2.28.3 (stable): + +Build +* Ship convert_pangomm.m4 in tarballs. + (Frederic Peters) Bug #657817 +* Don't use obsolete macros. + (Krzesimir Nowak) + +2.28.2 (stable): + +* Install the m4 files even without --enable-maintainer-mode, as with + other modules. + (Kalev Lember) Bug #645669 + +2.28.1 (stable): + +* Avoid a tarball dependency on mm-common. + (Murray Cumming) + +2.28.0 (stable): + +Just a version increase and a regenerated tarball due to changes in an m4 +macro in mm-common. + +2.27.1 (unstable): + +* LayoutIter: This now has a copy constructor. +* Layout::get_iter(): There is now a version of this method that returns a + LayoutIter. The version with the output parameter is now deprecated. + +2.26.2 (stable): + +* Documentation: Added main page text at index.html. + (David King, Murray Cumming) + +2.26.1 (stable): + +* Minor documentation improvements. + (Murray Cumming, José Alburquerque) + +2.26.0 (stable): + +* Minor documentation build fixes. (Daniel Elstner) + +2.25.1.3 (unstable): + +* Change public documentation location to library.gnome.org in + the pkg-config files as well. (Daniel Elstner) + +2.25.1.2 (unstable): + +* Change public documentation location to library.gnome.org. + (Daniel Elstner) + +2.25.1.1 (unstable): + +* Reenable the per-class hierarchy graphs in the reference documentation. + (Daniel Elstner) +* Drop the custom HTML header and footer, and use the shared doxygen.css + file from mm-common. (Daniel Elstner) + +2.25.1 (unstable): + +* Reworked the build system, using mm-common. + (Daniel Elstner) + +2.24.0 (stable): + +(Skipped version numbers since 2.14.1, to match pango 1.24 +(apart from the first digit, which we can't decrease.) + +* Layout: Added show_in_cairo_context(). + (Louis-Francis Ratté-Boulianne) Bug #560232. +* Build: Allow pangomm to build outside the source tree. Bug #570322 + (Theppitak Karoonboonyanan) +* License Header consistency. (Deng Xiyue) + +2.14.1 (stable): + +* Windows build: Use the new DLL naming convention, like boost. + (Armin Burgmeier) +* Documentation: + - Corrected the index page for DevHelp. + (Deng Xiyue) Bug #559896 + +2.14.0 (stable): + +* Language: Added get_scripts(). + (Murray Cumming) +* README and COPYING fixes. + (Deng Xiyue) +* Fixed the Windows build with Visual Studio Express. + (Armin Burgmeier) + +2.13.8 (unstable): + +* Context: Added set_font_map() because the C function is now + public (non backend-only) API. +* LayoutRun/GlyphItem: Added split() and letter(). +* Renderer: Added draw_glyph_item(). +* CairoFontMap:: Added set_default(). + (Murray Cumming) +* Build: Updated the MS Visual Studio 2005 build. + (Armin Burgmeier) + +2.13.7 (unstable): + +* Build: Require a correct version of pango. + (Sebastian Bacher) +* Documentation: Correct some mentions of pangomm-2.4 to pangomm-1.4. + (Deng Xiyue) + +2.13.6 (unstable): + +* Layout: Added get_height(), set_height(), get_baseline(). +* LayoutIter: Added get_layout(). +* Renderer: Added get_layout() and get_layout_line(). + (Murray Cumming) + +2.13.5 (unstable): + +This is a first version of pangomm in its own tarball. +The API and ABI are not changed. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b210edb --- /dev/null +++ b/README.md @@ -0,0 +1,132 @@ +# pangomm +This is pangomm, a C++ API for Pango. + +# General information + +pangomm-1.4 and pangomm-2.48 are different parallel-installable ABIs. +This file describes pangomm-2.48. + +Web site + - https://www.gtkmm.org + +Download location + - https://download.gnome.org/sources/pangomm + +Reference documentation + - https://gnome.pages.gitlab.gnome.org/pangomm + +Tarballs contain reference documentation. In tarballs generated with Meson, +see the untracked/docs/reference/html directory. + +Discussion on GNOME's discourse forum + - https://discourse.gnome.org/tag/cplusplus + - https://discourse.gnome.org/c/platform + +Git repository + - https://gitlab.gnome.org/GNOME/pangomm + +Bugs can be reported to + - https://gitlab.gnome.org/GNOME/pangomm/issues + +Patches can be submitted to + - https://gitlab.gnome.org/GNOME/pangomm/merge_requests + +# Building + +Whenever possible, you should use the official binary packages approved by the +supplier of your operating system, such as your Linux distribution. + +## Building on Windows + +See [README.win32](README.win32.md) + +## Building from a release tarball + +Extract the tarball and go to the extracted directory: +``` + $ tar xf pangomm-@PANGOMM_VERSION@.tar.xz + $ cd pangomm-@PANGOMM_VERSION@ +``` + +It's easiest to build with Meson, if the tarball was made with Meson, +and to build with Autotools, if the tarball was made with Autotools. +Then you don't have to use maintainer-mode. + +How do you know how the tarball was made? If it was made with Meson, +it contains files in untracked/pango/pangomm/ and other subdirectories +of untracked/. + +### Building from a tarball with Meson + +Don't call the builddir 'build'. There is a directory called 'build' with +files used by Autotools. +``` + $ meson setup --prefix /some_directory --libdir lib your_builddir . + $ cd your_builddir +``` +If the tarball was made with Autotools, you must enable maintainer-mode: +``` + $ meson configure -Dmaintainer-mode=true +``` + +Then, regardless of how the tarball was made: +``` + $ ninja + $ ninja install +``` +### Building from a tarball with Autotools + +If the tarball was made with Autotools: +``` + $ ./configure --prefix=/some_directory +``` +If the tarball was made with Meson, you must enable maintainer-mode: +``` + $ ./autogen.sh --prefix=/some_directory +``` + +Then, regardless of how the tarball was made: +``` + $ make + $ make install +``` +## Building from git + +Building from git can be difficult so you should prefer building from +a release tarball unless you need to work on the pangomm code itself. + +jhbuild can be a good help +- https://gitlab.gnome.org/GNOME/jhbuild +- https://wiki.gnome.org/Projects/Jhbuild +- https://gnome.pages.gitlab.gnome.org/jhbuild + +### Building from git with Meson + +Maintainer-mode is enabled by default when you build from a git clone. + +Don't call the builddir 'build'. There is a directory called 'build' with +files used by Autotools. +``` + $ meson setup --prefix /some_directory --libdir lib your_builddir . + $ cd your_builddir + $ ninja + $ ninja install +``` +You can create a tarball like so: +``` + $ ninja dist +``` +### Building from git with Autotools +``` + $ ./autogen.sh --prefix=/some_directory + $ make + $ make install +``` +You can create a tarball like so: +``` + $ make distcheck +``` +or +``` + $ make dist +``` diff --git a/README.win32.md b/README.win32.md new file mode 100644 index 0000000..ffd6fad --- /dev/null +++ b/README.win32.md @@ -0,0 +1,162 @@ +Building pangomm on Win32 += + +Currently, both the mingw (native win32) gcc compiler and MS Visual +Studio 2017 and later are supported. pangomm can be built with +mingw32-gcc using the gnu autotools (automake, autoconf, libtool) or +Meson. A `C++17`-compliant compiler is required. + +As explicitly stated in the gtk+ for win32 distribution +(http://www.gimp.org/win32/), the gcc compiler provided by the cygwin +distribution should not be used to build pango/pangomm libraries and/or +applications (see the README.win32 that comes with the gtk+ DLLs). +This MIGHT cause conflicts between the cygwin and msvcrt runtime +environments. + +### Mingw + +The mingw distribution which has been tested with this release is the +following : + +* MinGW-4.1 as the base distribution. + +First, make sure that you have working distribution of the native port +of both libsigc++-3.x and pango/pangocairo on win32 (see +http://www.gimp.org/win32). If you can't compile a simple pango example +using gcc and `pkg-config --cflags --libs`, you should not even think +about trying to compile pangomm, let alone using precompiled libpangomm +DLLs to port your pangomm application ! + +#### MinGW builds using autotools + +The bare mingw distribution does not provide the necessary tools (`sh`, `perl`, +`m4`, `autoconf`, `automake`, ...) to run the provided configure script "as is". One +(currently non supported) solution is to use mingw in conjunction with msys, +which is readily available on the mingw website (http://www.mingw.org/). + +The preferred method is to combine the cygwin distribution (for the unix tools +that were mentioned above) with mingw by making sure that the mingw +tools (`gcc`, `ld`, `dlltool`, ...) are called first. + +The configure script can then be called using (as an example) the +following options + +``` +./configure --prefix=/target --build=i386-pc-mingw32 --disable-static + +make +make check +make install +``` + +#### Meson with MinGW +The standard Meson build instructions for *NIX should work, although it +is untested at the time of writing. Please see `README.md` for more details. + +### MS Visual Studio 2017 or later + +#### Building using NMake +In a Visual Studio command prompt, navigate to the `MSVC_NMake` directory. +Run `nmake /f Makefile.vc CFG=[release|debug]` to build the pangomm DLL. +If a prefix other than `$(srcroot)\..\vs$(VSVER)\$(Platform)` is desired, +pass in `PREFIX=$(your_prefix)` in the NMake command line. + +If using C++ dependencies that are built with Meson, specify `USE_MESON_LIBS=1` +in your NMake command line. + +The following list lists the `$(VSVER)` and the `vc1xx` in the NMake-built DLL +and .lib that corresponds to the Visual Studio version used +(Visual Studio versions at or before 2015 are not supported): + * 2017: `15`, `pangomm-vc141-2_48.[dll|pdb|lib]` + * 2019: `16`, `pangomm-vc142-2_48.[dll|pdb|lib]` + * 2022: `17`: `pangomm-vc143-2_48.[dll|pdb|lib]` + +For Meson, the DLL/PDB filenames and .lib filenames will be like: + * 2017: `pangomm-vc141-2.48-1.[dll|pdb]`, `pangomm-vc141-2.48.lib` + * 2019: `pangomm-vc142-2.48-1.[dll|pdb]`, `pangomm-vc142-2.48.lib` + * 2022: `pangomm-vc143-2.48-1.[dll|pdb]`, `pangomm-vc143-2.48.lib` + +Notice that this is no longer always the `vc$(VSVER)0` that was used before, to be consistent with other common C++ libraries such as Boost. +Earlier gtkmm versions may still use the former `vc$(VSVER)0` naming scheme, so for +situations like where rebuilding code using pangomm became +inconvenient, a `USE_COMPAT_LIBS=1` NMake option is provided to use the older naming scheme. +(or use `-Dmsvc14x-parallel-installable=false` in the Meson configure command line +to avoid having the toolset version in the final DLL and .lib filenames); +again, this is only recommended if it is inconvenient to re-build the +dependent code. + +For the NMake builds, the following targets are supported: + + * `all` (or no target specified): Build the pangomm DLL and .lib + * `install`: Copy the built pangomm DLL, .lib and headers to appropriate +locations under `$(PREFIX)`. + * `clean`: Remove all the built files. This includes the generated sources +if building from a GIT checkout, as noted below. + +The NMake Makefiles now support building the pangomm libraries directly from a GIT +checkout with a few manual steps required, namely: + + * Ensure that you have a copy of Cygwin or MSYS/MSYS64 installed, including +`m4.exe` and `sh.exe`. You should also have a PERL for Windows installation +as well, and your `%PATH%` should contain the paths to your PERL interpreter +and the bin\ directory of your Cygwin or MSYS/MSYS64 installation, it is +recommended that these paths are towards the end of your `%PATH%`. You need to +install the `XML::Parser` PERL module as well for your PERL installation, which +requires libexpat. + + * You may wish to pass in the directory where gmmproc and generate_wrap_init.pl +from glibmm is found, if they are not in `$(PREFIX)\share\glibmm-2.68\proc`, using +`GMMPROC_DIR=...` in the NMake commandline. + + * Make a new copy of the entire source tree to some location, where the build +is to be done; then in `$(srcroot)\MSVC_NMake` run `nmake /f Makefile.vc CFG=[release|debug]`, +which will first copy and generate the following files with the proper info (this step will also +be run if the following files are not present in the unpacked source tarball): +``` +$(srcroot)\MSVC_NMake\pangomm\pangommconfig.h +$(srcroot)\MSVC_NMake\pangomm\pangomm.rc +``` + +For `pangommconfig.h`, it is recommended to keep `PANGOMM_DISABLE_DEPRECATED` +undefined unless you know what you are doing. + +Note that to generate any of the above 2 files with NMake, a PERL installation is +also required. + +#### Building Using Meson + +For building with Meson, please see `README.md` for further instructions. Please +note that using `-Ddefault_library=[static|both]` for Visual Studio builds is not +supported and is thus not allowed. + +You will need to have a working copy of glibmm-2.68, cairomm-1.16 and PangoCairo's +pkg-config files, which point to the corresponding locations of its headers +and .lib's and the headers and .lib's of all of its dependencies. You will need to +set `%LIB%` to include the location where +`glibmm_generate_extra_defs-vc14[x]-2.68.lib` from glibmm is, if not already in +there, preferably to the start of your `%LIB%`. glibmm-2.68 and cairomm-1.16 refer +to the C++17 branches of glibmm and cairomm, where they refer to glibmm-2.68.x and +cairomm-1.16.x (and later branches, including their master/main branches). + +When building with Meson, if building from a GIT checkout or if building with +`maintainer-mode` enabled, you will also need a PERL interpreter and the `m4.exe` +and `sh.exe` from Cygwin or MSYS/MSYS64, and you will need to also install Doxygen, +LLVM (likely needed by Doxygen) and GraphViz unless you pass in +`-Dbuild-documentation=false` in your Meson configure command line. You will still +need to have `mm-common` installed with its `bin` directory in your `%PATH%`, along +with the `gmmproc` items from glibmm, which will be found with `pkg-config`. + +The Ninja build tool is also required if not using +`--backend=[vs2017|vs2019|vs2022]` in the Meson +command line, as noted towards the end of this section. + +Note that `debug` builds should only be used against dependencies that are built +as debug builds, and `release`and `debugoptimized` should be only used against +dependencies that are built as `release` or `debugoptimized`. On Visual Studio +builds in Meson, `debugoptimized` is roughly equivilant to a Release build with +.PDB files enabled, perhaps with some debugging features that are specific to the +respective packages. + +### pangomm methods and signals not available on win32 + +All pangomm methods and signals are available on win32. diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..1d3b3de --- /dev/null +++ b/autogen.sh @@ -0,0 +1,7 @@ +#! /bin/sh -e +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +mm-common-prepare --force --copy "$srcdir" +autoreconf --force --install --warnings=all "$srcdir" +test -n "$NOCONFIGURE" || "$srcdir/configure" --enable-maintainer-mode "$@" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..ee52338 --- /dev/null +++ b/configure.ac @@ -0,0 +1,85 @@ +## Copyright (c) 2009 Openismus GmbH +## +## This file is part of pangomm. +## +## pangomm is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 2.1 of the License, +## or (at your option) any later version. +## +## pangomm is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . + +AC_INIT([pangomm], [2.52.0], + [https://gitlab.gnome.org/GNOME/pangomm/issues/], + [pangomm], [http://www.gtkmm.org/]) +AC_PREREQ([2.59]) + +AC_CONFIG_SRCDIR([pango/pangomm.h]) +AC_CONFIG_AUX_DIR([build]) +AC_CONFIG_MACRO_DIR([build]) +AC_CONFIG_HEADERS([config.h pango/pangommconfig.h]) + +AM_INIT_AUTOMAKE([1.9 -Wno-portability check-news dist-bzip2 no-define nostdinc tar-ustar foreign]) +# Support silent build rules. +# Disable by either passing --disable-silent-rules to configure or passing V=1 to make. +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AM_MAINTAINER_MODE +AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I ]) + +MM_PREREQ([0.9.12]) +MM_INIT_MODULE([pangomm-2.48]) + +# Copy the mm-common .pl scripts into docs/, +# and use them from there, +# so we can dist them to avoid a tarball-build dependency. +MM_CONFIG_DOCTOOL_DIR([docs]) + +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +AC_SUBST([LIBPANGOMM_SO_VERSION], [1:30:0]) + +AC_PROG_CXX +MM_AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) + +AC_DISABLE_STATIC +LT_INIT([win32-dll]) + +AC_SUBST([PANGOMM_MODULES], ['giomm-2.68 >= 2.68.0 cairomm-1.16 >= 1.15.1 pangocairo >= 1.52.0']) +AC_SUBST([MSVC_TOOLSET_VER], ['']) +PKG_CHECK_MODULES([PANGOMM], [$PANGOMM_MODULES]) + +MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0]) +MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.68]) + +MM_ARG_DISABLE_DEPRECATED_API +MM_ARG_ENABLE_DOCUMENTATION +MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++]) +MM_ARG_WITH_TAGFILE_DOC([libsigc++-3.0.tag], [sigc++-3.0]) +MM_ARG_WITH_TAGFILE_DOC([glibmm-2.68.tag], [glibmm-2.68]) +MM_ARG_WITH_TAGFILE_DOC([cairomm-1.16.tag], [cairomm-1.16]) + +AC_LANG([C++]) +MM_ARG_ENABLE_WARNINGS([PANGOMM_WXXFLAGS], + [-Wall], + [-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override -Wshadow -Wno-long-long], + [G PANGO GLIBMM]) + +AC_CONFIG_FILES([Makefile + tools/Makefile + pango/${PANGOMM_MODULE_NAME}.pc:pango/pangomm.pc.in + pango/${PANGOMM_MODULE_NAME}-uninstalled.pc:pango/pangomm-uninstalled.pc.in + pango/src/Makefile + pango/pangomm/Makefile + docs/Makefile + docs/reference/Doxyfile + MSVC_NMake/pangomm/pangomm.rc]) + +# Copy the generated configuration headers into the MSVC project directories. +AC_CONFIG_COMMANDS([MSVC_NMake/pangomm/pangommconfig.h], + [cp -f pango/pangommconfig.h MSVC_NMake/pangomm/pangommconfig.h]) +AC_OUTPUT diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..774ea72 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,30 @@ +## Copyright (c) 2009 Openismus GmbH +## +## This file is part of pangomm. +## +## pangomm is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 2.1 of the License, +## or (at your option) any later version. +## +## pangomm is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . + +include $(top_srcdir)/pango/src/filelist.am +include $(top_srcdir)/pango/pangomm/filelist.gmake.am + +pangomm_files_h = $(files_built_h) $(filter-out wrap_init.h,$(files_extra_h)) + +book_name = $(PANGOMM_MODULE_NAME) +doc_input = $(addprefix $(top_srcdir)/pango/pangomm/,$(pangomm_files_h)) \ + $(top_srcdir)/pango/pangomm.h + +docimagesdir = $(libdocdir)/images +dist_docimages_DATA = images/gtkmm_logo.gif images/top.gif + +include $(top_srcdir)/build/doc-reference.am diff --git a/docs/images/gtkmm_logo.gif b/docs/images/gtkmm_logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..30b502c4f4ec98e71808f764defe3868c9eaab04 GIT binary patch literal 4416 zcmbu)2_w@Fz`*g}W(=bkxyfxKg75plqND0CsnGdwP1x%gZe-Emc)j0RTu!N}8RW zm1pDDJtG_^qWVN!r%%Dk7B0mLVHFk@u9Y#uU@(6CNV1HvlamuxKq*gL*A6bNzy|l{ zzrf1QBY0jL&2^rOS5D!wr~8PZFoX1|eSVVP1E|y+eWn#eKpsfq{1df_;K7VuO4DiDL+e9nb}k{|f{Dj|{M! z(#o*LNTJLzV#uoi&9b+j-G#i^8|Zc66R++2mYZ;97fYr#e$DUt!p^Mgx!-JD+&St- zz1}(bhmR*D1caSA8|@Xs%9fsynU$TB9-5F}P*_x4Vs|!-lZ%Zx5#ebB9@g$;R!tcjJ7*?*jN$q zZFwL~;De~I`lw!)ANQack#*8zBo~1Rydqt3+gMr3q+O+mTK!s2QL7z!^b>t*Rz&e# z5-|FD7{DEj9Z@nW~zT#C_c9Wa7ddI3#zjlQ@*JxJF=i8L0H;q7durp8ak^7q8 zw3j~2$=_UP#|1K&><$EH@0~xXoItDlf26#S_CGhd9JDgZem3{%iJ^+gXx8QRmdX8{ zUK-&NMyx)g1wF;2cX-ac`}fuN>jeGGdW)S2n0-#}HjfWpPOv*K zQ*g>lW>29uZ+g3BHuoNw#xO}d$#FU9 zzH%iV4AfI;DNhir%Ur=Si07ig(%e#FV6e>i<1h|Ou}7~WlZVo^`TU@gN*PB?57<@( zCc&KQs8J>(q{^#2N7Eu=os{18t*l+5D<>mi@&2i6eZB7=}9 zrwRiRXB7Aum0D93$v2j5R9jt%e-ih-_8C{K%0X>;inVlcaWk2^#Z>=h-2!}%8NDeI zP4BL%>A%@RDSE-TN(YsSb6rpvSb^Jm|>RLipa`{qD=GtsWQ~*LJycSdS+cg;C116 zj2OJSQYdg-%3Jt~G8f|Sr*0dYgewgvv!3rjG@TbM9b5ITK)(}-ac^Oo#q>hYQr9+Z z*z=I%z%d}LCwz$(@K^aiYn)0Gz3$+TfkEiL==Y`6!)?{s2TM|;%j2_wYH!k^6Sy_1 z&Z*LJVYoT>jA_GD_4Q{#8Qq^$VeTQVc)p;c)3c>OdUqK)^iB818qLH1&4ZCQ``>iR zVxzaN@4wvpVLy6k@V@B_x_5g?Br|4m_TT35(746r(T_Jrg|uphzJO!u?8@jd0k0ZA z$?s!fVt)^kK3(u5Sx!4wLVPJ79~|s%KapTK2LaYVq9}wVp75$?)G}>bcl{nQJ8$3r|0>WN*`H&ammg)72ur=?|a$# z2yeZFyIv{TecZ6^h26AF?L0Xc3a>P|lALR`3YB6l z{8sN_NBH)f4Wu!ogaapQT7MlAU~8!hQ?a{;1m!=RAtKBAYr z*F1^-a3#|#W=)}G6YW6t$mvE}UX9*J)ZopLfAmLK&1Lg-^eu9FZ0d7p1s>+ZNGv#< zUQ4PJY}Bx9PK~ALNFQ@_6bc^L@PZ$D794bZbNBU+P!vvUNe- z)-AYJ@9Uy|)|u>G<&~dv2Su_)W_-uM95dxA>6;cztG4dUKk?$@#_ z;L3WZcD8jj9LvodJhnczj;N{oZ)q&{FZ?;_@k|DPH_F%Fg6ta^##3h0Y+3p>ptB^F2rRKg&<3v& zxXk2{tAXt;6l~3Vb8~cfSY6;Mu=`LchG|tCRDbTrUPLr7A9UFcq`&+lXHa-mUT2^} zb@^vRCf@AyEgtHx^W*HKuoFe!hZEEBbr|8(N zm5ZSMzx167&sazUOBLGh^gjBv1jI3}W02|GuV7F?1c=PNXf(9ab&9Cox)k^6{+hNJi%(JTH*`{5s!*e2R!-2D4<3M80(pO6L zwchpR@UIEw8$aX!&iU-ba6zJ(I^$xtFZH_g{}qd9eAX&Mx)GButb6dG@$Z&jV{j3_ z+h4JNr~|8ipe={<40P7w;R$?nx1a^^Gq`2`L3F*~0ZVdJ`uc<22t3EeX^7)&?9Q}G z^OrdDWhY@NUP~jT(K)=x#=W!2C>T9n()j)=uiVn85^V4`;j@EYLVT25l(0HMiZx_k zI#vajz!7nQAmwRyT^8Nu=t6XVmv1OI7NMS;pyuPDic3^U7SxNl6Wa{5hKTdhA)PdW za4zq4^(Zr3!lDlZO@AmV5U@ZD`e&)k`S4uDeRF+*E6zs*W<-)CBG4W2h=Vl*R1NvF zrk^SalAjUBu(B9;#2FI38-@IrcU zW?}f5!$_0eGjdEaHa{)mkC=bJo!Ac|U22kL9KZ-8sKiEy+i3)}Y2%)_L(0w}&dvyW za2W0!0d4EVs>!ADs`!?KUu5T!v4Ml?b5f`HRJm;kjRH8TBOv|O2R9N^rv^n>0`gqI zL{=K8BhAwxvf+>^b&X9lD|)+-XV^DXM&09nlOLNnNN9$YaTy9z!AlO?y4A=g8pCDs zP1XvM2mNX1PIy92!51d=$3Nv5Om&A`}QdA&`qIaN-Id1~%%`c= zigI4c{Nl}h?>Jn}N#V~W*l!}i(k;m!tgn~@h_nV}8ymIX_#ThYCKPi+0b{Y53j8N(E8(blW935{am&3vy8t5K)?pv!PM zuq;7CigC|i`Z#CCiO@oN;*(qeK^%6Lub=|U||!LgFzAa+BR6v@o0Y1FJDJJu;eh{{M@s48GoQk^NO zLX;9sQo=c8xTKVLH8TFX&>$m-i<~u5T)VhXH_1-%EUvq%R!kN|veU{ku#%sDnm}!8 z6Qb%2$LsGYG*}$hrft=)`0Ip?UTCf+Hwsnkjg$Y8pB}O|v~<_4kj+lUfo}^9_3TYX z3XO%SjZk!>j9eKDr7mbD3GUz=StvHA88k0+p9xL{r>)(swWeu$EsyesOD!v^R3S%ddQUrk;_0~Sa4y^S+Mf%-$eIxLhTTHy0gU=<&`tbkyo3rlnBBhQBWmNP5 j(q=y*0Cs!C@cniP;NKxHGWZnhi%=L;eafN-09yY8IMzrD literal 0 HcmV?d00001 diff --git a/docs/images/top.gif b/docs/images/top.gif new file mode 100644 index 0000000000000000000000000000000000000000..85d395c5b4b0b1518fa398997a75b44fea2a5488 GIT binary patch literal 260 zcmZ{ft4_mE06d&R}@aKam!Pe6m3)WsGT>MhKydm}ZV2+mplzwC6{?Fbt=utCSF! zAPB0evWXoMmn;DTG32mVJI^CXp)AYm#F0|IuLIMRa8r1bg%hrhHDplN_2u)CAK6#0 zU6*tYT5FlPHg6t<`%MUef>o literal 0 HcmV?d00001 diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in new file mode 100644 index 0000000..93816da --- /dev/null +++ b/docs/reference/Doxyfile.in @@ -0,0 +1,334 @@ +# Doxyfile 1.8.11 +# @configure_input@ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = @PACKAGE_NAME@ +PROJECT_NUMBER = @PACKAGE_VERSION@ +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = reference +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = "@abs_top_builddir@/pango/" \ + "@abs_top_srcdir@/pango/" +STRIP_FROM_INC_PATH = "@abs_top_builddir@/pango/" \ + "@abs_top_srcdir@/pango/" +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = "newin{2}=\xrefitem since_\1_\2 \"Since @PACKAGE_NAME@ \1.\2\" \"New API in @PACKAGE_NAME@ \1.\2\"" \ + "newin{3}=\xrefitem since_\1_\2_\3 \"Since @PACKAGE_NAME@ \1.\2.\3\" \"New API in @PACKAGE_NAME@ \1.\2.\3\"" +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = YES +SORT_GROUP_NAMES = YES +SORT_BY_SCOPE_NAME = YES +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 2 +SHOW_USED_FILES = NO +SHOW_FILES = NO +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = reference/doxygen.log +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = _* \ + adaptor_trait \ + basic_filebuf \ + basic_streambuf \ + binary_function \ + char_traits \ + internal \ + pair \ + unary_function +EXAMPLE_PATH = +EXAMPLE_PATTERNS = *.cc \ + *.h +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +CLANG_ASSISTED_PARSING = NO +CLANG_OPTIONS = +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = "$(MMDOCTOOLDIR)/doxygen-extra.css" +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO +ENUM_VALUES_PER_LINE = 1 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = NO +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = plain +LATEX_TIMESTAMP = NO +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = NO +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = "@abs_top_builddir@/pango" \ + "@abs_top_srcdir@/pango" +INCLUDE_FILE_PATTERNS = *.h +PREDEFINED = __cplusplus \ + DOXYGEN_SHOULD_SKIP_THIS \ + "G_GNUC_CONST=" \ + "G_GNUC_NORETURN=" \ + "G_GNUC_NULL_TERMINATED=" \ + "G_GNUC_PURE=" \ + GLIBMM_HAVE_WIDE_STREAM \ + "PANGOMM_API=" +EXPAND_AS_DEFINED = PANGOMM_MAJOR_VERSION \ + PANGOMM_MINOR_VERSION \ + PANGOMM_MICRO_VERSION +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- +TAGFILES = @DOXYGEN_TAGFILES@ +GENERATE_TAGFILE = "reference/@PANGOMM_MODULE_NAME@.tag" +ALLEXTERNALS = NO +EXTERNAL_GROUPS = NO +EXTERNAL_PAGES = YES +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +DIA_PATH = +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Sans +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = NO +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/docs/reference/meson.build b/docs/reference/meson.build new file mode 100644 index 0000000..d331a0d --- /dev/null +++ b/docs/reference/meson.build @@ -0,0 +1,175 @@ +# docs/reference + +# Input: built_files_root, project_source_root, pangomm_pcname, python3, +# hg_ccg_basenames, extra_h_files, built_h_file_targets, install_datadir, +# doc_reference_py, can_add_dist_script +# Output: install_docdir, install_devhelpdir, if build_documentation: tag_file + +tag_file_modules = [ + 'mm-common-libstdc++', + 'sigc++-3.0', + 'glibmm-2.68', + 'cairomm-1.16', +] +doxygen_tagfiles = '' +doxygen_tag_targets = [] +docinstall_flags = [] +foreach module : tag_file_modules + depmod = dependency(module, required: false) + if depmod.found() + doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') + if doxytagfile != '' + if depmod.type_name() == 'internal' + # Subprojects must build their tag files before doxygen is called. + if module.startswith('mm-common') + doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target') + else + doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target') + endif + endif + htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') + htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') + if htmlrefpub == '' + htmlrefpub = htmlrefdir + elif htmlrefdir == '' + htmlrefdir = htmlrefpub + endif + doxygen_tagfiles += ' "' + doxytagfile + '=' + htmlrefpub + '"' + + # Doxygen <= 1.8.15 + docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir] + if htmlrefpub != htmlrefdir + # Doxygen >= 1.8.16 + docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir] + endif + endif + endif +endforeach + +book_name = pangomm_pcname +book_title = meson.project_name() + ' Reference Manual' + +# Configuration data for Doxyfile. +doc_conf_data = configuration_data() +doc_conf_data.set('configure_input', + 'docs/reference/Doxyfile. Generated from Doxyfile.in by meson.configure_file().') +doc_conf_data.set('PACKAGE_NAME', meson.project_name()) +doc_conf_data.set('PACKAGE_VERSION', meson.project_version()) +doc_conf_data.set('abs_top_builddir', built_files_root) +doc_conf_data.set('abs_top_srcdir', project_source_root) +doc_conf_data.set('PANGOMM_MODULE_NAME', book_name) +doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles) + +doxyfile = configure_file( + input: 'Doxyfile.in', + output: '@BASENAME@', + configuration: doc_conf_data, +) + +# Installation directories relative to {prefix}. +install_docdir = install_datadir / 'doc' / book_name +install_reference_docdir = install_docdir / 'reference' +install_image_docdir = install_docdir / 'images' +install_devhelpdir = install_datadir / 'devhelp' / 'books' / book_name + +if not build_documentation + # Documentation shall not be built or installed. + # Return to the calling meson.build file. + subdir_done() +endif + +# Built input .h files to Doxygen. +built_h_files = [] +foreach file : hg_ccg_basenames + built_h_files += built_files_root / 'pango' / 'pangomm' / file + '.h' +endforeach + +# Hand-coded input .h files to Doxygen. +src_h_files = [] +foreach file : extra_h_files + if file != 'wrap_init.h' + src_h_files += project_source_root / 'pango' / 'pangomm' / file + endif +endforeach +src_h_files += project_source_root / 'pango' / 'pangomm.h' + +doctool_dir = project_source_root / 'untracked' / 'docs' # MMDOCTOOLDIR +doctool_dist_dir = 'untracked' / 'docs' # Relative to MESON_DIST_ROOT + +doc_h_files = src_h_files +if built_h_file_targets.length() > 0 + # .h files have been generated from .hg files (maintainer mode). + # Use built_h_file_targets instead of built_h_files here, or else Meson won't + # know that Doxygen must not be executed until the .h files have been built. + doc_h_files += built_h_file_targets +else + # All .h files are stored in the source tree (not maintainer mode). + doc_h_files += built_h_files +endif + +# Can't use @INPUT@ in the command. It requires absolute file paths. +# Paths in built_h_file_targets are relative to project_build_root. +tag_file = custom_target('html_and_tag', + input: doc_h_files, + output: book_name + '.tag', + command: [ + python3, doc_reference_py, 'doxygen', + doctool_dir, + '@OUTPUT@', + src_h_files, + built_h_files, + ], + depend_files: doxyfile, + depends: doxygen_tag_targets, + build_by_default: build_documentation, + install: true, + install_dir: install_reference_docdir, +) + +devhelp_file = custom_target('devhelp', + input: tag_file, + output: book_name + '.devhelp2', + command: [ + python3, doc_reference_py, 'devhelp', + doctool_dir, + '@INPUT@', + '@OUTPUT@', + book_name, + book_title, + ], + build_by_default: build_documentation, +) + +# Install Devhelp file and html files. +meson.add_install_script( + python3, doc_reference_py, 'install_doc', + doctool_dir, + devhelp_file.full_path(), + install_devhelpdir, + install_reference_docdir / 'html', + docinstall_flags +) + +# Install images. +image_basefiles = [ + 'gtkmm_logo.gif', + 'top.gif', +] +image_files = [] +foreach file : image_basefiles + image_files += '..' / 'images' / file +endforeach + +install_data(image_files, install_dir: install_image_docdir) + +if can_add_dist_script + # Distribute built files and files copied by mm-common-get. + meson.add_dist_script( + python3, doc_reference_py, 'dist_doc', + doctool_dir, + doctool_dist_dir, + meson.current_build_dir(), + tag_file.full_path(), + devhelp_file.full_path(), + ) +endif diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..fa0c70a --- /dev/null +++ b/meson.build @@ -0,0 +1,347 @@ +# This file is part of pangomm. + +project('pangomm', 'cpp', + version: '2.52.0', + license: 'LGPLv2.1+', + default_options: [ + 'cpp_std=c++17', + 'warning_level=1', + ], + meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...) + # and meson.add_install_script(python3, ...) +) + +pangomm_api_version = '2.48' +pangomm_pcname = meson.project_name() + '-' + pangomm_api_version + +pangomm_version_array = meson.project_version().split('.') +pangomm_major_version = pangomm_version_array[0].to_int() +pangomm_minor_version = pangomm_version_array[1].to_int() +pangomm_micro_version = pangomm_version_array[2].to_int() + +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# The relation between libtool's current:revison:age interface versioning +# and the .so filename, .so.x.y.z, is +# x = current - age +# y = age +# z = revision +# If libtool_soversion is updated as described in libtool's documentation, +# x.y.z will usually *not* be equal to meson.project_version(). +libtool_soversion = [1, 30, 0] +pangomm_libversion = '@0@.@1@.@2@'.format( + libtool_soversion[0] - libtool_soversion[2], + libtool_soversion[2], + libtool_soversion[1] +) +macos_darwin_versions = [ + libtool_soversion[0] + 1, + '@0@.@1@'.format(libtool_soversion[0] + 1, libtool_soversion[1]) +] + +# Use these instead of meson.source_root() and meson.build_root() in subdirectories. +# source_root() and build_root() are not useful, if this is a subproject. +project_source_root = meson.current_source_dir() +project_build_root = meson.current_build_dir() + +cpp_compiler = meson.get_compiler('cpp') +is_msvc = cpp_compiler.get_id() == 'msvc' + +python3 = find_program('python3', version: '>=3.5') + +# Do we build from a git repository? +# Suppose we do if and only if the meson.build file is tracked by git. +cmd_py = ''' +import shutil, subprocess, sys +git_exe = shutil.which('git') +if not git_exe: + sys.exit(1) +cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ] +sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) +''' +is_git_build = run_command( + python3, '-c', cmd_py, + project_source_root, + check: false, +).returncode() == 0 + +# Are we testing a dist tarball while it's being built? +# There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 +is_dist_check = project_source_root.contains('dist-unpack') and \ + project_build_root.contains('dist-build') + +# Options. +maintainer_mode_opt = get_option('maintainer-mode') +maintainer_mode = maintainer_mode_opt == 'true' or \ + (maintainer_mode_opt == 'if-git-build' and is_git_build) +if is_dist_check + message('Looks like a tarball is being tested. ' + \ + 'Option "dist-warnings" is used instead of "warnings".') + cpp_warnings = get_option('dist-warnings') +else + cpp_warnings = get_option('warnings') +endif +if get_option('warning_level') in ['0','1','2','3','4','5'] + warning_level = get_option('warning_level').to_int() +else + # For instance get_option('warning_level') == 'everything' + warning_level = 99 +endif +werror = get_option('werror') +build_deprecated_api = get_option('build-deprecated-api') +build_documentation_opt = get_option('build-documentation') +build_documentation = build_documentation_opt == 'true' or \ + (build_documentation_opt == 'if-maintainer-mode' and maintainer_mode) + +# Installation directories are relative to {prefix}. +install_prefix = get_option('prefix') +install_includedir = get_option('includedir') +install_libdir = get_option('libdir') +install_datadir = get_option('datadir') +install_pkgconfigdir = install_libdir / 'pkgconfig' + +# Dependencies. +# pangomm_build_dep: Dependencies when building the pangomm library. +# pangomm_dep (created in pango/pangomm/meson.build): +# Dependencies when using the pangomm library. + +# cairomm and glibmm recently gained Meson build support, so we look +# for their pkg-config files on Visual Studio, too +cairomm_req = '>= 1.15.1' +glibmm_req = '>= 2.68.0' + +# Pango supported pkg-config files on MSVC files for a good while, +# so just use that +pangocairo_req = '>= 1.52.0' +pangocairo_dep = dependency('pangocairo', version: pangocairo_req) + +glibmm_req_minor_ver = '68' +cairomm_req_minor_ver = '16' + +cairomm_dep = dependency('cairomm-1.@0@'.format(cairomm_req_minor_ver), version: cairomm_req) +glibmm_dep = dependency('glibmm-2.@0@'.format(glibmm_req_minor_ver), version: glibmm_req) +giomm_dep = dependency('giomm-2.@0@'.format(glibmm_req_minor_ver), version: glibmm_req) + +pangomm_build_dep = [giomm_dep, cairomm_dep, pangocairo_dep] +pangomm_requires = ' '.join([ + 'giomm-2.@0@'.format(glibmm_req_minor_ver), glibmm_req, + 'cairomm-1.@0@'.format(cairomm_req_minor_ver), cairomm_req, + 'pangocairo', pangocairo_req, +]) + +# Some dependencies are required only in maintainer mode and/or if +# reference documentation shall be built. +mm_common_get = find_program('mm-common-get', required: false) +if maintainer_mode and not mm_common_get.found() + message('Maintainer mode requires the \'mm-common-get\' command. If it is not found,\n' + + 'install the \'mm-common\' package, version 1.0.0 or higher.') + # If meson --wrap-mode != forcefallback, Meson falls back to the mm-common + # subproject only if mm-common-get is required. + mm_common_get = find_program('mm-common-get', required: true) +endif +m4 = find_program('m4', required: maintainer_mode) # Used by gmmproc (in glibmm) +doxygen = find_program('doxygen', required: build_documentation) +dot = find_program('dot', required: build_documentation) # Used by Doxygen +xsltproc = find_program('xsltproc', required: build_documentation) + +# Where to find gmmproc and generate_wrap_init.pl. +gmmproc_dir = glibmm_dep.get_variable(pkgconfig: 'gmmprocdir', internal: 'gmmprocdir') + +# Script files copied to 'untracked' by mm-common-get. +script_dir = project_source_root / 'untracked' / 'build_scripts' +generate_binding_py = script_dir / 'generate-binding.py' +doc_reference_py = script_dir / 'doc-reference.py' +dist_changelog_py = script_dir / 'dist-changelog.py' +dist_build_scripts_py = script_dir / 'dist-build-scripts.py' + +if maintainer_mode + # Copy files to untracked/build_scripts and untracked/docs. + run_command(mm_common_get, '--force', script_dir, + project_source_root / 'untracked' / 'docs', + check: true, + ) +elif not import('fs').is_file(generate_binding_py) + error('Missing files in untracked/. You must enable maintainer-mode.') +endif + +# Check if perl is required and available. +doc_perl_prop = run_command( + python3, doc_reference_py, 'get_script_property', + '', # MMDOCTOOLDIR is not used + 'requires_perl', + check: false, +) +doc_requires_perl = true +if doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false' + doc_requires_perl = false +endif + +perl = find_program('perl', required: maintainer_mode or \ + (build_documentation and doc_requires_perl)) + +# pangomm's own script files. +pangomm_script_dir = project_source_root / 'tools' +dummy_header_py = pangomm_script_dir / 'dummy-header.py' + +# Whether to include toolset version in .lib and DLL file names +# on Visual Studio 2017 and later (default: yes) +use_msvc14x_toolset_ver = get_option('msvc14x-parallel-installable') + +# Add toolset version in builds done with Visual Studio 2017 or later +msvc14x_toolset_ver = '' + +if is_msvc + # Put in the toolset version if the build is done with Visual Studio + # 2017 or later, unless explicitly told not to + if use_msvc14x_toolset_ver + if cpp_compiler.version().version_compare('>=19.30') + msvc14x_toolset_ver = '-vc143' + elif cpp_compiler.version().version_compare('>=19.20') + msvc14x_toolset_ver = '-vc142' + elif cpp_compiler.version().version_compare('>=19.10') + msvc14x_toolset_ver = '-vc141' + endif + endif +endif + +# Set compiler warnings. +# Meson warns if any of the /W1, /W2, /W3, /W4, /Wall, -Wall, -Wextra, -Werror +# compiler options are added with add_project_arguments(). +# Avoid such warnings, when possible. +# See _warn_about_builtin_args() in meson/mesonbuild/interpreter/interpreter.py. +warning_flags = [] +if cpp_warnings == 'min' + if warning_level == 0 + warning_flags = is_msvc ? ['/W2'] : ['-Wall'] + endif +elif cpp_warnings == 'max' or cpp_warnings == 'fatal' + if warning_level < 3 + warning_flags = is_msvc ? ['/W4'] : ['-pedantic', '-Wall', '-Wextra'] + endif + if not is_msvc + warning_flags += '-Wformat-security -Wsuggest-override -Wshadow -Wno-long-long'.split() + endif + if cpp_warnings == 'fatal' + if not werror + warning_flags += is_msvc ? ['/WX'] : ['-Werror'] + endif + deprecations = 'G PANGO GLIBMM SIGCXX'.split() + foreach d : deprecations + warning_flags += '-D@0@_DISABLE_DEPRECATED'.format(d) + endforeach + endif +endif + +warning_flags = cpp_compiler.get_supported_arguments(warning_flags) +add_project_arguments(warning_flags, language: 'cpp') + +# MSVC: Ignore warnings that aren't really harmful, but make those +# that should not be overlooked stand out. +if is_msvc + disable_warnings_list = [ + '/FImsvc_recommended_pragmas.h', # Turn off harmless warnings but make potentially + # dangerous ones glaring, distributed with GLib + '/EHsc', # avoid warnings caused by exception handling model used + '/utf-8', # Avoid C4819 unicode conversion warnings when building on CJK locales + ] + if host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64' + # 'var' : conversion from 'size_t' to 'type', possible loss of data (applies on 64-bit builds) + disable_warnings_list += '/wd4267' + endif + add_project_arguments( + cpp_compiler.get_supported_arguments(disable_warnings_list), + language: 'cpp' + ) +endif + +# add_dist_script() is not allowed in a subproject if meson.version() < 0.58.0. +can_add_dist_script = not meson.is_subproject() or meson.version().version_compare('>= 0.58.0') + +subdir('tools/extra_defs_gen') +subdir('pango') +subdir('MSVC_NMake/pangomm') +subdir('pango/pangomm') +subdir('docs/reference') + +if can_add_dist_script + # Add a ChangeLog file to the distribution directory. + meson.add_dist_script( + python3, dist_changelog_py, + project_source_root, + ) + + # Don't distribute these files. + dont_distribute = [ + 'pangomm.doap', + '.gitlab-ci.yml', + ] + # Add build scripts to the distribution directory, and delete .gitignore + # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. + meson.add_dist_script( + python3, dist_build_scripts_py, + project_source_root, + 'untracked' / 'build_scripts', + dont_distribute, + ) +endif + +if meson.is_subproject() + pkgconfig_vars = { + 'gmmprocm4dir': project_source_root / 'tools' / 'm4', + 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html', + 'htmlrefpub': 'https://gnome.pages.gitlab.gnome.org/' + pkg_conf_data.get_unquoted('PACKAGE_TARNAME') + } + if build_documentation + pkgconfig_vars += {'doxytagfile': tag_file.full_path()} + # May be used in a main project. + global_tag_file_target = tag_file + endif + pangomm_dep = declare_dependency( + dependencies: pangomm_own_dep, + variables: pkgconfig_vars, + ) + + # A main project that looks for pangomm_pcname.pc shall find pangomm_dep. + meson.override_dependency(pangomm_pcname, pangomm_dep) +endif + +# Print a summary. +real_maintainer_mode = '' +if maintainer_mode_opt == 'if-git-build' + real_maintainer_mode = ' (@0@)'.format(maintainer_mode) +endif + +real_build_documentation = '' +if build_documentation_opt == 'if-maintainer-mode' + real_build_documentation = ' (@0@)'.format(build_documentation) +endif + +summary = [ + '', + '------', + meson.project_name() + ' ' + meson.project_version(), + '', + ' Maintainer mode: @0@@1@'.format(maintainer_mode_opt, real_maintainer_mode), + ' Compiler warnings: @0@ (warning_level: @1@, werror: @2@)'. \ + format(cpp_warnings, warning_level, werror), + ' Build deprecated API: @0@'.format(build_deprecated_api), + 'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation), + 'Directories:', + ' prefix: @0@'.format(install_prefix), + ' includedir: @0@'.format(install_prefix / install_includedir), + ' includepangommdir: @0@'.format(install_prefix / install_includedir / pangomm_pcname), + ' libdir: @0@'.format(install_prefix / install_libdir), + ' includeconfigdir: @0@'.format(install_prefix / install_includeconfigdir), + ' m4dir: @0@'.format(install_prefix / install_m4dir), + ' pkgconfigdir: @0@'.format(install_prefix / install_pkgconfigdir), + ' datadir: @0@'.format(install_prefix / install_datadir), + ' docdir: @0@'.format(install_prefix / install_docdir), + ' devhelpdir: @0@'.format(install_prefix / install_devhelpdir), +] +if maintainer_mode + summary += [ + ' gmmprocdir: @0@'.format(gmmproc_dir), + ] +endif +summary += ['------'] + +message('\n'.join(summary)) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..940a398 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,12 @@ +option('maintainer-mode', type: 'combo', choices: ['false', 'if-git-build', 'true'], + value: 'if-git-build', description: 'Generate source code from .hg and .ccg files') +option('warnings', type: 'combo', choices: ['no', 'min', 'max', 'fatal'], value: 'min', + description: 'Compiler warning level') +option('dist-warnings', type: 'combo', choices: ['no', 'min', 'max', 'fatal'], value: 'fatal', + description: 'Compiler warning level when a tarball is created') +option('build-deprecated-api', type: 'boolean', value: true, + description: 'Build deprecated API and include it in the library') +option('build-documentation', type: 'combo', choices: ['false', 'if-maintainer-mode', 'true'], + value: 'if-maintainer-mode', description: 'Build and install the documentation') +option('msvc14x-parallel-installable', type: 'boolean', value: true, + description: 'Use separate DLL and LIB filenames for Visual Studio 2017 and 2019') diff --git a/pango/meson.build b/pango/meson.build new file mode 100644 index 0000000..377d74a --- /dev/null +++ b/pango/meson.build @@ -0,0 +1,52 @@ +# pango + +# Input: install_prefix, install_datadir, install_includedir, +# pangomm_pcname, pangomm_api_version, pangomm_requires, +# install_pkgconfigdir, install_libdir, build_deprecated_api, +# pangomm_major_version, pangomm_minor_version, pangomm_micro_version, +# msvc14x_toolset_ver +# Output: pkg_conf_data, install_includeconfigdir, pangommconfig_h_meson + +pkg_conf_data = configuration_data() +pkg_conf_data.set('prefix', install_prefix) +pkg_conf_data.set('exec_prefix', '${prefix}') +pkg_conf_data.set('libdir', '${exec_prefix}' / install_libdir) +pkg_conf_data.set('datarootdir', '${prefix}' / install_datadir) +pkg_conf_data.set('datadir', '${datarootdir}') +pkg_conf_data.set('includedir', '${prefix}' / install_includedir) +pkg_conf_data.set('srcdir', meson.current_source_dir()) +pkg_conf_data.set('PACKAGE_TARNAME', meson.project_name()) +pkg_conf_data.set('PACKAGE_VERSION', meson.project_version()) +pkg_conf_data.set('PANGOMM_MODULE_NAME', pangomm_pcname) +pkg_conf_data.set('PANGOMM_API_VERSION', pangomm_api_version) +pkg_conf_data.set('PANGOMM_MODULES', pangomm_requires) +pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) + +if not build_deprecated_api + pkg_conf_data.set('PANGOMM_DISABLE_DEPRECATED', true) +endif +pkg_conf_data.set('PANGOMM_MAJOR_VERSION', pangomm_major_version) +pkg_conf_data.set('PANGOMM_MINOR_VERSION', pangomm_minor_version) +pkg_conf_data.set('PANGOMM_MICRO_VERSION', pangomm_micro_version) + +configure_file( + input: 'pangomm.pc.in', + output: pangomm_pcname + '.pc', + configuration: pkg_conf_data, + install_dir: install_pkgconfigdir, +) + +configure_file( + input: 'pangomm-uninstalled.pc.in', + output: pangomm_pcname + '-uninstalled.pc', + configuration: pkg_conf_data, +) + +pangommconfig_h_meson = files('pangommconfig.h.meson') +install_includeconfigdir = install_libdir / pangomm_pcname / 'include' +configure_file( + input: pangommconfig_h_meson, + output: 'pangommconfig.h', + configuration: pkg_conf_data, + install_dir: install_includeconfigdir, +) diff --git a/pango/pangomm-uninstalled.pc.in b/pango/pangomm-uninstalled.pc.in new file mode 100644 index 0000000..4eaea77 --- /dev/null +++ b/pango/pangomm-uninstalled.pc.in @@ -0,0 +1,10 @@ +doxytagfile=${pc_top_builddir}/docs/reference/@PANGOMM_MODULE_NAME@.tag +htmlrefpub=http://library.gnome.org/devel/@PACKAGE_TARNAME@/unstable/ + +Name: pangomm +Description: C++ binding for Pango, not installed +Version: @PACKAGE_VERSION@ +URL: http://www.gtkmm.org/ +Requires: @PANGOMM_MODULES@ +Libs: ${pc_top_builddir}/${pcfiledir}/pangomm/libpangomm@MSVC_TOOLSET_VER@-@PANGOMM_API_VERSION@.la +Cflags: -I${pc_top_builddir}/${pcfiledir} -I${pc_top_builddir}/${pcfiledir}/@srcdir@ diff --git a/pango/pangomm.h b/pango/pangomm.h new file mode 100644 index 0000000..ca5afc1 --- /dev/null +++ b/pango/pangomm.h @@ -0,0 +1,85 @@ +/* pangomm - a C++ wrapper for the GLib toolkit + * + * Copyright 2002 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _PANGOMM_H +#define _PANGOMM_H + +/** @mainpage pangomm Reference Manual + * + * @section description Description + * + * pangomm is the official C++ interface for the Pango font layout library. + * See, for instance, the Pango::Layout class. + * + * @section basics Basic usage + * + * Include the pangomm header: + * @code + * #include + * @endcode + * This includes every header installed by pangomm, so can slow down + * compilation, but suffices for this simple example. Assuming that your + * program source file is @c program.cc, compile it with: + * @code + * g++ program.cc -o program `pkg-config --cflags --libs pangomm-2.48` + * @endcode + * If your version of g++ is not C++17-compliant by default, + * add the @c -std=c++17 option. + * + * If you use Meson, include the following + * in @c meson.build: + * @code + * pangomm_dep = dependency('pangomm-2.48') + * program_name = 'program' + * cpp_sources = [ 'program.cc' ] + * executable(program_name, + * cpp_sources, + * dependencies: [ pangomm_dep ] + * ) + * @endcode + * + * Alternatively, if using autoconf, use the following in @c configure.ac: + * @code + * PKG_CHECK_MODULES([PANGOMM], [pangomm-2.48]) + * @endcode + * Then use the generated @c PANGOMM_CFLAGS and @c PANGOMM_LIBS variables in + * the project @c Makefile.am files. For example: + * @code + * program_CPPFLAGS = $(PANGOMM_CFLAGS) + * program_LDADD = $(PANGOMM_LIBS) + * @endcode + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* _PANGOMM_H */ diff --git a/pango/pangomm.pc.in b/pango/pangomm.pc.in new file mode 100644 index 0000000..c2e6a5c --- /dev/null +++ b/pango/pangomm.pc.in @@ -0,0 +1,21 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +datarootdir=@datarootdir@ +datadir=@datadir@ +includedir=@includedir@ + +gmmprocm4dir=${libdir}/@PANGOMM_MODULE_NAME@/proc/m4 + +docdir=${datarootdir}/doc/@PANGOMM_MODULE_NAME@ +doxytagfile=${docdir}/reference/@PANGOMM_MODULE_NAME@.tag +htmlrefdir=${docdir}/reference/html +htmlrefpub=https://gnome.pages.gitlab.gnome.org/@PACKAGE_TARNAME@/ + +Name: pangomm +Description: C++ binding for Pango +Version: @PACKAGE_VERSION@ +URL: https://www.gtkmm.org/ +Requires: @PANGOMM_MODULES@ +Libs: -L${libdir} -lpangomm@MSVC_TOOLSET_VER@-@PANGOMM_API_VERSION@ +Cflags: -I${includedir}/@PANGOMM_MODULE_NAME@ -I${libdir}/@PANGOMM_MODULE_NAME@/include diff --git a/pango/pangomm/Makefile.am b/pango/pangomm/Makefile.am new file mode 100644 index 0000000..f1ac2b7 --- /dev/null +++ b/pango/pangomm/Makefile.am @@ -0,0 +1,32 @@ +## Copyright (c) 2009 Openismus GmbH +## +## This file is part of pangomm. +## +## pangomm is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 2.1 of the License, +## or (at your option) any later version. +## +## pangomm is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . + +lib_LTLIBRARIES = libpangomm-@PANGOMM_API_VERSION@.la + +include $(srcdir)/../src/filelist.am +include $(srcdir)/filelist.gmake.am + +include $(top_srcdir)/build/compile-binding.am + +local_cppflags = $(binding_includes) $(binding_cppflags) -DPANGOMM_BUILD=1 + +AM_CPPFLAGS = $(local_cppflags) $(GTHREAD_CFLAGS) $(PANGOMM_CFLAGS) +AM_CXXFLAGS = $(PANGOMM_WXXFLAGS) + +libpangomm_@PANGOMM_API_VERSION@_la_SOURCES = $(binding_sources) +libpangomm_@PANGOMM_API_VERSION@_la_LDFLAGS = -no-undefined -version-info $(LIBPANGOMM_SO_VERSION) +libpangomm_@PANGOMM_API_VERSION@_la_LIBADD = $(PANGOMM_LIBS) diff --git a/pango/pangomm/cairofontmapimpl.cc b/pango/pangomm/cairofontmapimpl.cc new file mode 100644 index 0000000..a76441b --- /dev/null +++ b/pango/pangomm/cairofontmapimpl.cc @@ -0,0 +1,41 @@ +/* Copyright (C) 2021 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include +#include // std::move() + +namespace Pango +{ +CairoFontMapImpl::CairoFontMapImpl(PangoFontMap* castitem) +: Glib::ObjectBase(nullptr), FontMap(castitem) +{} + +CairoFontMapImpl::CairoFontMapImpl(CairoFontMapImpl&& src) noexcept +: CairoFontMap(std::move(src)), + FontMap(std::move(src)) +{} + +CairoFontMapImpl& CairoFontMapImpl::operator=(CairoFontMapImpl&& src) noexcept +{ + CairoFontMap::operator=(std::move(src)); + FontMap::operator=(std::move(src)); + return *this; +} + +CairoFontMapImpl::~CairoFontMapImpl() noexcept +{} + +} // namespace Pango diff --git a/pango/pangomm/cairofontmapimpl.h b/pango/pangomm/cairofontmapimpl.h new file mode 100644 index 0000000..9b06122 --- /dev/null +++ b/pango/pangomm/cairofontmapimpl.h @@ -0,0 +1,63 @@ +#ifndef _PANGO_CAIROFONTMAPIMPL_H +#define _PANGO_CAIROFONTMAPIMPL_H + +/* Copyright (C) 2021 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include +#include +#include + +namespace Pango +{ + +/** %Gdk::CairoFontMapImpl is a Pango::FontMap that implements the Pango::CairoFontMap interface. + * + * The PangoCairoFontMap interface can be implemented by C classes that + * derive from PangoFontMap. No public %Pango class implements PangoCairoFontMap. + * Some %Pango functions, such as pango_cairo_font_map_get_default(), return an object + * of a class which is derived from PangoFontMap and implements PangoCairoFontMap. + * Since that C class is not public, it's not wrapped in a C++ class. + * A C object of such a class can be wrapped in a %Pango::CairoFontMapImpl object. + * %Pango::CairoFontMapImpl does not directly correspond to any %Pango class. + * + * This class is intended only for wrapping C objects returned from %Pango functions. + * + * @see Pango::CairoFontMap::get_default() + * @newin{2,50} + */ +class PANGOMM_API CairoFontMapImpl : public CairoFontMap, public FontMap +{ +#ifndef DOXYGEN_SHOULD_SKIP_THIS +protected: + explicit CairoFontMapImpl(PangoFontMap* castitem); + friend class FontMap_Class; + + // noncopyable + CairoFontMapImpl(const CairoFontMapImpl&) = delete; + CairoFontMapImpl& operator=(const CairoFontMapImpl&) = delete; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + CairoFontMapImpl(CairoFontMapImpl&& src) noexcept; + CairoFontMapImpl& operator=(CairoFontMapImpl&& src) noexcept; + + ~CairoFontMapImpl() noexcept override; +}; + +} // namespace Pango + +#endif /* _PANGO_CAIROFONTMAPIMPL_H */ diff --git a/pango/pangomm/filelist.am b/pango/pangomm/filelist.am new file mode 100644 index 0000000..2138b30 --- /dev/null +++ b/pango/pangomm/filelist.am @@ -0,0 +1,13 @@ +## This file is part of pangomm. + +files_built_cc = $(files_hg:.hg=.cc) wrap_init.cc +files_built_h = $(files_hg:.hg=.h) +files_extra_cc = \ + cairofontmapimpl.cc \ + init.cc +files_extra_h = \ + cairofontmapimpl.h \ + init.h \ + types.h \ + wrap_init.h +files_extra_ph = diff --git a/pango/pangomm/filelist.gmake.am b/pango/pangomm/filelist.gmake.am new file mode 100644 index 0000000..527f580 --- /dev/null +++ b/pango/pangomm/filelist.gmake.am @@ -0,0 +1,6 @@ +## This file is part of pangomm. + +include $(top_srcdir)/pango/pangomm/filelist.am + +# Split out from $(top_srcdir)/pango/pangomm/filelist.am +files_built_ph = $(patsubst %.hg,private/%_p.h,$(files_hg)) diff --git a/pango/pangomm/init.cc b/pango/pangomm/init.cc new file mode 100644 index 0000000..3dc4f2b --- /dev/null +++ b/pango/pangomm/init.cc @@ -0,0 +1,34 @@ +// -*- c++ -*- +/* $Id: init.cc 89 2003-12-08 04:46:54Z murrayc $ */ + +/* Copyright (C) 2003 The pangomm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +namespace Pango +{ + +void init() +{ + Glib::init(); + Pango::wrap_init(); +} + +} // namespace Pango + diff --git a/pango/pangomm/init.h b/pango/pangomm/init.h new file mode 100644 index 0000000..f4c8f3d --- /dev/null +++ b/pango/pangomm/init.h @@ -0,0 +1,43 @@ +// -*- c++ -*- +#ifndef _PANGOMM_INIT_H +#define _PANGOMM_INIT_H + +/* $Id: init.h 89 2003-12-08 04:46:54Z murrayc $ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +namespace Pango +{ + +/** Initialize pangomm. + * You may call this more than once. + * You do not need to call this if you are using Gtk::Main, + * because it calls it for you. + */ +PANGOMM_API +void init(); + +} // namespace Pango + + + +#endif // _PANGOMM_INIT_H + + diff --git a/pango/pangomm/meson.build b/pango/pangomm/meson.build new file mode 100644 index 0000000..5e0d2bc --- /dev/null +++ b/pango/pangomm/meson.build @@ -0,0 +1,246 @@ +# pango/pangomm + +# Input: pangomm_build_dep, pangomm_pcname, maintainer_mode, project_source_root, +# generate_binding_py, m4_files, pangomm_libversion, install_includedir, +# python3, pangomm_rc, dummy_header_py, gmmproc_dir, msvc14x_toolset_ver, +# can_add_dist_script +# Output: hg_ccg_basenames, extra_h_files, built_h_file_targets, built_files_root, +# pangomm_own_dep + +defs_basefiles = [ + 'pango.defs', + 'pango_methods.defs', + 'pango_enums.defs', + 'pango_vfuncs.defs', + 'pango_extra_objects.defs', + 'pango_docs.xml', + 'pango_docs_override.xml', +] + +defs_files = [] +foreach file : defs_basefiles + defs_files += '..' / 'src' / file +endforeach + +hg_ccg_basenames = [ + 'attributes', + 'attriter', + 'attrlist', + 'cairofontmap', + 'color', + 'context', + 'coverage', + 'font', + 'fontdescription', + 'fontface', + 'fontfamily', + 'fontmap', + 'fontmetrics', + 'fontset', + 'glyph', + 'glyphitem', + 'glyphstring', + 'item', + 'language', + 'layout', + 'layoutiter', + 'layoutline', + 'rectangle', + 'renderer', + 'tabarray', +] + +extra_cc_files = [ + 'cairofontmapimpl.cc', + 'init.cc', +] + +extra_h_files = [ + 'cairofontmapimpl.h', + 'init.h', + 'types.h', + 'wrap_init.h', +] + +install_headers('..' / 'pangomm.h', subdir: pangomm_pcname) +install_headers(extra_h_files, subdir: pangomm_pcname / 'pangomm') + +untracked_pangomm = 'untracked' / 'pango' / 'pangomm' +rel_untracked_pangomm = '..' / '..' / untracked_pangomm +src_untracked_pangomm = project_source_root / untracked_pangomm + +pangomm_cpp_args = [ '-DPANGOMM_BUILD=1' ] + +extra_pangomm_objects = [] + +# Build the .rc file for Windows builds and link to it +if host_machine.system() == 'windows' + windows = import('windows') + pangomm_res = windows.compile_resources(pangomm_rc) + extra_pangomm_objects += pangomm_res +endif + +pangomm_libname = meson.project_name() + msvc14x_toolset_ver + '-' + pangomm_api_version + +if maintainer_mode + + # Maintainer mode. Generate .h and .cc files from .hg and .ccg files in ../src. + + # docs/reference/meson.build needs these. + built_files_root = project_build_root + built_h_file_targets = [] + + # Force meson+ninja to generate source files before anything is compiled. + # Compilation must depend on these targets. + built_cc_file_targets = [] + + hg_files = [] + foreach file : hg_ccg_basenames + hg_files += '..' / 'src' / file + '.hg' + endforeach + + # Create wrap_init.cc in project_build_root/pango/pangomm. + built_cc_file_targets += custom_target('wrap_init.cc', + input: hg_files, + output: 'wrap_init.cc', + command: [ + python3, generate_binding_py, 'generate_wrap_init', + gmmproc_dir, + '@OUTPUT@', + 'Pango', # namespace + '@INPUT@', + ], + build_by_default: maintainer_mode, + install: false, + ) + + # Create .h/_p.h/.cc files from .hg/.ccg files in project_build_root/pango/pangomm. + foreach file : hg_ccg_basenames + hg_file = '..' / 'src' / file + '.hg' + ccg_file = '..' / 'src' / file + '.ccg' + built_file_target = custom_target(file + '.cc', + input: [hg_file, ccg_file], + output: [file + '.stamp', file + '.cc', file + '.h'], + command: [ + python3, generate_binding_py, 'gmmproc', + gmmproc_dir, + '@OUTPUT0@', + file, + meson.current_source_dir() / '..' / 'src', + project_source_root / 'tools' / 'm4', + ], + depend_files: defs_files + m4_files, + build_by_default: maintainer_mode, + install: false, + ) + built_cc_file_targets += built_file_target[1] + built_h_file_targets += built_file_target[2] + endforeach + + # Create dummy_header.h, depending on all generated headers. + # It's created if it does not exist, but it's never updated. + # It guarantees that all generated headers are built before pangomm_library + # is built, at the same time avoiding unnecessary recompilations. + # If built_h_file_targets would be listed as sources to pangomm_library, + # all generated .cc files could be recompiled if one generated .h file has + # been changed. + built_dummy_h_file_target = custom_target('dummy_header.h', + input: built_h_file_targets, + output: 'dummy_header.h', + command: [ + python3, dummy_header_py, + '@OUTPUT@', + ], + build_by_default: maintainer_mode, + install: false, + ) + + extra_include_dirs = ['..'] + + pangomm_library = library(pangomm_libname, extra_pangomm_objects, + built_cc_file_targets, extra_cc_files, built_dummy_h_file_target, + version: pangomm_libversion, + darwin_versions: macos_darwin_versions, + implicit_include_directories: false, + include_directories: extra_include_dirs, + cpp_args: pangomm_cpp_args, + dependencies: pangomm_build_dep, + install: true, + ) + + built_h_cc_dir = meson.current_build_dir() + +else # not maintainer_mode + + # Not maintainer mode. Compile built source code files in + # project_source_root/untracked/pango/pangomm. + + # docs/reference/meson.build needs these. + built_files_root = project_source_root / 'untracked' + built_h_file_targets = [] + + # Two cases: + # 1. The source code comes from a tarball, where the built files + # are stored in project_source_root/untracked. + # There are no built files in the build tree. + # 2. Files have been built in the build tree. Then maintainer_mode has + # been changed from true to false. Files that are missing or not up to date + # in project_source_root/untracked are copied from the build tree. + + # Try to copy built source code files to the source tree. + run_command( + python3, generate_binding_py, 'copy_built_files', + meson.current_build_dir(), + src_untracked_pangomm, + hg_ccg_basenames, + check: true, + ) + + built_cc_files = [ rel_untracked_pangomm / 'wrap_init.cc' ] + foreach file : hg_ccg_basenames + built_cc_files += rel_untracked_pangomm / file + '.cc' + endforeach + + extra_include_dirs = [ '..', '..' / '..' / 'untracked' / 'pango' ] + + pangomm_library = library(pangomm_libname, extra_pangomm_objects, + built_cc_files, extra_cc_files, + version: pangomm_libversion, + darwin_versions: macos_darwin_versions, + implicit_include_directories: false, + include_directories: extra_include_dirs, + cpp_args: pangomm_cpp_args, + dependencies: pangomm_build_dep, + install: true + ) + + built_h_cc_dir = src_untracked_pangomm + +endif + +# Install built .h and _p.h files. +meson.add_install_script( + python3, generate_binding_py, 'install_built_h_files', + built_h_cc_dir, + install_includedir / pangomm_pcname / 'pangomm', # subdir below {prefix} + hg_ccg_basenames +) + +if can_add_dist_script + # Distribute built files. + meson.add_dist_script( + python3, generate_binding_py, 'dist_built_files', + built_h_cc_dir, + untracked_pangomm, + hg_ccg_basenames, + ) +endif + +# This is part of pangomm_dep, when pangomm is a subproject. +# It can also be used if there are example programs and test programs to build. +pangomm_own_dep = declare_dependency( + sources: built_h_file_targets, + link_with: pangomm_library, + include_directories: extra_include_dirs, + dependencies: pangomm_build_dep +) diff --git a/pango/pangomm/types.h b/pango/pangomm/types.h new file mode 100644 index 0000000..72de3d9 --- /dev/null +++ b/pango/pangomm/types.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _PANGOMM_TYPES_H +#define _PANGOMM_TYPES_H + +#include + +namespace Pango +{ + +typedef PangoMatrix Matrix; + +} // namespace Pango + +#endif /* _PANGOMM_TYPES_H */ diff --git a/pango/pangomm/wrap_init.h b/pango/pangomm/wrap_init.h new file mode 100644 index 0000000..5d91c83 --- /dev/null +++ b/pango/pangomm/wrap_init.h @@ -0,0 +1,35 @@ +#ifndef _PANGOMM_WRAP_INIT_H +#define _PANGOMM_WRAP_INIT_H + +/* wrap_init.h + * + * Copyright (C) 1998-2001 The Gtk-- Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// wrap_init.cc is generated by tools/generate_wrap_init.pl + +#include + +namespace Pango +{ + +PANGOMM_API +void wrap_init(); + +} /* namespace Pango */ + +#endif // _PANGOMM_WRAP_INIT_H diff --git a/pango/pangommconfig.h.in b/pango/pangommconfig.h.in new file mode 100644 index 0000000..710d38d --- /dev/null +++ b/pango/pangommconfig.h.in @@ -0,0 +1,37 @@ +/* This file is part of pangomm. */ +#ifndef PANGOMM_PANGOMMCONFIG_H_INCLUDED +#define PANGOMM_PANGOMMCONFIG_H_INCLUDED + +#include + +/* Define to omit deprecated API from the library. */ +#undef PANGOMM_DISABLE_DEPRECATED + +/* Major version number of pangomm. */ +#undef PANGOMM_MAJOR_VERSION + +/* Micro version number of pangomm. */ +#undef PANGOMM_MICRO_VERSION + +/* Minor version number of pangomm. */ +#undef PANGOMM_MINOR_VERSION + +/* Enable DLL-specific stuff only when not building a static library */ +#if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB) +# define PANGOMM_DLL 1 +#endif + +#ifdef PANGOMM_DLL +# if defined(PANGOMM_BUILD) +# define PANGOMM_API __declspec(dllexport) +# elif !defined (__GNUC__) +# define PANGOMM_API __declspec(dllimport) +# else /* don't dllimport classes/methods on GCC/MinGW */ +# define PANGOMM_API +# endif /* PANGOMM_BUILD - _WINDLL */ +#else +/* Build a static library or a non-native-Windows library */ +# define PANGOMM_API +#endif /* PANGOMM_DLL */ + +#endif /* !PANGOMM_PANGOMMCONFIG_H_INCLUDED */ diff --git a/pango/pangommconfig.h.meson b/pango/pangommconfig.h.meson new file mode 100644 index 0000000..58fa4d8 --- /dev/null +++ b/pango/pangommconfig.h.meson @@ -0,0 +1,37 @@ +/* This file is part of pangomm. */ +#ifndef PANGOMM_PANGOMMCONFIG_H_INCLUDED +#define PANGOMM_PANGOMMCONFIG_H_INCLUDED + +#include + +/* Define to omit deprecated API from the library. */ +#mesondefine PANGOMM_DISABLE_DEPRECATED + +/* Major version number of pangomm. */ +#mesondefine PANGOMM_MAJOR_VERSION + +/* Minor version number of pangomm. */ +#mesondefine PANGOMM_MINOR_VERSION + +/* Micro version number of pangomm. */ +#mesondefine PANGOMM_MICRO_VERSION + +/* Enable DLL-specific stuff only when not building a static library */ +#if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB) +# define PANGOMM_DLL 1 +#endif + +#ifdef PANGOMM_DLL +# if defined(PANGOMM_BUILD) +# define PANGOMM_API __declspec(dllexport) +# elif !defined (__GNUC__) +# define PANGOMM_API __declspec(dllimport) +# else /* don't dllimport classes/methods on GCC/MinGW */ +# define PANGOMM_API +# endif /* PANGOMM_BUILD - _WINDLL */ +#else +/* Build a static library or a non-native-Windows library */ +# define PANGOMM_API +#endif /* PANGOMM_DLL */ + +#endif /* !PANGOMM_PANGOMMCONFIG_H_INCLUDED */ diff --git a/pango/src/Makefile.am b/pango/src/Makefile.am new file mode 100644 index 0000000..be5cccf --- /dev/null +++ b/pango/src/Makefile.am @@ -0,0 +1,24 @@ +## Copyright (c) 2009 Openismus GmbH +## +## This file is part of pangomm. +## +## pangomm is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 2.1 of the License, +## or (at your option) any later version. +## +## pangomm is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . + +binding_name = pangomm +wrap_init_flags = --namespace=Pango --parent_dir=pangomm +codegen_srcdir = $(top_srcdir)/tools + +include $(srcdir)/filelist.am +include $(top_srcdir)/tools/m4/filelist.am +include $(top_srcdir)/build/generate-binding.am diff --git a/pango/src/attributes.ccg b/pango/src/attributes.ccg new file mode 100644 index 0000000..ecec4f7 --- /dev/null +++ b/pango/src/attributes.ccg @@ -0,0 +1,468 @@ +/* + * + * Copyright 2002 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +namespace Pango +{ + +Attribute::Attribute() +: + gobject_(0) +{} + +Attribute::Attribute(const Attribute& src) +: + gobject_(src.gobject_ ? pango_attribute_copy(src.gobject_) : nullptr) +{} + +Attribute::Attribute(PangoAttribute* castitem, bool take_copy) +{ + if(take_copy) + { + if(castitem) + gobject_ = pango_attribute_copy(castitem); + else + gobject_ = nullptr; + } + else + { + // It was given to us by a function which has already made a copy for us to keep. + gobject_ = castitem; + } +} + +Attribute::~Attribute() +{ + if(gobject_) + pango_attribute_destroy(gobject_); + gobject_ = nullptr; +} + +Attribute& Attribute::operator=(const Attribute& src) +{ + auto* const new_gobject = (src.gobject_ ? pango_attribute_copy(src.gobject_) : nullptr); + + if(gobject_) + pango_attribute_destroy(gobject_); + gobject_ = new_gobject; + + return *this; +} + +AttrType Attribute::get_type() const +{ + return (AttrType) ((gobject_) ? gobj()->klass->type : PANGO_ATTR_INVALID); +} + +AttrType Attribute::register_type(const Glib::ustring& name) +{ + return (AttrType)pango_attr_type_register(name.c_str()); +} + +Glib::ustring Attribute::get_type_name(AttrType type) +{ + return Glib::convert_const_gchar_ptr_to_ustring(pango_attr_type_get_name((PangoAttrType)type)); +} + +AttrString Attribute::create_attr_family(const Glib::ustring& family) +{ + return Glib::wrap((PangoAttrString*)pango_attr_family_new(family.c_str())); +} + +AttrLanguage Attribute::create_attr_language(const Language& language) +{ + return Glib::wrap((PangoAttrLanguage*)pango_attr_language_new(const_cast(language.gobj()))); +} + +AttrColor Attribute::create_attr_foreground(guint16 red, guint16 green, guint16 blue) +{ + return Glib::wrap((PangoAttrColor*)pango_attr_foreground_new(red, green, blue)); +} + +AttrColor Attribute::create_attr_background(guint16 red, guint16 green, guint16 blue) +{ + return Glib::wrap((PangoAttrColor*)pango_attr_background_new(red, green, blue)); +} + +AttrInt Attribute::create_attr_foreground_alpha(guint16 alpha) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_foreground_alpha_new(alpha)); +} + +AttrInt Attribute::create_attr_background_alpha(guint16 alpha) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_background_alpha_new(alpha)); +} + +AttrInt Attribute::create_attr_size(int size) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_size_new(size)); +} + +AttrInt Attribute::create_attr_size_absolute(int size) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_size_new_absolute(size)); +} + +AttrInt Attribute::create_attr_style(Style style) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_style_new((PangoStyle)style)); +} + +AttrInt Attribute::create_attr_weight(Weight weight) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_weight_new((PangoWeight)weight)); +} + +AttrInt Attribute::create_attr_variant(Variant variant) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_variant_new((PangoVariant)variant)); +} + +AttrInt Attribute::create_attr_stretch(Stretch stretch) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_stretch_new((PangoStretch)stretch)); +} + +AttrFontDesc Attribute::create_attr_font_desc(const FontDescription& desc) +{ + return Glib::wrap((PangoAttrFontDesc*)pango_attr_font_desc_new(desc.gobj())); +} + +AttrInt Attribute::create_attr_underline(Underline underline) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_underline_new((PangoUnderline)underline)); +} + +AttrColor Attribute::create_attr_underline_color(guint16 red, guint16 green, guint16 blue) +{ + return Glib::wrap((PangoAttrColor*)pango_attr_underline_color_new(red, green, blue)); +} + +AttrInt Attribute::create_attr_overline(Overline overline) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_overline_new((PangoOverline)overline)); +} + +AttrColor Attribute::create_attr_overline_color(guint16 red, guint16 green, guint16 blue) +{ + return Glib::wrap((PangoAttrColor*)pango_attr_overline_color_new(red, green, blue)); +} + +AttrInt Attribute::create_attr_strikethrough(bool strikethrough) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_strikethrough_new(strikethrough)); +} + +AttrColor Attribute::create_attr_strikethrough_color(guint16 red, guint16 green, guint16 blue) +{ + return Glib::wrap((PangoAttrColor*)pango_attr_strikethrough_color_new(red, green, blue)); +} + +AttrInt Attribute::create_attr_rise(int rise) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_rise_new(rise)); +} + +AttrInt Attribute::create_attr_baseline_shift(int shift) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_baseline_shift_new(shift)); +} + +AttrInt Attribute::create_attr_font_scale(FontScale scale) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_font_scale_new((PangoFontScale)scale)); +} + +AttrFloat Attribute::create_attr_scale(double scale_factor) +{ + return Glib::wrap((PangoAttrFloat*)pango_attr_scale_new(scale_factor)); +} + +AttrInt Attribute::create_attr_fallback(bool enable_fallback) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_fallback_new(enable_fallback)); +} + +AttrInt Attribute::create_attr_letter_spacing(int letter_spacing) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_letter_spacing_new(letter_spacing)); +} + +AttrShape Attribute::create_attr_shape(const Rectangle& ink_rect, const Rectangle& logical_rect) +{ + return Glib::wrap((PangoAttrShape*)pango_attr_shape_new(ink_rect.gobj(), logical_rect.gobj())); +} + +AttrInt Attribute::create_attr_gravity(Gravity gravity) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_gravity_new((PangoGravity)gravity)); +} + +AttrInt Attribute::create_attr_gravity_hint(GravityHint hint) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_gravity_hint_new((PangoGravityHint)hint)); +} + +AttrString Attribute::create_attr_font_features(const Glib::ustring& features) +{ + return Glib::wrap((PangoAttrString*)pango_attr_font_features_new(features.c_str())); +} + +AttrInt Attribute::create_attr_allow_breaks(bool allow_breaks) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_allow_breaks_new(allow_breaks)); +} + +AttrInt Attribute::create_attr_word() +{ + return Glib::wrap((PangoAttrInt*)pango_attr_word_new()); +} + +AttrInt Attribute::create_attr_sentence() +{ + return Glib::wrap((PangoAttrInt*)pango_attr_sentence_new()); +} + +AttrInt Attribute::create_attr_insert_hyphens(bool insert_hyphens) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_insert_hyphens_new(insert_hyphens)); +} + +AttrInt Attribute::create_attr_show(ShowFlags show) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_show_new((PangoShowFlags)show)); +} + +AttrFloat Attribute::create_attr_line_height(double factor) +{ + return Glib::wrap((PangoAttrFloat*)pango_attr_line_height_new(factor)); +} + +AttrInt Attribute::create_attr_line_height_absolute(int height) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_line_height_new_absolute(height)); +} + +AttrInt Attribute::create_attr_text_transform(TextTransform transform) +{ + return Glib::wrap((PangoAttrInt*)pango_attr_text_transform_new((PangoTextTransform)transform)); +} + + +AttrString::AttrString() +{} + +AttrString::AttrString(const AttrString& src) +: + Attribute(src) +{} + +AttrString::AttrString(PangoAttrString* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrString& AttrString::operator=(const AttrString& src) +{ + Attribute::operator=(src); + return *this; +} + +void AttrString::set_string(const Glib::ustring& str) +{ + g_free(gobj()->value); + gobj()->value = g_strdup(str.c_str()); +} + + +AttrLanguage::AttrLanguage() +{} + +AttrLanguage::AttrLanguage(const AttrLanguage& src) +: + Attribute(src) +{} + +AttrLanguage::AttrLanguage(PangoAttrLanguage* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrLanguage& AttrLanguage::operator=(const AttrLanguage& src) +{ + Attribute::operator=(src); + return *this; +} + + +AttrColor::AttrColor() +{} + +AttrColor::AttrColor(const AttrColor& src) +: + Attribute(src) +{} + +AttrColor::AttrColor(PangoAttrColor* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrColor& AttrColor::operator=(const AttrColor& src) +{ + Attribute::operator=(src); + return *this; +} + + +AttrInt::AttrInt() +{} + +AttrInt::AttrInt(const AttrInt& src) +: + Attribute(src) +{} + +AttrInt::AttrInt(PangoAttrInt* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrInt& AttrInt::operator=(const AttrInt& src) +{ + Attribute::operator=(src); + return *this; +} + + +AttrFloat::AttrFloat() +{} + +AttrFloat::AttrFloat(const AttrFloat& src) +: + Attribute(src) +{} + +AttrFloat::AttrFloat(PangoAttrFloat* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrFloat& AttrFloat::operator=(const AttrFloat& src) +{ + Attribute::operator=(src); + return *this; +} + + +AttrFontDesc::AttrFontDesc() +{} + +AttrFontDesc::AttrFontDesc(const AttrFontDesc& src) +: + Attribute(src) +{} + +AttrFontDesc::AttrFontDesc(PangoAttrFontDesc* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrFontDesc& AttrFontDesc::operator=(const AttrFontDesc& src) +{ + Attribute::operator=(src); + return *this; +} + +void AttrFontDesc::set_desc(const FontDescription& desc) +{ + pango_font_description_free(gobj()->desc); + gobj()->desc = pango_font_description_copy(desc.gobj()); +} + + +AttrShape::AttrShape() +{} + +AttrShape::AttrShape(const AttrShape& src) +: + Attribute(src) +{} + +AttrShape::AttrShape(PangoAttrShape* castitem, bool take_copy) +: + Attribute((PangoAttribute*)castitem, take_copy) +{} + +AttrShape& AttrShape::operator=(const AttrShape& src) +{ + Attribute::operator=(src); + return *this; +} + +} //namespace Pango + + +namespace Glib +{ + +Pango::Attribute wrap(PangoAttribute* object, bool take_copy) +{ + return Pango::Attribute(object, take_copy); +} + +Pango::AttrString wrap(PangoAttrString* object, bool take_copy) +{ + return Pango::AttrString(object, take_copy); +} + +Pango::AttrLanguage wrap(PangoAttrLanguage* object, bool take_copy) +{ + return Pango::AttrLanguage(object, take_copy); +} + +Pango::AttrColor wrap(PangoAttrColor* object, bool take_copy) +{ + return Pango::AttrColor(object, take_copy); +} + +Pango::AttrInt wrap(PangoAttrInt* object, bool take_copy) +{ + return Pango::AttrInt(object, take_copy); +} + +Pango::AttrFloat wrap(PangoAttrFloat* object, bool take_copy) +{ + return Pango::AttrFloat(object, take_copy); +} + +Pango::AttrFontDesc wrap(PangoAttrFontDesc* object, bool take_copy) +{ + return Pango::AttrFontDesc(object, take_copy); +} + +Pango::AttrShape wrap(PangoAttrShape* object, bool take_copy) +{ + return Pango::AttrShape(object, take_copy); +} + +} //namespace Glib + diff --git a/pango/src/attributes.hg b/pango/src/attributes.hg new file mode 100644 index 0000000..16e3af6 --- /dev/null +++ b/pango/src/attributes.hg @@ -0,0 +1,769 @@ +/* attributes.h + * + * Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ +/** Pango::AttrType distinguishes between different types of attributes. + * Along with the predefined values, it is possible to allocate additional values for + * custom attributes using Pango::Attribute::register_type(). The predefined values + * are given below. The type of structure used to store the + * attribute is listed in parentheses after the description. + */ +_WRAP_ENUM(AttrType, PangoAttrType, s#^SCALE$#SCALE_FACTOR#, decl_prefix PANGOMM_API) +// gcc complains that SCALE shadows the global constant SCALE from font.h. + +_WRAP_ENUM(Underline, PangoUnderline, decl_prefix PANGOMM_API) +_WRAP_ENUM(Overline, PangoOverline, decl_prefix PANGOMM_API) +_WRAP_ENUM(ShowFlags, PangoShowFlags, decl_prefix PANGOMM_API) +_WRAP_ENUM(TextTransform, PangoTextTransform, newin "2,50", decl_prefix PANGOMM_API) +_WRAP_ENUM(BaselineShift, PangoBaselineShift, CONV_TO_INT, newin "2,50", decl_prefix PANGOMM_API) +_WRAP_ENUM(FontScale, PangoFontScale, newin "2,50", decl_prefix PANGOMM_API) + +/** A Pango::LogAttr stores information about the attributes of a single character. + */ +typedef PangoLogAttr LogAttr; + + +class PANGOMM_API AttrString; +class PANGOMM_API AttrLanguage; +class PANGOMM_API AttrColor; +class PANGOMM_API AttrInt; +class PANGOMM_API AttrFloat; +class PANGOMM_API AttrFontDesc; +class PANGOMM_API AttrShape; + +enum class PANGOMM_API GravityHint; + +/** The %Pango::Attribute structure represents the common portions of all attributes. + * Particular types of attributes derive this class. It holds the range in which the + * value in the type-specific part of the attribute applies. + * + * 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 Pango::Layout. + */ +class PANGOMM_API Attribute +{ + _CLASS_GENERIC(Attribute, PangoAttribute) + _IGNORE(pango_attribute_copy, pango_attribute_destroy, pango_attribute_init) + +public: + /** Constructs an invalid attribute. + */ + Attribute(); + + Attribute(const Attribute& src); + explicit Attribute(PangoAttribute* castitem, bool take_copy=true); + ~Attribute(); + + Attribute& operator=(const Attribute& src); + + /** Gets the type ID for this attribute. + * @return The type ID for this attribute or ATTR_INVALID if the attribute is invalid. + */ + AttrType get_type() const; + + /** Allocate a new attribute type ID. + * + * The attribute type name can be accessed later by using get_type_name(). + * + * @param name An identifier for the type. + * @return The new type ID. + */ + static AttrType register_type(const Glib::ustring& name); + + /** Fetches the attribute type name passed in when registering the type using + * register_type(). + * + * @newin{2,46} + * + * @param type An attribute type ID to fetch the name for. + * @return The type ID name (which may be an empty string), or an empty string + * if @a type is a built-in Pango attribute type or invalid. + */ + static Glib::ustring get_type_name(AttrType type); + // _WRAP_METHOD() can't be used here, because glibmm/tools/defs_gen/h2def.py + // assumes that pango_attr_type_get_name() is a method of a class named PangoAttrType. + + /** Gets the start index of the range. + * @return The start index of the range. + */ + _MEMBER_GET(start_index, start_index, unsigned int, guint) + + /** Gets the end index of the range. The character at this index is not included in the range. + * @return The end index of the range. + */ + _MEMBER_GET(end_index, end_index, unsigned int, guint) + + /** Sets the start index of the range. + * @param value The new start index (in bytes). + */ + _MEMBER_SET(start_index, start_index, unsigned int, guint) + + /** Sets the end index of the range. The character at this index is not included in the range. + * @param value The new end index (in bytes). + */ + _MEMBER_SET(end_index, end_index, unsigned int, guint) + + _WRAP_METHOD(bool equal(const Attribute& attr2) const, pango_attribute_equal) + + /// Provides access to the underlying C GObject. + PangoAttribute* gobj() { return gobject_; } + /// Provides access to the underlying C GObject. + const PangoAttribute* gobj() const { return gobject_; } + + /** Create a new font family attribute. + * @param family The family or comma separated list of families. + * @return An attribute of type AttrString. + */ + static AttrString create_attr_family(const Glib::ustring& family); + + /** Create a new language tag attribute + * @param language The language tag. + * @return An attribute of type AttrLanguage. + */ + static AttrLanguage create_attr_language(const Language& language); + + /** Create a new foreground color attribute. + * @param red The red value (ranging from 0 to 65535). + * @param green The green value (ranging from 0 to 65535). + * @param blue The blue value (ranging from 0 to 65535). + * @return An attribute of type AttrColor. + */ + static AttrColor create_attr_foreground(guint16 red, guint16 green, guint16 blue); + + /** Create a new background color attribute. + * @param red The red value (ranging from 0 to 65535). + * @param green The green value (ranging from 0 to 65535). + * @param blue The blue value (ranging from 0 to 65535). + * @return An attribute of type AttrColor. + */ + static AttrColor create_attr_background(guint16 red, guint16 green, guint16 blue); + + /** Create a new foreground alpha attribute. + * @param alpha The alpha value, between 1 and 65536. + */ + static AttrInt create_attr_foreground_alpha(guint16 alpha); + + /** Create a new background alpha attribute. + * @param alpha The alpha value, between 1 and 65536. + */ + static AttrInt create_attr_background_alpha(guint16 alpha); + + /** Create a new font-size attribute. + * @param size The font size, in 1024ths of a point. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_size(int size); + + /** Create a new font-size attribute. + * + * @newin{2,42} + * + * @param size The font size, in 1024ths of a device unit. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_size_absolute(int size); + + /** Create a new font slant style attribute. + * @param style The slant style. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_style(Style style); + + /** Create a new font weight attribute. + * @param weight The weight. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_weight(Weight weight); + + /** Create a new font variant attribute (normal or small caps). + * @param variant The variant. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_variant(Variant variant); + + /** Create a new font stretch attribute. + * @param stretch The stretch. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_stretch(Stretch stretch); + + /** Create a new font description attribute. + * This attribute allows setting family, style, weight, variant, stretch, and size simultaneously. + * @param desc The font description. + * @return An attribute of type AttrFontDesc. + */ + static AttrFontDesc create_attr_font_desc(const FontDescription& desc); + + /** Create a new underline-style object. + * @param underline The underline style. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_underline(Underline underline); + + /** Create a new underline color attribute. + * This attribute modifies the color of underlines. If not set, + * underlines will use the foreground color. + * + * @newin{2,42} + * + * @param red The red value (ranging from 0 to 65535). + * @param green The green value (ranging from 0 to 65535). + * @param blue The blue value (ranging from 0 to 65535). + * @return An attribute of type AttrColor. + */ + static AttrColor create_attr_underline_color(guint16 red, guint16 green, guint16 blue); + + /** Create a new overline-style object. + * + * @newin{2,46} + * + * @param overline The overline style. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_overline(Overline overline); + + /** Create a new overline color attribute. + * + * This attribute modifies the color of overlines. If not set, + * overlines will use the foreground color. + * + * @newin{2,46} + * + * @param red The red value (ranging from 0 to 65535). + * @param green The green value (ranging from 0 to 65535). + * @param blue The blue value (ranging from 0 to 65535). + * @return An attribute of type AttrColor. + */ + static AttrColor create_attr_overline_color(guint16 red, guint16 green, guint16 blue); + + /** Create a new font strike-through attribute. + * @param strikethrough True indicates the text should be struck-through. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_strikethrough(bool strikethrough); + + /** Create a new strikethrough color attribute. + * This attribute modifies the color of strikethrough lines. If not set, + * strikethrough lines will use the foreground color. + * + * @newin{2,42} + * + * @param red The red value (ranging from 0 to 65535). + * @param green The green value (ranging from 0 to 65535). + * @param blue The blue value (ranging from 0 to 65535). + * @return An attribute of type AttrColor. + */ + static AttrColor create_attr_strikethrough_color(guint16 red, guint16 green, guint16 blue); + + /** Create a new baseline displacement attribute. + * @param rise The amount that the text should be displaced vertically, in 10'000ths of an em. Positive values displace the text upwards. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_rise(int rise); + + /** Create a new baseline displacement attribute. + * + * The effect of this attribute is to shift the baseline of a run, + * relative to the run of preceding run. + * + * @newin{2,50} + * + * @param shift Either a Pango::BaselineShift enumeration value or an absolute value (> 1024) + * in %Pango units, relative to the baseline of the previous run. + * Positive values displace the text upwards. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_baseline_shift(int shift); + + /** Create a new font scale attribute. + * + * The effect of this attribute is to change the font size of a run, + * relative to the size of preceding run. + * + * @newin{2,50} + * + * @param scale A Pango::FontScale value, which indicates font size change relative + * to the size of the previous run. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_font_scale(FontScale scale); + + /** Create a new font size scale attribute. + * The base font for the affected text will have its size multiplied by scale_factor. + * @param scale_factor Factor to scale the font. + * @return An attribute of type AttrFloat. + */ + static AttrFloat create_attr_scale(double scale_factor); + + /** 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. + * + * @newin{2,42} + * + * @param enable_fallback true if we should fall back on other fonts + * for characters the active font is missing. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_fallback(bool enable_fallback); + + /** Create a new letter-spacing attribute. + * + * @newin{2,42} + * + * @param letter_spacing Amount of extra space to add between graphemes + * of the text, in Pango units. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_letter_spacing(int letter_spacing); + + /** Create a new shape attribute. + * A shape is used to impose a particular ink and logical rect on the result of shaping a particular glyph. + * This might be used, for instance, for embedding a picture or a widget inside a PangoLayout. + * @param ink_rect Ink rectangle to assign to each character. + * @param logical_rect Logical rectangle assign to each character. + * @return An attribute of type AttrShape. + */ + static AttrShape create_attr_shape(const Rectangle& ink_rect, const Rectangle& logical_rect); + + /** Create a new gravity attribute. + * + * @newin{2,42} + * + * @param gravity The gravity value; should not be Pango::Gravity::AUTO. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_gravity(Gravity gravity); + + /** Create a new gravity hint attribute. + * + * @newin{2,42} + * + * @param hint The gravity hint value. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_gravity_hint(GravityHint hint); + + /** Create a new font features tag attribute. + * + * @newin{2,42} + * + * @param features A string with OpenType font features, in CSS syntax. + * @return An attribute of type AttrString. + */ + static AttrString create_attr_font_features(const Glib::ustring& features); + + /** Create a new allow-breaks attribute. + * + * If breaks are disabled, the range will be kept in a + * single run, as far as possible. + * + * @newin{2,46} + * + * @param allow_breaks true if line breaks are allowed. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_allow_breaks(bool allow_breaks); + + /** Marks the range of the attribute as a single word. + * + * Note that this may require adjustments to word and + * sentence classification around the range. + * + * @newin{2,50} + * + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_word(); + + /** Marks the range of the attribute as a single sentence. + * + * Note that this may require adjustments to word and + * sentence classification around the range. + * + * @newin{2,50} + * + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_sentence(); + + /** Create a new insert-hyphens attribute. + * + * Pangomm will insert hyphens when breaking lines in the middle + * of a word. This attribute can be used to suppress the hyphen. + * + * @newin{2,46} + * + * @param insert_hyphens true if hyphens should be inserted. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_insert_hyphens(bool insert_hyphens); + + /** Create a new attribute that influences how invisible characters are rendered. + * + * @newin{2,46} + * + * @param flags Pango::ShowFlags to apply. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_show(ShowFlags show); + + /** Modify the height of logical line extents by a factor. + * + * This affects the values returned by Pango::LayoutLine::get_extents(), + * Pango::LayoutLine::get_pixel_extents() and Pango::LayoutIter::get_line_extents(). + * + * @newin{2,50} + * + * @param factor The scaling factor to apply to the logical height. + * @return An attribute of type AttrFloat. + */ + static AttrFloat create_attr_line_height(double factor); + + /** Override the height of logical line extents to be @a height. + * + * This affects the values returned by Pango::LayoutLine::get_extents(), + * Pango::LayoutLine::get_pixel_extents() and Pango::LayoutIter::get_line_extents(). + * + * @newin{2,50} + * + * @param height The line height, in Pango::SCALE-ths of a point. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_line_height_absolute(int height); + + /** Create a new attribute that influences how characters are transformed during shaping. + * + * @newin{2,50} + * + * @param transform Pango::TextTransform to apply. + * @return An attribute of type AttrInt. + */ + static AttrInt create_attr_text_transform(TextTransform transform); + + _IGNORE(pango_attribute_as_string, pango_attribute_as_language, pango_attribute_as_int) + _IGNORE(pango_attribute_as_size, pango_attribute_as_float, pango_attribute_as_color) + _IGNORE(pango_attribute_as_font_desc, pango_attribute_as_shape, pango_attribute_as_font_features) + +protected: + PangoAttribute* gobject_; +}; + +/** @relates Pango::Attribute */ +inline bool operator==(const Attribute& lhs, const Attribute& rhs) +{ + return lhs.equal(rhs); +} + +/** @relates Pango::Attribute */ +inline bool operator!=(const Attribute& lhs, const Attribute& rhs) +{ + return !lhs.equal(rhs); +} + + +/** A Pango::AttrString is used to represent an attribute with a string value. + */ +class PANGOMM_API AttrString : public Attribute +{ + _CLASS_GENERIC(AttrString, PangoAttrString) + +protected: + AttrString(); +public: + AttrString(const AttrString& src); + explicit AttrString(PangoAttrString* castitem, bool take_copy=true); + + AttrString& operator=(const AttrString& src); + + /** Gets the string which is the value of the attribute. + * @return The string value of the attribute. + */ + _MEMBER_GET(string, value, Glib::ustring, const char*) + + /** Sets the string which is the value of the attribute. + * @param string The new string value for the attribute. + */ + void set_string(const Glib::ustring& string); + + /// Provides access to the underlying C GObject. + PangoAttrString* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrString* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrLanguage is used to represent an attribute that is a language. + */ +class PANGOMM_API AttrLanguage : public Attribute +{ + _CLASS_GENERIC(AttrLanguage, PangoAttrLanguage) + +protected: + AttrLanguage(); +public: + AttrLanguage(const AttrLanguage& src); + explicit AttrLanguage(PangoAttrLanguage* castitem, bool take_copy=true); + + AttrLanguage& operator=(const AttrLanguage& src); + + /** Gets the language which is the value of the attribute. + * @return The language tag of the attribute. + */ + _MEMBER_GET(language, value, Language, PangoLanguage*) + + /** Sets the language which is the value of the attribute. + * @param value The new language tag for the attribute. + */ + _MEMBER_SET_PTR(language, value, const Language&, PangoLanguage*) + + /// Provides access to the underlying C GObject. + PangoAttrLanguage* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrLanguage* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrColor is used to represent an attribute which is a color. + */ +class PANGOMM_API AttrColor : public Attribute +{ + _CLASS_GENERIC(AttrColor, PangoAttrColor) + +protected: + AttrColor(); +public: + AttrColor(const AttrColor& src); + explicit AttrColor(PangoAttrColor* castitem, bool take_copy=true); + + AttrColor& operator=(const AttrColor& src); + + /** Gets the color which is the value of the attribute. + * @return The color value of the attribute. + */ + _MEMBER_GET(color, color, Color, PangoColor) + + /** Sets the color which is the value of the attribute. + * @param value The new color value for the attribute. + */ + _MEMBER_SET(color, color, Color, PangoColor) + + /// Provides access to the underlying C GObject. + PangoAttrColor* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrColor* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrInt is used to represent an attribute with an integer or enumeration value. + */ +class PANGOMM_API AttrInt : public Attribute +{ + _CLASS_GENERIC(AttrInt, PangoAttrInt) + +protected: + AttrInt(); +public: + AttrInt(const AttrInt& src); + explicit AttrInt(PangoAttrInt* castitem, bool take_copy=true); + + AttrInt& operator=(const AttrInt& src); + + /** Gets the integer value of the attribute. + * @return The integer value of the attribute. + */ + _MEMBER_GET(value, value, int, int) + + /** Sets the integer value of the attribute. + * @param value The new integer value for the attribute. + */ + _MEMBER_SET(value, value, int, int) + + /// Provides access to the underlying C GObject. + PangoAttrInt* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrInt* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrFloat is used to represent an attribute with a float or double value. + */ +class PANGOMM_API AttrFloat : public Attribute +{ + _CLASS_GENERIC(AttrFloat, PangoAttrFloat) + +protected: + AttrFloat(); +public: + AttrFloat(const AttrFloat& src); + explicit AttrFloat(PangoAttrFloat* castitem, bool take_copy=true); + + AttrFloat& operator=(const AttrFloat& src); + + /** Gets the floating point value of the attribute. + * @return The floating point value of the attribute. + */ + _MEMBER_GET(value, value, double, double) + + /** Sets the floating point value of the attribute. + * @param value The new floating point value for the attribute. + */ + _MEMBER_SET(value, value, double, double) + + /// Provides access to the underlying C GObject. + PangoAttrFloat* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrFloat* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrFontDesc is used to represent an attribute that sets all aspects of the font description at once. + */ +class PANGOMM_API AttrFontDesc : public Attribute +{ + _CLASS_GENERIC(AttrFontDesc, PangoAttrFontDesc) + +protected: + AttrFontDesc(); +public: + AttrFontDesc(const AttrFontDesc& src); + explicit AttrFontDesc(PangoAttrFontDesc* castitem, bool take_copy=true); + + AttrFontDesc& operator=(const AttrFontDesc& src); + + /** Gets the font description which is the value of the attribute. + * @return The font description of the attribute. + */ + _MEMBER_GET(desc, desc, FontDescription, PangoFontDescription*) + + /** Sets the font description which is the value of the attribute. + * @param desc The new font description for the attribute. + */ + void set_desc(const FontDescription& desc); + + /// Provides access to the underlying C GObject. + PangoAttrFontDesc* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrFontDesc* gobj() const { return reinterpret_cast(gobject_); } +}; + + +/** A Pango::AttrShape structure is used to represent an attribute which imposes shape restrictions. + */ +class PANGOMM_API AttrShape : public Attribute +{ + _CLASS_GENERIC(AttrShape, PangoAttrShape) + +protected: + AttrShape(); +public: + AttrShape(const AttrShape& src); + explicit AttrShape(PangoAttrShape* castitem, bool take_copy=true); + + AttrShape& operator=(const AttrShape& src); + + /** Gets the ink rectangle to restrict to. + * @return The ink rectangle of the attribute. + */ + _MEMBER_GET(ink_rect, ink_rect, Rectangle, PangoRectangle) + + /** Gets the logical rectangle to restrict to. + * @return The logical rectangle of the attribute. + */ + _MEMBER_GET(logical_rect, logical_rect, Rectangle, PangoRectangle) + + /** Sets the ink rectangle to restrict to. + * @param value The new ink rectangle for the attribute. + */ + _MEMBER_SET(ink_rect, ink_rect, Rectangle, PangoRectangle) + + /** Sets the logical rectangle to restrict to. + * @param value The new logical rectangle for the attribute. + */ + _MEMBER_SET(logical_rect, logical_rect, Rectangle, PangoRectangle) + + /// Provides access to the underlying C GObject. + PangoAttrShape* gobj() { return reinterpret_cast(gobject_); } + /// Provides access to the underlying C GObject. + const PangoAttrShape* gobj() const { return reinterpret_cast(gobject_); } +}; + + +struct AttributeTraits +{ + typedef Pango::Attribute CppType; + typedef const PangoAttribute* CType; + typedef PangoAttribute* CTypeNonConst; + + static CType to_c_type (const CppType& obj) { return obj.gobj(); } + static CType to_c_type (CType ptr) { return ptr; } + static CppType to_cpp_type (CType ptr) { return CppType(const_cast(ptr), true); } + static void release_c_type (CType ptr) { pango_attribute_destroy(const_cast(ptr)); } +}; + +} // namespace Pango + + +namespace Glib +{ + +/** @relates Pango::Attribute */ +PANGOMM_API +Pango::Attribute wrap(PangoAttribute* object, bool take_copy = false); + +/** @relates Pango::AttrString */ +PANGOMM_API +Pango::AttrString wrap(PangoAttrString* object, bool take_copy = false); + +/** @relates Pango::AttrLanguage */ +PANGOMM_API +Pango::AttrLanguage wrap(PangoAttrLanguage* object, bool take_copy = false); + +/** @relates Pango::AttrColor */ +PANGOMM_API +Pango::AttrColor wrap(PangoAttrColor* object, bool take_copy = false); + +/** @relates Pango::AttrInt */ +PANGOMM_API +Pango::AttrInt wrap(PangoAttrInt* object, bool take_copy = false); + +/** @relates Pango::AttrFloat */ +PANGOMM_API +Pango::AttrFloat wrap(PangoAttrFloat* object, bool take_copy = false); + +/** @relates Pango::AttrFontDesc */ +PANGOMM_API +Pango::AttrFontDesc wrap(PangoAttrFontDesc* object, bool take_copy = false); + +/** @relates Pango::AttrShape */ +PANGOMM_API +Pango::AttrShape wrap(PangoAttrShape* object, bool take_copy = false); + +} //namespace Glib + diff --git a/pango/src/attriter.ccg b/pango/src/attriter.ccg new file mode 100644 index 0000000..f46712d --- /dev/null +++ b/pango/src/attriter.ccg @@ -0,0 +1,153 @@ +/* + * + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +AttrIter::AttrIter() +: + gobject_(0) +{} + +AttrIter::AttrIter(const AttrIter& src) +: + gobject_(src.gobject_ ? pango_attr_iterator_copy(src.gobject_) : nullptr) +{} + +AttrIter::AttrIter(PangoAttrIterator* castitem, bool take_copy) +{ + if(take_copy) + { + if(castitem) + gobject_ = pango_attr_iterator_copy(castitem); + else + gobject_ = nullptr; + } + else + { + gobject_ = castitem; + } +} + +AttrIter::~AttrIter() +{ + if(gobject_) + pango_attr_iterator_destroy(gobject_); +} + +AttrIter& AttrIter::operator=(const AttrIter& src) +{ + auto* const new_gobject = (src.gobject_ ? pango_attr_iterator_copy(src.gobject_) : nullptr); + + if(gobject_) + pango_attr_iterator_destroy(gobject_); + gobject_ = new_gobject; + + return *this; +} + +AttrIter& AttrIter::operator++() +{ + next(); + return *this; +} + +const AttrIter AttrIter::operator++(int) +{ + AttrIter previous(*this); + next(); + return previous; +} + +/* operator bool() cannot be implemented to work properly if a Pango::AttrIter is created + * from an already invalid PangoAttrIterator* because there is no way to validate it. + * Otherwise the iterator can only become invalid after some call to Pango::AttrIter::next() + * in which case gobject_ is destroyed thus marking the iterator as invalid. + */ +AttrIter::operator bool() const +{ + return (gobject_ != nullptr); +} + +bool AttrIter::next() +{ + if(!pango_attr_iterator_next(gobj())) + { + pango_attr_iterator_destroy(gobject_); + gobject_ = nullptr; // Mark as invalid. There is no other way to determine whether the iterator is valid later. + return false; + } + else + return true; +} + +FontDescription AttrIter::get_font_desc() const +{ + FontDescription desc; + pango_attr_iterator_get_font(const_cast(gobj()), desc.gobj(), 0, 0); + + // See pango ref docs for pango_attr_iterator_get_font. + pango_font_description_set_family(desc.gobj(), pango_font_description_get_family(desc.gobj())); + + return desc; +} + +Language AttrIter::get_language() const +{ + FontDescription desc; + PangoLanguage* language = nullptr; + + pango_attr_iterator_get_font(const_cast(gobj()), desc.gobj(), &language, 0); + + return Language(language, true); +} + +using SListHandler_Attribute = Glib::SListHandler; + +std::vector AttrIter::get_extra_attrs() const +{ + FontDescription desc; + GSList* extra_attrs = nullptr; + + pango_attr_iterator_get_font(const_cast(gobj()), desc.gobj(), 0, &extra_attrs); + + return SListHandler_Attribute::slist_to_vector(extra_attrs, Glib::OWNERSHIP_DEEP); +} + +std::vector AttrIter::get_attrs() const +{ + auto attrs = pango_attr_iterator_get_attrs( const_cast(gobj()) ); + return SListHandler_Attribute::slist_to_vector(attrs, Glib::OWNERSHIP_DEEP); +} + + +} /* namespace Pango */ + + +namespace Glib +{ + +Pango::AttrIter wrap(PangoAttrIterator* object, bool take_copy) +{ + return Pango::AttrIter(object, take_copy); +} + +} /* namespace Glib */ + diff --git a/pango/src/attriter.hg b/pango/src/attriter.hg new file mode 100644 index 0000000..07b4810 --- /dev/null +++ b/pango/src/attriter.hg @@ -0,0 +1,114 @@ +/* attriter.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +/** A Pango::AttrIter is used to represent an iterator through a Pango::AttrList. + * A new iterator is created with Pango::AttrList::get_iter(). Once the iterator is created, + * it can be advanced through the style changes in the text using Pango::AttrIter::next(). + * At each style change, the range of the current style segment and the attributes currently in effect can be queried. + */ +class PANGOMM_API AttrIter +{ + _CLASS_GENERIC(AttrIter, PangoAttrIterator) + _IGNORE(pango_attr_iterator_copy, pango_attr_iterator_destroy, pango_attr_iterator_next, pango_attr_iterator_get_font) +public: + typedef std::forward_iterator_tag iterator_category; + typedef int difference_type; + +protected: + AttrIter(); + +public: + explicit AttrIter(PangoAttrIterator* castitem, bool take_copy=true); + AttrIter(const AttrIter& src); + + ~AttrIter(); + + AttrIter& operator=(const AttrIter& src); + + /** Advance the iterator until the next change of style. + * The iterator becomes invalid if the end of the list is reached. + * @return The iterator itself. + */ + AttrIter& operator++(); + + const AttrIter operator++(int); + + /** Check whether the iterator is valid. + * @return true if the iterator is valid. + */ + explicit operator bool() const; + + /** The same as operator++(). + * @return false if the end of the list is reached. + */ + bool next(); + + _WRAP_METHOD(void get_range(int& start, int& end) const, pango_attr_iterator_range) + _WRAP_METHOD(Attribute get_attribute(AttrType type) const, pango_attr_iterator_get) + + /** Get the font description used at the current iterator position. + * @return The font description used at the current iterator position. + */ + FontDescription get_font_desc() const; + + /** Gets the language tag used at current iterator position. + * @return The language tag or an empty Pango::Language object if non is found. + */ + Language get_language() const; + + /** Gets a list of non-font attributes at the the current iterator position. + * Only the highest priority value of each attribute will be added to this list. + * @return The list of non-font attributes at the current iterator position. + */ + std::vector get_extra_attrs() const; + + /** Gets a list all attributes a the current position of the + * iterator. + * + * @result A list of all attributes for the current range. + */ + std::vector get_attrs() const; + _IGNORE(pango_attr_iterator_get_attrs) + + PangoAttrIterator* gobj() { return gobject_; } + const PangoAttrIterator* gobj() const { return gobject_; } + +protected: + PangoAttrIterator* gobject_; +}; + +} // namespace Pango + + +namespace Glib +{ + +/** @relates Pango::AttrIter */ +PANGOMM_API +Pango::AttrIter wrap(PangoAttrIterator* object, bool take_copy=false); + +} // namespace Glib + diff --git a/pango/src/attrlist.ccg b/pango/src/attrlist.ccg new file mode 100644 index 0000000..0bbc1e8 --- /dev/null +++ b/pango/src/attrlist.ccg @@ -0,0 +1,73 @@ +/* + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +using SListHandler_Attribute = Glib::SListHandler; + +AttrList::AttrList(const Glib::ustring& markup_text, gunichar accel_marker) +{ + gboolean bTest = pango_parse_markup(markup_text.c_str(), -1 /* means null-terminated */, accel_marker, + &gobject_, 0, 0, 0); + if(bTest == FALSE) + gobject_ = nullptr; +} + +AttrList::operator bool() const +{ + return gobj() != nullptr; +} + +AttrList::AttrList(const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& accel_char) +{ + //initialize output parameters: + text.erase(); + accel_char = 0; + + gchar* pchText = nullptr; + gboolean bTest = pango_parse_markup(markup_text.c_str(), -1 /* means null-terminated */, accel_marker, + &gobject_, &pchText, &accel_char, 0); + if(bTest == FALSE) + { + gobject_ = nullptr; + } + else + { + text = pchText; + g_free(pchText); + } +} + +void AttrList::insert(Attribute& attr) +{ + pango_attr_list_insert(gobj(), pango_attribute_copy(attr.gobj())); +} + +void AttrList::insert_before(Attribute& attr) +{ + pango_attr_list_insert_before(gobj(), pango_attribute_copy(attr.gobj())); +} + +void AttrList::change(Attribute& attr) +{ + pango_attr_list_change(gobj(), pango_attribute_copy(attr.gobj())); +} + +} /* namespace Pango */ diff --git a/pango/src/attrlist.hg b/pango/src/attrlist.hg new file mode 100644 index 0000000..d001398 --- /dev/null +++ b/pango/src/attrlist.hg @@ -0,0 +1,99 @@ +/* attrlist.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +/** A %Pango::AttrList 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::AttrList::change(), the overlap between properties will meet stricter criteria. + * + * Since the %Pango::AttrList 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 %Pango::AttrList for more than one paragraph of text. + * + * When obtaining an %AttrList, you should check that it is valid. For instance, if(attrlist). + */ +class PANGOMM_API AttrList +{ + _CLASS_BOXEDTYPE(AttrList, PangoAttrList, pango_attr_list_new, pango_attr_list_copy, pango_attr_list_unref, PANGOMM_API) + _IGNORE(pango_attr_list_copy, pango_attr_list_ref, pango_attr_list_unref) +public: + /** Constructs an attribute list by parsing a marked-up text (see markup format). + * If @a accel_marker is nonzero, the given character will mark the character + * following it as an accelerator. For example, the accel marker might be an + * ampersand or underscore. All characters marked as an accelerator will receive + * a Pango::UNDERLINE_LOW attribute. + * Two @a accel_marker characters following each other + * produce a single literal @a accel_marker character. + * + * @param markup_text Markup to parse (see markup format). + * @param accel_marker Character that precedes an accelerator, or 0 for none. + */ + explicit AttrList(const Glib::ustring& markup_text, gunichar accel_marker=0); + + /** Constructs an attribute list by parsing a marked-up text (see markup format). + * @a text is set to the plaintext string. + * If @a accel_marker is nonzero, the given character will mark the character + * following it as an accelerator. For example, the accel marker might be an + * ampersand or underscore. All characters marked as an accelerator will receive + * a Pango::UNDERLINE_LOW attribute. The first character so marked will be + * returned in @a accel_char. Two @a accel_marker characters following each other + * produce a single literal @a accel_marker character. + * + * @param markup_text Markup to parse (see markup format). + * @param accel_marker Character that precedes an accelerator, or 0 for none. + * @param text Return location for text with tags stripped. + * @param accel_char Return location for accelerator char. + */ + AttrList(const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& accel_char); + + ///Tests whether the %AttrList is valid. + explicit operator bool() const; + + void insert(Attribute& attr); + _IGNORE(pango_attr_list_insert) // hand code because we need to pass a copy of the attribute + void insert_before(Attribute& attr); + _IGNORE(pango_attr_list_insert_before) // hand code because we need to pass a copy of the attribute + void change(Attribute& attr); + _IGNORE(pango_attr_list_change) // hand code because we need to pass a copy of the attribute + _WRAP_METHOD(void splice(AttrList& other, int pos, int len), pango_attr_list_splice) + _WRAP_METHOD(void update(int pos, int remove, int add), pango_attr_list_update, newin "2,50") + +#m4 _CONVERSION(`GSList*',`std::vector',`SListHandler_Attribute::slist_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector get_attributes() const, pango_attr_list_get_attributes, newin "2,50") + + _WRAP_METHOD(bool equal(const AttrList& other_list) const, pango_attr_list_equal, newin "2,50") + _WRAP_METHOD(Glib::ustring to_string() const, pango_attr_list_to_string, newin "2,50") + // Don't replace from_string() by a constructor. A call to such a constructor would be + // ambiguous because of AttrList(markup_text, accel_marker=0). +#m4 _CONVERSION(`PangoAttrList*',`AttrList',`AttrList($3, false)') + _WRAP_METHOD(static AttrList from_string(const Glib::ustring& text), pango_attr_list_from_string, newin "2,50") + _WRAP_METHOD(AttrIter get_iter(), pango_attr_list_get_iterator) + + //TODO: Though it doesn't seem important: + //PangoAttrList* pango_attr_list_filter (PangoAttrList* list, PangoAttrFilterFunc func, gpointer data) +}; + +} //namespace Pango diff --git a/pango/src/cairofontmap.ccg b/pango/src/cairofontmap.ccg new file mode 100644 index 0000000..da4b125 --- /dev/null +++ b/pango/src/cairofontmap.ccg @@ -0,0 +1,19 @@ +/* + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include diff --git a/pango/src/cairofontmap.hg b/pango/src/cairofontmap.hg new file mode 100644 index 0000000..40f303d --- /dev/null +++ b/pango/src/cairofontmap.hg @@ -0,0 +1,86 @@ +/* fontmap.h + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/interface_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _PangoCairoFontMapIface PangoCairoFontMapIface; +#endif + +namespace Pango +{ + +/** %Pango::CairoFontMap is an interface implemented 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. + */ +class PANGOMM_API CairoFontMap : public Glib::Interface +{ + _CLASS_INTERFACE(CairoFontMap, PangoCairoFontMap, PANGO_CAIRO_FONT_MAP, PangoCairoFontMapIface, , , PANGOMM_API) + +public: + /** Gets a default %Pango::CairoFontMap 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 Pango::FontMap and + * %Pango::CairoFontMap API on the returned object. + * + * The default Cairo fontmap can be changed by using + * 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. + * + * To use %Pango::CairoFontMap API, do something like + * @code + * auto font_map = Pango::CairoFontMap::get_default(); + * auto cairo_font_map = std::dynamic_pointer_cast(font_map); + * if (cairo_font_map) + * cairo_font_map->do_something(); + * @endcode + * + * @newin{1,10} + * + * @return The default PangoCairo fontmap for the current thread. + */ + _WRAP_METHOD(static Glib::RefPtr get_default(), pango_cairo_font_map_get_default, refreturn) + + _WRAP_METHOD(void set_default(), pango_cairo_font_map_set_default) + +#m4 _CONVERSION(`cairo_font_type_t',`Cairo::FontType',`static_cast($3)') + _WRAP_METHOD(Cairo::FontType get_font_type() const, pango_cairo_font_map_get_font_type) + + _WRAP_METHOD(void set_resolution(double dpi), pango_cairo_font_map_set_resolution) + _WRAP_METHOD(double get_resolution() const, pango_cairo_font_map_get_resolution) + _IGNORE(pango_cairo_font_map_create_context)dnl// deprecated +}; + +} // namespace Pango diff --git a/pango/src/color.ccg b/pango/src/color.ccg new file mode 100644 index 0000000..a43853d --- /dev/null +++ b/pango/src/color.ccg @@ -0,0 +1,33 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +/* For some unknown reason pango doesn't provide pango_color_new(). Let's define an + * equivalent function ourself! */ +PangoColor* _pango_color_new() +{ + return g_new(PangoColor, 1); +} + +Color::operator bool() const +{ + return gobj() != nullptr; +} + +} /* namespace Pango */ diff --git a/pango/src/color.hg b/pango/src/color.hg new file mode 100644 index 0000000..4c9c9e0 --- /dev/null +++ b/pango/src/color.hg @@ -0,0 +1,76 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +/** A Pango::Color is used to represent a color in an uncalibrated RGB colorspace. + */ +class PANGOMM_API Color +{ + _CLASS_BOXEDTYPE_STATIC(Color, PangoColor, PANGOMM_API) + _IGNORE(pango_color_copy, pango_color_free) + +public: + + /// Tests whether the Color is valid. + explicit operator bool() const; + + /** Gets the red component of the color. + * @return The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_GET(red, red, guint16, guint16) + + /** Gets the green component of the color. + * @return The green component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_GET(green, green, guint16, guint16) + + /** Gets the blue component of the color. + * @return The blue component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_GET(blue, blue, guint16, guint16) + + /** Sets the red component of the color. + * @param value The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_SET(red, red, guint16, guint16) + + /** Sets the green component of the color. + * @param value The green component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_SET(green, green, guint16, guint16) + + /** Sets the blue component of the color. + * @param value The blue component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. + */ + _MEMBER_SET(blue, blue, guint16, guint16) + + _WRAP_METHOD(bool parse(const Glib::ustring& spec), pango_color_parse) + + _WRAP_METHOD(Glib::ustring to_string() const, pango_color_to_string) +}; + +} /* namespace Pango */ diff --git a/pango/src/context.ccg b/pango/src/context.ccg new file mode 100644 index 0000000..3d50764 --- /dev/null +++ b/pango/src/context.ccg @@ -0,0 +1,91 @@ +/* + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +namespace Pango +{ + +std::vector> Context::list_families() const +{ + //Get array: + PangoFontFamily** pFamilies = nullptr; + int n_families = 0; + pango_context_list_families(const_cast(gobj()), &pFamilies, &n_families); + + return Glib::ArrayHandler>::array_to_vector + (pFamilies, n_families, Glib::OWNERSHIP_SHALLOW); +} + +Pango::FontMetrics Context::get_metrics(const FontDescription& desc) const +{ + return FontMetrics(pango_context_get_metrics(const_cast(gobj()), desc.gobj(), nullptr)); +} + +struct ItemTraits +{ + typedef Pango::Item CppType; + typedef const PangoItem* CType; + typedef PangoItem* CTypeNonConst; + + static CType to_c_type (const CppType& obj) { return obj.gobj(); } + static CType to_c_type (CType ptr) { return ptr; } + static CppType to_cpp_type (CType ptr) { return CppType(const_cast(ptr), true); } + static void release_c_type (CType ptr) { pango_item_free(const_cast(ptr)); } +}; + +using ListHandler_Item = Glib::ListHandler; + +std::vector Context::itemize(const Glib::ustring& text, const AttrList& attrs) const +{ + return ListHandler_Item::list_to_vector( + pango_itemize(const_cast(gobj()), + text.c_str(), 0, text.bytes(), + const_cast(attrs.gobj()), nullptr), + Glib::OWNERSHIP_DEEP); +} + +std::vector Context::itemize(const Glib::ustring& text, int start_index, int length, + const AttrList& attrs, AttrIter& cached_iter) const +{ + return ListHandler_Item::list_to_vector( + pango_itemize(const_cast(gobj()), + text.c_str(), start_index, length, + const_cast(attrs.gobj()), cached_iter.gobj()), + Glib::OWNERSHIP_DEEP); +} + +void Context::update_from_cairo_context(const Cairo::RefPtr& context) +{ + pango_cairo_update_context(context->cobj(), gobj()); +} + +Matrix Context::get_matrix() const +{ + const auto* matrix = pango_context_get_matrix(const_cast(gobj())); + if(matrix) + return *matrix; + else + { + PangoMatrix identity_transform = PANGO_MATRIX_INIT; + return identity_transform; + } +} + +} /* namespace Pango */ diff --git a/pango/src/context.hg b/pango/src/context.hg new file mode 100644 index 0000000..3eddfa4 --- /dev/null +++ b/pango/src/context.hg @@ -0,0 +1,174 @@ +/* context.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include //For Matrix +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ + +_WRAP_ENUM(Direction, PangoDirection, decl_prefix PANGOMM_API) +_WRAP_ENUM(GravityHint, PangoGravityHint, decl_prefix PANGOMM_API) + + +/** A Pango::Context stores global information used to control the itemization process. + * You can retrieve a Pango::Context object with Gtk::Widget::create_pango_context() or + * Gtk::Widget::get_pango_context(). If you don't use gtkmm call some c function of the + * pango backend you intend to use and create a wrapper for the returned context, + * e.g. Glib::wrap(pango_x_get_context()). + * + * Creating a Pango::Context object is the starting point of every rendering process. + * You can either use it to create a high level Pango::Layout object which does all + * the hard work for you by passing it into + * Pango::Layout::create() or to generate glyph strings from character strings with + * the help of itemize() and Pango::Item::shape() subsequently. + * + * Which fonts are used for rendering can be influenced by setting the default + * font description, language and base direction of the context. + * + * If you want to calculate the space some text will need to be displayed you + * might find the functions of Pango::FontMetrics useful. Use get_metrics() to + * obtain the Pango::FontMetrics object for a specific Pango::FontDescription. + * For more detailed calculations in a rendering-system-independant manner + * and to determine whether specific characters can be represented by the + * font that would be used for a specific Pango::FontDescription load a + * Pango::Fontset with load_fontset() (load_font() returns the Pango::Font + * that is the closest match for a Pango::FontDescription; however that's not + * necessarily the font that will be used for rendering). + */ +class PANGOMM_API Context : public Glib::Object +{ + _CLASS_GOBJECT(Context, PangoContext, PANGO_CONTEXT, Glib::Object, GObject, , , PANGOMM_API) + _IGNORE(pango_context_set_font_map) //PANGO_ENABLE_BACKEND + _IGNORE(pango_context_list_families) +protected: + _CTOR_DEFAULT + _IGNORE(pango_context_new) + +public: + /** List all available font families for a context. + * You can specify one of these as your desired font family in the Pango::FontDesciption + * objects you use, e.g. in the default font description of the context. + * @return An array of Pango::FontFamily objects. + */ + std::vector> list_families() const; + + _IGNORE(pango_context_changed) + + _WRAP_METHOD(void set_font_map(const Glib::RefPtr& font_map), pango_context_set_font_map) + + _WRAP_METHOD(Glib::RefPtr get_font_map(), pango_context_get_font_map, refreturn) + _WRAP_METHOD(Glib::RefPtr get_font_map() const, pango_context_get_font_map, refreturn, constversion) + + _WRAP_METHOD(guint get_serial() const, pango_context_get_serial) + + _WRAP_METHOD(Glib::RefPtr load_font(const FontDescription& desc) const, pango_context_load_font) + _WRAP_METHOD(Glib::RefPtr load_fontset(const FontDescription& desc, const Language& language) const, pango_context_load_fontset) + + /** Get overall metric information for a particular font description. + * The metrics may be substantially different for different scripts. However this + * function overload returns the metrics of the entire font. + * @param desc A Pango::FontDescription object. + * @return A Pango::FontMetrics object. + */ + FontMetrics get_metrics(const FontDescription& desc) const; + _WRAP_METHOD(FontMetrics get_metrics(const FontDescription& desc, const Language& language) const, pango_context_get_metrics) + _WRAP_METHOD(void set_font_description(const FontDescription& desc), pango_context_set_font_description) + _WRAP_METHOD(FontDescription get_font_description() const, pango_context_get_font_description) + _WRAP_METHOD(Language get_language() const, pango_context_get_language) + _WRAP_METHOD(void set_language(const Language& language), pango_context_set_language) + _WRAP_METHOD(void set_base_dir(Direction direction), pango_context_set_base_dir) + _WRAP_METHOD(Direction get_base_dir() const, pango_context_get_base_dir) + + _WRAP_METHOD(void set_base_gravity(Gravity gravity), pango_context_set_base_gravity) + _WRAP_METHOD(Gravity get_base_gravity() const, pango_context_get_base_gravity) + _WRAP_METHOD(Gravity get_gravity() const, pango_context_get_gravity) + _WRAP_METHOD(void set_gravity_hint(GravityHint hint), pango_context_set_gravity_hint) + _WRAP_METHOD(GravityHint get_gravity_hint() const, pango_context_get_gravity_hint) + + _WRAP_METHOD(void set_matrix(const Matrix& matrix), pango_context_set_matrix) + + Matrix get_matrix() const; + _IGNORE(pango_context_get_matrix) + + /** Breaks a piece of text into segments with consistent directional level and shaping engine. + * Each byte of @a 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). + * @param text The text to itemize. + * @param attrs The set of attributes that apply. + * @return A list of Pango::Item objects. + */ + std::vector itemize(const Glib::ustring& text, const AttrList& attrs) const; + + /** Breaks a piece of text into segments with consistent directional level and shaping engine. + * Each byte of @a 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). + * + * @a cached_iter should be an iterator over @a attrs currently positioned at a range before + * or containing @a start_index. @a cached_iter will be advanced to the range covering the + * position just after @a start_index + @a length. (i.e. if itemizing in a loop, just keep + * passing in the same @a cached_iter). + * + * @param text The text to itemize. + * @param start_index First byte in @a text to process. + * @param length The number of bytes (not characters) to process after @a start_index. This must be >= 0. + * @param attrs The set of attributes that apply to @a text. + * @param cached_iter Cached attribute iterator. + * @return A list of Pango::Item structures. + */ + std::vector itemize(const Glib::ustring& text, int start_index, int length, + const AttrList& attrs, AttrIter& cached_iter) const; + + /** Updates a Pango Context 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. + * + * @param context A Cairo context, from CairoFontMap::create_context(). + */ + void update_from_cairo_context(const Cairo::RefPtr& context); + + + _WRAP_METHOD(void set_cairo_font_options(const Cairo::FontOptions& options), pango_cairo_context_set_font_options) + +#m4 _CONVERSION(`const cairo_font_options_t*',`Cairo::FontOptions',`Cairo::FontOptions(const_cast< cairo_font_options_t*>($3), false /* take_copy */)') + _WRAP_METHOD(Cairo::FontOptions get_font_options() const, pango_cairo_context_get_font_options) + + _WRAP_METHOD(void set_resolution(double dpi), pango_cairo_context_set_resolution) + _WRAP_METHOD(double get_resolution() const, pango_cairo_context_get_resolution) + +}; + +} /* namespace Pango */ diff --git a/pango/src/coverage.ccg b/pango/src/coverage.ccg new file mode 100644 index 0000000..cfddb8f --- /dev/null +++ b/pango/src/coverage.ccg @@ -0,0 +1,32 @@ +/* + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +using Level = Pango::Coverage::Level; + +// The g_object_ref() preprocessor macro can't be used in a _CLASS_OPAQUE_REFCOUNTED. +// The g_object_ref() function is fine. +//-- pango/pangomm/coverage.cc: In member function ‘PangoCoverage* Pango::Coverage::gobj_copy() const’: +//-- glib-2.0/gobject/gobject.h:548:28: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] +//-- 548 | #define g_object_ref(Obj) ((glib_typeof (Obj)) (g_object_ref) (Obj)) +//-- | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +//-- pango/pangomm/coverage.cc:109:3: note: in expansion of macro ‘g_object_ref’ +//-- 109 | g_object_ref(gobject); +//-- | ^~~~~~~~~~~~ +// gobject is defined as a const pointer to a non-const object (const auto). +#undef g_object_ref diff --git a/pango/src/coverage.hg b/pango/src/coverage.hg new file mode 100644 index 0000000..d1b8d04 --- /dev/null +++ b/pango/src/coverage.hg @@ -0,0 +1,54 @@ +/* coverage.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ +// PangoCoverage is a GObject since pango 1.44.0 (July 2019). +// Since that time pango_coverage_ref/unref() only call g_object_ref/unref(). +// pango_coverage_ref/unref() are deprecated since pango 1.52.0. +//TODO: When we can break ABI, make Pango::Coverage a _CLASS_GOBJECT. + +/** A Pango::Coverage represents a map from ISO-10646 character point to Pango::Coverage::Level. + * 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. Pango::Coverage holds this information. + */ +class PANGOMM_API Coverage final +{ + _CLASS_OPAQUE_REFCOUNTED(Coverage, PangoCoverage, pango_coverage_new, g_object_ref, g_object_unref, PANGOMM_API) + _IGNORE(pango_coverage_ref, pango_coverage_unref) + _IGNORE(pango_coverage_copy) + _IGNORE(pango_coverage_to_bytes, pango_coverage_from_bytes, pango_coverage_max)dnl// deprecated + +public: + _WRAP_ENUM(Level, PangoCoverageLevel, decl_prefix PANGOMM_API) + + //_WRAP_METHOD(Glib::RefPtr copy() const, pango_coverage_copy) //see above + + _WRAP_METHOD(Level get(int index) const, pango_coverage_get) + _WRAP_METHOD(void set(int index, Level level), pango_coverage_set) +}; + +} // namespace Pango diff --git a/pango/src/filelist.am b/pango/src/filelist.am new file mode 100644 index 0000000..68ec6a0 --- /dev/null +++ b/pango/src/filelist.am @@ -0,0 +1,39 @@ +## This file is part of pangomm. + +files_defs = \ + pango.defs \ + pango_methods.defs \ + pango_enums.defs \ + pango_vfuncs.defs \ + pango_extra_objects.defs \ + pango_docs.xml \ + pango_docs_override.xml + +files_hg = \ + attributes.hg \ + attriter.hg \ + attrlist.hg \ + cairofontmap.hg \ + color.hg \ + context.hg \ + coverage.hg \ + font.hg \ + fontdescription.hg \ + fontface.hg \ + fontfamily.hg \ + fontmap.hg \ + fontmetrics.hg \ + fontset.hg \ + glyph.hg \ + glyphitem.hg \ + glyphstring.hg \ + item.hg \ + language.hg \ + layout.hg \ + layoutiter.hg \ + layoutline.hg \ + rectangle.hg \ + renderer.hg \ + tabarray.hg + +files_ccg = $(files_hg:.hg=.ccg) diff --git a/pango/src/font.ccg b/pango/src/font.ccg new file mode 100644 index 0000000..256569d --- /dev/null +++ b/pango/src/font.ccg @@ -0,0 +1,45 @@ +/* + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +namespace Pango +{ + +FontMetrics Font::get_metrics() const +{ + return FontMetrics(pango_font_get_metrics(const_cast(gobj()), 0)); +} + +Rectangle Font::get_glyph_ink_extents(Glyph glyph) const +{ + Rectangle ink_rect; + pango_font_get_glyph_extents(const_cast(gobj()), glyph, ink_rect.gobj(), 0); + return ink_rect; +} + +Rectangle Font::get_glyph_logical_extents(Glyph glyph) const +{ + Rectangle logical_rect; + pango_font_get_glyph_extents(const_cast(gobj()), glyph, 0, logical_rect.gobj()); + return logical_rect; +} + +} /* namespace Pango */ diff --git a/pango/src/font.hg b/pango/src/font.hg new file mode 100644 index 0000000..66e0126 --- /dev/null +++ b/pango/src/font.hg @@ -0,0 +1,95 @@ +/* font.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ + +const int SCALE = 1024; +const double SCALE_XX_SMALL = 0.5787037037037; +const double SCALE_X_SMALL = 0.6444444444444; +const double SCALE_SMALL = 0.8333333333333; +const double SCALE_MEDIUM = 1.0; +const double SCALE_LARGE = 1.2; +const double SCALE_X_LARGE = 1.4399999999999; +const double SCALE_XX_LARGE = 1.728; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +class PANGOMM_API FontFace; +class PANGOMM_API FontMap; +#endif //DOXYGEN_SHOULD_SKIP_THIS + +/** A Pango::Font is used to represent a font in a rendering-system-independent matter. + */ +class PANGOMM_API Font : public Glib::Object +{ + _CLASS_GOBJECT(Font, PangoFont, PANGO_FONT, Glib::Object, GObject, , , PANGOMM_API) + _IGNORE(pango_font_find_shaper) // Deprecated + +public: + _WRAP_METHOD(FontDescription describe() const, pango_font_describe) + _WRAP_METHOD(FontDescription describe_with_absolute_size() const, pango_font_describe_with_absolute_size) + _WRAP_METHOD(Glib::RefPtr get_coverage(const Language& language) const, pango_font_get_coverage) + + /** Gets overall metric information for a font. + * The metrics may be substantially different for different scripts. + * However, this function overload returns the metrics for the entire font. + */ + FontMetrics get_metrics() const; + _WRAP_METHOD(FontMetrics get_metrics(const Language& language) const, pango_font_get_metrics) + + _WRAP_METHOD(void get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) const, pango_font_get_glyph_extents) + + _WRAP_METHOD(Glib::RefPtr get_font_map(), pango_font_get_font_map) + _WRAP_METHOD(Glib::RefPtr get_font_map() const, pango_font_get_font_map, constversion) + + _WRAP_METHOD(Glib::RefPtr get_face(), pango_font_get_face, refreturn) + _WRAP_METHOD(Glib::RefPtr get_face() const, pango_font_get_face, refreturn, constversion) + + _WRAP_METHOD(bool has_char(gunichar wc) const, pango_font_has_char) + + /** Get the ink extents of a glyph within the font. + * @param glyph The glyph index. + * @return The extents of the glyph as drawn. + */ + Rectangle get_glyph_ink_extents(Glyph glyph) const; + + /** Gets the logical extents of a glyph within the font. + * @param glyph The glyph index. + * @return The logical extents of the glyph. + */ + Rectangle get_glyph_logical_extents(Glyph glyph) const; + +// PangoFontClass is hidden when PANGO_DISABLE_DEPRECATED is defined. +// Don't wrap vfuncs. +}; + +} /* namespace Pango */ diff --git a/pango/src/fontdescription.ccg b/pango/src/fontdescription.ccg new file mode 100644 index 0000000..bd7bb09 --- /dev/null +++ b/pango/src/fontdescription.ccg @@ -0,0 +1,35 @@ +// -*- c++ -*- +/* $Id: fontdescription.ccg,v 1.1 2003/01/21 13:41:03 murrayc Exp $ */ + +/* + * + * Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + + +namespace Pango +{ + +FontDescription::FontDescription(const Glib::ustring& font_name) +{ + gobject_ = pango_font_description_from_string(font_name.c_str()); +} + +} // namespace Pango + diff --git a/pango/src/fontdescription.hg b/pango/src/fontdescription.hg new file mode 100644 index 0000000..340457b --- /dev/null +++ b/pango/src/fontdescription.hg @@ -0,0 +1,103 @@ +/* fontdescription.h + * + * Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +_WRAP_ENUM(Style, PangoStyle, decl_prefix PANGOMM_API) +_WRAP_ENUM(Variant, PangoVariant, decl_prefix PANGOMM_API) +_WRAP_ENUM(Stretch, PangoStretch, decl_prefix PANGOMM_API) +_WRAP_ENUM(Weight, PangoWeight, CONV_TO_INT, decl_prefix PANGOMM_API) +_WRAP_ENUM(FontMask, PangoFontMask, decl_prefix PANGOMM_API) +_WRAP_ENUM(Gravity, PangoGravity, decl_prefix PANGOMM_API) + +/** A Pango::FontDescription represents the description of an ideal font. + * It is used both to list what fonts are available on the system and also for specifying the characteristics of a font to load. + */ +class PANGOMM_API FontDescription +{ + _CLASS_BOXEDTYPE(FontDescription, PangoFontDescription, pango_font_description_new, pango_font_description_copy, pango_font_description_free, PANGOMM_API) + _IGNORE(pango_font_description_free, pango_font_description_copy, pango_font_description_copy_static, pango_font_description_equal) + + /* These functions are dangerous! The first casts the "const" from the parameter away + * copying the pointer and keep it hanging around. + * So desc.set_family_static("some_family") would lead to a segfault. + * The latter makes a shallow copy of the parameter's "family" data member. + * So if the FontDescription you passed in dies, a pointer to its (deleted) + * family data member still hangs around! + * This is why we can't wrap these functions! + */ + _IGNORE(pango_font_description_set_family_static, pango_font_description_merge_static) + +public: + /** Constructs a font description from a string representation. + * @a font_name must have 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, + * or stretch, and SIZE is an decimal number (size in points). 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 0. 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. + * @param font_name String representation of a font description. + */ + explicit FontDescription(const Glib::ustring& font_name); + + _WRAP_METHOD(guint hash() const, pango_font_description_hash) + _WRAP_METHOD(void set_family(const Glib::ustring& family), pango_font_description_set_family) + _WRAP_METHOD(Glib::ustring get_family() const, pango_font_description_get_family) + _WRAP_METHOD(void set_style(Style style), pango_font_description_set_style) + _WRAP_METHOD(Style get_style() const, pango_font_description_get_style) + _WRAP_METHOD(void set_variant(Variant variant),pango_font_description_set_variant) + _WRAP_METHOD(Variant get_variant() const, pango_font_description_get_variant) + _WRAP_METHOD(void set_weight(Weight weight), pango_font_description_set_weight) + _WRAP_METHOD(Weight get_weight() const, pango_font_description_get_weight) + _WRAP_METHOD(void set_stretch(Stretch stretch), pango_font_description_set_stretch) + _WRAP_METHOD(Stretch get_stretch() const, pango_font_description_get_stretch) + _WRAP_METHOD(void set_size(int size), pango_font_description_set_size) + _WRAP_METHOD(int get_size() const, pango_font_description_get_size) + _WRAP_METHOD(void set_absolute_size(double size), pango_font_description_set_absolute_size) + _WRAP_METHOD(bool get_size_is_absolute() const, pango_font_description_get_size_is_absolute) + _WRAP_METHOD(void set_gravity(Gravity gravity), pango_font_description_set_gravity) + _WRAP_METHOD(Gravity get_gravity() const, pango_font_description_get_gravity) + _IGNORE(pango_font_description_set_variations_static) + _WRAP_METHOD(void set_variations(const Glib::ustring& settings), pango_font_description_set_variations) + _WRAP_METHOD(Glib::ustring get_variations() const, pango_font_description_get_variations) + _WRAP_METHOD(FontMask get_set_fields() const, pango_font_description_get_set_fields) + _WRAP_METHOD(void unset_fields(FontMask to_unset), pango_font_description_unset_fields) + _WRAP_METHOD(void merge(const FontDescription& desc_to_merge, bool replace_existing), pango_font_description_merge) + _WRAP_METHOD(bool better_match(const FontDescription& old_match, const FontDescription& new_match) const, pango_font_description_better_match) + _WRAP_METHOD(Glib::ustring to_string() const, pango_font_description_to_string) + _WRAP_METHOD(Glib::ustring to_filename() const, pango_font_description_to_filename) + +#m4begin + _WRAP_EQUAL(pango_font_description_equal, , PANGOMM_API) +#m4end +}; + +} //namespace Pango + diff --git a/pango/src/fontface.ccg b/pango/src/fontface.ccg new file mode 100644 index 0000000..60327da --- /dev/null +++ b/pango/src/fontface.ccg @@ -0,0 +1,33 @@ +/* + * Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +namespace Pango +{ + +std::vector FontFace::list_sizes() const +{ + int* sizes = nullptr; + int n_sizes = 0; + pango_font_face_list_sizes(const_cast(gobj()), &sizes, &n_sizes); + + return Glib::ArrayHandler::array_to_vector(sizes, n_sizes, Glib::OWNERSHIP_SHALLOW); //The ArrayHandle will free the array. +} + +} //namespace Pango diff --git a/pango/src/fontface.hg b/pango/src/fontface.hg new file mode 100644 index 0000000..086fa0d --- /dev/null +++ b/pango/src/fontface.hg @@ -0,0 +1,56 @@ +/* fontface.h + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ +class PANGOMM_API FontFamily; + +/** A Pango::FontFace is used to represent a group of fonts with the same family, slant, weight, width, but varying sizes. + */ +class PANGOMM_API FontFace : public Glib::Object +{ + _CLASS_GOBJECT(FontFace, PangoFontFace, PANGO_FONT_FACE, Glib::Object, GObject, , , PANGOMM_API) + +public: + _WRAP_METHOD(FontDescription describe() const, pango_font_face_describe) + _WRAP_METHOD(Glib::ustring get_name() const, pango_font_face_get_face_name) + + /** List the available sizes for a font. This is only applicable to bitmap fonts. + * For scalable fonts this returns an empty array. + * The sizes returned are in Pango units and are sorted in ascending order. + */ + std::vector list_sizes() const; + _IGNORE(pango_font_face_list_sizes) + + _WRAP_METHOD(bool is_synthesized() const, pango_font_face_is_synthesized) + _WRAP_METHOD(Glib::RefPtr get_family(), pango_font_face_get_family, refreturn) + _WRAP_METHOD(Glib::RefPtr get_family() const, pango_font_face_get_family, refreturn, constversion) + +// PangoFontFaceClass is hidden when PANGO_DISABLE_DEPRECATED is defined. +// Don't wrap vfuncs. +}; + +} /* namespace Pango */ diff --git a/pango/src/fontfamily.ccg b/pango/src/fontfamily.ccg new file mode 100644 index 0000000..2c68b1f --- /dev/null +++ b/pango/src/fontfamily.ccg @@ -0,0 +1,38 @@ +// -*- c++ -*- +/* $Id: fontfamily.ccg,v 1.1 2003/01/21 13:41:03 murrayc Exp $ */ + +/* + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +std::vector> FontFamily::list_faces() const +{ + //Get the array: + PangoFontFace** pFontFaces = nullptr; + int n_fonts = 0; + pango_font_family_list_faces(const_cast(gobj()), &pFontFaces, &n_fonts); + + return Glib::ArrayHandler>::array_to_vector(pFontFaces, n_fonts, Glib::OWNERSHIP_SHALLOW); +} + +} /* namespace Pango */ + + diff --git a/pango/src/fontfamily.hg b/pango/src/fontfamily.hg new file mode 100644 index 0000000..0d0dba6 --- /dev/null +++ b/pango/src/fontfamily.hg @@ -0,0 +1,80 @@ +/* fontfamily.h + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ + +/** A Pango::FontFamily 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. + */ +class PANGOMM_API FontFamily : public Glib::Object, public Gio::ListModel +{ + _CLASS_GOBJECT(FontFamily, PangoFontFamily, PANGO_FONT_FAMILY, Glib::Object, GObject, , , PANGOMM_API) + _IMPLEMENTS_INTERFACE(Gio::ListModel) + _IGNORE(pango_font_family_list_faces) + +public: + /** 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. + * @return an array of pointers to Pango::FontFace objects. + */ + std::vector> list_faces() const; + + _WRAP_METHOD(Glib::ustring get_name() const, pango_font_family_get_name) + _WRAP_METHOD(bool is_monospace() const, pango_font_family_is_monospace) + _WRAP_METHOD(bool is_variable() const, pango_font_family_is_variable) + + _WRAP_METHOD(Glib::RefPtr get_face(const Glib::ustring& name{NULL} = {}), + pango_font_family_get_face, refreturn) + _WRAP_METHOD(Glib::RefPtr get_face(const Glib::ustring& name{NULL} = {}) const, + pango_font_family_get_face, refreturn, constversion) + + _WRAP_PROPERTY("item-type", GType, newin "2,52") + _WRAP_PROPERTY("n-items", unsigned int, newin "2,52") + _WRAP_PROPERTY("name", Glib::ustring) + _WRAP_PROPERTY("is-monospace", bool) + _WRAP_PROPERTY("is-variable", bool) + +// PangoFontFamilyClass is hidden when PANGO_DISABLE_DEPRECATED is defined. +// Don't wrap vfuncs. +}; + +/* +struct FontFamilyRefPtrTraits +{ + typedef Glib::RefPtr CppType; + typedef PangoFontFamily * CType; + typedef PangoFontFamily * CTypeNonConst; + + static CType to_c_type (const CppType& ptr) { return Glib::unwrap (ptr); } + static CType to_c_type (CType ptr) { return ptr; } + static CppType to_cpp_type (CType ptr) { return FontFamily::wrap_specific_type (ptr); } + static void release_c_type (CType ptr) { g_object_unref (ptr); } +}; +*/ + +} // namespace Pango diff --git a/pango/src/fontmap.ccg b/pango/src/fontmap.ccg new file mode 100644 index 0000000..e4d9ea6 --- /dev/null +++ b/pango/src/fontmap.ccg @@ -0,0 +1,46 @@ +/* + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include + +namespace Pango +{ + +// Custom wrap_new() because we want to create +// a CairoFontMapImpl if the underlying C class implements the PangoCairoFontMap interface. +Glib::ObjectBase* FontMap_Class::wrap_new(GObject* object) +{ + if (PANGO_IS_CAIRO_FONT_MAP(object)) + return new CairoFontMapImpl((PangoFontMap*)object); + return new FontMap((PangoFontMap*)object); +} + +std::vector> FontMap::list_families() const +{ + //Get the array: + PangoFontFamily** pFamilies = nullptr; + int n_families = 0; + pango_font_map_list_families(const_cast(gobj()), &pFamilies, &n_families); + + return Glib::ArrayHandler>::array_to_vector + (pFamilies, n_families, Glib::OWNERSHIP_SHALLOW); +} + +} /* namespace Pango */ diff --git a/pango/src/fontmap.hg b/pango/src/fontmap.hg new file mode 100644 index 0000000..f7c798c --- /dev/null +++ b/pango/src/fontmap.hg @@ -0,0 +1,77 @@ +/* fontmap.h + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ + +class PANGOMM_API Context; + +/** A %Pango::FontMap represents the set of fonts available for a particular rendering system. + * + * This is an abstract base class with implementations being specific to + * particular rendering systems. + * + * @see Pango::CairoFontMap::get_default() + */ +class PANGOMM_API FontMap : public Glib::Object, public Gio::ListModel +{ + _CLASS_GOBJECT(FontMap, PangoFontMap, PANGO_FONT_MAP, Glib::Object, GObject, , , PANGOMM_API) + _IMPLEMENTS_INTERFACE(Gio::ListModel) + _CUSTOM_WRAP_NEW + _IGNORE(pango_font_map_list_families) + +public: + _WRAP_METHOD(Glib::RefPtr load_font(const Glib::RefPtr& context, const FontDescription& desc) const, pango_font_map_load_font) + _WRAP_METHOD(Glib::RefPtr load_fontset(const Glib::RefPtr& context, const FontDescription& desc, const Language& language) const, pango_font_map_load_fontset) + + _WRAP_METHOD(Glib::RefPtr create_context(), pango_font_map_create_context) + + /** List all families for the fontmap. + * @return an array of pointers to Pango::FontFamily objects. + */ + std::vector> list_families() const; + + _WRAP_METHOD(guint get_serial() const, pango_font_map_get_serial) + + _IGNORE(pango_font_map_changed)dnl// Shall not be used by applications + + _WRAP_METHOD(Glib::RefPtr get_family(const Glib::ustring& name), + pango_font_map_get_family, refreturn, newin "2,50") + _WRAP_METHOD(Glib::RefPtr get_family(const Glib::ustring& name) const, + pango_font_map_get_family, refreturn, constversion, newin "2,50") + + _WRAP_METHOD(Glib::RefPtr reload_font(const Glib::RefPtr& font, + double scale, const Glib::RefPtr& context = {}, + const Glib::ustring& variations{NULL} = {}) const, pango_font_map_reload_font) + + _WRAP_PROPERTY("item-type", GType, newin "2,52") + _WRAP_PROPERTY("n-items", unsigned int, newin "2,52") +}; + +} /* namespace Pango */ diff --git a/pango/src/fontmetrics.ccg b/pango/src/fontmetrics.ccg new file mode 100644 index 0000000..60f0241 --- /dev/null +++ b/pango/src/fontmetrics.ccg @@ -0,0 +1,22 @@ +// -*- c++ -*- +/* $Id: fontmetrics.ccg,v 1.1 2003/01/21 13:41:04 murrayc Exp $ */ + +/* + * + * Copyright 1998-1999 The Gtk-- Development Team + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ diff --git a/pango/src/fontmetrics.hg b/pango/src/fontmetrics.hg new file mode 100644 index 0000000..869f0a1 --- /dev/null +++ b/pango/src/fontmetrics.hg @@ -0,0 +1,50 @@ +/* fontmetrics.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +/** A Pango::FontMetrics holds the overall metric information for a font (possibly restricted to a script). + */ +class PANGOMM_API FontMetrics +{ + _CLASS_BOXEDTYPE(FontMetrics, PangoFontMetrics, NONE, pango_font_metrics_ref, pango_font_metrics_unref, PANGOMM_API) + _IGNORE(pango_font_metrics_unref, pango_font_metrics_ref) +public: + _WRAP_METHOD(int get_ascent() const, pango_font_metrics_get_ascent) + _WRAP_METHOD(int get_descent() const, pango_font_metrics_get_descent) + _WRAP_METHOD(int get_height() const, pango_font_metrics_get_height) + _WRAP_METHOD(int get_approximate_char_width() const, pango_font_metrics_get_approximate_char_width) + _WRAP_METHOD(int get_approximate_digit_width() const, pango_font_metrics_get_approximate_digit_width) + + _WRAP_METHOD(int get_underline_position() const, pango_font_metrics_get_underline_position) + _WRAP_METHOD(int get_underline_thickness() const, pango_font_metrics_get_underline_thickness) + _WRAP_METHOD(int get_strikethrough_position() const, pango_font_metrics_get_strikethrough_position) + _WRAP_METHOD(int get_strikethrough_thickness() const, pango_font_metrics_get_strikethrough_thickness) + +}; + +} //namespace Pango diff --git a/pango/src/fontset.ccg b/pango/src/fontset.ccg new file mode 100644 index 0000000..ea50a35 --- /dev/null +++ b/pango/src/fontset.ccg @@ -0,0 +1,47 @@ +/* + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +extern "C" +{ +static gboolean fontset_foreach_callback(PangoFontset* /* fontset */, PangoFont* font, gpointer data) +{ + try + { + auto& slot = *static_cast(data); + auto cppFont = Glib::wrap(font, true /* take_copy */); + + return slot(cppFont); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + + return false; //arbitrary default +} +} // extern "C" + +namespace Pango +{ + +void Fontset::foreach(const ForeachSlot& slot) +{ + pango_fontset_foreach(gobj(), &fontset_foreach_callback, (void*)&slot); +} + +} //namespace diff --git a/pango/src/fontset.hg b/pango/src/fontset.hg new file mode 100644 index 0000000..03b36ab --- /dev/null +++ b/pango/src/fontset.hg @@ -0,0 +1,58 @@ +/* fontset.h + * + * Copyright 2001 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include + +_DEFS(pangomm,pango) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Pango +{ + +/** A Pango::Fontset is used to represent a set of fonts. + */ +class PANGOMM_API Fontset : public Glib::Object +{ + _CLASS_GOBJECT(Fontset, PangoFontset, PANGO_FONTSET, Glib::Object, GObject, , , PANGOMM_API) + +public: + _WRAP_METHOD(Glib::RefPtr get_font(guint wc) const, pango_fontset_get_font) + _WRAP_METHOD(FontMetrics get_metrics() const, pango_fontset_get_metrics) + + /** For instance, + * bool on_foreach(const Glib::RefPtr& font); + */ + typedef sigc::slot&)> ForeachSlot; + + /** Iterates through all the fonts in a fontset, calling @a slot for + * each one. If @a slot returns true, that stops the iteration. + * + * @since-1.4 + * + * @param slot Callback function + */ + void foreach(const ForeachSlot& slot); + _IGNORE(pango_fontset_foreach) +}; + +} /* namespace Pango */ diff --git a/pango/src/glyph.ccg b/pango/src/glyph.ccg new file mode 100644 index 0000000..d175075 --- /dev/null +++ b/pango/src/glyph.ccg @@ -0,0 +1,87 @@ +/* + * Copyright 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +GlyphInfo::GlyphInfo() +{ + gobject_.glyph = 0; +} + + +GlyphGeometry::GlyphGeometry() +{ + gobject_.width = gobject_.x_offset = gobject_.y_offset = 0; +} + +GlyphGeometry::GlyphGeometry(const PangoGlyphGeometry* src) +{ + gobject_.width = src->width; + gobject_.x_offset = src->x_offset; + gobject_.y_offset = src->y_offset; +} + + +/*GlyphVisAttr::GlyphVisAttr() +{ + gobject_.is_cluster_start = 0; +} + +GlyphVisAttr::GlyphVisAttr(const PangoGlyphVisAttr* src) +{ + gobject_.is_cluster_start = src->is_cluster_start; +}*/ + +} //namespace Pango + + +namespace Glib +{ + +Pango::GlyphInfo& wrap(PangoGlyphInfo* object) +{ + return *reinterpret_cast(object); +} + +const Pango::GlyphInfo& wrap(const PangoGlyphInfo* object) +{ + return *reinterpret_cast(object); +} + +Pango::GlyphGeometry& wrap(PangoGlyphGeometry* object) +{ + return *reinterpret_cast(object); +} + +const Pango::GlyphGeometry& wrap(const PangoGlyphGeometry* object) +{ + return *reinterpret_cast(object); +} + +/*Pango::GlyphVisAttr& wrap(PangoGlyphVisAttr* object) +{ + return *reinterpret_cast(object); +} + +const Pango::GlyphVisAttr& wrap(const PangoGlyphVisAttr* object) +{ + return *reinterpret_cast(object); +}*/ + +} //namespace Glib diff --git a/pango/src/glyph.hg b/pango/src/glyph.hg new file mode 100644 index 0000000..48c97f9 --- /dev/null +++ b/pango/src/glyph.hg @@ -0,0 +1,203 @@ +/* glyph.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_CONFIGINCLUDE(pangommconfig.h) + +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +class PANGOMM_API GlyphInfo; +class PANGOMM_API GlyphGeometry; + + +/** A Pango::Glyph represents a single glyph in the output form of a string. + */ +typedef PangoGlyph Glyph; //This is defined as a guint32 + + +/** A Pango::GlyphUnit is used to store dimensions within Pango. Dimensions are stored in 1/64ths of a point. + */ +typedef PangoGlyphUnit GlyphUnit; + + +/** A Pango::GlyphVisAttr is used to communicate information between the shaping phase and the rendering phase. It's contents are still evolving. + */ +typedef PangoGlyphVisAttr GlyphVisAttr; + + +/** A Pango::GlyphInfo represents a single glyph together with positioning information and visual attributes. + */ +class PANGOMM_API GlyphInfo +{ + _CLASS_GENERIC(GlyphInfo, PangoGlyphInfo) + +public: + GlyphInfo(); + + /** Gets the glyph itself. + * @return The glyph. + */ + _MEMBER_GET(glyph, glyph, Glyph, PangoGlyph) + + /** Gets the positional information about the glyph. + * @return A GylphGeometry object. + */ + _MEMBER_GET(geometry, geometry, GlyphGeometry, PangoGlyphGeometry) + + /** Gets the visual attributes of the glyph. + * @return A GlyphVisAttr structure. + */ + _MEMBER_GET(attr, attr, GlyphVisAttr, PangoGlyphVisAttr) + +//I don't think that we need these set_* functions! +//TODO: Who wrote this comment? Investigate. murrayc. + /* Sets the glyph itself. + * @param glyph The new glyph. + */ +// _MEMBER_SET(glyph, glyph, Glyph, PangoGlyph) + + /* Sets the positional information about the glyph. + * @param geometry A GlyphGeometry object. + */ +// _MEMBER_SET(geometry, geometry, GlyphGeometry, PangoGlyphGeometry) + + /* Sets the visual attributes of the glyph. + * @param attr A GylphVisAttr structure. + */ +// _MEMBER_SET(attr, attr, GlyphVisAttr, PangoGlyphVisAttr) + + /// Provides access to the underlying C GObject. + PangoGlyphInfo* gobj() { return &gobject_; } + /// Provides access to the underlying C GObject. + const PangoGlyphInfo* gobj() const { return &gobject_; } + +protected: + PangoGlyphInfo gobject_; +}; + + +/** A Pango::GlyphGeometry contains width and positioning information for a single glyph. Distances are in 1/64ths of a point. + */ +class PANGOMM_API GlyphGeometry +{ + _CLASS_GENERIC(GlyphGeometry, PangoGlyphGeometry) + +public: + GlyphGeometry(); + explicit GlyphGeometry(const PangoGlyphGeometry* src); + + /** Gets the logical width to use for the character. + * @return The logical width. + */ + _MEMBER_GET(width, width, GlyphUnit, PangoGlyphUnit) + + /** Gets the horizontal offset from nominal character position. + * @return The horizontal offset. + */ + _MEMBER_GET(x_offset, x_offset, GlyphUnit, PangoGlyphUnit) + + /** Gets the vertical offset from nominal character position. + * @return The vertical offset. + */ + _MEMBER_GET(y_offset, y_offset, GlyphUnit, PangoGlyphUnit) + +//I don't think that we need these set_* functions! + /* Sets the logical width to use for the character. + * @param width The new logical width. + */ +// _MEMBER_SET(width, width, GlyphUnit, PangoGlyphUnit) + + /* Sets the horizontal offset from nominal character position. + * @param x_offset The new horizontal offset. + */ +// _MEMBER_SET(x_offset, x_offset, GlyphUnit, PangoGlyphUnit) + + /* Sets the vertical offset from nominal character position. + * @param y_offset The new vertical offset. + */ +// _MEMBER_SET(y_offset, y_offset, GlyphUnit, PangoGlyphUnit) + + PangoGlyphGeometry* gobj() { return &gobject_; } + const PangoGlyphGeometry* gobj() const { return &gobject_; } + +protected: + PangoGlyphGeometry gobject_; +}; + + +/* Since "the contents [of this struct] are still evolving" it might get necessary + * to create a wrapper class for PangoGlyphVisAttr in future. Currently, however, + * PangoGlyphVisAttr just contains one simple data field (guint is_cluster_start). + */ +/*class PANGOMM_API GlyphVisAttr +{ + _CLASS_GENERIC(GlyphVisAttr, PangoGlyphVisAttr) + +public: + GlyphVisAttr(); + explicit GlyphVisAttr(const PangoGlyphVisAttr* src); + + _MEMBER_GET(cluster_start, is_cluster_start, bool, guint) + + _MEMBER_SET(cluster_start, is_cluster_start, bool, guint) + + /// Provides access to the underlying C GObject. + PangoGlyphVisAttr* gobj() { return &gobject_; } + /// Provides access to the underlying C GObject. + const PangoGlyphVisAttr* gobj() const { return &gobject_; } + +protected: + PangoGlyphVisAttr gobject_; +};*/ + +} //namespace Pango + + +namespace Glib +{ + +/** @relates Pango::GlyphInfo */ +PANGOMM_API +Pango::GlyphInfo& wrap(PangoGlyphInfo* object); + +/** @relates Pango::GlyphInfo */ +PANGOMM_API +const Pango::GlyphInfo& wrap(const PangoGlyphInfo* object); + +/** @relates Pango::GlyphGeometry */ +PANGOMM_API +Pango::GlyphGeometry& wrap(PangoGlyphGeometry* object); + +/** @relates Pango::GlyphGeometry */ +PANGOMM_API +const Pango::GlyphGeometry& wrap(const PangoGlyphGeometry* object); + +/* @relates Pango::GlyphVisAttr */ +//PANGOMM_API +//Pango::GlyphVisAttr& wrap(PangoGlyphVisAttr* object); + +/* @relates Pango::GlyphVisAttr */ +//PANGOMM_API +//const Pango::GlyphVisAttr& wrap(const PangoGlyphVisAttr* object); + +} //namespace Glib diff --git a/pango/src/glyphitem.ccg b/pango/src/glyphitem.ccg new file mode 100644 index 0000000..57c96e0 --- /dev/null +++ b/pango/src/glyphitem.ccg @@ -0,0 +1,20 @@ +/* + * Copyright 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include diff --git a/pango/src/glyphitem.hg b/pango/src/glyphitem.hg new file mode 100644 index 0000000..53e77f1 --- /dev/null +++ b/pango/src/glyphitem.hg @@ -0,0 +1,69 @@ +/* glyphitem.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include //For LogAttr. +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ + +class PANGOMM_API Item; +class PANGOMM_API GlyphString; + +/** A %Pango::GlyphItem is a pair of a Pango::Item and the glyphs + * resulting from shaping the text corresponding to an item. + * + * As an example of the usage of %Pango::GlyphItem, the results + * of shaping text with Pango::Layout is a list of Pango::LayoutLine, + * each of which contains a list of Pango::GlyphItem. + * + * For backward compatibility PangoLayoutRun is an alias for PangoGlyphItem + * in pango's C code. There is no Pango::LayoutRun in this version of pangomm. + * + * @newin{2,48} + */ +class PANGOMM_API GlyphItem +{ + _CLASS_BOXEDTYPE(GlyphItem, PangoGlyphItem, NONE, pango_glyph_item_copy, pango_glyph_item_free, PANGOMM_API) + _IGNORE(pango_glyph_item_free, pango_glyph_item_copy) + +public: + // pango_glyph_item_split() returns a newly created PangoGlyphItem. Don't take a copy. +#m4 _CONVERSION(`PangoGlyphItem*',`GlyphItem',`Glib::wrap($3)') + _WRAP_METHOD(GlyphItem split(const Glib::ustring& text, int split_index), pango_glyph_item_split) + + //This takes ownership of the GlyphItem, which is strange: + // _WRAP_METHOD(GSList* apply_attrs(const Glib::ustring& text, const AttrList& list), pango_glyph_item_apply_attrs) + _WRAP_METHOD(void letter_space(const Glib::ustring& text, const LogAttr& log_attrs, + int letter_spacing = 0), pango_glyph_item_letter_space) + + /** Gets the Pango::Item object that provides information about the segment of text in this run. + * @return A Pango::Item object. + */ + _MEMBER_GET(item, item, Item, PangoItem*) + + /** Gets the string of glyphs obtained by shaping the text for this item. + * @return A Pango::GlyphString object. + */ + _MEMBER_GET(glyphs, glyphs, GlyphString, PangoGlyphString*) +}; + +} /* namespace Pango */ diff --git a/pango/src/glyphstring.ccg b/pango/src/glyphstring.ccg new file mode 100644 index 0000000..b8dd6ea --- /dev/null +++ b/pango/src/glyphstring.ccg @@ -0,0 +1,95 @@ +/* + * Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +namespace Pango +{ + +GlyphString::GlyphString(const Glib::ustring& text, const Analysis& analysis) +: + gobject_(pango_glyph_string_new()) +{ + pango_shape(text.c_str(), text.bytes(), analysis.gobj(), gobj()); +} + +GlyphString::GlyphString(const Glib::ustring& item_text, const Glib::ustring& paragraph_text, + const Analysis& analysis, ShapeFlags flags) +: + gobject_(pango_glyph_string_new()) +{ + pango_shape_with_flags(item_text.c_str(), item_text.bytes(), paragraph_text.c_str(), + paragraph_text.bytes(), analysis.gobj(), gobj(), static_cast(flags)); +} + +Rectangle GlyphString::get_ink_extents(const Glib::RefPtr& font) const +{ + Rectangle ink_rect; + pango_glyph_string_extents(const_cast(gobj()), const_cast(font->gobj()), ink_rect.gobj(), 0); + return ink_rect; +} + +Rectangle GlyphString::get_ink_extents(int start, int end, const Glib::RefPtr& font) const +{ + Rectangle ink_rect; + pango_glyph_string_extents_range(const_cast(gobj()), start, end, const_cast(font->gobj()), ink_rect.gobj(), 0); + return ink_rect; +} + +Rectangle GlyphString::get_logical_extents(const Glib::RefPtr& font) const +{ + Rectangle logical_rect; + pango_glyph_string_extents(const_cast(gobj()), const_cast(font->gobj()), 0, logical_rect.gobj()); + return logical_rect; +} + +Rectangle GlyphString::get_logical_extents(int start, int end, const Glib::RefPtr& font) const +{ + Rectangle logical_rect; + pango_glyph_string_extents_range(const_cast(gobj()), start, end, const_cast(font->gobj()), 0, logical_rect.gobj()); + return logical_rect; +} + +std::vector GlyphString::get_logical_widths(const Glib::ustring& text, int embedding_level) const +{ + int* logical_widths = g_new(int, text.length()); + pango_glyph_string_get_logical_widths(const_cast(gobj()), text.c_str(), text.bytes(), embedding_level, logical_widths); + return Glib::ArrayHandler::array_to_vector(logical_widths, text.length(), Glib::OWNERSHIP_SHALLOW); +} + +int GlyphString::index_to_x(const Glib::ustring& text, const Analysis& analysis, int index, bool trailing) const +{ + int x_pos; + pango_glyph_string_index_to_x(const_cast(gobj()), const_cast(text.c_str()), text.bytes(), const_cast(analysis.gobj()), index, static_cast(trailing), &x_pos); + return x_pos; +} + +void GlyphString::x_to_index(const Glib::ustring& text, const Analysis& analysis, int x_pos, int& index, bool& trailing) const +{ + gboolean trailing_temp = FALSE; + pango_glyph_string_x_to_index(const_cast(gobj()), const_cast(text.c_str()), text.bytes(), const_cast(analysis.gobj()), x_pos, &index, &trailing_temp); + trailing = trailing_temp; +} + +std::vector GlyphString::get_glyphs() const +{ + return Glib::ArrayHandler::array_to_vector(reinterpret_cast(gobj()->glyphs), gobj()->num_glyphs, Glib::OWNERSHIP_NONE); +} + +} //namespace Pango diff --git a/pango/src/glyphstring.hg b/pango/src/glyphstring.hg new file mode 100644 index 0000000..6df1641 --- /dev/null +++ b/pango/src/glyphstring.hg @@ -0,0 +1,152 @@ +/* glyphstring.h + * + * Copyright (C) 1998-1999 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include // for Analysis and ShapeFlags +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ +/** A Pango::GlyphString is used to store strings of glyphs with geometry and visual attribute information. + * It can be measured or drawn to the screen. + */ +class PANGOMM_API GlyphString +{ + _CLASS_BOXEDTYPE(GlyphString, PangoGlyphString, pango_glyph_string_new, pango_glyph_string_copy, pango_glyph_string_free, PANGOMM_API) + _IGNORE(pango_glyph_string_free, pango_glyph_string_copy) + _IGNORE(pango_glyph_string_index_to_x, pango_glyph_string_x_to_index, pango_glyph_string_get_logical_widths) + +public: + + /** Constructs a string of glyphs from a string of characters. + * + * Given a segment of text and the corresponding Pango::Analysis structure + * returned from Pango::Context::itemize(), convert the characters into glyphs. + * You may also pass in only a substring of the item. + * + * It is recommended that you use the constructor with @a item_text and + * @a paragraph_text parameters instead, since that API allows for shaping + * interaction happening across text item boundaries. + * + * @param text The text to process. You must pass the same string into those + * member functions expecting a const Glib::ustring&. + * @param analysis The analysis information returned from Pango::Context::itemize(). + */ + GlyphString(const Glib::ustring& text, const Analysis& analysis); + + /** Constructs a string of glyphs from a string of characters. + * + * Given a segment of text and the corresponding Pango::Analysis structure + * returned from Pango::Context::itemize(), convert the characters into glyphs. + * You may also pass in only a substring of the item. + * + * This is similar to the constructor with only one @a text parameter, except + * it also takes @a flags and 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 @a item_text is a part, provide the + * broader text as @a paragraph_text. + * + * @newin{2,44} + * + * @param item_text Valid UTF-8 text to shape. + * @param paragraph_text Text of the paragraph (see details). + * @param analysis The analysis information returned from Pango::Context::itemize(). + * @param flags Flags influencing the shaping process. + */ + GlyphString(const Glib::ustring& item_text, const Glib::ustring& paragraph_text, + const Analysis& analysis, ShapeFlags flags = ShapeFlags::NONE); + + _WRAP_METHOD(void set_size (int new_len), pango_glyph_string_set_size) + + _WRAP_METHOD(void get_extents(const Glib::RefPtr& font, Rectangle& ink_rect, Rectangle& logical_rect) const, pango_glyph_string_extents) + _WRAP_METHOD(void get_extents(int start, int end, const Glib::RefPtr& font, Rectangle& ink_rect, Rectangle& logical_rect) const, pango_glyph_string_extents_range) + + _WRAP_METHOD(int get_width() const, pango_glyph_string_get_width) + + /** Computes the extents of the glyph string as drawn. + * @param font A Pango::Font. + * @return The extents of the glyph string as drawn. + */ + Rectangle get_ink_extents(const Glib::RefPtr& font) const; + + /** Computes the extents of a sub-portion of the glyph string as drawn. + * @param start The start index. + * @param end The end index. + * @param font A Panog::Font + * @return The extents of the sub-portion of the glyph string as drawn. + */ + Rectangle get_ink_extents(int start, int end, const Glib::RefPtr& font) const; + + /** Computes the logical extents of a sub-portion of the glyph string. + * @param font A Pango::Font. + * @return The logical extents of the glyph string. + */ + Rectangle get_logical_extents(const Glib::RefPtr& font) const; + + /** Computes the logical extents of a sub-portion of the glyph string. + * @param start The start index. + * @param end The end index. + * @param font A Pango::Font. + * @return The logical extents of the sub-portion of the glyph string. + */ + Rectangle get_logical_extents(int start, int end, const Glib::RefPtr& font) const; + + /** 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. + * @param text The text corresponding to the glyphs. + * @param embedding_level The embedding level of the string. + * @return An array of integers representing the resulting character widths. + */ + std::vector get_logical_widths(const Glib::ustring& text, int embedding_level) const; + + /** 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. + * @param text The text corresponding to the glyphs. + * @param analysis The analysis information return from Pango::Context::itemize(). + * @param index The byte index within text. + * @param trailing Whether we should compute the result for the beginning or end of the character. + * @return The x position. + */ + int index_to_x(const Glib::ustring& text, const Analysis& analysis, int index, bool trailing) const; + + /** 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. + * @param text The text corresponding to the glyphs. + * @param analysis The analysis information return from Pango::Context::itemize(). + * @param x_pos The x offset (in thousands of a device unit). + * @param index The location to store calculated byte index within. + * @param trailing The location to store a boolean indicating whether the user clicked on the leading or trailing edge of the character. + */ + void x_to_index(const Glib::ustring& text, const Analysis& analysis, int x_pos, int& index, bool& trailing) const; + + /** Gharacter positions are computed by dividing up each cluster into equal portions. + * @return An array of Pango::GlyphInfo objects. + */ + std::vector get_glyphs() const; +}; + +} //namespace Pango diff --git a/pango/src/item.ccg b/pango/src/item.ccg new file mode 100644 index 0000000..9bb29c7 --- /dev/null +++ b/pango/src/item.ccg @@ -0,0 +1,130 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include + +namespace Pango +{ + +Analysis::Analysis() +{} + +Analysis::Analysis(const PangoAnalysis* src) +: + gobject_ (*src) +{} + +std::vector Analysis::get_extra_attrs() const +{ + using SListHandler_Attribute = Glib::SListHandler; + return SListHandler_Attribute::slist_to_vector(gobj()->extra_attrs, Glib::OWNERSHIP_NONE); +} + + +Item::Item(const Item& src) +: + gobject_ ((src.gobject_) ? pango_item_copy(src.gobject_) : nullptr) +{} + +Item::Item(PangoItem* castitem, bool make_a_copy) +{ + // For BoxedType wrappers, make_a_copy is true by default. The static + // BoxedType wrappers must always take a copy, thus make_a_copy = true + // ensures identical behaviour if the default argument is used. + + if(make_a_copy) + { + if(castitem) + gobject_ = pango_item_copy(castitem); + else + gobject_ = nullptr; + } + else + { + // It was given to us by a function which has already made a copy for us to keep. + gobject_ = castitem; + } +} + +Item& Item::operator=(const Item& src) +{ + auto* const new_gobject = (src.gobject_) ? pango_item_copy(src.gobject_) : nullptr; + + if(gobject_) + pango_item_free(gobject_); + gobject_ = new_gobject; + + return *this; +} + +Item::~Item() +{ + if(gobject_) + pango_item_free(gobject_); +} + +PangoItem* Item::gobj_copy() const +{ + return pango_item_copy(gobject_); +} + +Analysis Item::get_analysis() const +{ + return Analysis(&gobj()->analysis); +} + +Glib::ustring Item::get_segment(const Glib::ustring& text) const +{ + const char *const start = text.data() + gobj()->offset; + return Glib::ustring(start, start + gobj()->length); +} + +Pango::GlyphString Item::shape(const Glib::ustring& text) const +{ + return GlyphString(text, get_analysis()); +} + +Pango::GlyphString Item::shape(const Glib::ustring& item_text, + const Glib::ustring& paragraph_text, ShapeFlags flags) const +{ + return GlyphString(item_text, paragraph_text, get_analysis(), flags); +} + +} /* namespace Pango */ + + +namespace Glib +{ + +Pango::Analysis& wrap(PangoAnalysis* object) +{ + return *reinterpret_cast(object); +} + +const Pango::Analysis& wrap(const PangoAnalysis* object) +{ + return *reinterpret_cast(object); +} + +Pango::Item wrap(PangoItem* object, bool take_copy) +{ + return Pango::Item(object, take_copy); +} + +} /* namespace Glib */ diff --git a/pango/src/item.hg b/pango/src/item.hg new file mode 100644 index 0000000..d388ade --- /dev/null +++ b/pango/src/item.hg @@ -0,0 +1,191 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include + +_DEFS(pangomm,pango) + +namespace Pango +{ +_WRAP_ENUM(ShapeFlags, PangoShapeFlags, newin "2,44", decl_prefix PANGOMM_API) + +class Font; +class GlyphString; + +/** A %Pango::Analysis stores information about the properties of a segment of text. + * %Pango::Analysis is used as an output type only so there is no public default constructor. + * You can retrieve an object of this type from an object of type Pango::Item by + * calling Pango::Item::get_analysis(). Objects of this class can be used for some + * calculations in Pango::GlyphString. + */ +class PANGOMM_API Analysis +{ + _CLASS_GENERIC(Analysis, PangoAnalysis) + +protected: + // This class is only used as an output type. + Analysis(); + +public: + explicit Analysis(const PangoAnalysis* src); + +public: +// _MEMBER_GET_PTR(engine_shape, shape_engine, EngineShape*, PangoEngineShape*) //We don't wrap the Engine* stuff. +// _MEMBER_GET_PTR(engine_lang, lang_engine, EngineLang*, PangoEngineLang*) + + /** Gets the font used to render this segment. + * @return The font used to render this segment. + */ + _MEMBER_GET_GOBJECT(font, font, Font, PangoFont*) + + /** Gets the bidrectional level for this segment. + * @return The bidirectional level for this segment. + */ + _MEMBER_GET(level, level, guint8, guint8) + + /** Gets the language of this segment. + * @return The language of this segment. + */ + _MEMBER_GET(language, language, Language, PangoLanguage*) + + /** Gets a list of non-font attributes for this segment. + * @return A list of non-font attributes for this segment. + */ + std::vector get_extra_attrs() const; + + /// Provides access to the underlying C GObject. + PangoAnalysis* gobj() { return &gobject_; } + /// Provides access to the underlying C GObject. + const PangoAnalysis* gobj() const { return &gobject_; } + +protected: + PangoAnalysis gobject_; +}; + + +/** A Pango::Item stores information about a segment of text. + * Pango::Item is used as an output type only so there is no public default constructor. + * You retrieve objects of this type by calling Pango::Context::itemize() with some text. + * The actual rendering of the segment of text that corresponds to a particular Pango::Item + * (or some sub-string) into a string of glyphs is done with shape(). + * The segment of text that corresponds to a Pango::Item can be computed from the + * text passed into Pango::Context::itemize() with get_segment(). Together with + * the Pango::Analysis data member that can be accessed with get_analysis() + * it is needed for further calculations in Pango::GlyphString. + */ +class PANGOMM_API Item +{ + _CLASS_GENERIC(Item, PangoItem) //There is the whole set of functions for _CLASS_BOXEDTYPE but unfortunately PangoItem is not registered as a boxed type and lacks pango_item_get_type... + _IGNORE(pango_item_copy,pango_item_free) + +public: + // There is no default constructor. This class is only used as an output type. + explicit Item(PangoItem* castitem, bool make_a_copy = true); + + Item(const Item& src); + Item& operator=(const Item& src); + + ~Item(); + + /// Provides access to the underlying C GObject. The caller is responsible for freeing it. Use when directly setting fields in structs. + PangoItem* gobj_copy() const; + +public: + _WRAP_METHOD(Item split(int split_index, int split_offset), pango_item_split) + + /** Gets the offset of the segment from the beginning of the string in bytes. + * @return The offset of the segment from the beginning of the string in bytes. + */ + _MEMBER_GET(offset, offset, int, gint) + + /** Gets the length of the segment in bytes. + * @return The length of the segment in bytes. + */ + _MEMBER_GET(length, length, int, gint) + + /** Gets the length of the segment in characters. + * @return The length of the semgment in characters. + */ + _MEMBER_GET(num_chars, num_chars, int, gint) + + /** Gets the properties of the segment. + * @return The properties of the segment. + */ + Analysis get_analysis() const; + + /** Computes the segment of text that is represented by the item. + * @param text The text that has been passed into Pango::Context::itemize(). + * @return The sub-string of @a text that corresponds to the item. + */ + Glib::ustring get_segment(const Glib::ustring& text) const; + + /** Converts a segment of text into a string of glyphs. + * + * @param text The text to process. This must either be the whole segment of text + * that corresponds to the item as returned by get_segment() or a + * substring of that segment. You need to pass the same text to + * the member functions of Pango::GlyphString for further calculations. + * @return A Pango::GlyphString object that can be measured or drawn. + */ + GlyphString shape(const Glib::ustring& text) const; + + /** Converts a segment of text into a string of glyphs. + * + * @newin{2,44} + * + * @param item_text The text to process. This must either be the whole segment of text + * that corresponds to the item as returned by get_segment() or a + * substring of that segment. You need to pass the same text to + * the member functions of Pango::GlyphString for further calculations. + * @param paragraph_text Text of the paragraph. See GlyphString::GlyphString( + * const Glib::ustring& item_text, const Glib::ustring& paragraph_text, + * const Analysis& analysis, ShapeFlags flags). + * @param flags Flags influencing the shaping process. + * @return A Pango::GlyphString object that can be measured or drawn. + */ + GlyphString shape(const Glib::ustring& item_text, const Glib::ustring& paragraph_text, + ShapeFlags flags = ShapeFlags::NONE) const; + + /// Provides access to the underlying C GObject. + PangoItem* gobj() { return gobject_; } + /// Provides access to the underlying C GObject. + const PangoItem* gobj() const { return gobject_; } + +protected: + PangoItem* gobject_; +}; + +} // namespace Pango + +namespace Glib +{ + +/** @relates Pango::Analysis */ +PANGOMM_API +Pango::Analysis& wrap(PangoAnalysis* object); + +/** @relates Pango::Analysis */ +PANGOMM_API +const Pango::Analysis& wrap(const PangoAnalysis* object); + +/** @relates Pango::Item */ +PANGOMM_API +Pango::Item wrap(PangoItem* object, bool take_copy=true); + +} // namespace Glib diff --git a/pango/src/language.ccg b/pango/src/language.ccg new file mode 100644 index 0000000..f6b9178 --- /dev/null +++ b/pango/src/language.ccg @@ -0,0 +1,70 @@ +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Pango +{ + +/* PangoLanguage is just another example of inconsistent coding in atk/pango/gtk: + * on the one hand it is defined and registered as a boxed type, on the other + * hand it is always a pointer to some statically allocated string and thus + * neither allocated by itself, nor copied by value, nor freed. Similar dummy + * functions as below are defined in pango/pango-util.c but they are not exported. + * Compare with pango/pango-util.c for reference. */ + //(I wonder who wrote this - it wasn't me. murrayc) + +inline PangoLanguage* _pango_language_new() +{ + return 0; +} + +inline PangoLanguage* _pango_language_copy(const PangoLanguage* language) +{ + return const_cast(language); +} + +inline void _pango_language_free(PangoLanguage*) +{ + return; +} + +Language::Language() +: + gobject_(0) +{} + +Language::Language(const Glib::ustring& language) +: + gobject_(pango_language_from_string(language.c_str())) +{} + +Glib::ustring Language::get_string() const +{ + if (gobject_) + return pango_language_to_string(const_cast(gobj())); + else + return Glib::ustring(); +} + +std::vector