pango-0.7.0/.gitignore010064400007650000024000000001451350341530100130240ustar0000000000000000test/bin/ target/ doc/ configure.in config.log config.status *.dylib .rust *.so *.o *.swp Cargo.lock pango-0.7.0/.gitmodules010064400007650000024000000002401350341530100132050ustar0000000000000000[submodule "gir"] path = gir url = https://github.com/gtk-rs/gir.git [submodule "gir-files"] path = gir-files url = https://github.com/gtk-rs/gir-files.git pango-0.7.0/.travis.yml010064400007650000024000000034651350341657000131660ustar0000000000000000dist: xenial language: rust matrix: include: - os: linux rust: nightly env: GTK=3.14 FEATURES= - os: linux rust: nightly env: GTK=3.24 FEATURES=v1_38 - os: linux rust: beta env: GTK=3.14 FEATURES= - os: linux rust: beta env: GTK=3.24 FEATURES=v1_38 - os: linux rust: 1.34.0 env: GTK=3.14 FEATURES= - os: linux rust: 1.34.0 env: GTK=3.24 FEATURES=v1_38 - os: osx rust: nightly env: GTK=3.14 FEATURES= # - os: osx # rust: nightly # env: GTK=3.24 FEATURES=v1_38 - os: osx rust: beta env: GTK=3.14 FEATURES= # - os: osx # rust: beta # env: GTK=3.24 FEATURES=v1_38 - os: osx rust: stable env: GTK=3.14 FEATURES= # - os: osx # rust: stable # env: GTK=3.24 FEATURES=v1_38 addons: apt: packages: - libgtk-3-dev - libmount-dev before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gtk+3 cairo atk; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig; fi script: - rustc --version - if [ "$TRAVIS_RUST_VERSION" == "nightly" ] && [ "$GTK" == "3.14" ]; then rustup component add rustfmt; make regen_check; fi - cargo doc --features "dox,embed-lgpl-docs" - cargo test --features "$FEATURES,embed-lgpl-docs" # catch any sneaked in lgpl docs - cargo build --features "$FEATURES,purge-lgpl-docs" --jobs 1 - git diff -R --exit-code - rustc --version - mkdir .cargo - echo 'paths = ["."]' > .cargo/config - git clone -q --depth 50 -b pending https://github.com/gtk-rs/examples _examples - cd _examples - ./build_travis.sh pango-0.7.0/appveyor.yml010064400007650000024000000014471350341530100134320ustar0000000000000000environment: matrix: - RUST: stable BITS: 32 - RUST: stable BITS: 64 install: - IF "%BITS%" == "32" SET ARCH=i686 - IF "%BITS%" == "64" SET ARCH=x86_64 - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe --default-host "%ARCH%-pc-windows-gnu" --default-toolchain %RUST% -y - SET PATH=C:\Users\appveyor\.cargo\bin;C:\msys64\mingw%BITS%\bin;%PATH%;C:\msys64\usr\bin - rustc -Vv - cargo -Vv - pacman --noconfirm -S mingw-w64-%ARCH%-gtk3 build_script: - cargo doc --features "dox" - cargo test - cargo test --features v1_42 - mkdir .cargo - echo paths = ["."] > .cargo\config - git clone -q --depth 50 -b pending https://github.com/gtk-rs/examples _examples - cd _examples - cargo build - cargo build --features gtk_3_24 test: false pango-0.7.0/build.rs010064400007650000024000000010011350341657000125020ustar0000000000000000fn main() { manage_docs(); } #[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))] fn manage_docs() { extern crate lgpl_docs; const PATH: &'static str = "src"; const IGNORES: &'static [&'static str] = &["lib.rs", "prelude.rs"]; lgpl_docs::purge(PATH, IGNORES); if cfg!(feature = "embed-lgpl-docs") { lgpl_docs::embed(lgpl_docs::Library::Pango, PATH, IGNORES); } } #[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))] fn manage_docs() {} pango-0.7.0/Cargo.toml.orig010064400007650000024000000017131350341713700137360ustar0000000000000000[package] name = "pango" documentation = "http://gtk-rs.org/docs/pango/" homepage = "http://gtk-rs.org/" authors = ["The Gtk-rs Project Developers"] keywords = ["pango", "gtk-rs", "gnome"] readme = "README.md" version = "0.7.0" description = "Rust bindings for the Pango library" repository = "https://github.com/gtk-rs/pango" license = "MIT" exclude = [ "gir-files/*", ] [badges] appveyor = { repository = "GuillaumeGomez/pango", service = "github" } travis-ci = { repository = "gtk-rs/pango" } [features] v1_38 = ["pango-sys/v1_38"] v1_40 = ["v1_38"] v1_42 = ["v1_40", "pango-sys/v1_42"] dox = ["pango-sys/dox", "glib/dox"] purge-lgpl-docs = ["gtk-rs-lgpl-docs"] embed-lgpl-docs = ["gtk-rs-lgpl-docs"] [build-dependencies.gtk-rs-lgpl-docs] version = "0.1.3" optional = true [dependencies] gobject-sys = "0.9.0" glib = "0.8.0" glib-sys = "0.9.0" pango-sys = "0.9.0" libc = "0.2" bitflags = "1.0" lazy_static = "1.0" [dev-dependencies] gir-format-check = "^0.1" pango-0.7.0/Cargo.toml0000644000000031520000000000000102020ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "pango" version = "0.7.0" authors = ["The Gtk-rs Project Developers"] exclude = ["gir-files/*"] description = "Rust bindings for the Pango library" homepage = "http://gtk-rs.org/" documentation = "http://gtk-rs.org/docs/pango/" readme = "README.md" keywords = ["pango", "gtk-rs", "gnome"] license = "MIT" repository = "https://github.com/gtk-rs/pango" [dependencies.bitflags] version = "1.0" [dependencies.glib] version = "0.8.0" [dependencies.glib-sys] version = "0.9.0" [dependencies.gobject-sys] version = "0.9.0" [dependencies.lazy_static] version = "1.0" [dependencies.libc] version = "0.2" [dependencies.pango-sys] version = "0.9.0" [dev-dependencies.gir-format-check] version = "^0.1" [build-dependencies.gtk-rs-lgpl-docs] version = "0.1.3" optional = true [features] dox = ["pango-sys/dox", "glib/dox"] embed-lgpl-docs = ["gtk-rs-lgpl-docs"] purge-lgpl-docs = ["gtk-rs-lgpl-docs"] v1_38 = ["pango-sys/v1_38"] v1_40 = ["v1_38"] v1_42 = ["v1_40", "pango-sys/v1_42"] [badges.appveyor] repository = "GuillaumeGomez/pango" service = "github" [badges.travis-ci] repository = "gtk-rs/pango" pango-0.7.0/COPYRIGHT010064400007650000024000000050021350341530100123240ustar0000000000000000The Gtk-rs Project is copyright 2013-2016, The Gtk-rs Project Developers: Adam Crume Adolfo Ochagavía Andre Bogus Anton Konjahin Arne Dussin Boden Garman Brian Kropf Bryant Mairs Chris Greenaway Chris Palmer Corey Farwell Daniel Zalevskiy David Li Edward Shaw Edward Yang Esption Evgenii Pashkin Geoffrey French Gleb Kozyrev Glenn Watson Google Inc. Guillaume Gomez Gulshan Singh Jakob Gillich James Shepherdson Jeremy Letang John Vrbanac kennytm Laurence Tratt Lionel Flandrin Lucas Werkmeister Lukas Diekmann Mathijs Henquet Maxwell Koo mitaa Nick Herman Nicolas Koch Oliver Schneider Ömer Sinan Ağacan Ralph Giles Paul Dennis Paul Hendry Philipp Brüschweiler Raphael Nestler Robertas Romain Gauthier S.J.R. van Schaik Sebastian Schulze Silvio Fricke Simon Sapin Steve Klabnik Tobias Bales trolleyman Umur Gedik UrKr Vojtech Kral Zach Oakes Zach Ploskey The Gtk-rs Project is licensed under the MIT license, see the LICENSE file or . This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL, see the LGPL file. pango-0.7.0/Gir.toml010064400007650000024000000115731350341530100124610ustar0000000000000000[options] girs_dir = "gir-files" library = "Pango" version = "1.0" target_path = "." work_mode = "normal" generate_safety_asserts = false min_cfg_version = "1.36" single_version_file = true deprecate_by_min_version = true generate = [ # "Pango.AttrColor", # "Pango.AttrFloat", # "Pango.AttrFontDesc", # "Pango.AttrFontFeatures", # "Pango.AttrInt", # "Pango.AttrLanguage", # "Pango.AttrShape", # "Pango.AttrSize", # "Pango.AttrString", # "Pango.GlyphGeometry", # "Pango.GlyphInfo", # "Pango.GlyphVisAttr", # "Pango.LogAttr", # "Pango.Map", # "Pango.MapEntry", # "Pango.ScriptForLang", # "Pango.ScriptIter", "Pango.Alignment", "Pango.Attribute", "Pango.AttrType", "Pango.BidiType", "Pango.Color", "Pango.CoverageLevel", "Pango.Direction", "Pango.EllipsizeMode", "Pango.EngineLang", "Pango.EngineShape", "Pango.FontFace", "Pango.FontFamily", "Pango.FontMask", "Pango.FontMetrics", "Pango.Fontset", "Pango.FontsetSimple", "Pango.Glyph", "Pango.GlyphItem", "Pango.GlyphItemIter", "Pango.GlyphString", "Pango.GlyphUnit", "Pango.Gravity", "Pango.GravityHint", "Pango.Item", "Pango.LayoutIter", "Pango.LayoutLine", "Pango.LayoutRun", "Pango.Matrix", "Pango.Renderer", "Pango.RenderPart", "Pango.Script", "Pango.Stretch", "Pango.Style", "Pango.TabAlign", "Pango.TabArray", "Pango.Underline", "Pango.Variant", "Pango.Weight", "Pango.WrapMode", ] manual = [ "GLib.Error", "Pango.Analysis", "Pango.AttrClass", "Pango.Language", "Pango.Rectangle", ] [[object]] name = "Pango.*" status = "generate" [[object.function]] name = "extents_to_pixels" [[object.function.parameter]] pattern = ".+" const = true [[object.function]] name = "get_mirror_char" #out param ignore = true [[object.function]] name = "log2vis_get_embedding_levels" #out param ignore = true [[object.function]] pattern = "attr_.+" #moved to Attribute ignore = true [[object.function]] name = "itemize" [[object.function.parameter]] name = "cached_iter" const = true [[object.function]] name = "itemize_with_base_dir" [[object.function.parameter]] name = "cached_iter" const = true [[object.function]] name = "reorder_items" ignore = true [[object.function]] name = "shape_full" # invalid length computation on Stash instead of str ignore = true [[object]] name = "Pango.AttrIterator" status = "generate" [[object.function]] name = "get_font" ignore = true [[object]] name = "Pango.AttrList" status = "generate" [[object.function]] name = "change" ignore = true [[object.function]] name = "insert" ignore = true [[object.function]] name = "insert_before" ignore = true [[object]] name = "Pango.Context" status = "generate" [[object.function]] name = "get_metrics" [[object.function.parameter]] name = "language" const = true [[object.function]] name = "load_fontset" [[object.function.parameter]] name = "language" const = true [[object.function]] name = "set_language" [[object.function.parameter]] name = "language" const = true [[object]] name = "Pango.Coverage" status = "generate" [[object.function]] name = "new" [object.function.return] nullable = false [[object]] name = "Pango.Font" status = "generate" [[object.function]] name = "descriptions_free" ignore = true [[object.function]] name = "get_metrics" [[object.function.parameter]] name = "language" const = true [[object.function]] name = "find_shaper" [[object.function.parameter]] name = "language" const = true [[object.function]] name = "get_coverage" [[object.function.parameter]] name = "language" const = true [[object]] name = "Pango.FontDescription" status = "generate" [[object.function]] name = "from_string" [object.function.return] nullable = false [[object.function]] name = "set_family_static" ignore = true [[object.function]] name = "copy_static" ignore = true [[object.function]] name = "merge_static" ignore = true [[object]] name = "Pango.FontMap" status = "generate" [[object.function]] name = "load_fontset" [[object.function.parameter]] name = "language" const = true [[object]] name = "Pango.Layout" status = "generate" [[object.function]] name = "xy_to_index" [object.function.return] nullable = false [[object.function]] name = "set_tabs" [[object.function.parameter]] name = "tabs" const = true pango-0.7.0/LGPL010064400007650000024000000613141350341530100115220ustar0000000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! pango-0.7.0/LICENSE010064400007650000024000000021201350341530100120340ustar0000000000000000The MIT License (MIT) Copyright (c) 2013-2015, The Gtk-rs Project Developers. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pango-0.7.0/Makefile010064400007650000024000000012601350341657000125040ustar0000000000000000GIR = gir/target/bin/gir GIR_SRC = gir/Cargo.toml gir/Cargo.lock gir/build.rs $(shell find gir/src -name '*.rs') GIR_FILES = gir-files/Pango-1.0.gir # Run `gir` generating the bindings gir : src/auto/mod.rs cargo fmt doc: $(GIR) $(GIR_FILES) $(GIR) -m doc -c Gir.toml not_bound: $(GIR) $(GIR_FILES) $(GIR) -m not_bound -c Gir.toml regen_check: $(GIR) $(GIR_FILES) rm src/auto/* $(GIR) -c Gir.toml cargo fmt git diff -R --exit-code src/auto/mod.rs : Gir.toml $(GIR) $(GIR_FILES) $(GIR) -c Gir.toml $(GIR) : $(GIR_SRC) rm -f gir/target/bin/gir cargo install --path gir --root gir/target rm -f gir/target/.crates.toml $(GIR_SRC) $(GIR_FILES) : git submodule update --init pango-0.7.0/README.md010064400007650000024000000011271350341530100123140ustar0000000000000000# pango [![Build Status](https://travis-ci.org/gtk-rs/pango.png?branch=master)](https://travis-ci.org/gtk-rs/pango) [![Build status](https://ci.appveyor.com/api/projects/status/9nyo0226rxvikdtm?svg=true)](https://ci.appveyor.com/project/GuillaumeGomez/pango) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gtk-rs/gtk) Pango bindings for Rust. - [Gtk-rs project site](http://gtk-rs.org/) - [Online documentation](http://gtk-rs.org/docs/) - [Readme](https://github.com/gtk-rs/gtk/blob/master/README.md) in our [main repo](https://github.com/gtk-rs/gtk) ## License MIT pango-0.7.0/src/analysis.rs010064400007650000024000000043171350341657000140320ustar0000000000000000// Copyright 2018, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or use glib::translate::*; use pango_sys; use EngineLang; use EngineShape; use Font; use Gravity; use Language; use Script; #[repr(C)] pub struct Analysis(pango_sys::PangoAnalysis); impl Analysis { pub fn shape_engine(&self) -> EngineShape { unsafe { from_glib_none(self.0.shape_engine) } } pub fn lang_engine(&self) -> EngineLang { unsafe { from_glib_none(self.0.lang_engine) } } pub fn font(&self) -> Font { unsafe { from_glib_none(self.0.font) } } pub fn level(&self) -> u8 { self.0.level } pub fn gravity(&self) -> Gravity { from_glib(self.0.gravity as i32) } pub fn flags(&self) -> u8 { self.0.flags } pub fn script(&self) -> Script { from_glib(self.0.script as i32) } pub fn language(&self) -> Language { unsafe { from_glib_none(self.0.language) } } /*pub fn extra_attrs(&self) -> Vec { unsafe { from_glib_none_num_as_vec(self.0.extra_attrs) } }*/ } #[doc(hidden)] impl<'a> ToGlibPtr<'a, *const pango_sys::PangoAnalysis> for Analysis { type Storage = &'a Self; #[inline] fn to_glib_none(&'a self) -> Stash<'a, *const pango_sys::PangoAnalysis, Self> { let ptr: *const pango_sys::PangoAnalysis = &self.0; Stash(ptr, self) } } #[doc(hidden)] impl<'a> ToGlibPtrMut<'a, *mut pango_sys::PangoAnalysis> for Analysis { type Storage = &'a mut Self; #[inline] fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut pango_sys::PangoAnalysis, Self> { let ptr: *mut pango_sys::PangoAnalysis = &mut self.0; StashMut(ptr, self) } } #[doc(hidden)] impl FromGlibPtrNone<*const pango_sys::PangoAnalysis> for Analysis { unsafe fn from_glib_none(ptr: *const pango_sys::PangoAnalysis) -> Self { Analysis(*ptr) } } #[doc(hidden)] impl FromGlibPtrNone<*mut pango_sys::PangoAnalysis> for Analysis { unsafe fn from_glib_none(ptr: *mut pango_sys::PangoAnalysis) -> Self { Analysis(*ptr) } } pango-0.7.0/src/attr_class.rs010064400007650000024000000032141350341657000143410ustar0000000000000000// Copyright 2017, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or use glib::translate::{FromGlibPtrFull, FromGlibPtrNone, Stash, ToGlibPtr}; use pango_sys; #[doc(hidden)] impl<'a> ToGlibPtr<'a, *mut pango_sys::PangoAttrClass> for &'a AttrClass { type Storage = &'a AttrClass; fn to_glib_none(&self) -> Stash<'a, *mut pango_sys::PangoAttrClass, Self> { Stash(self.0, *self) } } #[doc(hidden)] impl FromGlibPtrNone<*mut pango_sys::PangoAttrClass> for AttrClass { unsafe fn from_glib_none(ptr: *mut pango_sys::PangoAttrClass) -> Self { assert!(!ptr.is_null()); AttrClass(ptr) } } #[doc(hidden)] impl FromGlibPtrFull<*mut pango_sys::PangoAttrClass> for AttrClass { unsafe fn from_glib_full(ptr: *mut pango_sys::PangoAttrClass) -> Self { assert!(!ptr.is_null()); AttrClass(ptr) } } #[doc(hidden)] impl FromGlibPtrNone<*const pango_sys::PangoAttrClass> for AttrClass { unsafe fn from_glib_none(ptr: *const pango_sys::PangoAttrClass) -> Self { assert!(!ptr.is_null()); AttrClass(ptr as *mut _) } } #[doc(hidden)] impl FromGlibPtrFull<*const pango_sys::PangoAttrClass> for AttrClass { unsafe fn from_glib_full(ptr: *const pango_sys::PangoAttrClass) -> Self { assert!(!ptr.is_null()); AttrClass(ptr as *mut _) } } pub struct AttrClass(*mut pango_sys::PangoAttrClass); impl PartialEq for AttrClass { fn eq(&self, other: &AttrClass) -> bool { self.0 == other.0 } } impl Eq for AttrClass {} pango-0.7.0/src/attr_iterator.rs010064400007650000024000000021041350341657000150620ustar0000000000000000// Copyright 2018, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or use glib::translate::*; use glib_sys; use pango_sys; use AttrIterator; use Attribute; use FontDescription; use Language; use std::ptr; impl AttrIterator { pub fn get_font( &mut self, desc: &mut FontDescription, language: Option<&Language>, extra_attrs: &[&Attribute], ) { unsafe { let stash_vec: Vec<_> = extra_attrs.iter().rev().map(|v| v.to_glib_none()).collect(); let mut list: *mut glib_sys::GSList = ptr::null_mut(); for stash in &stash_vec { list = glib_sys::g_slist_prepend(list, Ptr::to(stash.0)); } pango_sys::pango_attr_iterator_get_font( self.to_glib_none_mut().0, desc.to_glib_none_mut().0, &mut language.to_glib_none().0, &mut list, ); } } } pango-0.7.0/src/attr_list.rs010064400007650000024000000023261350341657000142120ustar0000000000000000// Copyright 2017, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or use glib::translate::*; use pango_sys; use std::mem; use AttrList; use Attribute; impl AttrList { pub fn change(&self, attr: Attribute) { unsafe { pango_sys::pango_attr_list_change( self.to_glib_none().0, attr.to_glib_none().0 as *mut _, ); mem::forget(attr); //As attr transferred fully } } pub fn insert(&self, attr: Attribute) { unsafe { pango_sys::pango_attr_list_insert( self.to_glib_none().0, attr.to_glib_none().0 as *mut _, ); mem::forget(attr); //As attr transferred fully } } pub fn insert_before(&self, attr: Attribute) { unsafe { pango_sys::pango_attr_list_insert_before( self.to_glib_none().0, attr.to_glib_none().0 as *mut _, ); mem::forget(attr); //As attr transferred fully } } } pango-0.7.0/src/attribute.rs010064400007650000024000000107621350341657000142130ustar0000000000000000// Copyright 2017, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or use glib::translate::*; use pango_sys; use AttrClass; use Attribute; use Gravity; use GravityHint; use Stretch; use Style; use Underline; use Variant; use Weight; impl Attribute { #[cfg(any(feature = "v1_38", feature = "dox"))] pub fn new_background_alpha(alpha: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_background_alpha_new(alpha)) } } pub fn new_background(red: u16, green: u16, blue: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_background_new(red, green, blue)) } } pub fn new_fallback(enable_fallback: bool) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_fallback_new( enable_fallback.to_glib(), )) } } pub fn new_family(family: &str) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_family_new(family.to_glib_none().0)) } } #[cfg(any(feature = "v1_38", feature = "dox"))] pub fn new_foreground_alpha(alpha: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_foreground_alpha_new(alpha)) } } pub fn new_foreground(red: u16, green: u16, blue: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_foreground_new(red, green, blue)) } } pub fn new_gravity_hint(hint: GravityHint) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_gravity_hint_new(hint.to_glib())) } } pub fn new_gravity(gravity: Gravity) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_gravity_new(gravity.to_glib())) } } pub fn new_letter_spacing(letter_spacing: i32) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_letter_spacing_new(letter_spacing)) } } pub fn new_rise(rise: i32) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_rise_new(rise)) } } pub fn new_scale(scale_factor: f64) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_scale_new(scale_factor)) } } pub fn new_stretch(stretch: Stretch) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_stretch_new(stretch.to_glib())) } } pub fn new_strikethrough_color(red: u16, green: u16, blue: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_strikethrough_color_new( red, green, blue, )) } } pub fn new_strikethrough(strikethrough: bool) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_strikethrough_new( strikethrough.to_glib(), )) } } pub fn new_style(style: Style) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_style_new(style.to_glib())) } } pub fn new_underline_color(red: u16, green: u16, blue: u16) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_underline_color_new(red, green, blue)) } } pub fn new_underline(underline: Underline) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_underline_new(underline.to_glib())) } } pub fn new_variant(variant: Variant) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_variant_new(variant.to_glib())) } } pub fn new_weight(weight: Weight) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_weight_new(weight.to_glib())) } } pub fn get_attr_class(&self) -> AttrClass { unsafe { from_glib_full((*self.to_glib_none().0).klass) } } pub fn get_start_index(&self) -> u32 { unsafe { let stash = self.to_glib_none(); (*stash.0).start_index } } pub fn get_end_index(&self) -> u32 { unsafe { let stash = self.to_glib_none(); (*stash.0).end_index } } pub fn set_start_index(&mut self, index: u32) { unsafe { let stash = self.to_glib_none_mut(); (*stash.0).start_index = index; } } pub fn set_end_index(&mut self, index: u32) { unsafe { let stash = self.to_glib_none_mut(); (*stash.0).end_index = index; } } } pango-0.7.0/src/auto/alias.rs010064400007650000024000000004011350341530100142250ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[allow(unused_imports)] use auto::*; pub type Glyph = u32; pub type GlyphUnit = i32; pub type LayoutRun = GlyphItem; pango-0.7.0/src/auto/attr_iterator.rs010064400007650000024000000027721350341657000160450ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use std::mem; use AttrType; use Attribute; glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct AttrIterator(Boxed); match fn { copy => |ptr| pango_sys::pango_attr_iterator_copy(mut_override(ptr)), free => |ptr| pango_sys::pango_attr_iterator_destroy(ptr), } } impl AttrIterator { pub fn get(&mut self, type_: AttrType) -> Option { unsafe { from_glib_none(pango_sys::pango_attr_iterator_get( self.to_glib_none_mut().0, type_.to_glib(), )) } } pub fn get_attrs(&mut self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(pango_sys::pango_attr_iterator_get_attrs( self.to_glib_none_mut().0, )) } } pub fn next(&mut self) -> bool { unsafe { from_glib(pango_sys::pango_attr_iterator_next( self.to_glib_none_mut().0, )) } } pub fn range(&mut self) -> (i32, i32) { unsafe { let mut start = mem::uninitialized(); let mut end = mem::uninitialized(); pango_sys::pango_attr_iterator_range(self.to_glib_none_mut().0, &mut start, &mut end); (start, end) } } } pango-0.7.0/src/auto/attr_list.rs010064400007650000024000000043261350341657000151640ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use AttrIterator; use Attribute; glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct AttrList(Shared); match fn { ref => |ptr| pango_sys::pango_attr_list_ref(ptr), unref => |ptr| pango_sys::pango_attr_list_unref(ptr), get_type => || pango_sys::pango_attr_list_get_type(), } } impl AttrList { pub fn new() -> AttrList { unsafe { from_glib_full(pango_sys::pango_attr_list_new()) } } pub fn copy(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_list_copy(self.to_glib_none().0)) } } pub fn filter bool>(&self, func: P) -> Option { let func_data: P = func; unsafe extern "C" fn func_func bool>( attribute: *mut pango_sys::PangoAttribute, user_data: glib_sys::gpointer, ) -> glib_sys::gboolean { let attribute = from_glib_borrow(attribute); let callback: *mut P = user_data as *const _ as usize as *mut P; let res = (*callback)(&attribute); res.to_glib() } let func = Some(func_func::

as _); let super_callback0: &P = &func_data; unsafe { from_glib_full(pango_sys::pango_attr_list_filter( self.to_glib_none().0, func, super_callback0 as *const _ as usize as *mut _, )) } } pub fn get_iterator(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_attr_list_get_iterator( self.to_glib_none().0, )) } } pub fn splice(&self, other: &AttrList, pos: i32, len: i32) { unsafe { pango_sys::pango_attr_list_splice( self.to_glib_none().0, other.to_glib_none().0, pos, len, ); } } } impl Default for AttrList { fn default() -> Self { Self::new() } } pango-0.7.0/src/auto/attribute.rs010064400007650000024000000020331350341657000151530ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use AttrClass; glib_wrapper! { #[derive(Debug, PartialOrd, Ord, Hash)] pub struct Attribute(Boxed); match fn { copy => |ptr| pango_sys::pango_attribute_copy(mut_override(ptr)), free => |ptr| pango_sys::pango_attribute_destroy(ptr), } } impl Attribute { fn equal(&self, attr2: &Attribute) -> bool { unsafe { from_glib(pango_sys::pango_attribute_equal( self.to_glib_none().0, attr2.to_glib_none().0, )) } } pub fn init(&mut self, klass: &AttrClass) { unsafe { pango_sys::pango_attribute_init(self.to_glib_none_mut().0, klass.to_glib_none().0); } } } impl PartialEq for Attribute { #[inline] fn eq(&self, other: &Self) -> bool { self.equal(other) } } impl Eq for Attribute {} pango-0.7.0/src/auto/color.rs010064400007650000024000000020731350341657000142720ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use glib::GString; use pango_sys; use std::fmt; glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Color(Boxed); match fn { copy => |ptr| pango_sys::pango_color_copy(mut_override(ptr)), free => |ptr| pango_sys::pango_color_free(ptr), get_type => || pango_sys::pango_color_get_type(), } } impl Color { pub fn parse(&mut self, spec: &str) -> bool { unsafe { from_glib(pango_sys::pango_color_parse( self.to_glib_none_mut().0, spec.to_glib_none().0, )) } } fn to_string(&self) -> GString { unsafe { from_glib_full(pango_sys::pango_color_to_string(self.to_glib_none().0)) } } } impl fmt::Display for Color { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.to_string()) } } pango-0.7.0/src/auto/constants.rs010064400007650000024000000015421350341657000151700ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use pango_sys; use std::ffi::CStr; #[cfg_attr(feature = "v1_38", deprecated)] lazy_static! { pub static ref ENGINE_TYPE_LANG: &'static str = unsafe { CStr::from_ptr(pango_sys::PANGO_ENGINE_TYPE_LANG) .to_str() .unwrap() }; } #[cfg_attr(feature = "v1_38", deprecated)] lazy_static! { pub static ref ENGINE_TYPE_SHAPE: &'static str = unsafe { CStr::from_ptr(pango_sys::PANGO_ENGINE_TYPE_SHAPE) .to_str() .unwrap() }; } #[cfg_attr(feature = "v1_38", deprecated)] lazy_static! { pub static ref RENDER_TYPE_NONE: &'static str = unsafe { CStr::from_ptr(pango_sys::PANGO_RENDER_TYPE_NONE) .to_str() .unwrap() }; } pango-0.7.0/src/auto/context.rs010064400007650000024000000126161350341657000146440ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use pango_sys; use std::fmt; use std::mem; use std::ptr; use Direction; use Font; use FontDescription; use FontFamily; use FontMap; use FontMetrics; use Fontset; use Gravity; use GravityHint; use Language; use Matrix; glib_wrapper! { pub struct Context(Object); match fn { get_type => || pango_sys::pango_context_get_type(), } } impl Context { pub fn new() -> Context { unsafe { from_glib_full(pango_sys::pango_context_new()) } } pub fn changed(&self) { unsafe { pango_sys::pango_context_changed(self.to_glib_none().0); } } pub fn get_base_dir(&self) -> Direction { unsafe { from_glib(pango_sys::pango_context_get_base_dir(self.to_glib_none().0)) } } pub fn get_base_gravity(&self) -> Gravity { unsafe { from_glib(pango_sys::pango_context_get_base_gravity( self.to_glib_none().0, )) } } pub fn get_font_description(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_context_get_font_description( self.to_glib_none().0, )) } } pub fn get_font_map(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_context_get_font_map(self.to_glib_none().0)) } } pub fn get_gravity(&self) -> Gravity { unsafe { from_glib(pango_sys::pango_context_get_gravity(self.to_glib_none().0)) } } pub fn get_gravity_hint(&self) -> GravityHint { unsafe { from_glib(pango_sys::pango_context_get_gravity_hint( self.to_glib_none().0, )) } } pub fn get_language(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_context_get_language(self.to_glib_none().0)) } } pub fn get_matrix(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_context_get_matrix(self.to_glib_none().0)) } } pub fn get_metrics( &self, desc: Option<&FontDescription>, language: Option<&Language>, ) -> Option { unsafe { from_glib_full(pango_sys::pango_context_get_metrics( self.to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0), )) } } pub fn get_serial(&self) -> u32 { unsafe { pango_sys::pango_context_get_serial(self.to_glib_none().0) } } pub fn list_families(&self) -> Vec { unsafe { let mut families = ptr::null_mut(); let mut n_families = mem::uninitialized(); pango_sys::pango_context_list_families( self.to_glib_none().0, &mut families, &mut n_families, ); FromGlibContainer::from_glib_container_num(families, n_families as usize) } } pub fn load_font(&self, desc: &FontDescription) -> Option { unsafe { from_glib_full(pango_sys::pango_context_load_font( self.to_glib_none().0, desc.to_glib_none().0, )) } } pub fn load_fontset(&self, desc: &FontDescription, language: &Language) -> Option { unsafe { from_glib_full(pango_sys::pango_context_load_fontset( self.to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0), )) } } pub fn set_base_dir(&self, direction: Direction) { unsafe { pango_sys::pango_context_set_base_dir(self.to_glib_none().0, direction.to_glib()); } } pub fn set_base_gravity(&self, gravity: Gravity) { unsafe { pango_sys::pango_context_set_base_gravity(self.to_glib_none().0, gravity.to_glib()); } } pub fn set_font_description(&self, desc: &FontDescription) { unsafe { pango_sys::pango_context_set_font_description( self.to_glib_none().0, desc.to_glib_none().0, ); } } pub fn set_font_map>(&self, font_map: &P) { unsafe { pango_sys::pango_context_set_font_map( self.to_glib_none().0, font_map.as_ref().to_glib_none().0, ); } } pub fn set_gravity_hint(&self, hint: GravityHint) { unsafe { pango_sys::pango_context_set_gravity_hint(self.to_glib_none().0, hint.to_glib()); } } pub fn set_language(&self, language: &Language) { unsafe { pango_sys::pango_context_set_language( self.to_glib_none().0, mut_override(language.to_glib_none().0), ); } } pub fn set_matrix(&self, matrix: Option<&Matrix>) { unsafe { pango_sys::pango_context_set_matrix(self.to_glib_none().0, matrix.to_glib_none().0); } } } impl Default for Context { fn default() -> Self { Self::new() } } impl fmt::Display for Context { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Context") } } pango-0.7.0/src/auto/coverage.rs010064400007650000024000000036651350341657000147570ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use std::mem; use std::ptr; use CoverageLevel; glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Coverage(Shared); match fn { ref => |ptr| pango_sys::pango_coverage_ref(ptr), unref => |ptr| pango_sys::pango_coverage_unref(ptr), } } impl Coverage { pub fn copy(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_coverage_copy(self.to_glib_none().0)) } } pub fn get(&self, index_: i32) -> CoverageLevel { unsafe { from_glib(pango_sys::pango_coverage_get(self.to_glib_none().0, index_)) } } pub fn max(&self, other: &Coverage) { unsafe { pango_sys::pango_coverage_max(self.to_glib_none().0, other.to_glib_none().0); } } pub fn set(&self, index_: i32, level: CoverageLevel) { unsafe { pango_sys::pango_coverage_set(self.to_glib_none().0, index_, level.to_glib()); } } pub fn to_bytes(&self) -> Vec { unsafe { let mut bytes = ptr::null_mut(); let mut n_bytes = mem::uninitialized(); pango_sys::pango_coverage_to_bytes(self.to_glib_none().0, &mut bytes, &mut n_bytes); FromGlibContainer::from_glib_full_num(bytes, n_bytes as usize) } } pub fn from_bytes(bytes: &[u8]) -> Option { let n_bytes = bytes.len() as i32; unsafe { from_glib_full(pango_sys::pango_coverage_from_bytes( bytes.to_glib_none().0, n_bytes, )) } } pub fn new() -> Coverage { unsafe { from_glib_none(pango_sys::pango_coverage_new()) } } } impl Default for Coverage { fn default() -> Self { Self::new() } } pango-0.7.0/src/auto/engine_lang.rs010064400007650000024000000011551350341657000154220ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use std::fmt; glib_wrapper! { pub struct EngineLang(Object); match fn { get_type => || pango_sys::pango_engine_lang_get_type(), } } impl EngineLang {} pub const NONE_ENGINE_LANG: Option<&EngineLang> = None; impl fmt::Display for EngineLang { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "EngineLang") } } pango-0.7.0/src/auto/engine_shape.rs010064400007650000024000000011671350341657000156040ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; use std::fmt; glib_wrapper! { pub struct EngineShape(Object); match fn { get_type => || pango_sys::pango_engine_shape_get_type(), } } impl EngineShape {} pub const NONE_ENGINE_SHAPE: Option<&EngineShape> = None; impl fmt::Display for EngineShape { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "EngineShape") } } pango-0.7.0/src/auto/enums.rs010064400007650000024000001722131350341657000143070ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use glib::value::FromValue; use glib::value::FromValueOptional; use glib::value::SetValue; use glib::value::Value; use glib::StaticType; use glib::Type; use gobject_sys; use pango_sys; use std::fmt; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Alignment { Left, Center, Right, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Alignment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Alignment::{}", match *self { Alignment::Left => "Left", Alignment::Center => "Center", Alignment::Right => "Right", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Alignment { type GlibType = pango_sys::PangoAlignment; fn to_glib(&self) -> pango_sys::PangoAlignment { match *self { Alignment::Left => pango_sys::PANGO_ALIGN_LEFT, Alignment::Center => pango_sys::PANGO_ALIGN_CENTER, Alignment::Right => pango_sys::PANGO_ALIGN_RIGHT, Alignment::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Alignment { fn from_glib(value: pango_sys::PangoAlignment) -> Self { match value { 0 => Alignment::Left, 1 => Alignment::Center, 2 => Alignment::Right, value => Alignment::__Unknown(value), } } } impl StaticType for Alignment { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_alignment_get_type()) } } } impl<'a> FromValueOptional<'a> for Alignment { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Alignment { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Alignment { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum AttrType { Invalid, Language, Family, Style, Weight, Variant, Stretch, Size, FontDesc, Foreground, Background, Underline, Strikethrough, Rise, Shape, Scale, Fallback, LetterSpacing, UnderlineColor, StrikethroughColor, AbsoluteSize, Gravity, GravityHint, FontFeatures, ForegroundAlpha, BackgroundAlpha, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for AttrType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "AttrType::{}", match *self { AttrType::Invalid => "Invalid", AttrType::Language => "Language", AttrType::Family => "Family", AttrType::Style => "Style", AttrType::Weight => "Weight", AttrType::Variant => "Variant", AttrType::Stretch => "Stretch", AttrType::Size => "Size", AttrType::FontDesc => "FontDesc", AttrType::Foreground => "Foreground", AttrType::Background => "Background", AttrType::Underline => "Underline", AttrType::Strikethrough => "Strikethrough", AttrType::Rise => "Rise", AttrType::Shape => "Shape", AttrType::Scale => "Scale", AttrType::Fallback => "Fallback", AttrType::LetterSpacing => "LetterSpacing", AttrType::UnderlineColor => "UnderlineColor", AttrType::StrikethroughColor => "StrikethroughColor", AttrType::AbsoluteSize => "AbsoluteSize", AttrType::Gravity => "Gravity", AttrType::GravityHint => "GravityHint", AttrType::FontFeatures => "FontFeatures", AttrType::ForegroundAlpha => "ForegroundAlpha", AttrType::BackgroundAlpha => "BackgroundAlpha", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for AttrType { type GlibType = pango_sys::PangoAttrType; fn to_glib(&self) -> pango_sys::PangoAttrType { match *self { AttrType::Invalid => pango_sys::PANGO_ATTR_INVALID, AttrType::Language => pango_sys::PANGO_ATTR_LANGUAGE, AttrType::Family => pango_sys::PANGO_ATTR_FAMILY, AttrType::Style => pango_sys::PANGO_ATTR_STYLE, AttrType::Weight => pango_sys::PANGO_ATTR_WEIGHT, AttrType::Variant => pango_sys::PANGO_ATTR_VARIANT, AttrType::Stretch => pango_sys::PANGO_ATTR_STRETCH, AttrType::Size => pango_sys::PANGO_ATTR_SIZE, AttrType::FontDesc => pango_sys::PANGO_ATTR_FONT_DESC, AttrType::Foreground => pango_sys::PANGO_ATTR_FOREGROUND, AttrType::Background => pango_sys::PANGO_ATTR_BACKGROUND, AttrType::Underline => pango_sys::PANGO_ATTR_UNDERLINE, AttrType::Strikethrough => pango_sys::PANGO_ATTR_STRIKETHROUGH, AttrType::Rise => pango_sys::PANGO_ATTR_RISE, AttrType::Shape => pango_sys::PANGO_ATTR_SHAPE, AttrType::Scale => pango_sys::PANGO_ATTR_SCALE, AttrType::Fallback => pango_sys::PANGO_ATTR_FALLBACK, AttrType::LetterSpacing => pango_sys::PANGO_ATTR_LETTER_SPACING, AttrType::UnderlineColor => pango_sys::PANGO_ATTR_UNDERLINE_COLOR, AttrType::StrikethroughColor => pango_sys::PANGO_ATTR_STRIKETHROUGH_COLOR, AttrType::AbsoluteSize => pango_sys::PANGO_ATTR_ABSOLUTE_SIZE, AttrType::Gravity => pango_sys::PANGO_ATTR_GRAVITY, AttrType::GravityHint => pango_sys::PANGO_ATTR_GRAVITY_HINT, AttrType::FontFeatures => pango_sys::PANGO_ATTR_FONT_FEATURES, AttrType::ForegroundAlpha => pango_sys::PANGO_ATTR_FOREGROUND_ALPHA, AttrType::BackgroundAlpha => pango_sys::PANGO_ATTR_BACKGROUND_ALPHA, AttrType::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AttrType { fn from_glib(value: pango_sys::PangoAttrType) -> Self { match value { 0 => AttrType::Invalid, 1 => AttrType::Language, 2 => AttrType::Family, 3 => AttrType::Style, 4 => AttrType::Weight, 5 => AttrType::Variant, 6 => AttrType::Stretch, 7 => AttrType::Size, 8 => AttrType::FontDesc, 9 => AttrType::Foreground, 10 => AttrType::Background, 11 => AttrType::Underline, 12 => AttrType::Strikethrough, 13 => AttrType::Rise, 14 => AttrType::Shape, 15 => AttrType::Scale, 16 => AttrType::Fallback, 17 => AttrType::LetterSpacing, 18 => AttrType::UnderlineColor, 19 => AttrType::StrikethroughColor, 20 => AttrType::AbsoluteSize, 21 => AttrType::Gravity, 22 => AttrType::GravityHint, 23 => AttrType::FontFeatures, 24 => AttrType::ForegroundAlpha, 25 => AttrType::BackgroundAlpha, value => AttrType::__Unknown(value), } } } impl StaticType for AttrType { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_attr_type_get_type()) } } } impl<'a> FromValueOptional<'a> for AttrType { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for AttrType { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for AttrType { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum BidiType { L, Lre, Lro, R, Al, Rle, Rlo, Pdf, En, Es, Et, An, Cs, Nsm, Bn, B, S, Ws, On, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for BidiType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "BidiType::{}", match *self { BidiType::L => "L", BidiType::Lre => "Lre", BidiType::Lro => "Lro", BidiType::R => "R", BidiType::Al => "Al", BidiType::Rle => "Rle", BidiType::Rlo => "Rlo", BidiType::Pdf => "Pdf", BidiType::En => "En", BidiType::Es => "Es", BidiType::Et => "Et", BidiType::An => "An", BidiType::Cs => "Cs", BidiType::Nsm => "Nsm", BidiType::Bn => "Bn", BidiType::B => "B", BidiType::S => "S", BidiType::Ws => "Ws", BidiType::On => "On", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for BidiType { type GlibType = pango_sys::PangoBidiType; fn to_glib(&self) -> pango_sys::PangoBidiType { match *self { BidiType::L => pango_sys::PANGO_BIDI_TYPE_L, BidiType::Lre => pango_sys::PANGO_BIDI_TYPE_LRE, BidiType::Lro => pango_sys::PANGO_BIDI_TYPE_LRO, BidiType::R => pango_sys::PANGO_BIDI_TYPE_R, BidiType::Al => pango_sys::PANGO_BIDI_TYPE_AL, BidiType::Rle => pango_sys::PANGO_BIDI_TYPE_RLE, BidiType::Rlo => pango_sys::PANGO_BIDI_TYPE_RLO, BidiType::Pdf => pango_sys::PANGO_BIDI_TYPE_PDF, BidiType::En => pango_sys::PANGO_BIDI_TYPE_EN, BidiType::Es => pango_sys::PANGO_BIDI_TYPE_ES, BidiType::Et => pango_sys::PANGO_BIDI_TYPE_ET, BidiType::An => pango_sys::PANGO_BIDI_TYPE_AN, BidiType::Cs => pango_sys::PANGO_BIDI_TYPE_CS, BidiType::Nsm => pango_sys::PANGO_BIDI_TYPE_NSM, BidiType::Bn => pango_sys::PANGO_BIDI_TYPE_BN, BidiType::B => pango_sys::PANGO_BIDI_TYPE_B, BidiType::S => pango_sys::PANGO_BIDI_TYPE_S, BidiType::Ws => pango_sys::PANGO_BIDI_TYPE_WS, BidiType::On => pango_sys::PANGO_BIDI_TYPE_ON, BidiType::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for BidiType { fn from_glib(value: pango_sys::PangoBidiType) -> Self { match value { 0 => BidiType::L, 1 => BidiType::Lre, 2 => BidiType::Lro, 3 => BidiType::R, 4 => BidiType::Al, 5 => BidiType::Rle, 6 => BidiType::Rlo, 7 => BidiType::Pdf, 8 => BidiType::En, 9 => BidiType::Es, 10 => BidiType::Et, 11 => BidiType::An, 12 => BidiType::Cs, 13 => BidiType::Nsm, 14 => BidiType::Bn, 15 => BidiType::B, 16 => BidiType::S, 17 => BidiType::Ws, 18 => BidiType::On, value => BidiType::__Unknown(value), } } } impl StaticType for BidiType { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_bidi_type_get_type()) } } } impl<'a> FromValueOptional<'a> for BidiType { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for BidiType { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for BidiType { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum CoverageLevel { None, Fallback, Approximate, Exact, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for CoverageLevel { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "CoverageLevel::{}", match *self { CoverageLevel::None => "None", CoverageLevel::Fallback => "Fallback", CoverageLevel::Approximate => "Approximate", CoverageLevel::Exact => "Exact", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for CoverageLevel { type GlibType = pango_sys::PangoCoverageLevel; fn to_glib(&self) -> pango_sys::PangoCoverageLevel { match *self { CoverageLevel::None => pango_sys::PANGO_COVERAGE_NONE, CoverageLevel::Fallback => pango_sys::PANGO_COVERAGE_FALLBACK, CoverageLevel::Approximate => pango_sys::PANGO_COVERAGE_APPROXIMATE, CoverageLevel::Exact => pango_sys::PANGO_COVERAGE_EXACT, CoverageLevel::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for CoverageLevel { fn from_glib(value: pango_sys::PangoCoverageLevel) -> Self { match value { 0 => CoverageLevel::None, 1 => CoverageLevel::Fallback, 2 => CoverageLevel::Approximate, 3 => CoverageLevel::Exact, value => CoverageLevel::__Unknown(value), } } } impl StaticType for CoverageLevel { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_coverage_level_get_type()) } } } impl<'a> FromValueOptional<'a> for CoverageLevel { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for CoverageLevel { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for CoverageLevel { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Direction { Ltr, Rtl, TtbLtr, TtbRtl, WeakLtr, WeakRtl, Neutral, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Direction { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Direction::{}", match *self { Direction::Ltr => "Ltr", Direction::Rtl => "Rtl", Direction::TtbLtr => "TtbLtr", Direction::TtbRtl => "TtbRtl", Direction::WeakLtr => "WeakLtr", Direction::WeakRtl => "WeakRtl", Direction::Neutral => "Neutral", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Direction { type GlibType = pango_sys::PangoDirection; fn to_glib(&self) -> pango_sys::PangoDirection { match *self { Direction::Ltr => pango_sys::PANGO_DIRECTION_LTR, Direction::Rtl => pango_sys::PANGO_DIRECTION_RTL, Direction::TtbLtr => pango_sys::PANGO_DIRECTION_TTB_LTR, Direction::TtbRtl => pango_sys::PANGO_DIRECTION_TTB_RTL, Direction::WeakLtr => pango_sys::PANGO_DIRECTION_WEAK_LTR, Direction::WeakRtl => pango_sys::PANGO_DIRECTION_WEAK_RTL, Direction::Neutral => pango_sys::PANGO_DIRECTION_NEUTRAL, Direction::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Direction { fn from_glib(value: pango_sys::PangoDirection) -> Self { match value { 0 => Direction::Ltr, 1 => Direction::Rtl, 2 => Direction::TtbLtr, 3 => Direction::TtbRtl, 4 => Direction::WeakLtr, 5 => Direction::WeakRtl, 6 => Direction::Neutral, value => Direction::__Unknown(value), } } } impl StaticType for Direction { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_direction_get_type()) } } } impl<'a> FromValueOptional<'a> for Direction { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Direction { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Direction { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum EllipsizeMode { None, Start, Middle, End, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for EllipsizeMode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "EllipsizeMode::{}", match *self { EllipsizeMode::None => "None", EllipsizeMode::Start => "Start", EllipsizeMode::Middle => "Middle", EllipsizeMode::End => "End", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for EllipsizeMode { type GlibType = pango_sys::PangoEllipsizeMode; fn to_glib(&self) -> pango_sys::PangoEllipsizeMode { match *self { EllipsizeMode::None => pango_sys::PANGO_ELLIPSIZE_NONE, EllipsizeMode::Start => pango_sys::PANGO_ELLIPSIZE_START, EllipsizeMode::Middle => pango_sys::PANGO_ELLIPSIZE_MIDDLE, EllipsizeMode::End => pango_sys::PANGO_ELLIPSIZE_END, EllipsizeMode::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for EllipsizeMode { fn from_glib(value: pango_sys::PangoEllipsizeMode) -> Self { match value { 0 => EllipsizeMode::None, 1 => EllipsizeMode::Start, 2 => EllipsizeMode::Middle, 3 => EllipsizeMode::End, value => EllipsizeMode::__Unknown(value), } } } impl StaticType for EllipsizeMode { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_ellipsize_mode_get_type()) } } } impl<'a> FromValueOptional<'a> for EllipsizeMode { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for EllipsizeMode { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for EllipsizeMode { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Gravity { South, East, North, West, Auto, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Gravity { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Gravity::{}", match *self { Gravity::South => "South", Gravity::East => "East", Gravity::North => "North", Gravity::West => "West", Gravity::Auto => "Auto", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Gravity { type GlibType = pango_sys::PangoGravity; fn to_glib(&self) -> pango_sys::PangoGravity { match *self { Gravity::South => pango_sys::PANGO_GRAVITY_SOUTH, Gravity::East => pango_sys::PANGO_GRAVITY_EAST, Gravity::North => pango_sys::PANGO_GRAVITY_NORTH, Gravity::West => pango_sys::PANGO_GRAVITY_WEST, Gravity::Auto => pango_sys::PANGO_GRAVITY_AUTO, Gravity::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Gravity { fn from_glib(value: pango_sys::PangoGravity) -> Self { match value { 0 => Gravity::South, 1 => Gravity::East, 2 => Gravity::North, 3 => Gravity::West, 4 => Gravity::Auto, value => Gravity::__Unknown(value), } } } impl StaticType for Gravity { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_gravity_get_type()) } } } impl<'a> FromValueOptional<'a> for Gravity { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Gravity { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Gravity { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum GravityHint { Natural, Strong, Line, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for GravityHint { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "GravityHint::{}", match *self { GravityHint::Natural => "Natural", GravityHint::Strong => "Strong", GravityHint::Line => "Line", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for GravityHint { type GlibType = pango_sys::PangoGravityHint; fn to_glib(&self) -> pango_sys::PangoGravityHint { match *self { GravityHint::Natural => pango_sys::PANGO_GRAVITY_HINT_NATURAL, GravityHint::Strong => pango_sys::PANGO_GRAVITY_HINT_STRONG, GravityHint::Line => pango_sys::PANGO_GRAVITY_HINT_LINE, GravityHint::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for GravityHint { fn from_glib(value: pango_sys::PangoGravityHint) -> Self { match value { 0 => GravityHint::Natural, 1 => GravityHint::Strong, 2 => GravityHint::Line, value => GravityHint::__Unknown(value), } } } impl StaticType for GravityHint { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_gravity_hint_get_type()) } } } impl<'a> FromValueOptional<'a> for GravityHint { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for GravityHint { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for GravityHint { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum RenderPart { Foreground, Background, Underline, Strikethrough, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for RenderPart { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "RenderPart::{}", match *self { RenderPart::Foreground => "Foreground", RenderPart::Background => "Background", RenderPart::Underline => "Underline", RenderPart::Strikethrough => "Strikethrough", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for RenderPart { type GlibType = pango_sys::PangoRenderPart; fn to_glib(&self) -> pango_sys::PangoRenderPart { match *self { RenderPart::Foreground => pango_sys::PANGO_RENDER_PART_FOREGROUND, RenderPart::Background => pango_sys::PANGO_RENDER_PART_BACKGROUND, RenderPart::Underline => pango_sys::PANGO_RENDER_PART_UNDERLINE, RenderPart::Strikethrough => pango_sys::PANGO_RENDER_PART_STRIKETHROUGH, RenderPart::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for RenderPart { fn from_glib(value: pango_sys::PangoRenderPart) -> Self { match value { 0 => RenderPart::Foreground, 1 => RenderPart::Background, 2 => RenderPart::Underline, 3 => RenderPart::Strikethrough, value => RenderPart::__Unknown(value), } } } impl StaticType for RenderPart { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_render_part_get_type()) } } } impl<'a> FromValueOptional<'a> for RenderPart { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for RenderPart { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for RenderPart { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Script { InvalidCode, Common, Inherited, Arabic, Armenian, Bengali, Bopomofo, Cherokee, Coptic, Cyrillic, Deseret, Devanagari, Ethiopic, Georgian, Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul, Hebrew, Hiragana, Kannada, Katakana, Khmer, Lao, Latin, Malayalam, Mongolian, Myanmar, Ogham, OldItalic, Oriya, Runic, Sinhala, Syriac, Tamil, Telugu, Thaana, Thai, Tibetan, CanadianAboriginal, Yi, Tagalog, Hanunoo, Buhid, Tagbanwa, Braille, Cypriot, Limbu, Osmanya, Shavian, LinearB, TaiLe, Ugaritic, NewTaiLue, Buginese, Glagolitic, Tifinagh, SylotiNagri, OldPersian, Kharoshthi, Unknown, Balinese, Cuneiform, Phoenician, PhagsPa, Nko, KayahLi, Lepcha, Rejang, Sundanese, Saurashtra, Cham, OlChiki, Vai, Carian, Lycian, Lydian, Batak, Brahmi, Mandaic, Chakma, MeroiticCursive, MeroiticHieroglyphs, Miao, Sharada, SoraSompeng, Takri, BassaVah, CaucasianAlbanian, Duployan, Elbasan, Grantha, Khojki, Khudawadi, LinearA, Mahajani, Manichaean, MendeKikakui, Modi, Mro, Nabataean, OldNorthArabian, OldPermic, PahawhHmong, Palmyrene, PauCinHau, PsalterPahlavi, Siddham, Tirhuta, WarangCiti, Ahom, AnatolianHieroglyphs, Hatran, Multani, OldHungarian, Signwriting, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Script { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Script::{}", match *self { Script::InvalidCode => "InvalidCode", Script::Common => "Common", Script::Inherited => "Inherited", Script::Arabic => "Arabic", Script::Armenian => "Armenian", Script::Bengali => "Bengali", Script::Bopomofo => "Bopomofo", Script::Cherokee => "Cherokee", Script::Coptic => "Coptic", Script::Cyrillic => "Cyrillic", Script::Deseret => "Deseret", Script::Devanagari => "Devanagari", Script::Ethiopic => "Ethiopic", Script::Georgian => "Georgian", Script::Gothic => "Gothic", Script::Greek => "Greek", Script::Gujarati => "Gujarati", Script::Gurmukhi => "Gurmukhi", Script::Han => "Han", Script::Hangul => "Hangul", Script::Hebrew => "Hebrew", Script::Hiragana => "Hiragana", Script::Kannada => "Kannada", Script::Katakana => "Katakana", Script::Khmer => "Khmer", Script::Lao => "Lao", Script::Latin => "Latin", Script::Malayalam => "Malayalam", Script::Mongolian => "Mongolian", Script::Myanmar => "Myanmar", Script::Ogham => "Ogham", Script::OldItalic => "OldItalic", Script::Oriya => "Oriya", Script::Runic => "Runic", Script::Sinhala => "Sinhala", Script::Syriac => "Syriac", Script::Tamil => "Tamil", Script::Telugu => "Telugu", Script::Thaana => "Thaana", Script::Thai => "Thai", Script::Tibetan => "Tibetan", Script::CanadianAboriginal => "CanadianAboriginal", Script::Yi => "Yi", Script::Tagalog => "Tagalog", Script::Hanunoo => "Hanunoo", Script::Buhid => "Buhid", Script::Tagbanwa => "Tagbanwa", Script::Braille => "Braille", Script::Cypriot => "Cypriot", Script::Limbu => "Limbu", Script::Osmanya => "Osmanya", Script::Shavian => "Shavian", Script::LinearB => "LinearB", Script::TaiLe => "TaiLe", Script::Ugaritic => "Ugaritic", Script::NewTaiLue => "NewTaiLue", Script::Buginese => "Buginese", Script::Glagolitic => "Glagolitic", Script::Tifinagh => "Tifinagh", Script::SylotiNagri => "SylotiNagri", Script::OldPersian => "OldPersian", Script::Kharoshthi => "Kharoshthi", Script::Unknown => "Unknown", Script::Balinese => "Balinese", Script::Cuneiform => "Cuneiform", Script::Phoenician => "Phoenician", Script::PhagsPa => "PhagsPa", Script::Nko => "Nko", Script::KayahLi => "KayahLi", Script::Lepcha => "Lepcha", Script::Rejang => "Rejang", Script::Sundanese => "Sundanese", Script::Saurashtra => "Saurashtra", Script::Cham => "Cham", Script::OlChiki => "OlChiki", Script::Vai => "Vai", Script::Carian => "Carian", Script::Lycian => "Lycian", Script::Lydian => "Lydian", Script::Batak => "Batak", Script::Brahmi => "Brahmi", Script::Mandaic => "Mandaic", Script::Chakma => "Chakma", Script::MeroiticCursive => "MeroiticCursive", Script::MeroiticHieroglyphs => "MeroiticHieroglyphs", Script::Miao => "Miao", Script::Sharada => "Sharada", Script::SoraSompeng => "SoraSompeng", Script::Takri => "Takri", Script::BassaVah => "BassaVah", Script::CaucasianAlbanian => "CaucasianAlbanian", Script::Duployan => "Duployan", Script::Elbasan => "Elbasan", Script::Grantha => "Grantha", Script::Khojki => "Khojki", Script::Khudawadi => "Khudawadi", Script::LinearA => "LinearA", Script::Mahajani => "Mahajani", Script::Manichaean => "Manichaean", Script::MendeKikakui => "MendeKikakui", Script::Modi => "Modi", Script::Mro => "Mro", Script::Nabataean => "Nabataean", Script::OldNorthArabian => "OldNorthArabian", Script::OldPermic => "OldPermic", Script::PahawhHmong => "PahawhHmong", Script::Palmyrene => "Palmyrene", Script::PauCinHau => "PauCinHau", Script::PsalterPahlavi => "PsalterPahlavi", Script::Siddham => "Siddham", Script::Tirhuta => "Tirhuta", Script::WarangCiti => "WarangCiti", Script::Ahom => "Ahom", Script::AnatolianHieroglyphs => "AnatolianHieroglyphs", Script::Hatran => "Hatran", Script::Multani => "Multani", Script::OldHungarian => "OldHungarian", Script::Signwriting => "Signwriting", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Script { type GlibType = pango_sys::PangoScript; fn to_glib(&self) -> pango_sys::PangoScript { match *self { Script::InvalidCode => pango_sys::PANGO_SCRIPT_INVALID_CODE, Script::Common => pango_sys::PANGO_SCRIPT_COMMON, Script::Inherited => pango_sys::PANGO_SCRIPT_INHERITED, Script::Arabic => pango_sys::PANGO_SCRIPT_ARABIC, Script::Armenian => pango_sys::PANGO_SCRIPT_ARMENIAN, Script::Bengali => pango_sys::PANGO_SCRIPT_BENGALI, Script::Bopomofo => pango_sys::PANGO_SCRIPT_BOPOMOFO, Script::Cherokee => pango_sys::PANGO_SCRIPT_CHEROKEE, Script::Coptic => pango_sys::PANGO_SCRIPT_COPTIC, Script::Cyrillic => pango_sys::PANGO_SCRIPT_CYRILLIC, Script::Deseret => pango_sys::PANGO_SCRIPT_DESERET, Script::Devanagari => pango_sys::PANGO_SCRIPT_DEVANAGARI, Script::Ethiopic => pango_sys::PANGO_SCRIPT_ETHIOPIC, Script::Georgian => pango_sys::PANGO_SCRIPT_GEORGIAN, Script::Gothic => pango_sys::PANGO_SCRIPT_GOTHIC, Script::Greek => pango_sys::PANGO_SCRIPT_GREEK, Script::Gujarati => pango_sys::PANGO_SCRIPT_GUJARATI, Script::Gurmukhi => pango_sys::PANGO_SCRIPT_GURMUKHI, Script::Han => pango_sys::PANGO_SCRIPT_HAN, Script::Hangul => pango_sys::PANGO_SCRIPT_HANGUL, Script::Hebrew => pango_sys::PANGO_SCRIPT_HEBREW, Script::Hiragana => pango_sys::PANGO_SCRIPT_HIRAGANA, Script::Kannada => pango_sys::PANGO_SCRIPT_KANNADA, Script::Katakana => pango_sys::PANGO_SCRIPT_KATAKANA, Script::Khmer => pango_sys::PANGO_SCRIPT_KHMER, Script::Lao => pango_sys::PANGO_SCRIPT_LAO, Script::Latin => pango_sys::PANGO_SCRIPT_LATIN, Script::Malayalam => pango_sys::PANGO_SCRIPT_MALAYALAM, Script::Mongolian => pango_sys::PANGO_SCRIPT_MONGOLIAN, Script::Myanmar => pango_sys::PANGO_SCRIPT_MYANMAR, Script::Ogham => pango_sys::PANGO_SCRIPT_OGHAM, Script::OldItalic => pango_sys::PANGO_SCRIPT_OLD_ITALIC, Script::Oriya => pango_sys::PANGO_SCRIPT_ORIYA, Script::Runic => pango_sys::PANGO_SCRIPT_RUNIC, Script::Sinhala => pango_sys::PANGO_SCRIPT_SINHALA, Script::Syriac => pango_sys::PANGO_SCRIPT_SYRIAC, Script::Tamil => pango_sys::PANGO_SCRIPT_TAMIL, Script::Telugu => pango_sys::PANGO_SCRIPT_TELUGU, Script::Thaana => pango_sys::PANGO_SCRIPT_THAANA, Script::Thai => pango_sys::PANGO_SCRIPT_THAI, Script::Tibetan => pango_sys::PANGO_SCRIPT_TIBETAN, Script::CanadianAboriginal => pango_sys::PANGO_SCRIPT_CANADIAN_ABORIGINAL, Script::Yi => pango_sys::PANGO_SCRIPT_YI, Script::Tagalog => pango_sys::PANGO_SCRIPT_TAGALOG, Script::Hanunoo => pango_sys::PANGO_SCRIPT_HANUNOO, Script::Buhid => pango_sys::PANGO_SCRIPT_BUHID, Script::Tagbanwa => pango_sys::PANGO_SCRIPT_TAGBANWA, Script::Braille => pango_sys::PANGO_SCRIPT_BRAILLE, Script::Cypriot => pango_sys::PANGO_SCRIPT_CYPRIOT, Script::Limbu => pango_sys::PANGO_SCRIPT_LIMBU, Script::Osmanya => pango_sys::PANGO_SCRIPT_OSMANYA, Script::Shavian => pango_sys::PANGO_SCRIPT_SHAVIAN, Script::LinearB => pango_sys::PANGO_SCRIPT_LINEAR_B, Script::TaiLe => pango_sys::PANGO_SCRIPT_TAI_LE, Script::Ugaritic => pango_sys::PANGO_SCRIPT_UGARITIC, Script::NewTaiLue => pango_sys::PANGO_SCRIPT_NEW_TAI_LUE, Script::Buginese => pango_sys::PANGO_SCRIPT_BUGINESE, Script::Glagolitic => pango_sys::PANGO_SCRIPT_GLAGOLITIC, Script::Tifinagh => pango_sys::PANGO_SCRIPT_TIFINAGH, Script::SylotiNagri => pango_sys::PANGO_SCRIPT_SYLOTI_NAGRI, Script::OldPersian => pango_sys::PANGO_SCRIPT_OLD_PERSIAN, Script::Kharoshthi => pango_sys::PANGO_SCRIPT_KHAROSHTHI, Script::Unknown => pango_sys::PANGO_SCRIPT_UNKNOWN, Script::Balinese => pango_sys::PANGO_SCRIPT_BALINESE, Script::Cuneiform => pango_sys::PANGO_SCRIPT_CUNEIFORM, Script::Phoenician => pango_sys::PANGO_SCRIPT_PHOENICIAN, Script::PhagsPa => pango_sys::PANGO_SCRIPT_PHAGS_PA, Script::Nko => pango_sys::PANGO_SCRIPT_NKO, Script::KayahLi => pango_sys::PANGO_SCRIPT_KAYAH_LI, Script::Lepcha => pango_sys::PANGO_SCRIPT_LEPCHA, Script::Rejang => pango_sys::PANGO_SCRIPT_REJANG, Script::Sundanese => pango_sys::PANGO_SCRIPT_SUNDANESE, Script::Saurashtra => pango_sys::PANGO_SCRIPT_SAURASHTRA, Script::Cham => pango_sys::PANGO_SCRIPT_CHAM, Script::OlChiki => pango_sys::PANGO_SCRIPT_OL_CHIKI, Script::Vai => pango_sys::PANGO_SCRIPT_VAI, Script::Carian => pango_sys::PANGO_SCRIPT_CARIAN, Script::Lycian => pango_sys::PANGO_SCRIPT_LYCIAN, Script::Lydian => pango_sys::PANGO_SCRIPT_LYDIAN, Script::Batak => pango_sys::PANGO_SCRIPT_BATAK, Script::Brahmi => pango_sys::PANGO_SCRIPT_BRAHMI, Script::Mandaic => pango_sys::PANGO_SCRIPT_MANDAIC, Script::Chakma => pango_sys::PANGO_SCRIPT_CHAKMA, Script::MeroiticCursive => pango_sys::PANGO_SCRIPT_MEROITIC_CURSIVE, Script::MeroiticHieroglyphs => pango_sys::PANGO_SCRIPT_MEROITIC_HIEROGLYPHS, Script::Miao => pango_sys::PANGO_SCRIPT_MIAO, Script::Sharada => pango_sys::PANGO_SCRIPT_SHARADA, Script::SoraSompeng => pango_sys::PANGO_SCRIPT_SORA_SOMPENG, Script::Takri => pango_sys::PANGO_SCRIPT_TAKRI, Script::BassaVah => pango_sys::PANGO_SCRIPT_BASSA_VAH, Script::CaucasianAlbanian => pango_sys::PANGO_SCRIPT_CAUCASIAN_ALBANIAN, Script::Duployan => pango_sys::PANGO_SCRIPT_DUPLOYAN, Script::Elbasan => pango_sys::PANGO_SCRIPT_ELBASAN, Script::Grantha => pango_sys::PANGO_SCRIPT_GRANTHA, Script::Khojki => pango_sys::PANGO_SCRIPT_KHOJKI, Script::Khudawadi => pango_sys::PANGO_SCRIPT_KHUDAWADI, Script::LinearA => pango_sys::PANGO_SCRIPT_LINEAR_A, Script::Mahajani => pango_sys::PANGO_SCRIPT_MAHAJANI, Script::Manichaean => pango_sys::PANGO_SCRIPT_MANICHAEAN, Script::MendeKikakui => pango_sys::PANGO_SCRIPT_MENDE_KIKAKUI, Script::Modi => pango_sys::PANGO_SCRIPT_MODI, Script::Mro => pango_sys::PANGO_SCRIPT_MRO, Script::Nabataean => pango_sys::PANGO_SCRIPT_NABATAEAN, Script::OldNorthArabian => pango_sys::PANGO_SCRIPT_OLD_NORTH_ARABIAN, Script::OldPermic => pango_sys::PANGO_SCRIPT_OLD_PERMIC, Script::PahawhHmong => pango_sys::PANGO_SCRIPT_PAHAWH_HMONG, Script::Palmyrene => pango_sys::PANGO_SCRIPT_PALMYRENE, Script::PauCinHau => pango_sys::PANGO_SCRIPT_PAU_CIN_HAU, Script::PsalterPahlavi => pango_sys::PANGO_SCRIPT_PSALTER_PAHLAVI, Script::Siddham => pango_sys::PANGO_SCRIPT_SIDDHAM, Script::Tirhuta => pango_sys::PANGO_SCRIPT_TIRHUTA, Script::WarangCiti => pango_sys::PANGO_SCRIPT_WARANG_CITI, Script::Ahom => pango_sys::PANGO_SCRIPT_AHOM, Script::AnatolianHieroglyphs => pango_sys::PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS, Script::Hatran => pango_sys::PANGO_SCRIPT_HATRAN, Script::Multani => pango_sys::PANGO_SCRIPT_MULTANI, Script::OldHungarian => pango_sys::PANGO_SCRIPT_OLD_HUNGARIAN, Script::Signwriting => pango_sys::PANGO_SCRIPT_SIGNWRITING, Script::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Script { fn from_glib(value: pango_sys::PangoScript) -> Self { match value { -1 => Script::InvalidCode, 0 => Script::Common, 1 => Script::Inherited, 2 => Script::Arabic, 3 => Script::Armenian, 4 => Script::Bengali, 5 => Script::Bopomofo, 6 => Script::Cherokee, 7 => Script::Coptic, 8 => Script::Cyrillic, 9 => Script::Deseret, 10 => Script::Devanagari, 11 => Script::Ethiopic, 12 => Script::Georgian, 13 => Script::Gothic, 14 => Script::Greek, 15 => Script::Gujarati, 16 => Script::Gurmukhi, 17 => Script::Han, 18 => Script::Hangul, 19 => Script::Hebrew, 20 => Script::Hiragana, 21 => Script::Kannada, 22 => Script::Katakana, 23 => Script::Khmer, 24 => Script::Lao, 25 => Script::Latin, 26 => Script::Malayalam, 27 => Script::Mongolian, 28 => Script::Myanmar, 29 => Script::Ogham, 30 => Script::OldItalic, 31 => Script::Oriya, 32 => Script::Runic, 33 => Script::Sinhala, 34 => Script::Syriac, 35 => Script::Tamil, 36 => Script::Telugu, 37 => Script::Thaana, 38 => Script::Thai, 39 => Script::Tibetan, 40 => Script::CanadianAboriginal, 41 => Script::Yi, 42 => Script::Tagalog, 43 => Script::Hanunoo, 44 => Script::Buhid, 45 => Script::Tagbanwa, 46 => Script::Braille, 47 => Script::Cypriot, 48 => Script::Limbu, 49 => Script::Osmanya, 50 => Script::Shavian, 51 => Script::LinearB, 52 => Script::TaiLe, 53 => Script::Ugaritic, 54 => Script::NewTaiLue, 55 => Script::Buginese, 56 => Script::Glagolitic, 57 => Script::Tifinagh, 58 => Script::SylotiNagri, 59 => Script::OldPersian, 60 => Script::Kharoshthi, 61 => Script::Unknown, 62 => Script::Balinese, 63 => Script::Cuneiform, 64 => Script::Phoenician, 65 => Script::PhagsPa, 66 => Script::Nko, 67 => Script::KayahLi, 68 => Script::Lepcha, 69 => Script::Rejang, 70 => Script::Sundanese, 71 => Script::Saurashtra, 72 => Script::Cham, 73 => Script::OlChiki, 74 => Script::Vai, 75 => Script::Carian, 76 => Script::Lycian, 77 => Script::Lydian, 78 => Script::Batak, 79 => Script::Brahmi, 80 => Script::Mandaic, 81 => Script::Chakma, 82 => Script::MeroiticCursive, 83 => Script::MeroiticHieroglyphs, 84 => Script::Miao, 85 => Script::Sharada, 86 => Script::SoraSompeng, 87 => Script::Takri, 88 => Script::BassaVah, 89 => Script::CaucasianAlbanian, 90 => Script::Duployan, 91 => Script::Elbasan, 92 => Script::Grantha, 93 => Script::Khojki, 94 => Script::Khudawadi, 95 => Script::LinearA, 96 => Script::Mahajani, 97 => Script::Manichaean, 98 => Script::MendeKikakui, 99 => Script::Modi, 100 => Script::Mro, 101 => Script::Nabataean, 102 => Script::OldNorthArabian, 103 => Script::OldPermic, 104 => Script::PahawhHmong, 105 => Script::Palmyrene, 106 => Script::PauCinHau, 107 => Script::PsalterPahlavi, 108 => Script::Siddham, 109 => Script::Tirhuta, 110 => Script::WarangCiti, 111 => Script::Ahom, 112 => Script::AnatolianHieroglyphs, 113 => Script::Hatran, 114 => Script::Multani, 115 => Script::OldHungarian, 116 => Script::Signwriting, value => Script::__Unknown(value), } } } impl StaticType for Script { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_script_get_type()) } } } impl<'a> FromValueOptional<'a> for Script { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Script { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Script { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Stretch { UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Stretch { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Stretch::{}", match *self { Stretch::UltraCondensed => "UltraCondensed", Stretch::ExtraCondensed => "ExtraCondensed", Stretch::Condensed => "Condensed", Stretch::SemiCondensed => "SemiCondensed", Stretch::Normal => "Normal", Stretch::SemiExpanded => "SemiExpanded", Stretch::Expanded => "Expanded", Stretch::ExtraExpanded => "ExtraExpanded", Stretch::UltraExpanded => "UltraExpanded", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Stretch { type GlibType = pango_sys::PangoStretch; fn to_glib(&self) -> pango_sys::PangoStretch { match *self { Stretch::UltraCondensed => pango_sys::PANGO_STRETCH_ULTRA_CONDENSED, Stretch::ExtraCondensed => pango_sys::PANGO_STRETCH_EXTRA_CONDENSED, Stretch::Condensed => pango_sys::PANGO_STRETCH_CONDENSED, Stretch::SemiCondensed => pango_sys::PANGO_STRETCH_SEMI_CONDENSED, Stretch::Normal => pango_sys::PANGO_STRETCH_NORMAL, Stretch::SemiExpanded => pango_sys::PANGO_STRETCH_SEMI_EXPANDED, Stretch::Expanded => pango_sys::PANGO_STRETCH_EXPANDED, Stretch::ExtraExpanded => pango_sys::PANGO_STRETCH_EXTRA_EXPANDED, Stretch::UltraExpanded => pango_sys::PANGO_STRETCH_ULTRA_EXPANDED, Stretch::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Stretch { fn from_glib(value: pango_sys::PangoStretch) -> Self { match value { 0 => Stretch::UltraCondensed, 1 => Stretch::ExtraCondensed, 2 => Stretch::Condensed, 3 => Stretch::SemiCondensed, 4 => Stretch::Normal, 5 => Stretch::SemiExpanded, 6 => Stretch::Expanded, 7 => Stretch::ExtraExpanded, 8 => Stretch::UltraExpanded, value => Stretch::__Unknown(value), } } } impl StaticType for Stretch { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_stretch_get_type()) } } } impl<'a> FromValueOptional<'a> for Stretch { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Stretch { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Stretch { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Style { Normal, Oblique, Italic, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Style { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Style::{}", match *self { Style::Normal => "Normal", Style::Oblique => "Oblique", Style::Italic => "Italic", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Style { type GlibType = pango_sys::PangoStyle; fn to_glib(&self) -> pango_sys::PangoStyle { match *self { Style::Normal => pango_sys::PANGO_STYLE_NORMAL, Style::Oblique => pango_sys::PANGO_STYLE_OBLIQUE, Style::Italic => pango_sys::PANGO_STYLE_ITALIC, Style::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Style { fn from_glib(value: pango_sys::PangoStyle) -> Self { match value { 0 => Style::Normal, 1 => Style::Oblique, 2 => Style::Italic, value => Style::__Unknown(value), } } } impl StaticType for Style { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_style_get_type()) } } } impl<'a> FromValueOptional<'a> for Style { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Style { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Style { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum TabAlign { Left, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for TabAlign { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "TabAlign::{}", match *self { TabAlign::Left => "Left", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for TabAlign { type GlibType = pango_sys::PangoTabAlign; fn to_glib(&self) -> pango_sys::PangoTabAlign { match *self { TabAlign::Left => pango_sys::PANGO_TAB_LEFT, TabAlign::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TabAlign { fn from_glib(value: pango_sys::PangoTabAlign) -> Self { match value { 0 => TabAlign::Left, value => TabAlign::__Unknown(value), } } } impl StaticType for TabAlign { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_tab_align_get_type()) } } } impl<'a> FromValueOptional<'a> for TabAlign { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for TabAlign { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for TabAlign { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Underline { None, Single, Double, Low, Error, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Underline { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Underline::{}", match *self { Underline::None => "None", Underline::Single => "Single", Underline::Double => "Double", Underline::Low => "Low", Underline::Error => "Error", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Underline { type GlibType = pango_sys::PangoUnderline; fn to_glib(&self) -> pango_sys::PangoUnderline { match *self { Underline::None => pango_sys::PANGO_UNDERLINE_NONE, Underline::Single => pango_sys::PANGO_UNDERLINE_SINGLE, Underline::Double => pango_sys::PANGO_UNDERLINE_DOUBLE, Underline::Low => pango_sys::PANGO_UNDERLINE_LOW, Underline::Error => pango_sys::PANGO_UNDERLINE_ERROR, Underline::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Underline { fn from_glib(value: pango_sys::PangoUnderline) -> Self { match value { 0 => Underline::None, 1 => Underline::Single, 2 => Underline::Double, 3 => Underline::Low, 4 => Underline::Error, value => Underline::__Unknown(value), } } } impl StaticType for Underline { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_underline_get_type()) } } } impl<'a> FromValueOptional<'a> for Underline { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Underline { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Underline { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Variant { Normal, SmallCaps, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Variant { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Variant::{}", match *self { Variant::Normal => "Normal", Variant::SmallCaps => "SmallCaps", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Variant { type GlibType = pango_sys::PangoVariant; fn to_glib(&self) -> pango_sys::PangoVariant { match *self { Variant::Normal => pango_sys::PANGO_VARIANT_NORMAL, Variant::SmallCaps => pango_sys::PANGO_VARIANT_SMALL_CAPS, Variant::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Variant { fn from_glib(value: pango_sys::PangoVariant) -> Self { match value { 0 => Variant::Normal, 1 => Variant::SmallCaps, value => Variant::__Unknown(value), } } } impl StaticType for Variant { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_variant_get_type()) } } } impl<'a> FromValueOptional<'a> for Variant { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Variant { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Variant { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum Weight { Thin, Ultralight, Light, Semilight, Book, Normal, Medium, Semibold, Bold, Ultrabold, Heavy, Ultraheavy, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for Weight { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Weight::{}", match *self { Weight::Thin => "Thin", Weight::Ultralight => "Ultralight", Weight::Light => "Light", Weight::Semilight => "Semilight", Weight::Book => "Book", Weight::Normal => "Normal", Weight::Medium => "Medium", Weight::Semibold => "Semibold", Weight::Bold => "Bold", Weight::Ultrabold => "Ultrabold", Weight::Heavy => "Heavy", Weight::Ultraheavy => "Ultraheavy", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for Weight { type GlibType = pango_sys::PangoWeight; fn to_glib(&self) -> pango_sys::PangoWeight { match *self { Weight::Thin => pango_sys::PANGO_WEIGHT_THIN, Weight::Ultralight => pango_sys::PANGO_WEIGHT_ULTRALIGHT, Weight::Light => pango_sys::PANGO_WEIGHT_LIGHT, Weight::Semilight => pango_sys::PANGO_WEIGHT_SEMILIGHT, Weight::Book => pango_sys::PANGO_WEIGHT_BOOK, Weight::Normal => pango_sys::PANGO_WEIGHT_NORMAL, Weight::Medium => pango_sys::PANGO_WEIGHT_MEDIUM, Weight::Semibold => pango_sys::PANGO_WEIGHT_SEMIBOLD, Weight::Bold => pango_sys::PANGO_WEIGHT_BOLD, Weight::Ultrabold => pango_sys::PANGO_WEIGHT_ULTRABOLD, Weight::Heavy => pango_sys::PANGO_WEIGHT_HEAVY, Weight::Ultraheavy => pango_sys::PANGO_WEIGHT_ULTRAHEAVY, Weight::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Weight { fn from_glib(value: pango_sys::PangoWeight) -> Self { match value { 100 => Weight::Thin, 200 => Weight::Ultralight, 300 => Weight::Light, 350 => Weight::Semilight, 380 => Weight::Book, 400 => Weight::Normal, 500 => Weight::Medium, 600 => Weight::Semibold, 700 => Weight::Bold, 800 => Weight::Ultrabold, 900 => Weight::Heavy, 1000 => Weight::Ultraheavy, value => Weight::__Unknown(value), } } } impl StaticType for Weight { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_weight_get_type()) } } } impl<'a> FromValueOptional<'a> for Weight { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for Weight { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Weight { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] pub enum WrapMode { Word, Char, WordChar, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for WrapMode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "WrapMode::{}", match *self { WrapMode::Word => "Word", WrapMode::Char => "Char", WrapMode::WordChar => "WordChar", _ => "Unknown", } ) } } #[doc(hidden)] impl ToGlib for WrapMode { type GlibType = pango_sys::PangoWrapMode; fn to_glib(&self) -> pango_sys::PangoWrapMode { match *self { WrapMode::Word => pango_sys::PANGO_WRAP_WORD, WrapMode::Char => pango_sys::PANGO_WRAP_CHAR, WrapMode::WordChar => pango_sys::PANGO_WRAP_WORD_CHAR, WrapMode::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for WrapMode { fn from_glib(value: pango_sys::PangoWrapMode) -> Self { match value { 0 => WrapMode::Word, 1 => WrapMode::Char, 2 => WrapMode::WordChar, value => WrapMode::__Unknown(value), } } } impl StaticType for WrapMode { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_wrap_mode_get_type()) } } } impl<'a> FromValueOptional<'a> for WrapMode { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for WrapMode { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for WrapMode { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } pango-0.7.0/src/auto/flags.rs010064400007650000024000000031331350341657000142460ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use glib::value::FromValue; use glib::value::FromValueOptional; use glib::value::SetValue; use glib::value::Value; use glib::StaticType; use glib::Type; use gobject_sys; use pango_sys; bitflags! { pub struct FontMask: u32 { const FAMILY = 1; const STYLE = 2; const VARIANT = 4; const WEIGHT = 8; const STRETCH = 16; const SIZE = 32; const GRAVITY = 64; const VARIATIONS = 128; } } #[doc(hidden)] impl ToGlib for FontMask { type GlibType = pango_sys::PangoFontMask; fn to_glib(&self) -> pango_sys::PangoFontMask { self.bits() } } #[doc(hidden)] impl FromGlib for FontMask { fn from_glib(value: pango_sys::PangoFontMask) -> FontMask { FontMask::from_bits_truncate(value) } } impl StaticType for FontMask { fn static_type() -> Type { unsafe { from_glib(pango_sys::pango_font_mask_get_type()) } } } impl<'a> FromValueOptional<'a> for FontMask { unsafe fn from_value_optional(value: &Value) -> Option { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for FontMask { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0)) } } impl SetValue for FontMask { unsafe fn set_value(value: &mut Value, this: &Self) { gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) } } pango-0.7.0/src/auto/font.rs010064400007650000024000000063441350341657000141270ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use pango_sys; use std::fmt; use Coverage; use EngineShape; use FontDescription; use FontMap; use FontMetrics; use Glyph; use Language; use Rectangle; glib_wrapper! { pub struct Font(Object); match fn { get_type => || pango_sys::pango_font_get_type(), } } pub const NONE_FONT: Option<&Font> = None; pub trait FontExt: 'static { fn describe(&self) -> Option; fn describe_with_absolute_size(&self) -> Option; fn find_shaper(&self, language: &Language, ch: u32) -> Option; fn get_coverage(&self, language: &Language) -> Option; fn get_font_map(&self) -> Option; fn get_glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle); fn get_metrics(&self, language: Option<&Language>) -> Option; } impl> FontExt for O { fn describe(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_font_describe( self.as_ref().to_glib_none().0, )) } } fn describe_with_absolute_size(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_font_describe_with_absolute_size( self.as_ref().to_glib_none().0, )) } } fn find_shaper(&self, language: &Language, ch: u32) -> Option { unsafe { from_glib_none(pango_sys::pango_font_find_shaper( self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0), ch, )) } } fn get_coverage(&self, language: &Language) -> Option { unsafe { from_glib_full(pango_sys::pango_font_get_coverage( self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0), )) } } fn get_font_map(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_get_font_map( self.as_ref().to_glib_none().0, )) } } fn get_glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle) { unsafe { let mut ink_rect = Rectangle::uninitialized(); let mut logical_rect = Rectangle::uninitialized(); pango_sys::pango_font_get_glyph_extents( self.as_ref().to_glib_none().0, glyph, ink_rect.to_glib_none_mut().0, logical_rect.to_glib_none_mut().0, ); (ink_rect, logical_rect) } } fn get_metrics(&self, language: Option<&Language>) -> Option { unsafe { from_glib_full(pango_sys::pango_font_get_metrics( self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0), )) } } } impl fmt::Display for Font { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Font") } } pango-0.7.0/src/auto/font_description.rs010064400007650000024000000170711350341657000165310ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use glib::GString; use pango_sys; use std::fmt; use std::hash; use FontMask; use Gravity; use Stretch; use Style; use Variant; use Weight; glib_wrapper! { #[derive(Debug, PartialOrd, Ord)] pub struct FontDescription(Boxed); match fn { copy => |ptr| pango_sys::pango_font_description_copy(mut_override(ptr)), free => |ptr| pango_sys::pango_font_description_free(ptr), get_type => || pango_sys::pango_font_description_get_type(), } } impl FontDescription { pub fn new() -> FontDescription { unsafe { from_glib_full(pango_sys::pango_font_description_new()) } } pub fn better_match( &self, old_match: Option<&FontDescription>, new_match: &FontDescription, ) -> bool { unsafe { from_glib(pango_sys::pango_font_description_better_match( self.to_glib_none().0, old_match.to_glib_none().0, new_match.to_glib_none().0, )) } } fn equal(&self, desc2: &FontDescription) -> bool { unsafe { from_glib(pango_sys::pango_font_description_equal( self.to_glib_none().0, desc2.to_glib_none().0, )) } } pub fn get_family(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_description_get_family( self.to_glib_none().0, )) } } pub fn get_gravity(&self) -> Gravity { unsafe { from_glib(pango_sys::pango_font_description_get_gravity( self.to_glib_none().0, )) } } pub fn get_set_fields(&self) -> FontMask { unsafe { from_glib(pango_sys::pango_font_description_get_set_fields( self.to_glib_none().0, )) } } pub fn get_size(&self) -> i32 { unsafe { pango_sys::pango_font_description_get_size(self.to_glib_none().0) } } pub fn get_size_is_absolute(&self) -> bool { unsafe { from_glib(pango_sys::pango_font_description_get_size_is_absolute( self.to_glib_none().0, )) } } pub fn get_stretch(&self) -> Stretch { unsafe { from_glib(pango_sys::pango_font_description_get_stretch( self.to_glib_none().0, )) } } pub fn get_style(&self) -> Style { unsafe { from_glib(pango_sys::pango_font_description_get_style( self.to_glib_none().0, )) } } pub fn get_variant(&self) -> Variant { unsafe { from_glib(pango_sys::pango_font_description_get_variant( self.to_glib_none().0, )) } } #[cfg(any(feature = "v1_42", feature = "dox"))] pub fn get_variations(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_description_get_variations( self.to_glib_none().0, )) } } pub fn get_weight(&self) -> Weight { unsafe { from_glib(pango_sys::pango_font_description_get_weight( self.to_glib_none().0, )) } } fn hash(&self) -> u32 { unsafe { pango_sys::pango_font_description_hash(self.to_glib_none().0) } } pub fn merge(&mut self, desc_to_merge: Option<&FontDescription>, replace_existing: bool) { unsafe { pango_sys::pango_font_description_merge( self.to_glib_none_mut().0, desc_to_merge.to_glib_none().0, replace_existing.to_glib(), ); } } pub fn set_absolute_size(&mut self, size: f64) { unsafe { pango_sys::pango_font_description_set_absolute_size(self.to_glib_none_mut().0, size); } } pub fn set_family(&mut self, family: &str) { unsafe { pango_sys::pango_font_description_set_family( self.to_glib_none_mut().0, family.to_glib_none().0, ); } } pub fn set_gravity(&mut self, gravity: Gravity) { unsafe { pango_sys::pango_font_description_set_gravity( self.to_glib_none_mut().0, gravity.to_glib(), ); } } pub fn set_size(&mut self, size: i32) { unsafe { pango_sys::pango_font_description_set_size(self.to_glib_none_mut().0, size); } } pub fn set_stretch(&mut self, stretch: Stretch) { unsafe { pango_sys::pango_font_description_set_stretch( self.to_glib_none_mut().0, stretch.to_glib(), ); } } pub fn set_style(&mut self, style: Style) { unsafe { pango_sys::pango_font_description_set_style(self.to_glib_none_mut().0, style.to_glib()); } } pub fn set_variant(&mut self, variant: Variant) { unsafe { pango_sys::pango_font_description_set_variant( self.to_glib_none_mut().0, variant.to_glib(), ); } } #[cfg(any(feature = "v1_42", feature = "dox"))] pub fn set_variations(&mut self, settings: &str) { unsafe { pango_sys::pango_font_description_set_variations( self.to_glib_none_mut().0, settings.to_glib_none().0, ); } } #[cfg(any(feature = "v1_42", feature = "dox"))] pub fn set_variations_static(&mut self, settings: &str) { unsafe { pango_sys::pango_font_description_set_variations_static( self.to_glib_none_mut().0, settings.to_glib_none().0, ); } } pub fn set_weight(&mut self, weight: Weight) { unsafe { pango_sys::pango_font_description_set_weight( self.to_glib_none_mut().0, weight.to_glib(), ); } } pub fn to_filename(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_font_description_to_filename( self.to_glib_none().0, )) } } fn to_string(&self) -> GString { unsafe { from_glib_full(pango_sys::pango_font_description_to_string( self.to_glib_none().0, )) } } pub fn unset_fields(&mut self, to_unset: FontMask) { unsafe { pango_sys::pango_font_description_unset_fields( self.to_glib_none_mut().0, to_unset.to_glib(), ); } } pub fn from_string(str: &str) -> FontDescription { unsafe { from_glib_full(pango_sys::pango_font_description_from_string( str.to_glib_none().0, )) } } } impl Default for FontDescription { fn default() -> Self { Self::new() } } impl PartialEq for FontDescription { #[inline] fn eq(&self, other: &Self) -> bool { self.equal(other) } } impl Eq for FontDescription {} impl fmt::Display for FontDescription { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.to_string()) } } impl hash::Hash for FontDescription { #[inline] fn hash(&self, state: &mut H) where H: hash::Hasher, { hash::Hash::hash(&self.hash(), state) } } pango-0.7.0/src/auto/font_face.rs010064400007650000024000000036731350341657000151070ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use glib::GString; use pango_sys; use std::fmt; use std::mem; use std::ptr; use FontDescription; glib_wrapper! { pub struct FontFace(Object); match fn { get_type => || pango_sys::pango_font_face_get_type(), } } pub const NONE_FONT_FACE: Option<&FontFace> = None; pub trait FontFaceExt: 'static { fn describe(&self) -> Option; fn get_face_name(&self) -> Option; fn is_synthesized(&self) -> bool; fn list_sizes(&self) -> Vec; } impl> FontFaceExt for O { fn describe(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_font_face_describe( self.as_ref().to_glib_none().0, )) } } fn get_face_name(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_face_get_face_name( self.as_ref().to_glib_none().0, )) } } fn is_synthesized(&self) -> bool { unsafe { from_glib(pango_sys::pango_font_face_is_synthesized( self.as_ref().to_glib_none().0, )) } } fn list_sizes(&self) -> Vec { unsafe { let mut sizes = ptr::null_mut(); let mut n_sizes = mem::uninitialized(); pango_sys::pango_font_face_list_sizes( self.as_ref().to_glib_none().0, &mut sizes, &mut n_sizes, ); FromGlibContainer::from_glib_full_num(sizes, n_sizes as usize) } } } impl fmt::Display for FontFace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "FontFace") } } pango-0.7.0/src/auto/font_family.rs010064400007650000024000000033031350341657000154600ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use glib::GString; use pango_sys; use std::fmt; use std::mem; use std::ptr; use FontFace; glib_wrapper! { pub struct FontFamily(Object); match fn { get_type => || pango_sys::pango_font_family_get_type(), } } pub const NONE_FONT_FAMILY: Option<&FontFamily> = None; pub trait FontFamilyExt: 'static { fn get_name(&self) -> Option; fn is_monospace(&self) -> bool; fn list_faces(&self) -> Vec; } impl> FontFamilyExt for O { fn get_name(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_family_get_name( self.as_ref().to_glib_none().0, )) } } fn is_monospace(&self) -> bool { unsafe { from_glib(pango_sys::pango_font_family_is_monospace( self.as_ref().to_glib_none().0, )) } } fn list_faces(&self) -> Vec { unsafe { let mut faces = ptr::null_mut(); let mut n_faces = mem::uninitialized(); pango_sys::pango_font_family_list_faces( self.as_ref().to_glib_none().0, &mut faces, &mut n_faces, ); FromGlibContainer::from_glib_container_num(faces, n_faces as usize) } } } impl fmt::Display for FontFamily { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "FontFamily") } } pango-0.7.0/src/auto/font_map.rs010064400007650000024000000062611350341657000147620ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use glib::GString; use pango_sys; use std::fmt; use std::mem; use std::ptr; use Context; use Font; use FontDescription; use FontFamily; use Fontset; use Language; glib_wrapper! { pub struct FontMap(Object); match fn { get_type => || pango_sys::pango_font_map_get_type(), } } pub const NONE_FONT_MAP: Option<&FontMap> = None; pub trait FontMapExt: 'static { fn changed(&self); fn create_context(&self) -> Option; fn get_serial(&self) -> u32; #[cfg_attr(feature = "v1_38", deprecated)] fn get_shape_engine_type(&self) -> Option; fn list_families(&self) -> Vec; fn load_font(&self, context: &Context, desc: &FontDescription) -> Option; fn load_fontset( &self, context: &Context, desc: &FontDescription, language: &Language, ) -> Option; } impl> FontMapExt for O { fn changed(&self) { unsafe { pango_sys::pango_font_map_changed(self.as_ref().to_glib_none().0); } } fn create_context(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_font_map_create_context( self.as_ref().to_glib_none().0, )) } } fn get_serial(&self) -> u32 { unsafe { pango_sys::pango_font_map_get_serial(self.as_ref().to_glib_none().0) } } fn get_shape_engine_type(&self) -> Option { unsafe { from_glib_none(pango_sys::pango_font_map_get_shape_engine_type( self.as_ref().to_glib_none().0, )) } } fn list_families(&self) -> Vec { unsafe { let mut families = ptr::null_mut(); let mut n_families = mem::uninitialized(); pango_sys::pango_font_map_list_families( self.as_ref().to_glib_none().0, &mut families, &mut n_families, ); FromGlibContainer::from_glib_container_num(families, n_families as usize) } } fn load_font(&self, context: &Context, desc: &FontDescription) -> Option { unsafe { from_glib_full(pango_sys::pango_font_map_load_font( self.as_ref().to_glib_none().0, context.to_glib_none().0, desc.to_glib_none().0, )) } } fn load_fontset( &self, context: &Context, desc: &FontDescription, language: &Language, ) -> Option { unsafe { from_glib_full(pango_sys::pango_font_map_load_fontset( self.as_ref().to_glib_none().0, context.to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0), )) } } } impl fmt::Display for FontMap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "FontMap") } } pango-0.7.0/src/auto/font_metrics.rs010064400007650000024000000036511350341657000156530ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::translate::*; use pango_sys; glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FontMetrics(Shared); match fn { ref => |ptr| pango_sys::pango_font_metrics_ref(ptr), unref => |ptr| pango_sys::pango_font_metrics_unref(ptr), get_type => || pango_sys::pango_font_metrics_get_type(), } } impl FontMetrics { pub fn new() -> FontMetrics { unsafe { from_glib_full(pango_sys::pango_font_metrics_new()) } } pub fn get_approximate_char_width(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_approximate_char_width(self.to_glib_none().0) } } pub fn get_approximate_digit_width(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_approximate_digit_width(self.to_glib_none().0) } } pub fn get_ascent(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_ascent(self.to_glib_none().0) } } pub fn get_descent(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_descent(self.to_glib_none().0) } } pub fn get_strikethrough_position(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_strikethrough_position(self.to_glib_none().0) } } pub fn get_strikethrough_thickness(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_strikethrough_thickness(self.to_glib_none().0) } } pub fn get_underline_position(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_underline_position(self.to_glib_none().0) } } pub fn get_underline_thickness(&self) -> i32 { unsafe { pango_sys::pango_font_metrics_get_underline_thickness(self.to_glib_none().0) } } } impl Default for FontMetrics { fn default() -> Self { Self::new() } } pango-0.7.0/src/auto/fontset.rs010064400007650000024000000043051350341657000146360ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use pango_sys; use std::fmt; use Font; use FontMetrics; glib_wrapper! { pub struct Fontset(Object); match fn { get_type => || pango_sys::pango_fontset_get_type(), } } pub const NONE_FONTSET: Option<&Fontset> = None; pub trait FontsetExt: 'static { fn foreach bool>(&self, func: P); fn get_font(&self, wc: u32) -> Option; fn get_metrics(&self) -> Option; } impl> FontsetExt for O { fn foreach bool>(&self, func: P) { let func_data: P = func; unsafe extern "C" fn func_func bool>( fontset: *mut pango_sys::PangoFontset, font: *mut pango_sys::PangoFont, user_data: glib_sys::gpointer, ) -> glib_sys::gboolean { let fontset = from_glib_borrow(fontset); let font = from_glib_borrow(font); let callback: *mut P = user_data as *const _ as usize as *mut P; let res = (*callback)(&fontset, &font); res.to_glib() } let func = Some(func_func::

as _); let super_callback0: &P = &func_data; unsafe { pango_sys::pango_fontset_foreach( self.as_ref().to_glib_none().0, func, super_callback0 as *const _ as usize as *mut _, ); } } fn get_font(&self, wc: u32) -> Option { unsafe { from_glib_full(pango_sys::pango_fontset_get_font( self.as_ref().to_glib_none().0, wc, )) } } fn get_metrics(&self) -> Option { unsafe { from_glib_full(pango_sys::pango_fontset_get_metrics( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for Fontset { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Fontset") } } pango-0.7.0/src/auto/fontset_simple.rs010064400007650000024000000023311350341657000162040ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::IsA; use glib::translate::*; use pango_sys; use std::fmt; use Font; use Fontset; use Language; glib_wrapper! { pub struct FontsetSimple(Object) @extends Fontset; match fn { get_type => || pango_sys::pango_fontset_simple_get_type(), } } impl FontsetSimple { pub fn new(language: &mut Language) -> FontsetSimple { unsafe { from_glib_full(pango_sys::pango_fontset_simple_new( language.to_glib_none_mut().0, )) } } pub fn append>(&self, font: &P) { unsafe { pango_sys::pango_fontset_simple_append( self.to_glib_none().0, font.as_ref().to_glib_none().0, ); } } pub fn size(&self) -> i32 { unsafe { pango_sys::pango_fontset_simple_size(self.to_glib_none().0) } } } impl fmt::Display for FontsetSimple { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "FontsetSimple") } } pango-0.7.0/src/auto/functions.rs010064400007650000024000000237551350341657000151760ustar0000000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib; use glib::translate::*; use glib::GString; use pango_sys; use std::mem; use std::ptr; use Analysis; use AttrIterator; use AttrList; use Context; use Direction; use Error; use GlyphString; use Item; use Rectangle; use Stretch; use Style; use Variant; use Weight; //pub fn break_(text: &str, analysis: &mut Analysis, attrs: /*Ignored*/&[&LogAttr]) { // unsafe { TODO: call pango_sys:pango_break() } //} #[cfg_attr(feature = "v1_38", deprecated)] pub fn config_key_get(key: &str) -> Option { unsafe { from_glib_full(pango_sys::pango_config_key_get(key.to_glib_none().0)) } } #[cfg_attr(feature = "v1_38", deprecated)] pub fn config_key_get_system(key: &str) -> Option { unsafe { from_glib_full(pango_sys::pango_config_key_get_system(key.to_glib_none().0)) } } //pub fn default_break(text: &str, analysis: Option<&mut Analysis>, attrs: /*Ignored*/&mut LogAttr, attrs_len: i32) { // unsafe { TODO: call pango_sys:pango_default_break() } //} pub fn extents_to_pixels(inclusive: Option<&Rectangle>, nearest: Option<&Rectangle>) { unsafe { pango_sys::pango_extents_to_pixels( mut_override(inclusive.to_glib_none().0), mut_override(nearest.to_glib_none().0), ); } } pub fn find_base_dir(text: &str) -> Direction { let length = text.len() as i32; unsafe { from_glib(pango_sys::pango_find_base_dir( text.to_glib_none().0, length, )) } } //#[cfg_attr(feature = "v1_38", deprecated)] //pub fn find_map(language: &mut Language, engine_type_id: u32, render_type_id: u32) -> /*Ignored*/Option { // unsafe { TODO: call pango_sys:pango_find_map() } //} pub fn find_paragraph_boundary(text: &str) -> (i32, i32) { let length = text.len() as i32; unsafe { let mut paragraph_delimiter_index = mem::uninitialized(); let mut next_paragraph_start = mem::uninitialized(); pango_sys::pango_find_paragraph_boundary( text.to_glib_none().0, length, &mut paragraph_delimiter_index, &mut next_paragraph_start, ); (paragraph_delimiter_index, next_paragraph_start) } } #[cfg_attr(feature = "v1_38", deprecated)] pub fn get_lib_subdirectory() -> Option { unsafe { from_glib_none(pango_sys::pango_get_lib_subdirectory()) } } //pub fn get_log_attrs(text: &str, level: i32, language: &mut Language, log_attrs: /*Ignored*/&[&LogAttr]) { // unsafe { TODO: call pango_sys:pango_get_log_attrs() } //} #[cfg_attr(feature = "v1_38", deprecated)] pub fn get_sysconf_subdirectory() -> Option { unsafe { from_glib_none(pango_sys::pango_get_sysconf_subdirectory()) } } pub fn is_zero_width(ch: char) -> bool { unsafe { from_glib(pango_sys::pango_is_zero_width(ch.to_glib())) } } pub fn itemize( context: &Context, text: &str, start_index: i32, length: i32, attrs: &AttrList, cached_iter: Option<&AttrIterator>, ) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(pango_sys::pango_itemize( context.to_glib_none().0, text.to_glib_none().0, start_index, length, attrs.to_glib_none().0, mut_override(cached_iter.to_glib_none().0), )) } } pub fn itemize_with_base_dir( context: &Context, base_dir: Direction, text: &str, start_index: i32, length: i32, attrs: &AttrList, cached_iter: Option<&AttrIterator>, ) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(pango_sys::pango_itemize_with_base_dir( context.to_glib_none().0, base_dir.to_glib(), text.to_glib_none().0, start_index, length, attrs.to_glib_none().0, mut_override(cached_iter.to_glib_none().0), )) } } //pub fn markup_parser_finish(context: /*Ignored*/&glib::MarkupParseContext) -> Result<(AttrList, GString, char), Error> { // unsafe { TODO: call pango_sys:pango_markup_parser_finish() } //} //pub fn markup_parser_new(accel_marker: char) -> /*Ignored*/Option { // unsafe { TODO: call pango_sys:pango_markup_parser_new() } //} //#[cfg_attr(feature = "v1_38", deprecated)] //pub fn module_register(module: /*Ignored*/&mut IncludedModule) { // unsafe { TODO: call pango_sys:pango_module_register() } //} #[cfg_attr(feature = "v1_38", deprecated)] pub fn parse_enum( type_: glib::types::Type, str: Option<&str>, warn: bool, ) -> Option<(i32, GString)> { unsafe { let mut value = mem::uninitialized(); let mut possible_values = ptr::null_mut(); let ret = from_glib(pango_sys::pango_parse_enum( type_.to_glib(), str.to_glib_none().0, &mut value, warn.to_glib(), &mut possible_values, )); if ret { Some((value, from_glib_full(possible_values))) } else { None } } } pub fn parse_markup( markup_text: &str, accel_marker: char, ) -> Result<(AttrList, GString, char), Error> { let length = markup_text.len() as i32; unsafe { let mut attr_list = ptr::null_mut(); let mut text = ptr::null_mut(); let mut accel_char = mem::uninitialized(); let mut error = ptr::null_mut(); let _ = pango_sys::pango_parse_markup( markup_text.to_glib_none().0, length, accel_marker.to_glib(), &mut attr_list, &mut text, &mut accel_char, &mut error, ); if error.is_null() { Ok(( from_glib_full(attr_list), from_glib_full(text), from_glib(accel_char), )) } else { Err(from_glib_full(error)) } } } pub fn parse_stretch(str: &str, warn: bool) -> Option { unsafe { let mut stretch = mem::uninitialized(); let ret = from_glib(pango_sys::pango_parse_stretch( str.to_glib_none().0, &mut stretch, warn.to_glib(), )); if ret { Some(from_glib(stretch)) } else { None } } } pub fn parse_style(str: &str, warn: bool) -> Option