pangocairo-0.14.0/.cargo_vcs_info.json0000644000000001120000000000100132320ustar { "git": { "sha1": "8708ff7604ba3ec0a936451e5ac0e94c0764d001" } } pangocairo-0.14.0/COPYRIGHT000064400000000000000000000012130072674642500133500ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. 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 or other licenses. For more information check the license of each GNOME library. pangocairo-0.14.0/Cargo.toml0000644000000025650000000000100112460ustar # 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] edition = "2018" name = "pangocairo" version = "0.14.0" authors = ["The gtk-rs Project Developers"] exclude = ["gir-files/*"] description = "Rust bindings for the PangoCairo library" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/pangocairo/" readme = "README.md" keywords = ["pango", "cairo", "gtk-rs", "gnome"] license = "MIT" repository = "https://github.com/gtk-rs/gtk-rs-core" [package.metadata.docs.rs] features = ["dox"] [dependencies.bitflags] version = "1.0" [dependencies.cairo-rs] version = "0.14.0" [dependencies.ffi] version = "0.14.0" package = "pangocairo-sys" [dependencies.glib] version = "0.14.0" [dependencies.libc] version = "0.2" [dependencies.pango] version = "0.14.0" [dev-dependencies.gir-format-check] version = "^0.1" [features] dox = ["glib/dox", "pango/dox", "cairo-rs/dox"] pangocairo-0.14.0/Cargo.toml.orig000064400000000000000000000013670072674642500147560ustar 00000000000000[package] name = "pangocairo" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/pangocairo/" homepage = "https://gtk-rs.org/" authors = ["The gtk-rs Project Developers"] keywords = ["pango", "cairo", "gtk-rs", "gnome"] readme = "README.md" version = "0.14.0" description = "Rust bindings for the PangoCairo library" repository = "https://github.com/gtk-rs/gtk-rs-core" license = "MIT" exclude = [ "gir-files/*", ] edition = "2018" [features] dox = ["glib/dox", "pango/dox", "cairo-rs/dox"] [package.metadata.docs.rs] features = ["dox"] [dependencies] libc = "0.2" bitflags = "1.0" ffi = {package = "pangocairo-sys", version = "0.14.0"} glib = "0.14.0" pango = "0.14.0" cairo-rs = "0.14.0" [dev-dependencies] gir-format-check = "^0.1" pangocairo-0.14.0/Gir.toml000064400000000000000000000052240072674642500135010ustar 00000000000000[options] girs_directories = ["../gir-files"] library = "PangoCairo" version = "1.0" target_path = "." work_mode = "normal" generate_safety_asserts = false min_cfg_version = "1.38" single_version_file = true deprecate_by_min_version = true generate = [ "PangoCairo.Font", ] manual = [ "cairo.Context", "cairo.FontOptions", "cairo.FontType", "cairo.ScaledFont", "GLib.Error", "Pango.Context", "Pango.Font", "Pango.FontMap", "Pango.GlyphItem", "Pango.GlyphString", "Pango.Layout", "Pango.LayoutLine", ] [[object]] name = "PangoCairo.*" status = "generate" [[object.function]] name = "context_get_font_options" ignore = true [[object.function]] name = "create_context" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "create_layout" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "error_underline_path" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "glyph_string_path" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "layout_line_path" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "layout_path" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "show_error_underline" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "show_glyph_item" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "show_glyph_string" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "show_layout" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "show_layout_line" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "update_context" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "update_layout" [[object.function.parameter]] name = "cr" const = true [[object]] name = "PangoCairo.FontMap" status = "generate" manual_traits = ["FontMapExtManual"] [[object.function]] name = "get_font_type" manual = true doc_trait_name = "FontMapExtManual" [[object.function]] name = "new_for_font_type" manual = true [[object.function]] name = "new" manual = true [[object.function]] name = "set_default" manual = true pangocairo-0.14.0/LICENSE000064400000000000000000000020000072674642500130550ustar 00000000000000Permission 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. pangocairo-0.14.0/README.md000064400000000000000000000023530072674642500133420ustar 00000000000000# pangocairo __Rust__ bindings and wrappers for __PangoCairo__, part of [gtk-rs-core](https://github.com/gtk-rs/gtk-rs-core). ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.51.0`. ## Documentation * [Rust API - Stable](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/pangocairo/) * [Rust API - Development](https://gtk-rs.org/gtk-rs-core/git/docs/pangocairo) * [GTK Installation instructions](https://www.gtk.org/docs/installations/) ## Using We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs), as [demonstrated here](https://gtk-rs.org/#using). If you want to track the bleeding edge, use the git dependency instead: ```toml [dependencies] pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "pangocairo" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] pangocairo = "0.13" pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "pangocairo" } ``` ### See Also * [cairo](https://crates.io/crates/cairo-rs) * [glib](https://crates.io/crates/glib) * [pango](https://crates.io/crates/pango) ## License __pangocairo__ is available under the MIT License, please refer to it. pangocairo-0.14.0/src/auto/font.rs000064400000000000000000000017660072674642500151450ustar 00000000000000// 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 std::fmt; glib::wrapper! { #[doc(alias = "PangoCairoFont")] pub struct Font(Interface) @requires pango::Font; match fn { type_ => || ffi::pango_cairo_font_get_type(), } } pub const NONE_FONT: Option<&Font> = None; pub trait FontExt: 'static { #[doc(alias = "pango_cairo_font_get_scaled_font")] #[doc(alias = "get_scaled_font")] fn scaled_font(&self) -> Option; } impl> FontExt for O { fn scaled_font(&self) -> Option { unsafe { from_glib_none(ffi::pango_cairo_font_get_scaled_font( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for Font { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Font") } } pangocairo-0.14.0/src/auto/font_map.rs000064400000000000000000000026460072674642500160000ustar 00000000000000// 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 std::fmt; glib::wrapper! { #[doc(alias = "PangoCairoFontMap")] pub struct FontMap(Interface) @requires pango::FontMap; match fn { type_ => || ffi::pango_cairo_font_map_get_type(), } } impl FontMap { #[doc(alias = "pango_cairo_font_map_get_default")] #[doc(alias = "get_default")] pub fn default() -> Option { unsafe { from_glib_none(ffi::pango_cairo_font_map_get_default()) } } } pub const NONE_FONT_MAP: Option<&FontMap> = None; pub trait FontMapExt: 'static { #[doc(alias = "pango_cairo_font_map_get_resolution")] #[doc(alias = "get_resolution")] fn resolution(&self) -> f64; #[doc(alias = "pango_cairo_font_map_set_resolution")] fn set_resolution(&self, dpi: f64); } impl> FontMapExt for O { fn resolution(&self) -> f64 { unsafe { ffi::pango_cairo_font_map_get_resolution(self.as_ref().to_glib_none().0) } } fn set_resolution(&self, dpi: f64) { unsafe { ffi::pango_cairo_font_map_set_resolution(self.as_ref().to_glib_none().0, dpi); } } } impl fmt::Display for FontMap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("FontMap") } } pangocairo-0.14.0/src/auto/functions.rs000064400000000000000000000123130072674642500161750ustar 00000000000000// 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::*; #[doc(alias = "pango_cairo_context_get_resolution")] pub fn context_get_resolution(context: &pango::Context) -> f64 { unsafe { ffi::pango_cairo_context_get_resolution(context.to_glib_none().0) } } //#[doc(alias = "pango_cairo_context_get_shape_renderer")] //pub fn context_get_shape_renderer(context: &pango::Context, data: /*Unimplemented*/Option) -> /*Unimplemented*/Fn(&cairo::Context, /*Ignored*/pango::AttrShape, bool) { // unsafe { TODO: call ffi:pango_cairo_context_get_shape_renderer() } //} #[doc(alias = "pango_cairo_context_set_font_options")] pub fn context_set_font_options(context: &pango::Context, options: Option<&cairo::FontOptions>) { unsafe { ffi::pango_cairo_context_set_font_options( context.to_glib_none().0, options.to_glib_none().0, ); } } #[doc(alias = "pango_cairo_context_set_resolution")] pub fn context_set_resolution(context: &pango::Context, dpi: f64) { unsafe { ffi::pango_cairo_context_set_resolution(context.to_glib_none().0, dpi); } } //#[doc(alias = "pango_cairo_context_set_shape_renderer")] //pub fn context_set_shape_renderer(context: &pango::Context, func: /*Unimplemented*/Fn(&cairo::Context, /*Ignored*/pango::AttrShape, bool), data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:pango_cairo_context_set_shape_renderer() } //} #[doc(alias = "pango_cairo_create_context")] pub fn create_context(cr: &cairo::Context) -> Option { unsafe { from_glib_full(ffi::pango_cairo_create_context(mut_override( cr.to_glib_none().0, ))) } } #[doc(alias = "pango_cairo_create_layout")] pub fn create_layout(cr: &cairo::Context) -> Option { unsafe { from_glib_full(ffi::pango_cairo_create_layout(mut_override( cr.to_glib_none().0, ))) } } #[doc(alias = "pango_cairo_error_underline_path")] pub fn error_underline_path(cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64) { unsafe { ffi::pango_cairo_error_underline_path( mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "pango_cairo_glyph_string_path")] pub fn glyph_string_path>( cr: &cairo::Context, font: &P, glyphs: &mut pango::GlyphString, ) { unsafe { ffi::pango_cairo_glyph_string_path( mut_override(cr.to_glib_none().0), font.as_ref().to_glib_none().0, glyphs.to_glib_none_mut().0, ); } } #[doc(alias = "pango_cairo_layout_line_path")] pub fn layout_line_path(cr: &cairo::Context, line: &pango::LayoutLine) { unsafe { ffi::pango_cairo_layout_line_path(mut_override(cr.to_glib_none().0), line.to_glib_none().0); } } #[doc(alias = "pango_cairo_layout_path")] pub fn layout_path(cr: &cairo::Context, layout: &pango::Layout) { unsafe { ffi::pango_cairo_layout_path(mut_override(cr.to_glib_none().0), layout.to_glib_none().0); } } #[doc(alias = "pango_cairo_show_error_underline")] pub fn show_error_underline(cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64) { unsafe { ffi::pango_cairo_show_error_underline( mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "pango_cairo_show_glyph_item")] pub fn show_glyph_item(cr: &cairo::Context, text: &str, glyph_item: &mut pango::GlyphItem) { unsafe { ffi::pango_cairo_show_glyph_item( mut_override(cr.to_glib_none().0), text.to_glib_none().0, glyph_item.to_glib_none_mut().0, ); } } #[doc(alias = "pango_cairo_show_glyph_string")] pub fn show_glyph_string>( cr: &cairo::Context, font: &P, glyphs: &mut pango::GlyphString, ) { unsafe { ffi::pango_cairo_show_glyph_string( mut_override(cr.to_glib_none().0), font.as_ref().to_glib_none().0, glyphs.to_glib_none_mut().0, ); } } #[doc(alias = "pango_cairo_show_layout")] pub fn show_layout(cr: &cairo::Context, layout: &pango::Layout) { unsafe { ffi::pango_cairo_show_layout(mut_override(cr.to_glib_none().0), layout.to_glib_none().0); } } #[doc(alias = "pango_cairo_show_layout_line")] pub fn show_layout_line(cr: &cairo::Context, line: &pango::LayoutLine) { unsafe { ffi::pango_cairo_show_layout_line(mut_override(cr.to_glib_none().0), line.to_glib_none().0); } } #[doc(alias = "pango_cairo_update_context")] pub fn update_context(cr: &cairo::Context, context: &pango::Context) { unsafe { ffi::pango_cairo_update_context( mut_override(cr.to_glib_none().0), context.to_glib_none().0, ); } } #[doc(alias = "pango_cairo_update_layout")] pub fn update_layout(cr: &cairo::Context, layout: &pango::Layout) { unsafe { ffi::pango_cairo_update_layout(mut_override(cr.to_glib_none().0), layout.to_glib_none().0); } } pangocairo-0.14.0/src/auto/mod.rs000064400000000000000000000005760072674642500147540ustar 00000000000000// 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 mod font; pub use self::font::{Font, NONE_FONT}; mod font_map; pub use self::font_map::{FontMap, NONE_FONT_MAP}; pub mod functions; #[doc(hidden)] pub mod traits { pub use super::font::FontExt; pub use super::font_map::FontMapExt; } pangocairo-0.14.0/src/auto/versions.txt000064400000000000000000000001720072674642500162300ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 6ed30fc) from gir-files (https://github.com/gtk-rs/gir-files @ 7d95377) pangocairo-0.14.0/src/font_map.rs000064400000000000000000000023360072674642500150240ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::FontMap; use glib::object::IsA; use glib::translate::*; pub trait FontMapExtManual { #[doc(alias = "pango_cairo_font_map_get_font_type")] #[doc(alias = "get_font_type")] fn font_type(&self) -> cairo::FontType; } impl> FontMapExtManual for O { fn font_type(&self) -> cairo::FontType { unsafe { ffi::pango_cairo_font_map_get_font_type(self.as_ref().to_glib_none().0).into() } } } impl FontMap { #[doc(alias = "pango_cairo_font_map_new_for_font_type")] #[doc(alias = "new_for_font_type")] pub fn for_font_type(fonttype: cairo::FontType) -> Option { unsafe { from_glib_full(ffi::pango_cairo_font_map_new_for_font_type(fonttype.into())) } } #[allow(clippy::new_ret_no_self)] #[doc(alias = "pango_cairo_font_map_new")] pub fn new() -> Option { unsafe { from_glib_full(ffi::pango_cairo_font_map_new()) } } #[doc(alias = "pango_cairo_font_map_set_default")] pub fn set_default(font_map: Option) { unsafe { ffi::pango_cairo_font_map_set_default(font_map.as_ref().to_glib_none().0); } } } pangocairo-0.14.0/src/lib.rs000064400000000000000000000012740072674642500137670ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file. //! # Rust PangoCairo bindings //! //! This library contains safe Rust bindings for [PangoCairo](https://docs.gtk.org/PangoCairo). //! It is a part of [gtk-rs](https://gtk-rs.org/). //! //! PangoCairo 1.38 is the lowest supported version for the underlying library. #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use cairo; pub use ffi; pub use glib; pub use pango; #[allow(clippy::too_many_arguments)] #[allow(unused_imports)] mod auto; pub use crate::auto::functions::*; pub use crate::auto::*; pub mod prelude; mod font_map; pangocairo-0.14.0/src/prelude.rs000064400000000000000000000003500072674642500146530ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. pub use crate::auto::*; pub use crate::font_map::FontMapExtManual; #[doc(hidden)] pub use glib::prelude::*; #[doc(hidden)] pub use pango::prelude::*; pangocairo-0.14.0/tests/check_gir.rs000064400000000000000000000003640072674642500155110ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #[test] fn check_gir_file() { let res = gir_format_check::check_gir_file("Gir.toml"); println!("{}", res.to_string()); assert_eq!(res.nb_errors, 0); }